/* RIKAHOE – Grundaufbau. Farben, Schriften und Schmuck stehen in stil.css (Entwurf A „Archiv“). */

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  --kopf-hoehe: 60px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--grund);
  color: var(--text);
  font-family: var(--schrift-text);
  font-size: 17px;
  line-height: 1.55;
  font-variant-numeric: lining-nums; /* gerade Ziffern (Punkt 72) */
}

body:has(.ansicht[open]) { overflow: hidden; }

img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }

/* Kopfzeile */

.seitenkopf {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--kopf-hoehe);
  padding: 0 max(16px, calc((100vw - 1240px) / 2));
  background: var(--kopf-grund);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linie);
}

.marke {
  flex: none;
  font-family: var(--schrift-titel);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .18em;
  text-decoration: none;
}

.serien-nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.serien-nav::-webkit-scrollbar { display: none; }

.serien-nav a {
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  color: var(--leise);
  font-size: .92rem;
  text-decoration: none;
  white-space: nowrap;
}

.serien-nav a:hover,
.serien-nav a.aktiv { color: var(--text); border-bottom-color: var(--akzent); }

/* Auf schmalen Bildschirmen reichen Startseite und „Alle Serien“ zur Navigation. */
@media (max-width: 640px) {
  .serien-nav { display: none; }
  .kopf-suche__knopf { margin-left: auto; } /* ohne Navigation rechtsbündig */
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px 64px;
}

.fuss {
  padding: 24px 16px 48px;
  color: var(--leise);
  font-size: .8rem;
  text-align: center;
}

.fuss a { color: var(--leise); }

/* Startseite */

.start__intro { padding: 64px 0 44px; text-align: center; }

.start__vorzeile {
  margin: 0;
  color: var(--leise);
  font-size: .78rem;
  letter-spacing: .3em;
  text-transform: uppercase;
}

.start__titel {
  margin: 10px 0;
  font-family: var(--schrift-titel);
  font-size: clamp(2.6rem, 8vw, 5rem);
  line-height: 1;
  letter-spacing: .12em;
}

.start__zahl { margin: 0; color: var(--leise); }

.serien-kacheln {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
}

.serien-kachel { display: block; text-decoration: none; }

.serien-kachel__bild { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }

.serien-kachel__name {
  margin: 20px 0 4px;
  font-family: var(--schrift-titel);
  font-size: 1.5rem;
  line-height: 1.2;
}

.serien-kachel__slogan { margin: 0 0 8px; color: var(--leise); font-style: italic; }

.serien-kachel__anzahl {
  margin: 0;
  color: var(--akzent);
  font-size: .8rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}

@media (max-width: 860px) {
  .serien-kacheln { grid-template-columns: minmax(0, 1fr); max-width: 460px; margin: 0 auto; gap: 48px; }
}

/* Kachel */

.kachel {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}

.kachel__bild {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--flaeche);
  transition: transform .25s ease, box-shadow .25s ease;
}

.kachel:hover .kachel__bild,
.kachel:focus-visible .kachel__bild { transform: translateY(-4px); }

.kachel:focus-visible { outline: none; }
.kachel:focus-visible .kachel__bild { outline: 2px solid var(--akzent); outline-offset: 3px; }

.kachel__nr {
  display: block;
  margin-top: 10px;
  color: var(--akzent);
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.kachel__titel {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
  font-size: .95rem;
  line-height: 1.3;
}

/* Serienseite */

.serie__kopf { padding: 52px 0 30px; text-align: center; }

.serie__zurueck {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--leise);
  font-size: .9rem;
  text-decoration: none;
}

.serie__zurueck:hover { color: var(--text); }

.serie__name {
  margin: 0;
  font-family: var(--schrift-titel);
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1.05;
}

.serie__slogan { margin: 12px 0 0; color: var(--leise); font-style: italic; }

.serie__anzahl {
  margin: 12px 0 0;
  color: var(--akzent);
  font-size: .8rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.werkzeuge {
  position: sticky;
  top: var(--kopf-hoehe);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 28px;
  padding: 12px 0;
  background: var(--grund);
  border-bottom: 1px solid var(--linie);
}

.suchfeld { position: relative; flex: 1 1 240px; min-width: 0; }

/* Suchfeld (Punkt 70, Wunsch Alex 08.10.): Kasten mit Lupe, gerade und hell statt kursiv und gedämpft */
.suche {
  width: 100%;
  padding: 11px 44px 11px 44px; /* links Platz für die Lupe, rechts für den ×-Knopf */
  border: 1px solid rgb(201 164 92 / .38);
  border-radius: 6px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8ab94' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6'/%3E%3Cpath d='M15 15l5 5'/%3E%3C/svg%3E") 14px center / 19px no-repeat,
    var(--flaeche);
  color: var(--text);
  font: inherit;
  font-size: 1.02rem;
  font-style: normal;
}

.suche::placeholder { color: #bdb09a; opacity: 1; }
.suche:focus { outline: none; border-color: var(--akzent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--akzent) 28%, transparent); }
.suche::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; } /* eigener Knopf statt Browser-× */

.suche__leeren {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--leise);
  transform: translateY(-50%);
  cursor: pointer;
}
.suche__leeren[hidden] { display: none; }
.suche__leeren:hover { color: var(--text); background: rgb(255 255 255 / .08); }
.suche__leeren:focus-visible { outline: 2px solid var(--akzent); outline-offset: 1px; }
.suche__leeren svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

.sprungleiste { display: flex; flex-wrap: wrap; gap: 6px; }
.sprungleiste[hidden] { display: none; }

.sprung,
.sortierung {
  padding: 8px 12px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: transparent;
  color: var(--leise);
  font-size: .85rem;
  cursor: pointer;
}

.sprung:hover,
.sortierung:hover { color: var(--text); border-color: var(--akzent); }

.raster {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 32px 22px;
}

.raster > li { scroll-margin-top: calc(var(--kopf-hoehe) + 140px); }

.keine-treffer { padding: 40px 0; color: var(--leise); text-align: center; }

@media (max-width: 520px) {
  .raster { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .werkzeuge { position: static; }
}

/* Großansicht */

.ansicht {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 24px; /* der Schließen-Knopf hat seinen Platz rechts neben dem Kopf (Wunsch Alex 13.10.) */
  border: 0;
  overflow-y: auto;
  background: var(--ansicht-grund);
  color: var(--text);
  isolation: isolate;
}

.ansicht::backdrop { background: rgb(0 0 0 / .85); }
/* margin: auto statt align-items: center – so rutscht hoher Inhalt nie unter den Schließen-Knopf */
.ansicht[open] { display: flex; }

.ansicht__rahmen {
  margin: 0 auto; /* oben bündig statt senkrecht zentriert: kein Leerraum über dem Kopf */
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
  align-items: start; /* Cover oben bündig mit dem Text, auch bei langen Titeln (Hinweis Alex 08.10.) */
  gap: 28px 44px;
  width: min(1180px, 100%);
}

/* Serie, Mehrteiler, Marke und Titel über die ganze Breite oberhalb von Cover und Text (Wunsch Alex 13.10.) */
.ansicht__kopf {
  grid-column: 1 / -1;
  padding-right: 230px; /* rechts frei für die Werkzeugleiste */
  /* Marke („Streng geheim“, Genres) rechts neben dem Titel statt in eigener Zeile (Wunsch Alex 13.10.) */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 18px;
}
.ansicht__serie, .ansicht__teil { flex: 0 0 100%; }
.ansicht__titel { order: 1; }
.ansicht__genre { order: 2; }

.ansicht__figur { position: relative; margin: 0; }
.ansicht__figur img { cursor: zoom-in; }

.ansicht__lupe {
  position: absolute;
  right: 12px;
  bottom: 12px;
  border-color: rgb(255 255 255 / .3);
  background: rgb(0 0 0 / .55);
  color: #fff;
}

.ansicht__figur img {
  width: 100%;
  max-height: calc(100dvh - 100px);
  object-fit: contain;
  transition: opacity .2s ease;
}

.ansicht__figur img.laedt { opacity: .3; }

.ansicht__serie {
  margin: 0 0 10px;
  color: var(--akzent);
  font-size: .8rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.ansicht__titel {
  margin: 0;
  font-family: var(--schrift-titel);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  line-height: 1.15;
}

.ansicht__tagline { margin: 0; font-style: italic; }
/* Mehrteiler in der Großansicht (Punkt 80) */
.ansicht__teil {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin: -4px 0 14px;
  color: var(--akzent);
  font-family: var(--schrift-text);
  font-size: .9rem;
  font-weight: 600;
}
.ansicht__teil[hidden] { display: none; }
.ansicht__teil-zeile { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; flex: 0 0 100%; }
.kachel__teil--bogen { border-style: dashed; } /* Handlungsbogen (Punkt 85), gestrichelt statt durchgezogen */
.ansicht__teil-knopf {
  padding: 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--akzent) 50%, transparent);
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.ansicht__teil-knopf:hover { border-bottom-color: var(--akzent); color: var(--akzent); }
.ansicht__teil-knopf:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.ansicht__tagline[hidden],
.ansicht__beschreibung[hidden] { display: none; }
.ansicht__beschreibung { margin: 22px 0 0; color: var(--leise); white-space: pre-line; }
.ansicht__tagline[hidden] + .ansicht__beschreibung { margin-top: 0; }

/* Blättern oben in der Textspalte, auf Höhe der Cover-Oberkante (Wunsch Alex 13.10.) */
/* Werkzeugleiste oben rechts: Blättern, Zähler, Schließen (Wunsch Alex 13.10.); bleibt beim Scrollen sichtbar */
.ansicht__leiste {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid rgb(255 255 255 / .12);
  border-radius: 999px;
  background: rgb(0 0 0 / .45);
  color: #fff;
}
.ansicht__leiste .knopf-rund { width: 38px; height: 38px; border-color: transparent; color: inherit; }
.ansicht__leiste .knopf-rund:hover { border-color: var(--akzent); }
.ansicht__leiste .knopf-rund svg { width: 20px; height: 20px; }
.ansicht__zaehler { min-width: 64px; color: rgb(255 255 255 / .75); font-size: .8rem; text-align: center; }
.ansicht__schliessen { margin-left: 6px; }

.knopf-rund {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--linie);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.knopf-rund:hover { border-color: var(--akzent); }
.knopf-rund:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

.knopf-rund svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}


@media (max-width: 820px) {
  .ansicht[open] { display: block; }
  .ansicht { padding: 16px 16px 32px; }
  .ansicht__rahmen { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .ansicht { padding-top: 76px; } /* auf dem Handy steht die Werkzeugleiste als eigene Zeile über dem Kopf */
  .ansicht__kopf { padding-right: 0; }
  .ansicht__figur img { max-height: none; }
}

/* Cover ganz groß (Wunsch Alex 2026-10-08): Klick aufs Cover blendet den Text aus.
   Pfeiltasten und Wischen blättern weiter, Klick/Esc/× führen zurück zur Ansicht mit Text. */
.ansicht.ansicht--vollbild { padding: 0; background: #000; }
.ansicht.ansicht--vollbild[open] { display: flex; }
.ansicht--vollbild .ansicht__rahmen {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  box-shadow: none;
}
.ansicht--vollbild .ansicht__kopf,
.ansicht--vollbild .ansicht__text,
.ansicht--vollbild .ansicht__zurueck,
.ansicht--vollbild .ansicht__zaehler,
.ansicht--vollbild .ansicht__weiter,
.ansicht--vollbild .ansicht__lupe { display: none; }
.ansicht--vollbild .ansicht__figur { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.ansicht--vollbild .ansicht__figur img {
  width: auto;
  height: auto;
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  object-fit: contain;
  box-shadow: none;
  cursor: zoom-out;
}

/* ---------- Ergänzungen 08.10.2026: Suche über alle Serien, Neu & aktuell, Steckbrief, Hörproben ---------- */

/* Kachel: Rahmen um das Cover für Markierungen */
.kachel__rahmen { position: relative; display: block; }

.kachel__neu {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 9px;
  border-radius: 2px;
  background: var(--akzent);
  color: #0e0c0a;
  font-family: var(--schrift-titel);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgb(0 0 0 / .6);
}

/* Mehrteiler (Punkt 80): „Teil 1/3“ neben der Folgennummer */
.kachel__teil {
  margin-left: .6em;
  padding: 1px 6px;
  border: 1px solid color-mix(in srgb, var(--akzent) 55%, transparent);
  border-radius: 2px;
  color: var(--text);
  font-size: .9em;
  letter-spacing: .04em;
  white-space: nowrap;
}
.kachel__ton {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgb(0 0 0 / .6);
  color: #fff;
}
.kachel__ton svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }

/* Suchergebnisse über alle Serien (Seite #/suche) */
.suchseite { padding-top: 28px; }
.treffer-zahl { margin: 0 0 8px; color: var(--leise); text-align: center; }
.treffer-serie {
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--linie);
  color: var(--akzent);
  font-family: var(--schrift-titel);
  font-size: 1.3rem;
}

/* Kopfzeile: Lupe und aufklappbare Suchleiste (Punkt 70) */
.kopf-suche__knopf {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--linie);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.kopf-suche__knopf svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.kopf-suche__knopf:hover,
.kopf-suche__knopf[aria-expanded="true"] { border-color: var(--gold); color: var(--gold); }
.kopf-suche__knopf:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.kopf-suche {
  padding: 14px max(16px, calc((100vw - 1240px) / 2));
  background: var(--kopf-grund);
  border-bottom: 1px solid var(--linie);
}
.kopf-suche[hidden] { display: none; }
.kopf-suche .suchfeld { max-width: 720px; margin: 0 auto; }

/* Startseite: Serienkacheln mit dem neuesten Cover (Punkt 71) */
.serien-kachel__rahmen { position: relative; display: block; }
.serien-kachel__neueste { margin: 8px 0 0; color: var(--text); font-size: .95rem; }

/* Serienseite: Titelmusik und Steckbrief */
.titelmusik {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  margin-top: 18px;
}
.titelmusik__text,
.ansicht__hoerprobe-text {
  color: var(--akzent);
  font-size: .8rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.titelmusik audio { width: min(360px, 100%); }

.steckbrief {
  margin: 0 0 28px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: rgb(255 255 255 / .02);
}
.steckbrief__knopf {
  padding: 14px 18px;
  color: var(--akzent);
  font-family: var(--schrift-titel);
  font-size: 1.05rem;
  cursor: pointer;
}
.steckbrief[open] .steckbrief__knopf { border-bottom: 1px solid var(--linie); }
.steckbrief__text { margin: 18px 18px 0; white-space: pre-line; }
.figuren {
  list-style: none;
  margin: 0;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 26px 22px;
}
/* Figuren nach Seite gruppiert (Punkt 78); --akzent kommt je Gruppe aus „## Seiten“ in _serie.md */
.figuren-gruppe + .figuren-gruppe { border-top: 1px solid var(--linie); }
.figuren-gruppe__titel {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 18px 0;
  color: var(--akzent);
  font-family: var(--schrift-titel);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .06em;
}
.figuren-gruppe__titel::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, color-mix(in srgb, var(--akzent) 60%, transparent), transparent);
}
.figur__bild img { width: 100%; height: auto; border-radius: var(--radius); background: var(--flaeche); }
.figur__name { margin: 12px 0 2px; font-family: var(--schrift-titel); font-size: 1.15rem; }
.figur__rolle { margin: 0 0 6px; color: var(--akzent); font-size: .85rem; letter-spacing: .06em; }
.figur__text { margin: 0; color: var(--leise); font-size: .95rem; white-space: pre-line; }
/* Knopf zum Charakterblatt (Punkt 76) */
.figur__blatt {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  margin: 4px 0 12px;
  padding: 6px 14px;
  border: 1px solid color-mix(in srgb, var(--akzent) 55%, transparent);
  border-radius: 999px;
  background: transparent;
  color: var(--akzent);
  font: 600 .85rem/1.2 var(--schrift-text);
  letter-spacing: .03em;
  cursor: pointer;
}
.figur__blatt:hover { border-color: var(--akzent); background: color-mix(in srgb, var(--akzent) 14%, transparent); }
.figur__blatt:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.figur__blatt svg { flex: none; }

/* Großansicht: Hörprobe */
.ansicht__hoerprobe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 24px; }
.ansicht__hoerprobe[hidden] { display: none; }
.ansicht__hoerprobe audio { width: 100%; }

/* Charakterblatt groß (Klick aufs Porträt im Steckbrief) */
.blatt-ansicht {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  color: var(--text);
}
.blatt-ansicht[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.blatt-ansicht::backdrop { background: rgb(0 0 0 / .9); }
.blatt-ansicht__bild {
  max-width: 100vw;
  max-height: calc(100dvh - 44px);
  object-fit: contain;
  cursor: zoom-in;
}
/* vergrößert: Blatt in voller Größe, Fenster scrollt */
.blatt-ansicht.blatt-ansicht--zoom { overflow: auto; }
.blatt-ansicht.blatt-ansicht--zoom[open] { display: block; }
.blatt-ansicht--zoom .blatt-ansicht__bild { max-width: none; max-height: none; height: auto; cursor: zoom-out; }
.blatt-ansicht--zoom .blatt-ansicht__name { display: none; }
.blatt-ansicht__name { margin: 8px 0 0; color: var(--leise); font-size: .9rem; white-space: pre; }
.blatt-ansicht__zu { position: fixed; top: 16px; right: 16px; z-index: 2; background: rgb(0 0 0 / .55); color: #fff; }
