/* FAQ (Sprint 8), Entwurf 3 "Buch" (entwuerfe/faq/3-buch/): aufgeschlagenes Buch im Holz-Gold-Rahmen. Links Inhaltsverzeichnis,
   rechts alle Fragen mit Antworten auf hellem Pergament. Handy: Seiten untereinander. Keine Animationen. */

.page {
  max-width: 1240px;
}

.buch-titel {
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

/* Stand-Hinweis über dem Buch (fester Text aus i18n) */
.buch-titel:has(+ .buch-stand) {
  margin-bottom: 0.75rem;
}

.buch-stand {
  margin: 0 auto clamp(1.5rem, 4vw, 2.5rem);
  max-width: 46rem;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Breiter (Marko 26.10.2026): Buch bis 1200 px, links schmales Inhaltsverzeichnis ohne eigenen Bildlauf (läuft mit der Seite),
   rechts die Antworten mit lesbarer Zeilenlänge */
.page > .buch-rahmen {
  max-width: 1200px;
}

.buch {
  display: grid;
  grid-template-columns: minmax(15rem, 21rem) minmax(0, 1fr);
  border: 3px solid var(--frame-dark);
  background: var(--frame-dark);
  gap: 6px; /* Buchrücken */
}

.buch__seite {
  padding: clamp(1.25rem, 4vw, 2.75rem);
  background: #f3ead7;
  color: #3a2614;
}

/* Zeilenlänge der Antworten ca. 80 Zeichen, Textblock mittig auf der rechten Seite */
.buch__seite--rechts > * {
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
}

.buch__seite--links {
  background: #eadcc0;
  box-shadow: inset -10px 0 0 -6px rgba(58, 38, 20, 0.15);
}

.buch__label {
  margin: 0 0 0.3rem;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: 0.06em;
  color: #8a5a2b;
}

.buch__einleitung {
  margin: 0 0 var(--space-lg);
  color: #5a3418;
}

.toc {
  margin: 0 0 var(--space-lg);
}

.toc__liste {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 2px solid rgba(58, 38, 20, 0.25);
}

/* Kapitel im Inhaltsverzeichnis: kleine Zeile "Kapitel 1" über dem Namen, wie im Buch */
.toc__kapitel {
  margin: var(--space-lg) 0 0.4rem;
}

.toc__kapitel:first-child {
  margin-top: 0;
}

.toc__kapitel a {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0 0.2rem 0.4rem;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.25;
  text-decoration: none;
  color: #3a2614;
  border-bottom: none;
}

.toc__kapitel a:hover {
  color: #b5541f;
}

.toc__kapitel-nr,
.buch__kapitel-nr {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a5a2b;
}

.toc a {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 0.2rem;
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  color: #3a2614;
  border-bottom: 2px solid rgba(58, 38, 20, 0.25);
}

.toc a:hover {
  color: #b5541f;
}

.toc__nr {
  flex: none;
  font-family: var(--font-title);
  font-weight: 700;
  color: #8a5a2b;
}

/* Kapitelüberschrift rechts: wie der Anfang eines Kapitels im Buch, mittig mit doppelter Linie */
/* Abstand der Kapitel über gap: ausgeblendete Kapitel (Suche) hinterlassen keine Lücke */
.buch__seite--rechts {
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 6vw, 4rem);
}

.buch__kapitel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 var(--space-lg);
  padding-bottom: 0.9rem;
  border-bottom: 4px double rgba(58, 38, 20, 0.45);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  line-height: 1.2;
  text-align: center;
  color: #3a2614;
  scroll-margin-top: var(--space-md);
}

.buch__eintrag + .buch__eintrag {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 2px dashed rgba(58, 38, 20, 0.3);
}

.buch__frage {
  display: flex;
  gap: 0.75rem;
  margin: 0 0 0.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.15rem, 2.3vw, 1.35rem);
  line-height: 1.3;
  color: #3a2614;
}

.buch__nr {
  flex: none;
  font-family: var(--font-title);
  color: #b5541f;
}

.buch__antwort {
  color: #4a2e18;
}

/* Antworten sind Markdown: Absätze, Listen, Links */
.buch__antwort > :first-child {
  margin-top: 0;
}

.buch__antwort > :last-child {
  margin-bottom: 0;
}

.buch__antwort p,
.buch__antwort ul,
.buch__antwort ol {
  margin: 0 0 0.75rem;
}

.buch__antwort a {
  color: #8a3a12;
}

.buch__antwort a:hover {
  color: #b5541f;
}

.buch__antwort h2,
.buch__antwort h3 {
  margin: 1rem 0 0.4rem;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: #3a2614;
}

/* Sprungziele nicht unter den Rand */
.buch__eintrag {
  scroll-margin-top: var(--space-md);
}

.buch__leer {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.15rem;
  color: #5a3418;
}

/* Kasten "Für Backer" am Ende: Wegweiser auf Fragen, Themen als kleine Zeile wie "Kapitel 1", Links wie im Inhaltsverzeichnis */
.buch__backer {
  scroll-margin-top: var(--space-md);
}

.buch__backer .buch__kapitel {
  scroll-margin-top: var(--space-md);
}

.buch__backer-thema {
  margin: var(--space-lg) 0 0.4rem;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a5a2b;
}

.buch__backer .toc {
  margin: 0;
}

.buch__backer .toc > .buch__backer-thema:first-child {
  margin-top: 0;
}

/* Suche über dem Buch (Marko 26.10.2026): Feld und Knopf in einer Zeile, ohne Bewegung */
.faq-suche {
  max-width: 40rem;
  margin: 0 auto clamp(1.5rem, 4vw, 2.5rem);
}

.faq-suche__label {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-text);
}

.faq-suche__zeile {
  display: flex;
  gap: 0.5rem;
}

.faq-suche__feld {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.7rem 1rem;
  font: inherit;
  color: var(--color-text);
  background: var(--color-bg-deep);
  border: 3px solid var(--frame-mid);
  border-radius: 0;
}

.faq-suche__feld:focus {
  outline: none;
  border-color: var(--color-primary);
}

.faq-suche__knopf {
  flex: none;
  padding: 0.7rem 1.4rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-bg);
  background: var(--color-primary);
  border: 3px solid var(--frame-dark);
  cursor: pointer;
}

.faq-suche__knopf:hover {
  background: var(--color-primary-light);
}

.faq-suche__alle {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: var(--text-sm);
  color: var(--color-primary-light);
}

/* Versteckte Treffer bleiben versteckt, auch wo display gesetzt ist */
.buch [hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .buch {
    grid-template-columns: minmax(0, 1fr);
  }

  .buch__seite--links {
    box-shadow: none;
  }

  /* Handy: mit Kapiteln zeigt das Inhaltsverzeichnis nur die Kapitel, sonst stünden 51 Fragen vor der ersten Antwort */
  .toc--kapitel .toc__liste {
    display: none;
  }

  .toc--kapitel .toc__kapitel {
    margin: 0;
  }

  .toc--kapitel .toc__kapitel a {
    padding: 0.6rem 0.2rem;
    border-bottom: 2px solid rgba(58, 38, 20, 0.25);
  }

  .toc--kapitel .toc__kapitel:first-child a {
    border-top: 2px solid rgba(58, 38, 20, 0.25);
  }
}
