/* Ratgeber und Quiz für Teilnehmer (/ratgeber, /ratgeber/..., /quiz).
   Baut auf .text-seite aus basis.css auf. Mobile-First: die Regeln ohne
   Media-Query gelten fürs Handy, größere Bildschirme nur über min-width.
   Aufbau: 1. Artikel  2. Inhaltsverzeichnis  3. Übersicht  4. Quiz
   5. größere Bildschirme */

/* ── 1. Artikel ───────────────────────────────────────────────────────── */
.ratgeber { margin-top: 1.5rem; }
.ratgeber h1 { font-size: 1.75rem; line-height: 1.15; }
.ratgeber h2 { margin-top: 2.4rem; }
.ratgeber li { margin-bottom: 0.45rem; }

/* Brotkrumen über der Überschrift: Startseite / Ratgeber / Seite */
.text-seite .brotkrumen ol { display: flex; flex-wrap: wrap; gap: 0.15rem 0; list-style: none; margin: 0 0 0.85rem; padding: 0; font-size: 0.9rem; color: var(--text-leise); }
.brotkrumen li { margin: 0; }
.brotkrumen li + li::before { content: '/'; margin: 0 0.45rem; color: var(--feld-rand); }
.brotkrumen a { color: var(--text-leise); }
.brotkrumen a:hover { color: var(--marke); }
.ratgeber-stand { margin: -0.1rem 0 1.5rem; color: var(--text-leise); font-size: 0.95rem; }
.ratgeber-einstieg { font-size: 1.1rem; color: var(--text); }

/* Artikel: Zeilen höchstens etwa 70 Zeichen lang */
.text-seite.ratgeber-artikel { max-width: 40rem; }

/* Das Wichtigste in Kürze: leicht getönte Fläche */
.kurz { margin: 0 0 1.5rem; padding: 1rem 1.1rem; border-radius: var(--radius); background: var(--marke-hell); }
.kurz-titel { margin: 0 0 0.5rem; font-family: var(--schrift-titel); font-weight: 700; }
.text-seite .kurz ul { margin: 0; }
.kurz li:last-child { margin-bottom: 0; }

/* Unauffälliger Hinweis in der Mitte des Artikels */
.ratgeber-hinweis { margin: 2rem 0; padding: 0.85rem 0; border-top: 1px solid var(--linie-fein); border-bottom: 1px solid var(--linie-fein); color: var(--text-leise); }

/* Beispielfragen: durch Linien getrennt, Antworten als a, b, c */
.beispiel-frage { margin: 1.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--linie); }
.beispiel-frage h3 { margin-top: 0; }
.beispiel-antworten { list-style: lower-alpha; }
.beispiel-loesung { margin-bottom: 0.4rem; color: var(--gut); }

/* Häufige Fragen: aufklappbar ohne JavaScript, durch Linien getrennt */
.ratgeber-faq { margin-top: 2.4rem; border-bottom: 1px solid var(--linie); }
.ratgeber-faq .faq-eintrag { border-top: 1px solid var(--linie); }
.ratgeber-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.25rem;
  padding: 0.65rem 0;
  font-family: var(--schrift-titel);
  font-weight: 650;
  line-height: 1.35;
  list-style: none;
  cursor: pointer;
}
.ratgeber-faq summary::-webkit-details-marker { display: none; }
.ratgeber-faq summary::after { content: '+'; flex: none; font-size: 1.4rem; line-height: 1; color: var(--marke); }
.ratgeber-faq details[open] summary::after { content: '\2212'; }
.ratgeber-faq summary:hover { color: var(--marke); }
.ratgeber-faq .faq-antwort p { margin: 0 0 1rem; color: var(--text-leise); }

/* Weiterlesen am Ende */
.ratgeber-weiter { margin-top: 2.75rem; padding-top: 1.25rem; border-top: 1px solid var(--linie); }
.ratgeber-weiter h2 { margin-top: 0; }

/* Quellen vor "Weiterlesen": klein und leise, eine schlichte Liste */
/* Quellen als Anhang: kleiner als der Fließtext (18 px), leise Farbe (#4F5D55 auf Weiß, 6,9:1) */
.ratgeber-quellen { margin: 3rem 0 2.5rem; color: var(--text-leise); font-size: 0.875rem; line-height: 1.5; }
.ratgeber .ratgeber-quellen h2 { margin: 0 0 0.4rem; font-size: 0.9rem; }
.text-seite .ratgeber-quellen ul { margin: 0; padding-left: 1.1rem; }
.text-seite .ratgeber-quellen li { margin-bottom: 0.2rem; }
.ratgeber-quellen a { color: var(--text-leise); }
.ratgeber-quellen a:hover { color: var(--marke); }

/* Sanft zu den Sprungmarken, nur wenn Bewegung erwünscht ist */
@media (prefers-reduced-motion: no-preference) {
  html:has(.ratgeber-artikel) { scroll-behavior: smooth; }
}

/* ── 2. Inhaltsverzeichnis ────────────────────────────────────────────────
   Beide Darstellungen entstehen aus derselben Liste (src/utils/ratgeber.js).
   Bis 67em steht es zum Aufklappen oben im Artikel, ab 67em als Kasten neben
   der Textspalte (Abschnitt 5). Nie beide gleichzeitig. */
.inhalt { margin: 0 0 2rem; border-top: 1px solid var(--linie); border-bottom: 1px solid var(--linie); }
.inhalt summary { display: flex; align-items: center; justify-content: space-between; min-height: 3rem; font-family: var(--schrift-titel); font-weight: 650; list-style: none; cursor: pointer; }
.inhalt summary::-webkit-details-marker { display: none; }
.inhalt summary::after { content: '+'; font-size: 1.4rem; line-height: 1; color: var(--marke); }
.inhalt[open] summary::after { content: '\2212'; }
.text-seite .inhalt ol { margin: 0 0 1rem; }
.inhalt li { margin-bottom: 0.35rem; }

.inhalt-schwebend, .themen-schwebend { display: none; }

/* ── 3. Übersicht ─────────────────────────────────────────────────────── */

/* Quiz-Einstiege (Übersicht und /quiz): tannengrüne Flächen, die ganze Fläche ist der Link */
.quiz-einstieg { display: grid; gap: 0.75rem; margin: 1.5rem 0 1rem; }
.quiz-flaeche {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 4.75rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--tanne);
  color: var(--text-hell);
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.quiz-flaeche:hover { background: var(--tanne-dunkel); color: var(--text-hell); }
.quiz-flaeche-siegel { width: 2.3rem; height: 2.3rem; flex: none; }
.quiz-flaeche-ring { fill: none; stroke: var(--messing); stroke-width: 1.5; }
.quiz-flaeche-haken { fill: none; stroke: #FFFFFF; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.quiz-flaeche-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.quiz-flaeche-titel { font-family: var(--schrift-titel); font-size: 1.15rem; font-weight: 700; line-height: 1.2; }
.quiz-flaeche-zusatz { color: var(--messing-hell); font-size: 0.9rem; line-height: 1.35; }
.quiz-flaeche-pfeil { display: grid; place-items: center; flex: none; width: 2.4rem; height: 2.4rem; margin-left: auto; border: 1.5px solid var(--messing); border-radius: 50%; }
.quiz-flaeche-pfeil::after { content: ''; width: 1rem; height: 1rem; background: var(--messing); -webkit-mask: var(--pfeil) center / contain no-repeat; mask: var(--pfeil) center / contain no-repeat; transition: transform 0.2s var(--weich); }
.quiz-flaeche:hover .quiz-flaeche-pfeil::after { transform: translateX(2px); }

/* Gruppen: Überschrift mit Anzahl, darunter eine Haarlinie in Messing */
.ratgeber-gruppe { margin-top: 2.4rem; }
.ratgeber-gruppe-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.65rem; padding-bottom: 0.55rem; border-bottom: 1px solid var(--messing); }
.ratgeber .ratgeber-gruppe-kopf h2 { margin: 0; }
.ratgeber-anzahl { color: var(--text-leise); font-size: 0.85rem; }
.text-seite .ratgeber-liste { list-style: none; padding-left: 0; margin: 0; }
.ratgeber-liste li { margin: 0; padding: 1rem 0; border-bottom: 1px solid var(--linie-fein); }
.ratgeber-liste li:last-child { border-bottom: 0; }
.ratgeber-liste h3 { margin: 0 0 0.3rem; font-size: 1.1rem; }
.ratgeber-liste h3 a { color: var(--tanne); font-weight: 700; text-decoration: none; }
.ratgeber-liste h3 a:hover, .ratgeber-liste h3 a:focus-visible { color: var(--tanne); text-decoration: underline; }
.ratgeber-liste p { margin: 0; color: var(--text-leise); }
.ratgeber-liste .ratgeber-lesezeit { margin-top: 0.2rem; font-size: 0.85rem; }
/* Für Lehrgangsanbieter: abgesetzt auf Papier, sonst gleicher Stil */
.ratgeber-gruppe-anbieter { padding: 1.1rem 1.1rem 0.4rem; border-radius: var(--radius); background: var(--papier-ton); }
.ratgeber-gruppe-anbieter .ratgeber-liste li { border-bottom-color: var(--linie); }
.ratgeber-zusatz { margin: 0.25rem 0 0.9rem; }

/* ── 4. Quiz ─────────────────────────────────────────────────────────────
   Das Quiz steht in einem App-Fenster: Kopf in Tannengrün mit Fortschritt,
   Stand und Frage, darunter ein weißes Blatt mit den Antworten. Am Handy von
   Rand zu Rand, ab Tabletbreite mit runden Ecken und leichtem Schatten. */
.quiz { max-width: 42rem; }
.quiz h1 { margin-bottom: 1rem; font-size: 1.3rem; line-height: 1.25; color: var(--tanne); }
.quiz-hinweis { color: var(--text-leise); }

.quiz-app { margin: 0 calc(-1 * var(--rand)); background: var(--grund); }
.quiz-kopf { padding: 1.25rem var(--rand) 1.4rem; background: var(--tanne); color: var(--text-hell); }
.quiz-blatt { padding: 1.1rem var(--rand) 1.4rem; background: var(--grund); }

.quiz-start-text { margin: 0; font-size: 1.1rem; line-height: 1.5; }
.quiz-blatt > p:first-child { margin-top: 0; }
.quiz-los { width: 100%; }

/* Fortschritt: zehn Segmente */
.text-seite .quiz-fortschritt { display: flex; gap: 0.3rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.quiz-fortschritt li { flex: 1; height: 5px; margin: 0; border-radius: 3px; background: rgba(255, 255, 255, 0.18); }
.quiz-fortschritt .ist-richtig { background: var(--messing); }
.quiz-fortschritt .ist-falsch { background: #D49088; background: color-mix(in srgb, var(--siegel) 55%, #FFFFFF); }
.quiz-fortschritt .ist-aktuell { background: #FFFFFF; }

.quiz-meta { display: flex; justify-content: space-between; gap: 1rem; margin: 0 0 0.6rem; color: var(--messing-hell); font-size: 0.85rem; letter-spacing: 0.01em; }
.ratgeber .quiz-frage-text { margin: 0; font-size: 1.35rem; line-height: 1.3; color: var(--text-hell); }
.quiz-frage-text:focus { outline: none; }

/* Antworten: echte Knöpfe, große Zeilen mit Buchstaben im Kreis */
.text-seite .quiz-antworten { display: grid; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.quiz-antworten li { margin: 0; }
.quiz-antwort {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--linie);
  border-radius: var(--radius);
  background: var(--grund);
  color: var(--text);
  font: inherit;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.quiz-antwort:hover:not([disabled]) { border-color: var(--tanne); background: var(--tanne-hell); }
.quiz-antwort[disabled] { cursor: default; }
.quiz-buchstabe { display: grid; place-items: center; flex: none; width: 1.8rem; height: 1.8rem; border: 1.5px solid var(--feld-rand); border-radius: 50%; color: var(--text-leise); font-size: 0.8rem; font-weight: 700; }
.quiz-antwort-text { flex: 1; min-width: 0; }
.quiz-marke { flex: none; display: inline-flex; align-items: center; gap: 0.25rem; margin-left: 0.5rem; font-size: 0.8rem; font-weight: 700; }
.quiz-antwort.ist-richtig { border-color: var(--gut); background: var(--tanne-hell); }
.quiz-antwort.ist-richtig .quiz-buchstabe { border-color: var(--tanne); background: var(--tanne); color: var(--text-hell); }
.quiz-antwort.ist-richtig .quiz-marke { color: var(--tanne); }
.quiz-antwort.ist-richtig .quiz-marke::before { content: ''; width: 0.75rem; height: 0.75rem; background: currentColor; -webkit-mask: var(--haken) center / contain no-repeat; mask: var(--haken) center / contain no-repeat; }
.quiz-antwort.ist-falsch { border-color: var(--siegel); background: var(--fehler-hell); }
.quiz-antwort.ist-falsch .quiz-buchstabe { border-color: var(--siegel); background: var(--siegel); color: var(--text-hell); }
.quiz-antwort.ist-falsch .quiz-marke { color: var(--siegel); }
.quiz-app { --haken: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.5'/%3E%3C/svg%3E"); }

/* Erklärung auf Papier mit kurzem Einstieg, entfällt ohne Erklärung */
.quiz-rueckmeldung { margin: 1rem 0 0; padding: 0.9rem 1rem; border-radius: var(--radius); background: var(--papier-ton); }
.quiz-erklaerung { margin: 0; line-height: 1.55; }
.quiz-urteil { font-weight: 700; }
.quiz-rueckmeldung.ist-richtig .quiz-urteil { color: var(--tanne); }
.quiz-rueckmeldung.ist-falsch .quiz-urteil { color: var(--siegel); }
.quiz-weiter-zeile { display: flex; justify-content: flex-end; margin-top: 1rem; }
.quiz-weiter-zeile .knopf { min-width: 11rem; }

/* Ergebnis: Kopf mit Modul und Fragenzahl, darunter das Siegel, das in den Kopf hineinragt */
.quiz-kopf.quiz-kopf-ende { padding-bottom: 6.25rem; text-align: center; }
.quiz-kopf-ende .quiz-meta { justify-content: center; margin-bottom: 0.25rem; }
.ratgeber .quiz-kopf-ende h2 { margin: 0; font-size: 1.35rem; color: var(--text-hell); }
.quiz-kopf-ende h2:focus { outline: none; }
.quiz-siegel { position: relative; width: 11rem; height: 11rem; margin: -5rem auto 0; }
.quiz-siegel-bild { width: 100%; height: 100%; }
.quiz-siegel-punkte { fill: none; stroke: var(--messing-blass); stroke-width: 1.5; stroke-dasharray: 2 4; }
.quiz-siegel-ring { fill: none; stroke: var(--messing); stroke-width: 2; }
.quiz-siegel-umlauf { fill: var(--messing-blass); font-family: var(--schrift-titel); font-size: 10.5px; font-weight: 700; }
.quiz-siegel-zahl { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0; color: var(--text-hell); text-align: center; line-height: 1.1; }
.quiz-siegel-zahl strong { font-family: var(--schrift-titel); font-size: 2.6rem; font-weight: 800; line-height: 1; }
.quiz-siegel-zahl span { margin-top: 0.15rem; color: var(--messing-blass); font-size: 0.72rem; font-weight: 600; }
.quiz-ende-blatt { padding-top: 0.75rem; text-align: center; }
.quiz-satz { margin: 0 0 1.25rem; }
.quiz-ende-blatt .knopf + .knopf { margin-top: 0.7rem; }
.quiz-geteilt { margin: 0.9rem 0 0; color: var(--gut); font-weight: 600; }
#quiz-lernplan { margin: 1.1rem 0 0; color: var(--text-leise); }
.text-seite .quiz-weiterlinks { margin: 1.25rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--linie); list-style: none; text-align: left; }
.quiz-weiterlinks li { margin: 0; }
.quiz-empfehlen { margin: 0.75rem 0 0; font-size: 0.92rem; color: var(--text-leise); text-align: left; }
.quiz-weiterlinks a { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.75rem; color: var(--tanne); text-decoration: none; }
.quiz-weiterlinks a:hover, .quiz-weiterlinks a:focus-visible { text-decoration: underline; }
.quiz-weiterlinks a::after { content: ''; flex: none; width: 0.85rem; height: 0.85rem; background: var(--messing); -webkit-mask: var(--pfeil) center / contain no-repeat; mask: var(--pfeil) center / contain no-repeat; }

@media (prefers-reduced-motion: no-preference) {
  .quiz-ende:not([hidden]) { animation: quiz-einblenden 0.35s var(--weich) both; }
}
@keyframes quiz-einblenden { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Text unter dem Quiz, steht ohne JavaScript im HTML: auf Papier, klar abgesetzt */
.quiz-info { margin: 2rem calc(-1 * var(--rand)) 0; padding: 1.25rem var(--rand) 0.5rem; background: var(--papier-ton); }
.ratgeber .quiz-info h2 { margin-top: 0; }

/* ── 5. Größere Bildschirme ───────────────────────────────────────────── */
@media (min-width: 48em) {
  .ratgeber { margin-top: 2.5rem; }
  .ratgeber h1 { font-size: 2.1rem; }
  /* Nebeneinander: Titel in einer Zeile, dafür Siegel, Pfeil und Abstände knapper */
  .quiz-einstieg { grid-template-columns: 1fr 1fr; }
  .quiz-flaeche { gap: 0.6rem; padding: 1rem 0.85rem; }
  .quiz-flaeche-siegel { width: 1.8rem; height: 1.8rem; }
  .quiz-flaeche-titel { font-size: 0.95rem; }
  .quiz-flaeche-pfeil { width: 2rem; height: 2rem; }
  .quiz-flaeche-pfeil::after { width: 0.85rem; height: 0.85rem; }

  .quiz h1 { font-size: 1.45rem; }
  .quiz-app { margin: 0; border-radius: 0.8rem; overflow: hidden; box-shadow: 0 0 0 1px var(--linie-fein), var(--schatten); }
  .quiz-kopf { padding: 1.4rem 1.7rem 1.7rem; }
  .quiz-blatt { padding: 1.3rem 1.7rem 1.6rem; }
  .ratgeber .quiz-frage-text { font-size: 1.6rem; }
  .quiz-los { width: auto; min-width: 14rem; }
  .quiz-ende-blatt { padding-left: 4rem; padding-right: 4rem; }
  .quiz-info { margin: 2rem 0 0; padding: 1.3rem 1.5rem 0.6rem; border-radius: 0.8rem; }
}

/* Schwebendes Inhaltsverzeichnis: Textspalte (40rem samt Rand) + 3rem
   Abstand + 15rem Kasten = 58rem = 1044 px, dazu bis zu 17 px Bildlaufleiste:
   1061 px. 67em = 1072 px ist die erste runde Breite, bei der beides
   nebeneinander passt, ohne dass die Textspalte schmaler wird. */
@media (min-width: 67em) {
  .text-seite.ratgeber-artikel {
    display: grid;
    grid-template-columns: minmax(0, calc(40rem - 2 * var(--rand))) 15rem;
    column-gap: 3rem;
    align-items: start;
    max-width: calc(40rem + 18rem);
  }
  /* Übersicht: breitere Spalte (46rem samt Rand). Zusammen mit dem Kasten
     braucht sie 64rem = 1152 px; darunter wird nur die Spalte schmaler. */
  .text-seite.ratgeber-uebersicht {
    display: grid;
    grid-template-columns: minmax(0, calc(46rem - 2 * var(--rand))) 15rem;
    column-gap: 3rem;
    align-items: start;
    max-width: calc(46rem + 18rem);
  }
  .artikel-spalte, .uebersicht-spalte { min-width: 0; }
  .ratgeber-artikel .inhalt { display: none; }
  .inhalt-schwebend, .themen-schwebend {
    display: block;
    position: sticky;
    top: calc(var(--kopf-hoehe) + 1.5rem);
    max-height: calc(100vh - var(--kopf-hoehe) - 3rem);
    overflow-y: auto;
    margin-top: 2.4rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    background: var(--grund);
    font-size: 0.9rem;
  }
  .inhalt-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 0.5rem; margin: 0 0 0.6rem; }
  .inhalt-titel { font-family: var(--schrift-titel); font-size: 1rem; font-weight: 700; }
  .inhalt-lesezeit { color: var(--text-leise); font-size: 0.8rem; }
  .text-seite .inhalt-schwebend ol, .text-seite .themen-schwebend ul { margin: 0; padding: 0; list-style: none; }
  .inhalt-schwebend li, .themen-schwebend li { margin: 0; }
  .inhalt-schwebend ol a, .themen-schwebend li > a { position: relative; display: block; padding: 0.3rem 0 0.3rem 0.95rem; color: var(--text-leise); line-height: 1.35; text-decoration: none; }
  .inhalt-schwebend ol a:hover, .inhalt-schwebend ol a:focus-visible, .themen-schwebend li > a:hover, .themen-schwebend li > a:focus-visible { color: var(--tanne); text-decoration: underline; }
  .inhalt-schwebend ol a.ist-aktiv { color: var(--tanne); font-weight: 700; }
  .inhalt-schwebend ol a.ist-aktiv::before { content: ''; position: absolute; left: 0.1rem; top: 0.82em; width: 0.38rem; height: 0.38rem; border-radius: 50%; background: var(--messing); }
  .inhalt-ziel { margin: 0.8rem 0 0; padding-top: 0.7rem; border-top: 1px solid var(--linie-fein); color: var(--text-leise); }
  .inhalt-ziel a { color: var(--tanne); font-weight: 600; }

  /* Themenkasten der Übersicht: Gruppennamen klein und leise, das Quiz unter einer Haarlinie in Messing */
  .themen-titel { margin: 0 0 0.2rem; font-family: var(--schrift-titel); font-size: 1rem; font-weight: 700; }
  .themen-gruppe { margin: 0.4rem 0 0; color: var(--text-leise); font-size: 0.78rem; letter-spacing: 0.02em; }
  .themen-schwebend li > a { padding-top: 0.12rem; padding-bottom: 0.12rem; }
  .themen-quiz { margin-top: 0.6rem; padding-top: 0.55rem; border-top: 1px solid var(--messing); }
}
