/* =========================================================
   Punschkuchl – Stylesheet (mobile first)
   Farben und Grafiken nach dem Original-Design
   ========================================================= */

:root {
  --red: #700e06;          /* Schrift & Linien */
  --red-dark: #660100;     /* Kopf-/Fußbereich */
  --red-bright: #b30000;
  --gold: #ffbd57;
  --box: rgba(255, 189, 87, .9);
  --box-solid: #ffc56e;
  --nav: rgba(255, 189, 87, .62);
  --shadow: 4px 4px 0 rgba(112, 14, 6, .2);
  --maxw: 980px;
  --font: Verdana, Geneva, "DejaVu Sans", Tahoma, sans-serif;
  --box-title: linear-gradient(transparent calc(100% - 1px), rgba(112, 14, 6, .4) 0); /* Ersatz, falls Grafik fehlt */
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font: 16px/1.6 var(--font);
  color: var(--red);
  background: #3a0d08;
  min-height: 100vh;
  position: relative;
}

/* Fixes Hintergrundfoto – als eigene Ebene, damit es auch auf iOS ruhig steht */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    var(--bg-mobile, none) center top / cover no-repeat,
    linear-gradient(180deg, #7a1b10 0%, #c2632d 45%, #3b2a3a 100%);
}
@media (min-width: 900px) {
  body::before {
    background:
      var(--bg, none) center top / cover no-repeat,
      linear-gradient(180deg, #7a1b10 0%, #c2632d 45%, #3b2a3a 100%);
  }
}

img { max-width: 100%; height: auto; }
a { color: var(--red); }
a:hover, a:focus-visible { color: var(--red-bright); }
:focus-visible { outline: 3px solid var(--red-bright); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--gold); padding: .5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

.icon { width: 1.25em; height: 1.25em; vertical-align: -.25em; }

/* ---------------- Kopfbereich ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(102,1,0,.97) 0%, rgba(124,1,0,.95) 100%);
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: .4rem 1rem;
  min-height: 60px;
}

.logo { display: block; flex: 1 1 auto; min-width: 0; text-decoration: none; }
.logo img { display: block; width: auto; height: 46px; max-width: 100%; object-fit: contain; object-position: left center; }
.logo-text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.6rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); text-shadow: 0 2px 0 rgba(0,0,0,.35);
}

/* Burger-Knopf */
.menu-toggle {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: 44px; padding: .4rem .8rem;
  font: inherit; font-size: .9rem; font-weight: bold;
  color: var(--red-dark); background: var(--gold);
  border: 0; border-radius: 6px; cursor: pointer;
}
.burger { display: inline-block; width: 20px; }
.burger span { display: block; height: 2px; margin: 4px 0; background: currentColor; transition: transform .2s, opacity .2s; }
.menu-toggle[aria-expanded="true"] .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .burger span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Navigation – Handy: aufklappbares Menü */
.main-nav {
  display: none;
  background: var(--box-solid);
  border-top: 1px solid var(--red);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}
.main-nav.open { display: block; }

.menu, .submenu { list-style: none; margin: 0; padding: 0; }
.menu > li { position: relative; border-bottom: 1px solid rgba(112,14,6,.25); }
.menu a {
  display: block;
  padding: .85rem 3.5rem .85rem 1.25rem;
  font-weight: bold; text-decoration: none; color: var(--red);
}
.menu > li.active > a { background: rgba(112,14,6,.1); }
.sub-toggle {
  position: absolute; right: 0; top: 0;
  width: 3.25rem; height: 3.1rem;
  border: 0; border-left: 1px solid rgba(112,14,6,.2);
  background: transparent; cursor: pointer; color: var(--red);
}
.sub-toggle::before {
  content: ""; display: block; margin: 0 auto;
  width: 10px; height: 10px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-3px) rotate(45deg); transition: transform .2s;
}
.sub-toggle[aria-expanded="true"]::before { transform: translateY(2px) rotate(-135deg); }
.submenu { display: none; background: rgba(255,255,255,.35); }
.submenu.open { display: block; }
.submenu a { font-weight: normal; padding-left: 2.25rem; border-top: 1px solid rgba(112,14,6,.12); }
.submenu li.active > a { text-decoration: underline; }

.social { display: flex; gap: .5rem; padding: .75rem 1.25rem; }
.social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  color: var(--gold); background: var(--red);
}
.social a:hover { background: var(--red-bright); color: #fff; }

/* ---------------- Inhalt ---------------- */

.page-wrap {
  max-width: var(--maxw);
  margin: 1rem auto 2rem;
  padding: 0 .75rem;
  display: grid;
  gap: 1rem;
}

.box {
  background: var(--box);
  border: 1px solid var(--red);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.1rem 1.25rem;
}

.content { min-width: 0; overflow-wrap: anywhere; }
.content > :first-child { margin-top: 0; }

h1, h2, h3, h4 { font-family: var(--font); color: var(--red); line-height: 1.3; }
.content h1 { font-size: 1.35rem; margin: 0 0 .75rem; }
.content h2 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; }
.content h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 .4rem;
  padding-left: 2rem;
  min-height: 1.9rem;
  display: flex; align-items: center;
  background: var(--ornament, none) left center / 1.6rem auto no-repeat;
}
.content p, .content ul, .content ol { margin: 0 0 .9rem; }
.content ul, .content ol { padding-left: 1.4rem; }
.content li { margin-bottom: .25rem; }
.content li > ul { margin: .3rem 0 .6rem; }
.content img { border: 1px solid var(--red); box-shadow: var(--shadow); }
.content figure { margin: 0 0 1rem; }
.content table { border-collapse: collapse; width: 100%; margin-bottom: 1rem; }
.content th, .content td { border: 1px solid rgba(112,14,6,.4); padding: .4rem .6rem; text-align: left; }

/* Referenzliste in Spalten */
.content ul.referenzen {
  list-style: none; padding: 0;
  columns: 2; column-gap: 1.25rem;
  font-size: .9rem;
}
.content ul.referenzen li { break-inside: avoid; margin: 0 0 .35rem; }

/* Seitenleiste */
.sidebar { display: grid; gap: 1rem; align-content: start; }
.widget h2 {
  font-size: 1rem; font-weight: bold;
  margin: -.25rem 0 .75rem;
  padding: 0 .5rem 1.6rem 1.5rem;
  background: var(--box-title) left bottom / min(310px, 100%) auto no-repeat;
}
.widget p, .widget ul { margin: 0 0 .6rem; }
.widget ul { padding-left: 1.2rem; }
.widget ul.subnav { list-style: none; padding: 0; }
.subnav li { border-bottom: 1px dotted rgba(112,14,6,.35); }
.subnav li:last-child { border-bottom: 0; }
.subnav a { display: block; padding: .55rem .25rem .55rem 1.1rem; text-decoration: none; position: relative; }
.subnav a::before { content: "›"; position: absolute; left: .2rem; font-weight: bold; }
.subnav a:hover { text-decoration: underline; }
.subnav li.current a { font-weight: bold; }
.widget a[href^="tel:"], .widget a[href^="mailto:"] { font-weight: bold; overflow-wrap: anywhere; }
.widget img { display: block; margin: 0 auto .5rem; }

/* ---------------- Fußbereich ---------------- */

.site-footer {
  position: relative;
  color: var(--gold);
  text-align: center;
  background: linear-gradient(180deg, rgba(102,1,0,0) 0, rgba(164,0,0,.36) 75px, rgba(150,0,0,.81) 150px, #660100 225px);
  padding-top: 3rem;
}
.footer-ornament {
  height: 0;
  padding-top: min(125px, 12.8%);
  max-width: 977px;
  margin: 0 auto;
  background: var(--footer-ornament, none) center bottom / contain no-repeat;
}
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 1rem 1rem 2rem; }
.site-footer a { color: var(--gold); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-contact { display: flex; flex-direction: column; gap: .6rem; align-items: center; margin: 0 0 1rem; font-weight: bold; }
.footer-contact a { display: inline-flex; gap: .5rem; align-items: center; min-height: 44px; }
.footer-social { display: flex; justify-content: center; gap: .75rem; margin: 0 0 1rem; }
.footer-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--gold);
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.5rem; margin: 0 0 1rem; }
.footer-links a { text-decoration: underline; }
.footer-text { font-size: .85rem; opacity: .85; margin: 0; }

.to-top {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 40;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  color: var(--gold) !important; background: var(--red);
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; }

/* Schnellkontakt-Leiste am Handy */
.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: flex;
  background: var(--red-dark);
  box-shadow: 0 -2px 8px rgba(0,0,0,.35);
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-bar a {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 52px;
  color: var(--gold); font-weight: bold; text-decoration: none;
}
.mobile-bar a + a { border-left: 1px solid rgba(255,189,87,.35); }
body.has-mobile-bar { padding-bottom: 52px; }
body.has-mobile-bar .to-top { bottom: 4.25rem; }

/* ---------------- Ab Tablet ---------------- */

@media (min-width: 600px) {
  .content ul.referenzen { columns: 3; }
  .box { padding: 1.4rem 1.6rem 1.6rem; }
  .footer-contact { flex-direction: row; justify-content: center; gap: 2rem; }
}

/* ---------------- Desktop ---------------- */

@media (min-width: 900px) {
  body { font-size: 15px; }

  .site-header {
    position: relative;
    background: linear-gradient(180deg,
      rgba(102,1,0,.92) 0, rgba(124,1,0,.94) 36px, rgba(156,0,0,.78) 72px,
      rgba(179,0,0,.49) 120px, rgba(160,0,0,.34) 144px, rgba(117,0,0,.14) 180px, rgba(113,0,0,0) 216px);
    box-shadow: none;
  }
  .header-inner { display: block; padding: 2rem 1rem .5rem; text-align: center; }
  .logo img { height: auto; width: 100%; max-width: 980px; margin: 0 auto; object-position: center; }
  .logo-text { font-size: 3.5rem; display: block; padding: 2rem 0; }
  .menu-toggle { display: none; }

  .main-nav {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    max-width: none; max-height: none; overflow: visible;
    border: 0;
    background: linear-gradient(180deg, rgba(255,190,87,.02) 0, rgba(255,190,87,.55) 10%, rgba(255,189,86,.67) 50%, rgba(255,189,87,.55) 90%, rgba(255,189,87,0) 100%);
    padding: 0 max(1rem, calc((100% - var(--maxw)) / 2 + 1rem));
    min-height: 41px;
  }
  .menu { display: flex; }
  .menu > li { border: 0; }
  .menu > li > a {
    padding: .55rem 1.4rem .55rem 2.2rem;
    font-size: .95rem;
    background: var(--ornament, none) .4rem center / 1.3rem auto no-repeat;
  }
  .menu > li.active > a, .menu > li > a:hover { background-color: rgba(112,14,6,.12); }
  .sub-toggle { display: none; }
  .submenu, .submenu.open { display: none; }
  .submenu {
    position: absolute; left: 0; top: 100%; z-index: 60;
    min-width: 280px;
    background: var(--box-solid);
    border: 1px solid var(--red); box-shadow: var(--shadow);
  }
  .has-children:hover > .submenu, .has-children:focus-within > .submenu { display: block; }
  .submenu a { padding: .6rem 1rem; }
  .submenu a:hover { background: rgba(112,14,6,.1); }
  .social { padding: 0; gap: .4rem; }
  .social a { width: 34px; height: 34px; }
  .social .icon { width: 18px; height: 18px; }

  .page-wrap { margin-top: 1.5rem; padding: 0 1rem; }
  .page-wrap.with-sidebar { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
  .content h1 { font-size: 1.3rem; }

  .mobile-bar { display: none; }
  body.has-mobile-bar { padding-bottom: 0; }
  body.has-mobile-bar .to-top { bottom: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media print {
  body::before, .site-header .main-nav, .menu-toggle, .mobile-bar, .to-top, .site-footer { display: none !important; }
  .box { box-shadow: none; border: 0; background: none; }
  body { color: #000; }
}
