/* Waidblick Hilfe — Farben und Schriften wie in der App (frontend/src/css/styles.css) */
@font-face { font-family: 'Inter'; font-weight: 100 900; font-display: swap; src: url('/assets/inter.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-weight: 100 900; font-display: swap; src: url('/assets/inter-ext.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fraunces'; font-weight: 100 900; font-display: swap; src: url('/assets/fraunces.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fraunces'; font-weight: 100 900; font-display: swap; src: url('/assets/fraunces-ext.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light;
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --bg: #f4efe5;
  --surface: #fffcf6;
  --surface-2: #f2ecdf;
  --border: rgba(70, 58, 30, 0.12);
  --border-strong: rgba(70, 58, 30, 0.22);
  --text: #1b211d;
  --text-muted: #5b6157;
  --accent: #b48d3c;
  --accent-text: #85631c;
  --accent-soft: rgba(180, 141, 60, 0.13);
  --sidebar: #16201b;
  --sidebar-text: #d9d3c3;
  --sidebar-muted: #8f978a;
  --tipp: #3f7a4a;
  --tipp-soft: rgba(63, 122, 74, 0.09);
  --hinweis: #3d6f93;
  --hinweis-soft: rgba(61, 111, 147, 0.09);
  --achtung: #b4543f;
  --achtung-soft: rgba(180, 84, 63, 0.09);
  --shadow: 0 1px 2px rgba(30, 25, 10, 0.06), 0 8px 24px rgba(30, 25, 10, 0.08);
  --kopf-h: 60px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0d1310;
    --surface: #141c18;
    --surface-2: #1a241f;
    --border: rgba(222, 205, 160, 0.1);
    --border-strong: rgba(222, 205, 160, 0.2);
    --text: #ece6d8;
    --text-muted: #a9a796;
    --accent: #c9a75a;
    --accent-text: #d9bb72;
    --accent-soft: rgba(201, 167, 90, 0.13);
    --sidebar: #101814;
    --tipp: #82c08d;
    --tipp-soft: rgba(130, 192, 141, 0.1);
    --hinweis: #86afcc;
    --hinweis-soft: rgba(134, 175, 204, 0.1);
    --achtung: #e4806f;
    --achtung-soft: rgba(228, 128, 111, 0.1);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--kopf-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font-ui); }
a { color: var(--accent-text); }
img { max-width: 100%; }

/* ── Kopfzeile ─────────────────────────────────────────────────────────── */
.kopf {
  position: sticky; top: 0; z-index: 20; height: var(--kopf-h);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: var(--sidebar); color: var(--sidebar-text); border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.marke { display: flex; align-items: center; gap: 10px; color: #f2ecdc; text-decoration: none; font: 600 19px var(--font-display); white-space: nowrap; }
.marke img { border-radius: 7px; }
.suche { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.suche input {
  width: 100%; height: 38px; padding: 0 14px; border-radius: 9px; font: inherit; font-size: 15px;
  border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.07); color: #f2ecdc;
}
.suche input::placeholder { color: var(--sidebar-muted); }
.suche input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.treffer {
  position: absolute; top: 44px; left: 0; right: 0; max-height: 70vh; overflow: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow);
}
.treffer a { display: block; padding: 10px 14px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border); }
.treffer a:last-child { border-bottom: 0; }
.treffer a:hover, .treffer a.aktiv { background: var(--accent-soft); }
.treffer small { display: block; color: var(--text-muted); font-size: 13px; }
.treffer mark { background: var(--accent-soft); color: inherit; border-radius: 2px; }
.treffer .leer { padding: 12px 14px; color: var(--text-muted); }
.sprache, .zur-app { color: var(--sidebar-text); text-decoration: none; font-size: 14px; white-space: nowrap; padding: 7px 12px; border-radius: 8px; }
.sprache { border: 1px solid rgba(255, 255, 255, 0.14); }
.zur-app { background: var(--accent); color: #17130a; font-weight: 600; }
.sprache:hover { background: rgba(255, 255, 255, 0.07); }
.menu-knopf { display: none; }

/* ── Grundgerüst ───────────────────────────────────────────────────────── */
.rahmen { display: grid; grid-template-columns: 280px minmax(0, 1fr) 220px; max-width: 1480px; margin: 0 auto; }
.seitennav {
  position: sticky; top: var(--kopf-h); height: calc(100vh - var(--kopf-h)); overflow-y: auto;
  padding: 24px 16px 40px; border-right: 1px solid var(--border);
}
.nav-gruppe + .nav-gruppe { margin-top: 22px; }
.nav-titel { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); padding: 0 10px 6px; }
.seitennav ul { list-style: none; margin: 0; padding: 0; }
.seitennav a { display: block; padding: 6px 10px; border-radius: 7px; color: var(--text); text-decoration: none; font-size: 15px; line-height: 1.35; }
.seitennav a:hover { background: var(--surface-2); }
.seitennav a[aria-current] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }

.inhalt { padding: 36px 48px 48px; min-width: 0; }
article { max-width: 780px; }
.bereich { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-text); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 40px; margin: 6px 0 18px; }
h2 { font-size: 27px; margin: 44px 0 12px; padding-top: 20px; border-top: 1px solid var(--border); }
h3 { font-size: 20px; margin: 30px 0 8px; }
.anker { float: left; margin-left: -1.1em; width: 1.1em; color: var(--text-muted); text-decoration: none; opacity: 0; font-weight: 400; }
h2:hover .anker, h3:hover .anker { opacity: 0.6; }
p, ul, ol { margin: 0 0 14px; }
li { margin: 4px 0; }
li > ul, li > ol { margin: 4px 0; }
code { font-size: 0.9em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }
kbd { font: 600 0.85em var(--font-ui); background: var(--surface); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; }
strong { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }

/* Bilder: Klick vergrößert */
.bild { margin: 20px 0 26px; }
.bild a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--border-strong); box-shadow: var(--shadow); cursor: zoom-in; background: var(--surface); }
.bild img { display: block; width: 100%; height: auto; }
.bild figcaption { margin-top: 8px; font-size: 14px; color: var(--text-muted); }
.bild-mobil { max-width: 300px; }
.bild-mobil a { border-radius: 30px; border: 9px solid #1d2420; box-shadow: var(--shadow), 0 0 0 1px var(--border-strong); }
.bilder { display: flex; flex-wrap: wrap; gap: 0 24px; align-items: flex-start; }
.bilder .bild-mobil { flex: 0 1 260px; }

/* Hinweisboxen */
.box { margin: 18px 0; padding: 12px 16px; border-radius: 10px; border-left: 4px solid; }
.box p:last-child { margin-bottom: 0; }
.box-tipp { background: var(--tipp-soft); border-color: var(--tipp); }
.box-hinweis { background: var(--hinweis-soft); border-color: var(--hinweis); }
.box-achtung { background: var(--achtung-soft); border-color: var(--achtung); }

/* Tabellen */
.tabelle { overflow-x: auto; margin: 16px 0 20px; border: 1px solid var(--border-strong); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

/* Kachel-Übersicht auf der Startseite */
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 18px 0 28px; }
.kacheln a { display: block; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.kacheln a:hover { border-color: var(--accent); }
.kacheln strong { display: block; font: 600 18px var(--font-display); color: var(--accent-text); margin-bottom: 4px; }
.kacheln span { font-size: 14px; color: var(--text-muted); line-height: 1.45; display: block; }

/* Vor/zurück */
.blaettern { display: flex; justify-content: space-between; gap: 16px; max-width: 780px; margin-top: 48px; }
.blaettern a { flex: 1; max-width: 48%; padding: 12px 16px; border: 1px solid var(--border-strong); border-radius: 10px; text-decoration: none; color: var(--text); font-weight: 600; }
.blaettern a:hover { border-color: var(--accent); }
.blaettern span { display: block; font-size: 13px; font-weight: 400; color: var(--text-muted); }
.blaettern .weiter { text-align: right; margin-left: auto; }
.fuss { max-width: 780px; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }

/* Inhaltsverzeichnis rechts */
.toc { position: sticky; top: var(--kopf-h); align-self: start; max-height: calc(100vh - var(--kopf-h)); overflow-y: auto; padding: 36px 16px 24px 0; font-size: 14px; }
.toc-titel { font-weight: 600; margin-bottom: 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.toc a { display: block; padding: 4px 0 4px 12px; margin-left: -2px; border-left: 2px solid transparent; color: var(--text-muted); text-decoration: none; line-height: 1.35; }
.toc a:hover, .toc a.aktiv { color: var(--accent-text); border-left-color: var(--accent); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(5, 8, 6, 0.88); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }
.lightbox button { position: absolute; top: 12px; right: 16px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 28px; cursor: pointer; }

/* ── Schmale Bildschirme ───────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .rahmen { grid-template-columns: 260px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  :root { --kopf-h: 56px; }
  .kopf { gap: 10px; padding: 0 12px; }
  .menu-knopf {
    display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none;
    border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  }
  .menu-knopf span, .menu-knopf span::before, .menu-knopf span::after {
    display: block; width: 20px; height: 2px; background: #f2ecdc; border-radius: 2px; position: relative; content: '';
  }
  .menu-knopf span::before { position: absolute; top: -6px; }
  .menu-knopf span::after { position: absolute; top: 6px; }
  .marke span { display: none; }
  .zur-app { display: none; }
  .suche { margin-left: 0; }
  .sprache { padding: 7px 9px; }
  .rahmen { display: block; }
  .seitennav {
    position: fixed; top: var(--kopf-h); left: 0; bottom: 0; z-index: 15; width: min(320px, 86vw); height: auto;
    background: var(--bg); transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow);
  }
  body.nav-offen .seitennav { transform: none; }
  .inhalt { padding: 22px 16px 40px; }
  h1 { font-size: 31px; }
  h2 { font-size: 23px; }
  .anker { display: none; }
  .bild-mobil { max-width: 240px; margin-left: auto; margin-right: auto; }
  .bilder { justify-content: center; }
  .blaettern { flex-direction: column; }
  .blaettern a { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .seitennav { transition: none; } }
