/* Wissensbibliothek – Stylesheet
   Teal / Terrakotta / Sand, flache Karten, viel Weißraum. Hell- und Dunkelmodus. */

/* ---------- Schriften (selbst gehostet, SIL OFL) ---------- */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/static/fonts/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/static/fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url('/static/fonts/inter-latin-wght-italic.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url('/static/fonts/source-serif-4-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url('/static/fonts/source-serif-4-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* ---------- Farben ---------- */
:root {
  color-scheme: light;
  --grund: #FBF8F3;
  --karte: #FFFFFF;
  --flaeche: #F3EEE6;
  --text: #1E2A2D;
  --leise: #56646A;
  --rahmen: #E3DCD1;
  --rahmen-stark: #C9BFB1;
  --akzent: #1D6A66;
  --akzent-flaeche: #DCEFEC;
  --akzent-text: #FFFFFF;
  --neu-grund: #A94B2F;
  --neu-text: #FFFFFF;
  --fokus: #B5553A;
  --schatten: 0 1px 2px rgb(30 42 45 / .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --grund: #141A1C; --karte: #1C2427; --flaeche: #222C2F; --text: #E9E5DE; --leise: #A3AFB2;
    --rahmen: #2F3B3E; --rahmen-stark: #445356; --akzent: #7CCBC2; --akzent-flaeche: #183A38;
    --akzent-text: #0E1416; --neu-grund: #E99A7C; --neu-text: #141A1C; --fokus: #F0A585;
    --schatten: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --grund: #141A1C; --karte: #1C2427; --flaeche: #222C2F; --text: #E9E5DE; --leise: #A3AFB2;
  --rahmen: #2F3B3E; --rahmen-stark: #445356; --akzent: #7CCBC2; --akzent-flaeche: #183A38;
  --akzent-text: #0E1416; --neu-grund: #E99A7C; --neu-text: #141A1C; --fokus: #F0A585;
  --schatten: none;
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--grund); color: var(--text);
  font: 400 1.0625rem/1.6 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
h1, h2, h3 { font-family: 'Source Serif 4', Georgia, serif; font-weight: 600; line-height: 1.2; margin: 0 0 .5em; text-wrap: balance;  hyphens: auto; overflow-wrap: break-word; }
h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.75rem); letter-spacing: -.01em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--akzent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -4rem; background: var(--akzent); color: var(--akzent-text); padding: .6rem 1rem; border-radius: 8px; z-index: 10; }
.skip-link:focus { top: 1rem; }
.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 40rem) { .wrap { padding: 0 1.5rem; } }

/* ---------- Kopfzeile ---------- */
.kopf { border-bottom: 1px solid var(--rahmen); background: var(--karte); }
.kopf .wrap { display: flex; align-items: center; gap: 1rem; min-height: 4rem; }
.marke { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font-family: 'Source Serif 4', Georgia, serif; font-weight: 600; font-size: 1.2rem;  white-space: nowrap; min-width: 0; }
.marke svg { flex: none; }
.kopf .theme-knopf { margin-left: auto; }

.theme-knopf {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .8rem;
  border: 1px solid var(--rahmen); border-radius: 999px; background: transparent; color: var(--text);
  font: inherit; font-size: .9rem; cursor: pointer;
}
.theme-knopf:hover { border-color: var(--rahmen-stark); }

@media (max-width: 30rem) {
  .marke { font-size: 1.05rem; }
  .theme-knopf .lang, .theme-knopf [data-theme-name] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .theme-knopf { padding: 0; width: 44px; justify-content: center; }
  .player .play { width: 3.5rem; height: 3.5rem; }
  .player .einwilligung .hinweis { gap: .35rem; font-size: .95rem; }
  .player .klein { font-size: .82rem; }
}

/* ---------- Einleitung + Suche ---------- */
.intro { padding-top: 2.5rem; padding-bottom: 1.5rem; }
.intro p.lead { color: var(--leise); max-width: 40rem; font-size: 1.1rem; }
.zaehler { color: var(--leise); font-size: .95rem; margin-bottom: 1.25rem; }
.suche { display: flex; gap: .5rem; max-width: 36rem; }
.suche input {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 1rem; font: inherit;
  border: 1px solid var(--rahmen-stark); border-radius: 10px; background: var(--karte); color: var(--text);
}
.suche input::placeholder { color: var(--leise); opacity: 1; }
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 48px; padding: 0 1.15rem; border-radius: 10px; border: 1px solid var(--akzent);
  background: var(--akzent); color: var(--akzent-text); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.knopf:hover { filter: brightness(1.08); }
.knopf.zweit { background: transparent; color: var(--akzent); }

/* ---------- Filter ---------- */
.filter { padding-bottom: 1.5rem; display: grid; gap: .75rem; }
.filter-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.filter-zeile .beschriftung { font-size: .9rem; color: var(--leise); margin-right: .25rem; min-width: 5.5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: 0 .95rem;
  border-radius: 999px; border: 1px solid var(--rahmen); background: var(--karte); color: var(--text);
  text-decoration: none; font-size: .95rem; white-space: nowrap;
}
.chip:hover { border-color: var(--rahmen-stark); }
.chip.kat { background: var(--k-bg); color: var(--k-fg); border-color: transparent; }
.chip[aria-current="true"] { border: 2px solid var(--text); font-weight: 600; }
.chip[aria-current="true"]::before { content: '✓'; }
@media (max-width: 40rem) {
  .filter-zeile { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: thin; margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; }
  .filter-zeile .beschriftung { min-width: auto; }
}

/* ---------- Karten ---------- */
.raster { display: grid; padding: 0; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); margin: 0 0 3rem; list-style: none; }
.karte {
  position: relative; display: flex; flex-direction: column; background: var(--karte);
  border: 1px solid var(--rahmen); border-radius: 14px; overflow: hidden; box-shadow: var(--schatten);
  transition: border-color .15s, transform .15s;
}
.karte:hover { border-color: var(--rahmen-stark); transform: translateY(-2px); }
.karte:focus-within { outline: 3px solid var(--fokus); outline-offset: 2px; }
.karte .bild { aspect-ratio: 16 / 9; background: var(--k-bg); color: var(--k-fg); display: grid; place-items: center; overflow: hidden; }
.karte .bild img { width: 100%; height: 100%; object-fit: cover; }
.karte .bild svg { width: 3.25rem; height: 3.25rem; }
.karte .inhalt { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.karte h2 { font-size: 1.25rem; margin: 0; }
.karte h2 a { color: var(--text); text-decoration: none; }
.karte h2 a::after { content: ''; position: absolute; inset: 0; }
.karte h2 a:focus-visible { outline: none; }
.karte p { color: var(--leise); margin: 0; font-size: .98rem; }
.badges { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--k-bg); color: var(--k-fg); }
.badge.neu { background: var(--neu-grund); color: var(--neu-text); }
.zaehl { display: flex; gap: 1rem; margin-top: auto; padding-top: .5rem; font-size: .88rem; color: var(--leise); list-style: none; padding-left: 0; margin-bottom: 0; }
.zaehl li { display: inline-flex; align-items: center; gap: .3rem; }
.zaehl svg { width: 1.05rem; height: 1.05rem; }
.leer { padding: 3rem 1rem; text-align: center; border: 1px dashed var(--rahmen-stark); border-radius: 14px; margin-bottom: 3rem; }

/* ---------- Themenseite ---------- */
.zurueck { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; margin-top: 1rem; }
.thema-kopf { padding: 1rem 0 1.5rem; max-width: 48rem; }
.thema-kopf .lead { font-size: 1.15rem; color: var(--leise); }
.fuer { color: var(--leise); font-size: .95rem; }
.thema-raster { display: grid; gap: 2rem; padding-bottom: 3rem; }
@media (min-width: 60rem) { .thema-raster { grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; } }
.abschnitt { background: var(--karte); border: 1px solid var(--rahmen); border-radius: 14px; padding: 1.25rem; }
.abschnitt + .abschnitt { margin-top: 1.5rem; }
.abschnitt h2 { font-size: 1.3rem; }

.player { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #0E1416; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .einwilligung {
  position: absolute; inset: 0; width: 100%; border: 0; padding: 0; cursor: pointer; background: #0E1416; color: #fff; font: inherit;
}
.player .einwilligung img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.player .einwilligung .hinweis {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
  height: 100%; padding: 1rem; text-align: center; text-shadow: 0 1px 3px rgb(0 0 0 / .6);
}
.player .play { width: 4.5rem; height: 4.5rem; border-radius: 50%; background: #B5553A; display: grid; place-items: center; box-shadow: 0 2px 10px rgb(0 0 0 / .35); }
.player .einwilligung:hover .play, .player .einwilligung:focus-visible .play { background: #C9643F; transform: scale(1.05); }
.player .klein { font-size: .9rem; max-width: 28rem; }
.video-titel { margin: .75rem 0 0; font-weight: 600; }
.video-liste { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .5rem; }
.video-liste a {
  display: flex; align-items: center; gap: .75rem; padding: .4rem; border-radius: 10px;
  border: 1px solid var(--rahmen); text-decoration: none; color: var(--text); min-height: 48px;
}
.video-liste a:hover { border-color: var(--rahmen-stark); }
.video-liste a[aria-current="true"] { border: 2px solid var(--akzent); background: var(--akzent-flaeche); }
.video-liste img { width: 6rem; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; flex: none; }
.video-liste .nr { font-size: .85rem; color: var(--leise); display: block; }
.extern { font-size: .9rem; color: var(--leise); margin: .5rem 0 0; }

.material-liste { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.material-liste a {
  display: flex; gap: .75rem; align-items: flex-start; padding: .8rem; border: 1px solid var(--rahmen); border-radius: 10px;
  text-decoration: none; color: var(--text); min-height: 48px;
}
.material-liste a:hover { border-color: var(--rahmen-stark); }
.material-liste svg { flex: none; width: 1.6rem; height: 1.6rem; color: var(--akzent); margin-top: .1rem; }
.material-liste .titel { font-weight: 600; display: block; }
.material-liste .info { font-size: .88rem; color: var(--leise); display: block; }

.prosa { max-width: 44rem; }
.prosa > :last-child { margin-bottom: 0; }
.prosa ul, .prosa ol { padding-left: 1.4rem; margin: 0 0 1em; }
.prosa li { margin-bottom: .3em; }
.prosa h2, .prosa h3 { margin-top: 1.2em; }
.prosa blockquote { margin: 0 0 1em; padding-left: 1rem; border-left: 3px solid var(--rahmen-stark); color: var(--leise); }
.meta { color: var(--leise); font-size: .9rem; margin-top: 1rem; }

/* ---------- Fuß ---------- */
.fuss { border-top: 1px solid var(--rahmen); padding: 1.5rem 0 2rem; font-size: .92rem; color: var(--leise); }
.fuss .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; }
.fuss nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.fuss a { color: var(--leise); display: inline-flex; min-height: 44px; align-items: center; }
.fuss .theme-knopf { margin-left: auto; }

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .karte:hover { transform: none; }
}

/* ---------- Vorschau-Banner (nur für den Admin sichtbar) ---------- */
.vorschau-banner { background: #F3E8D1; color: #4A3A14; border-bottom: 1px solid #D9C69B; padding: .75rem 0; }
.vorschau-banner a { color: #4A3A14; margin-left: .5rem; }

/* ---------- QR-Code ---------- */
.thema-aktionen { margin: 1rem 0 0; }
.thema-aktionen .knopf { min-height: 44px; }
.qr-dialog {
  width: min(26rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 1.25rem 1.25rem 1.5rem;
  border: 1px solid var(--rahmen); border-radius: 16px; background: var(--karte); color: var(--text); text-align: center;
}
.qr-dialog::backdrop { background: rgb(14 20 22 / .55); }
.qr-dialog-kopf { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.qr-dialog-kopf h2 { margin: 0; font-size: 1.35rem; }
.qr-dialog-kopf form { margin: 0; }
.icon-schliessen {
  min-width: 44px; min-height: 44px; border-radius: 10px; border: 1px solid var(--rahmen); background: transparent;
  color: var(--text); font: inherit; font-size: 1.1rem; cursor: pointer;
}
.qr-bild { width: min(240px, 70vw); height: auto; aspect-ratio: 1; margin: 0 auto; background: #fff; padding: 8px; border-radius: 8px; border: 1px solid var(--rahmen); }
.qr-url { font-weight: 600; margin: .75rem 0 .25rem; word-break: break-all; }
.hilfe-text { color: var(--leise); font-size: .92rem; }
.qr-aktionen { display: grid; gap: .5rem; margin-top: 1rem; }
.qr-seite { padding-bottom: 3rem; max-width: 28rem; text-align: center; }
.qr-seite .zurueck { display: flex; }
