/* ═══════════════════════════════════════════════
   Kuss im Dunkeln — kuss.css (BILDER FIXIERT)
   ═══════════════════════════════════════════════ */

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

:root {
  --bg:        #111010;
  --bg-nav:    #0A0909;
  --bg-hover:  #161414;
  --text:      #E8E0D4;
  --muted:     #7A7168;
  --faint:     #706A67;
  --fainter:   #5C5754;
  --red:       #9B2020;
  --red-soft:  #C0392B;
  --border:    #1C1A1A;
 --border-oben: #E8E0D4;
  --serif:     Georgia, 'Times New Roman', serif;
  --sans:      -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --nav-h:     48px;
  --max-w:     1280px;
}

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* ── FORTSCHRITTSBALKEN ── */
.progress-bar {
  position: absolute;
  bottom: 0; left: 0;
  height: 5px;
  width: 0%;
  background: var(--red);
  z-index: 1;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg-nav);
  border-bottom: 1.5px solid var(--red);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
}

.nav-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-title:hover { color: var(--text); }

.nav-right {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-right:hover { color: var(--muted); }

/* ── SCENE ── */
.scene {
  flex: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 3.5rem) 2rem 6rem;
}

/* ── STARTSEITE: HEADER ── */
.site-header { margin-bottom: 3rem; }
.site-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(28px, 5.5vw, 42px);
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 1.2rem;
  letter-spacing: -0.01em;
}
.site-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--faint);
  line-height: 1.6;
}
.site-quote cite {
  display: block;
  font-style: normal;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fainter);
  margin-top: 0.4rem;
}

/* ── KATEGORIEN ── */
.kategorien { margin-bottom: 2.5rem; }
.kategorie { border-top: 0.5px solid var(--border); }
.kategorie:last-child { border-bottom: 0.5px solid var(--border); }

.kat-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.9rem 0;
  color: inherit;
  gap: 1rem;
}
.kat-toggle:hover .kat-name { color: var(--red-soft); }

.kat-name {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  transition: color 0.2s;
}

.kat-right { display: flex; align-items: center; gap: 0.8rem; }
.kat-count {
  font-family: var(--sans);
  font-size: 9px;
  color: var(--fainter);
  letter-spacing: 0.06em;
}
.kat-arrow {
  font-size: 11px;
  color: var(--faint);
  transition: transform 0.25s ease;
  display: inline-block;
  line-height: 1;
}
.kategorie.open .kat-arrow { transform: rotate(90deg); }

/* ── STORY LIST ── */
.story-list { display: none; padding-bottom: 0.5rem; }
.kategorie.open .story-list { display: block; }

.story-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.5rem 0;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 0.5px solid var(--fainter);
  transition: color 0.2s, background 0.15s;
  gap: 1rem;
}
.story-link:last-child { border-bottom: none; }
.story-link:hover { color: var(--text); }

.story-titel {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1.4;
  flex: 1;
}
.story-lesezeit {
  font-family: var(--sans);
  font-size: 9px;
  color: var(--fainter);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

/* ── ÜBERRASCH MICH BUTTON ── */
.btn-wrap { display: flex; justify-content: center; margin-top: 0.5rem; }
.btn-ueberrasch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0.5px solid var(--red);
  color: var(--red);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 22px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-ueberrasch:hover { background: var(--red); color: var(--text); }
.btn-ueberrasch svg { width: 14px; height: 14px; fill: currentColor; flex-shrink: 0; }

/* ── GESCHICHTSSEITE ── */
.scene.story-scene { max-width: 900px; }
.story-header { margin-bottom: 2.5rem; }

.story-kat {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.7rem;
}

.story-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.story-meta {
  font-family: var(--sans);
  font-size: 9px;
  color: var(--fainter);
  letter-spacing: 0.08em;
  padding-bottom: 2rem;
  border-bottom: 0.5px solid var(--border);
}

/* ── STORY BODY ── */
.story-body {
  font-size: clamp(16px, 2.2vw, 18.5px);
  line-height: 1.88;
  color: var(--muted);
}
.story-body p { margin-bottom: 1.4em; }
.story-body p:last-child { margin-bottom: 0; }
.story-body em { font-style: italic; color: inherit; }
.story-body strong { font-weight: 700; color: var(--text); }

.story-body.gedicht {
  font-size: clamp(15px, 2vw, 17px);
  line-height: 2.1;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.story-body.gedicht p { margin-bottom: 0.4em; }

/* ── STORY BILD ── */
.story-img,
.story-body img {
  width: 100%;
  height: auto;
  display: block;
  margin: 2rem 0;
  border-radius: 4px;
  border: 0.5px solid var(--border);
}

/* ── DIALOG-ZEILEN ── */
.story-body .dialog-line { margin-bottom: 0.45em; }

.light-mode .story-img,
.light-mode .story-body img { border: none; }

/* ── STORY NAVIGATION ── */
.story-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4rem;
  padding-top: 1.8rem;
  gap: 1rem;
  position: static !important;
  z-index: auto !important;
  background: none;
  border: none;
}
.story-nav-link {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  text-decoration: none;
  transition: color 0.2s;
}
.story-nav-link:hover:not(.disabled) { color: var(--red-soft); }
.story-nav-link.disabled { opacity: 0.2; pointer-events: none; }
.story-nav-pos {
  font-family: var(--sans);
  font-size: 9px;
  color: var(--fainter);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ── FOOTER ── */
footer {
  border-top: 0.5px solid var(--border);
  padding: 2rem 2.5rem;
  text-align: center;
}
.ft-text {
  font-family: var(--sans);
  font-size: 10px;
  color: var(--fainter);
  letter-spacing: 0.06em;
}
.ft-text a { color: var(--fainter); text-decoration: none; transition: color 0.2s; }
.ft-text a:hover { color: var(--muted); }

/* ── LOADING STATE ── */
.loading {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--fainter);
  letter-spacing: 0.1em;
  text-align: center;
  padding: 4rem 0;
}

/* ── STARTSEITE ZWEISPALTIG ── */
.start-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 6rem;
  align-items: start;
}
.start-left { position: sticky; top: calc(var(--nav-h) + 3.5rem); }
.start-right { min-width: 0; }

/* ── GEDICHT ABSTÄNDE ── */
.story-body.gedicht p { margin-bottom: 0.5em; }
.story-body.gedicht p.stanza-break, 
.story-body.gedicht p + p {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}
.story-body.gedicht p:first-child { margin-top: 0; }

/* ── KURZGESCHICHTEN: BUCH-LOOK ── */
.story-body.kurzgeschichte {
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  line-height: 1.6;
  font-size: 1.1rem;
}
.story-body.kurzgeschichte .book-line {
  margin: 0 !important;
  text-indent: 1.5em;
  line-height: 1.6;
  display: block;
}
.story-body.kurzgeschichte .paragraph-break {
  display: block;
  height: 0;
  margin-top: 1.2em !important;
  margin-bottom: 0 !important;
  visibility: hidden;
  overflow: hidden;
}
.story-body.kurzgeschichte .dialog-line {
  text-indent: 0;
  margin-top: 1.2em;
  padding-left: 1.5em;
  border-left: none;
  font-style: italic;
}

/* ── SPEZIALFALL: GEDICHTE (Bilder schmaler) ── */
.story-body.gedicht .story-img {
  max-width: 100% !important; /* Deutlich schmaler als der Textblock */
  display: inline-block !important;
}

/* ── MOBILE OPTIMIERUNG (AB 768px ABWÄRTS) ── */
@media (max-width: 768px) {
  /* Bilder auf Mobile: Volle Breite des Containers, aber nie größer */
  .story-img {
    width: 100% !important;
    max-width: 100% !important;
    margin: 1.5rem 0 !important; /* Weniger Abstand auf Mobile */
  }

  /* Container sicherstellen */
  .scene, .story-scene {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }
}

/* ── RESPONSIVE LAYOUTS ── */
@media (max-width: 700px) {
  .start-layout { grid-template-columns: 1fr; gap: 0; }
  .start-left {
    position: static;
    padding-right: 0;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
  }
  .scene { padding: calc(var(--nav-h) + 2.5rem) 2.5rem 5rem; box-sizing: border-box; width: 100%; }
  .btn-wrap { justify-content: flex-start; margin-top: 1.5rem; }
}

@media (max-width: 600px) {
  nav { padding: 0 1rem; }
  .nav-title { font-size: 12px; }
  .scene { padding: calc(var(--nav-h) + 2.5rem) 1rem 5rem; }
  .story-body { font-size: 16px; }
  .story-nav { flex-wrap: wrap; }
  .story-nav-link { font-size: 9px; }
}

@media (max-width: 380px) {
  .site-title { font-size: 24px; }
}


/* ── LIGHT MODE (HELLER MODUS) ── */

/* Wenn body die Klasse .light-mode hat, überschreiben wir die Variablen */
body.light-mode {
  --bg:        #F4F4F0;       /* Helles Papier-Weiß */
  --bg-nav:    #F4F4F0;      /* Helles Papier-Weiß */
  --bg-hover:  #EAEAEA;       /* Helles Grau für Hover */
  --text:      #222222;       /* Fast Schwarz (Haupttext) */
  --muted:     #444444;       /* Dunkles Grau (Zitate, Nebentext) */
  --faint:     #555555;       /* Mittel-Dunkel (Metadaten, gut lesbar) */
  --fainter:   #666666;       /* Helles Grau (nur für unwichtige Details) */
  --red:       #C0392B;       /* Etwas helleres Rot für besseren Kontrast */
  --red-soft:  #E74C3C;       /* Helles Akzent-Rot */
  --border:    #C0392B;      /* Helle Rahmen */
  --border-oben: #C0392B;
}

/* Optional: Navigation im Light Mode etwas schattieren, damit sie sich abhebt */
body.light-mode nav:not(.story-nav) {
  border-bottom: 1px solid var(--border);
  /*box-shadow: 0 1px 3px rgba(0,0,0,0.05);*/
}

body.light-mode .story-img {
  border: none !important;
}

/* Der Schalter selbst (Design) */
.theme-toggle {
  background: none;
  border: 1px solid var(--text);
  color: var(--text);
  font-family: var(--sans);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-toggle:hover {
  background: var(--text);
  color: var(--bg);
}

/* Icon-Animation (optional) */
.theme-toggle span {
  font-size: 14px;
  line-height: 1;
}

/* ── NEUESTE GESCHICHTE ── */
.neu-link {
  display: block;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 0.5px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.neu-badge {
  display: inline-block;
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  border: 0.5px solid var(--red);
  padding: 2px 6px;
  border-radius: 2px;
  margin-bottom: 0.6rem;
}
.neu-kat {
  display: block;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.35rem;
}
.neu-titel {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--text);
  margin: 0 0 0.4rem;
  transition: color 0.2s;
}
.neu-link:hover .neu-titel { color: var(--red-soft); }
.neu-meta {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--faint);
}

/* ── NACH-OBEN-BUTTON ── */
.btn-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 40px;
  height: 40px;
  background: var(--bg);
  border: 0.5px solid var(--border-oben);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s, color 0.2s;
  pointer-events: none;
  z-index: 150;
}
.btn-top.on { opacity: 1; transform: none; pointer-events: auto; }
.btn-top:hover { color: var(--text); }