/* ==========================================================================
   IDBT-Glossar · Register, Begriffsseite, Schnellsuche
   --------------------------------------------------------------------------
   Aufbau nach PLAN-REDESIGN.md (ASD-STE100), Abschnitt 4:
     index.html       Seitenkopf mit Filterfeld und Kennzahlen; sechs
                      Themenkarten; A–Z-Liste mit stehender Leiste
                      (Alphabet, Themen), je Buchstabe die Namen als
                      Reihe von Verweisen (wie das Mollie-Glossar).
     begriffe/*.html  Seitenkopf mit Name und Leitsatz (wie Cloudflare
                      Learning Center); Text links, rechts eine Leiste
                      „Auf einen Blick", „Siehe auch", Begriffe mit
                      demselben Buchstaben; „Erwähnt in" als Karten;
                      Blättern.
     alle Seiten      Schnellsuche als Dialog (Strg+K, „/").
   Flach wie die Hauptseite: Papierflächen, Haarlinien, 16 px Ecken,
   Schatten nur für schwebende Flächen.
   ========================================================================== */

/* ==========================================================================
   TEXT EINES BEGRIFFS
   ========================================================================== */
.text { color: var(--slate); font-size: 17px; line-height: 1.72; }
.text :where(p, ul, ol) { max-width: 68ch; }
.text :where(p, ul, ol) + :where(p, ul, ol) { margin-top: 14px; }
.text ul, .text ol { display: grid; gap: 8px; padding-left: 22px; }
.text ul > li { position: relative; }
.text ul > li::before { content: ""; position: absolute; left: -16px; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.text ul ul > li::before { background: none; box-shadow: inset 0 0 0 1.5px var(--navy-400); }
.text ol { list-style: decimal; }
.text ol > li::marker { font-weight: 700; color: var(--navy); }
.text li > ul, .text li > ol { margin-top: 8px; }
.text__zwischen { font-weight: 700; color: var(--navy); }
.text__leer { color: var(--slate); }
.text [data-immer] { margin-top: 14px; }
.text a { font-weight: 600; color: var(--navy); text-decoration: underline; text-underline-offset: .2em; text-decoration-color: var(--navy-200); text-decoration-thickness: 1.5px; transition: text-decoration-color .2s var(--ease); }
.text a:hover { text-decoration-color: var(--orange); }
.todo { white-space: normal; }

/* ==========================================================================
   REGISTER (index.html)
   ========================================================================== */
/* Seitenkopf: Überschrift, Text, großes Filterfeld, Kennzahlen. */
.register-kopf h1 { max-width: 14ch; }
.suchfeld { position: relative; max-width: 720px; margin-top: 32px; }
.suchfeld > svg { position: absolute; left: 20px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--slate); pointer-events: none; }
.suchfeld input {
  width: 100%; height: 60px; padding: 0 64px 0 54px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--paper); font-size: 17px; font-weight: 500; color: var(--navy);
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.suchfeld input::placeholder { color: var(--slate); opacity: 1; }
.suchfeld input:hover { border-color: var(--navy-200); }
.suchfeld input:focus { outline: none; border-color: var(--navy); background: var(--white); }
.suchfeld input::-webkit-search-cancel-button { cursor: pointer; }
.suchfeld kbd {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--white); font: 700 13px/1 var(--sans); color: var(--slate); pointer-events: none;
  transition: opacity .2s var(--ease);
}
.suchfeld input:focus ~ kbd, .suchfeld input:not(:placeholder-shown) ~ kbd { opacity: 0; }
@media (hover: none) { .suchfeld kbd, .suchdialog__fuss { display: none; } }

/* Themen: sechs Papierkarten, die ganze Karte ist der Verweis. */
.themen { padding: clamp(32px, 4vw, 56px) 0 clamp(48px, 6vw, 88px); }
.themen__raster { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.themenkarte {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 220px; padding: 26px 26px 22px;
  border-radius: var(--r-md); background: var(--paper); text-decoration: none; color: var(--navy);
  transition: background-color .2s var(--ease);
}
.themenkarte:hover { background: var(--paper-hover); }
.themenkarte h3 { transition: color .2s var(--ease); }
.themenkarte:hover h3 { color: var(--orange-ink); }
.themenkarte__zahl { font-size: 14px; font-weight: 600; color: var(--slate); }
.themenkarte__beispiele { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.themenkarte__beispiele > span { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--slate); }
.themenkarte__beispiele > .themenkarte__mehr { border-color: transparent; background: none; color: var(--muted); }
.themenkarte__pfeil { display: grid; place-items: center; align-self: flex-end; width: 38px; height: 38px; margin-top: auto; border: 1px solid var(--navy-200); border-radius: 50%; background: var(--white); transition: border-color .2s var(--ease); }
.themenkarte__pfeil svg { width: 16px; height: 16px; transition: transform var(--dur) var(--ease); }
.themenkarte:hover .themenkarte__pfeil { border-color: var(--navy-400); }
.themenkarte:hover .themenkarte__pfeil svg { transform: translateX(3px); }
.themenkarte[aria-current] { background: var(--navy); color: var(--white); }
.themenkarte[aria-current] .themenkarte__zahl { color: rgba(255,255,255,.7); }
.themenkarte[aria-current] h3 { color: var(--white); }

/* A–Z: Leiste mit Alphabet, Themen und Ansicht; bleibt unter dem Kopf. */
.az { padding-bottom: clamp(24px, 3vw, 40px); }
.leiste {
  position: sticky; top: calc(var(--nav-h) - 1px); z-index: 20;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 0 calc(var(--gut) * -1) 32px; padding: 12px var(--gut);
  background: rgba(255,255,255,.96); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.abc { display: grid; grid-template-columns: repeat(26, minmax(0, 1fr)); gap: 2px; }
.abc__buchstabe { display: grid; place-items: center; height: 36px; border-radius: var(--r-sm); font-weight: 700; font-size: 15px; color: var(--navy); text-decoration: none; transition: background-color .2s var(--ease), color .2s var(--ease); }
a.abc__buchstabe:hover { background: var(--navy-100); }
.abc__buchstabe[aria-disabled], .abc__buchstabe.ist-leer { color: var(--navy-200); pointer-events: none; }
.abc__buchstabe[aria-current] { background: var(--navy); color: var(--white); }
.leiste__zeile { display: flex; align-items: center; gap: 12px; min-width: 0; }
.themenwahl { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.themenwahl__knopf {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 14px; flex: none;
  border: 1px solid var(--line); border-radius: 999px; background: var(--white); cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--slate); white-space: nowrap;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.themenwahl__zahl { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.themenwahl__knopf:hover { border-color: var(--navy-200); color: var(--navy); }
.themenwahl__knopf[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.themenwahl__knopf[aria-pressed="true"] .themenwahl__zahl { color: rgba(255,255,255,.65); }
/* Ansicht: graue Spur, weißer Daumen (Segmentschalter der Hauptseite). */

.register__stand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin: -12px 0 24px; }
.treffer { font-size: 15px; color: var(--slate); }
.treffer strong { color: var(--navy); }
.zuruecksetzen { padding: 4px 0; border: 0; background: none; cursor: pointer; font-size: 15px; font-weight: 700; color: var(--navy); text-decoration: underline; text-underline-offset: .25em; text-decoration-color: var(--navy-200); }
.zuruecksetzen:hover { text-decoration-color: var(--orange); }

/* Je Buchstabe die Namen als eine Reihe von Verweisen (wie das
   Mollie-Glossar; seit 2026-10-22 die einzige Form der Liste). Der Sprung
   über das Alphabet landet unter der Leiste: glossar.js misst ihre Höhe
   und setzt --leiste-h (ohne Script gilt der Ersatzwert). */
.gruppe { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; padding: 16px 0; scroll-margin-top: calc(var(--nav-h) + var(--leiste-h, 160px) + 8px); }
.gruppe + .gruppe { border-top: 1px solid var(--line); }
.gruppe__buchstabe { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; }
.zeilen { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 0; padding-top: 6px; }
.zeile:not(:last-child):not(.ist-letzt)::after { content: "·"; margin: 0 10px; color: var(--navy-400); }
.zeile__link {
  font-size: 16px; font-weight: 600; line-height: 1.5; color: var(--navy);
  text-decoration: underline; text-underline-offset: .22em; text-decoration-color: var(--navy-200); text-decoration-thickness: 1.5px;
  transition: color .2s var(--ease), text-decoration-color .2s var(--ease);
}
.zeile__link:hover { color: var(--orange-ink); text-decoration-color: var(--orange); }
.zeile--leer .zeile__link { color: var(--muted); }
mark { background: #FFE2DE; color: inherit; border-radius: 3px; box-shadow: 0 0 0 1px #FFE2DE; }

.kein-treffer { display: grid; justify-items: start; gap: 8px; padding: clamp(28px, 4vw, 44px); border: 1px dashed var(--navy-200); border-radius: var(--r-md); color: var(--slate); }
.kein-treffer__titel { font-size: 22px; font-weight: 700; color: var(--navy); }
.kein-treffer__knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ist-gefiltert { display: none !important; }

/* ==========================================================================
   BEGRIFFSSEITE (begriffe/*.html)
   ========================================================================== */
.begriff-kopf { padding: clamp(40px, 6vw, 88px) 0 clamp(32px, 4vw, 56px); border-bottom: 1px solid var(--line); }
/* Der Name: so groß wie möglich, aber das längste Wort (--wort, Zeichen,
   vom Generator gesetzt) passt immer in die Breite. Deutsche Komposita
   wie „Verhandlungsverfahren" brechen sonst mitten im Wort, wo der
   Browser keine Silbentrennung hat. */
.begriff-kopf h1 { --gross: clamp(40px, 5.6vw, 80px); font-size: min(var(--gross), calc((100vw - 2 * var(--gut)) / (var(--wort, 10) * .64))); max-width: 18ch; overflow-wrap: break-word; hyphens: manual; }
.begriff-kopf h1.ist-lang { --gross: clamp(34px, 4.2vw, 60px); max-width: 22ch; }
.leitsatz { margin-top: 24px; max-width: 46ch; font-size: clamp(20px, 1.9vw, 26px); font-weight: 500; line-height: 1.45; letter-spacing: -.015em; color: var(--navy); text-wrap: pretty; }
.leitsatz p + p, .leitsatz p + div, .leitsatz div + div { margin-top: 10px; }
.leitsatz a { color: inherit; text-decoration: underline; text-underline-offset: .18em; text-decoration-color: var(--navy-200); text-decoration-thickness: 2px; }
.leitsatz a:hover { text-decoration-color: var(--orange); }
.leitsatz .text__leer { font-size: 15px; font-weight: 600; color: var(--slate); }
.fehlt { display: grid; gap: 8px; max-width: 46ch; margin-top: 24px; padding: 22px 24px; border: 1px dashed var(--navy-200); border-radius: var(--r-md); color: var(--slate); }

.begriff-rumpf { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: clamp(40px, 6vw, 96px); align-items: start; padding: clamp(40px, 5vw, 72px) 0; }
.begriff-rumpf__text > h2, .erwaehnt h2 { font-size: clamp(24px, 2.2vw, 30px); margin-bottom: 18px; }
.begriff-rumpf__text > .text + h2 { margin-top: 40px; }
.begriff-rumpf__leer { color: var(--slate); }

/* Leiste rechts: Auf einen Blick, Siehe auch, gleicher Buchstabe. */
.schiene { position: sticky; top: calc(var(--nav-h) + 24px); display: grid; gap: 16px; }
.kasten { padding: 22px 24px; border-radius: var(--r-md); background: var(--paper); }
.kasten__titel { margin-bottom: 14px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.fakten { display: grid; gap: 14px; }
.fakten div { display: grid; gap: 2px; }
.fakten dt { font-size: 13px; font-weight: 600; color: var(--muted); }
.fakten dd { font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--navy); overflow-wrap: anywhere; }
.fakten dd a { text-decoration: underline; text-underline-offset: .2em; text-decoration-color: var(--navy-200); }
.fakten dd a:hover { text-decoration-color: var(--orange); }
.fakten abbr { text-decoration: none; font-weight: 800; }
.kasten .teilen { width: 100%; margin-top: 18px; }
.teilen.ist-kopiert { --bg: #F2F9F5; --edge: #BFE3CF; --fg: #0B4A2F; --bg-hover: #F2F9F5; --edge-hover: #BFE3CF; }
.verweisliste { display: grid; margin: 0 -10px; }
.verweisliste a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: var(--r-sm); font-size: 15px; font-weight: 600; line-height: 1.35; text-decoration: none; transition: background-color .2s var(--ease); }
.verweisliste a:hover { background: var(--white); }
.verweisliste a svg { width: 15px; height: 15px; flex: none; color: var(--slate); transition: transform var(--dur) var(--ease); }
.verweisliste a:hover svg { transform: translateX(3px); }
.verweisliste a[aria-current] { background: var(--navy); color: var(--white); }
.verweisliste a[aria-current] svg { display: none; }
.kasten__alle { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; font-weight: 700; text-decoration: none; }
.kasten__alle svg { width: 15px; height: 15px; transition: transform var(--dur) var(--ease); }
.kasten__alle:hover svg { transform: translateX(3px); }

/* Erwähnt in: Papierkarten mit Name und Leitsatz. */
.erwaehnt { padding: clamp(40px, 5vw, 72px) 0 0; border-top: 1px solid var(--line); }
.erwaehnt h2 .zahl { color: var(--muted); }
.karten { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.karte { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 22px; border-radius: var(--r-md); background: var(--paper); text-decoration: none; transition: background-color .2s var(--ease); }
.karte:hover { background: var(--paper-hover); }
.karte__name { font-size: 17px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; transition: color .2s var(--ease); overflow-wrap: anywhere; }
.karte:hover .karte__name { color: var(--orange-ink); }
.karte__kurz { font-size: 15px; line-height: 1.55; color: var(--slate); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.blaettern { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-top: clamp(40px, 5vw, 64px); }
.blaettern__knopf { display: flex; align-items: center; gap: 16px; min-height: 84px; padding: 18px 22px; border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; transition: border-color .2s var(--ease), background-color .2s var(--ease); }
.blaettern__knopf:hover { border-color: var(--navy-200); background: var(--paper); }
.blaettern__knopf--vor { grid-column: 2; justify-content: flex-end; text-align: right; }
.blaettern__knopf > span { display: grid; gap: 2px; min-width: 0; }
.blaettern__wohin { font-size: 13px; font-weight: 600; color: var(--muted); }
.blaettern__name { font-size: 17px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.blaettern__knopf svg { width: 18px; height: 18px; flex: none; transition: transform var(--dur) var(--ease); }
.blaettern__knopf--zurueck:hover svg { transform: translateX(-3px); }
.blaettern__knopf--vor:hover svg { transform: translateX(3px); }

/* ==========================================================================
   SCHNELLSUCHE (alle Seiten)
   ========================================================================== */
.suchdialog {
  width: min(640px, calc(100vw - 32px)); max-height: min(72vh, 640px); margin: 12vh auto auto; padding: 0;
  border: 1px solid var(--navy-200); border-radius: var(--r-md); background: var(--white); color: var(--navy);
  box-shadow: var(--sh-2); overflow: hidden;
}
.suchdialog[open] { display: flex; flex-direction: column; animation: dialog-ein .25s var(--ease) both; }
@keyframes dialog-ein { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.suchdialog::backdrop { background: rgba(11,11,35,.42); }
.suchdialog__feld { position: relative; flex: none; border-bottom: 1px solid var(--line); }
.suchdialog__feld > svg { position: absolute; left: 20px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--slate); pointer-events: none; }
.suchdialog__feld input { width: 100%; height: 64px; padding: 0 92px 0 54px; border: 0; background: none; font-size: 18px; font-weight: 500; }
.suchdialog__feld input:focus { outline: none; }
.suchdialog__feld input::-webkit-search-cancel-button { display: none; }
.suchdialog__zu { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); cursor: pointer; font: 700 12px/1 var(--sans); color: var(--slate); }
.suchdialog__zu:hover { border-color: var(--navy-200); color: var(--navy); }
.suchdialog__liste { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px; }
.suchdialog__eintrag { display: grid; gap: 2px; padding: 12px 14px; border-radius: 10px; cursor: pointer; text-decoration: none; }
[aria-selected="true"] > .suchdialog__eintrag { background: var(--navy-100); }
.suchdialog__kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.suchdialog__name { font-size: 16px; font-weight: 700; }
.suchdialog__thema { flex: none; font-size: 12px; font-weight: 600; color: var(--muted); }
.suchdialog__kurz { font-size: 14px; color: var(--slate); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.suchdialog__leer { padding: 28px 14px; color: var(--slate); text-align: center; }
.suchdialog__fuss { display: flex; flex-wrap: wrap; gap: 6px 18px; flex: none; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--paper); font-size: 12.5px; color: var(--slate); }
.suchdialog__fuss kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-right: 4px; padding: 0 5px; border: 1px solid var(--line); border-radius: 5px; background: var(--white); font: 700 11px/1 var(--sans); color: var(--navy); }

/* ==========================================================================
   SCHMAL
   ========================================================================== */
@media (max-width: 1024px) {
  .themen__raster, .karten { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .begriff-rumpf { grid-template-columns: minmax(0, 1fr); }
  .schiene { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 860px) {
  .leiste__zeile { flex-wrap: wrap; }
  .themenwahl { flex-basis: 100%; }
}
@media (max-width: 760px) {
  .leiste { position: static; }
  .abc { grid-template-columns: repeat(13, minmax(0, 1fr)); }
  .themenwahl { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gut) * -1); padding: 0 var(--gut); }
  .gruppe { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; scroll-margin-top: calc(var(--nav-h) + 8px); }
  .gruppe__buchstabe { font-size: 26px; }
  /* Größere Tippflächen: jeder Name eine Zeile hoch genug für den Finger. */
  .zeile__link { display: inline-block; padding: 6px 0; }
  .schiene { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .themen__raster, .karten { grid-template-columns: minmax(0, 1fr); }
  .themenkarte { min-height: 0; }
  .text { font-size: 16px; line-height: 1.68; }
  .suchfeld input { height: 56px; font-size: 16px; }
  .blaettern { grid-template-columns: minmax(0, 1fr); }
  .blaettern__knopf--vor { grid-column: 1; order: -1; }
  .suchdialog { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; }
  .suchdialog__feld input { font-size: 16px; }
}

/* ==========================================================================
   DRUCK: nur Inhalt, schwarz auf weiß
   ========================================================================== */
@media print {
  .kopf, .fuss, .skip-link, .leiste, .suchfeld, .schiene .teilen, .blaettern, .register__stand, .kein-treffer, .themen, .suchdialog { display: none !important; }
  body { font-size: 11pt; color: #000; }
  .wrap { max-width: none; padding: 0; }
  .seitenkopf, .begriff-kopf { padding: 0 0 12pt; }
  .begriff-rumpf { display: block; padding: 12pt 0; }
  .schiene { position: static; display: block; margin-top: 12pt; }
  .kasten { padding: 0; background: none; }
  .gruppe { padding: 6pt 0; break-inside: avoid; }
  .gruppe__buchstabe { font-size: 16pt; }
  .karte__kurz { display: block; -webkit-line-clamp: unset; overflow: visible; }
  .karten { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .karte { background: none; border: 1px solid #999; }
  a { color: inherit !important; text-decoration: none !important; }
  mark { background: none; box-shadow: none; }
}
