/*
 * So geht bin dabei (/guide), Aufgabe 50, Screens Anleitung und Desktop-Anleitung, „So geht bin dabei“ in
 * docs/design.md. Baut auf tokens.css, components.css und landing.css auf: Kopf, Fuß und Knöpfe wie die Landing
 * Page, Karten, Menüzeilen, Terminliste und Schalter aus den Bausteinen. Neu sind nur Kapitel, Schritte, Punkte,
 * Vorschau, Hinweis, „Wo:“, die zwei Fälle, die Fragen und das Inhaltsverzeichnis.
 * Mobil zuerst; ab 900 px steht das Inhaltsverzeichnis links und bleibt stehen. Farben nur über var(--…).
 */

/* Die Anleitung bringt ihre Ränder selbst mit (16 px, ab 900 px 24 px), nicht die der Landing Page. */
.app--landing > .app__main:has(> .guide) {
  padding: 0;
}

.guide {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding: 8px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-wrap: break-word;
}

.guide ul,
.guide ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-intro {
  padding: 16px 4px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guide-title {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.guide-lead {
  font-size: 16px;
  line-height: 1.45;
  color: var(--color-ink-2);
}

/* Abschluss „Bereit?“ wie auf der Landing Page, ohne die große Marke */
.guide-closing {
  padding-top: 40px;
}

/* Teil „Mitmachen“ / „Organisieren“: Überschrift auf dem Grund zwischen den Kapiteln */
.guide-part {
  padding: 28px 4px 2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scroll-margin-top: 16px; /* „Häufige Fragen“ ist ein Sprungziel */
}

.guide-part__title {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.guide-part__text {
  color: var(--color-ink-2);
}

/* Kapitel: eine Karte */
.guide-chapter {
  padding: 22px 20px 20px;
  border-radius: var(--radius-card);
  background: var(--color-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-margin-top: 16px;
}

.guide-chapter__head {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Der Kreis des Kapitels in einer Gruppenfarbe (Aufgabe 78, Screen 28), das Symbol fast schwarz */
.guide-chapter__icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--group-fill, var(--color-tint));
  color: var(--color-on-group);
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-chapter__title {
  font: var(--text-heading);
  letter-spacing: var(--letter-tight);
}

.guide-chapter p {
  line-height: 1.45;
}

/* Vorschau: feste Beispiele aus der App auf der Grundfarbe, wie die Vorschau der Gruppenfarbe */
.guide-figure {
  margin: 0;
  padding: 12px;
  border-radius: var(--radius-row);
  background: var(--color-ground);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Gezeichnete Umschalter (role="img"): Die Felder sind <span> statt <button>, sonst wie in der App */
.guide-figure span.segmented__option {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.guide-figure .segmented--tabs .segmented__option[aria-current="true"] {
  color: var(--color-on-ink);
}

.guide-figure .toggle,
.guide-figure .pay-pill > * {
  cursor: default;
}

.guide-figure figcaption {
  padding: 2px 4px 0;
  font: var(--text-small);
  color: var(--color-ink-2);
}

/* Schritte: Nummer im Kreis wie auf der Landing Page, kleiner */
.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guide-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.guide-step__number {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--color-ink);
  color: var(--color-on-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font: var(--text-small);
  font-weight: 700;
}

.guide-step__text {
  padding-top: 3px;
  line-height: 1.45;
}

.guide-step__text strong {
  font-weight: 600;
}

/* Punkte ohne Reihenfolge: kleiner Haken davor */
.guide-points {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
}

.guide-points svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-ink-2);
}

/* Hinweis: getönte Fläche mit Symbol, für Regeln, die man kennen sollte */
.guide-note {
  padding: 12px 14px;
  border-radius: var(--radius-row);
  background: var(--color-tint);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font: var(--text-small);
  line-height: 1.45;
}

.guide-note svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.guide-note strong {
  font-weight: 600;
}

/* Wo du es findest: Weg durch die App als Pillen */
.guide-where {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font: var(--text-small);
  color: var(--color-ink-2);
}

.guide-where__step {
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--color-tint);
  color: var(--color-ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

/* Zwei Fälle nebeneinander (mit und ohne Kontingent), am Handy untereinander */
.guide-cases {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.guide-case {
  padding: 14px;
  border-radius: var(--radius-row);
  background: var(--color-ground);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-case__title {
  font-weight: 700;
}

.guide-case p {
  font: var(--text-small);
  line-height: 1.45;
  color: var(--color-ink-2);
}

/* Häufige Fragen: <details> in einer Menükarte */
.guide-faq {
  padding: 6px 8px;
  border-radius: var(--radius-card);
  background: var(--color-card);
}

.guide-faq details {
  border-radius: var(--radius-row);
}

.guide-faq summary {
  min-height: 56px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.guide-faq summary::-webkit-details-marker {
  display: none;
}

.guide-faq summary svg {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--color-ink-2);
}

.guide-faq details[open] summary svg {
  transform: rotate(180deg);
}

.guide-faq details p {
  padding: 0 8px 14px;
  color: var(--color-ink-2);
  line-height: 1.45;
}

/* Inhaltsverzeichnis: Menükarte mit zwei Überschriften; ab 900 px links neben den Kapiteln */
.guide-toc .menu-row {
  min-height: 56px;
}

/* Verzeichnis: über jedem Teil ein Wort in Großbuchstaben, Nebentext 12 px wie Screen 28 */
.guide-toc__label {
  padding: 12px 8px 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ink-2);
}

/* Beispiel „Erinnern“ im Kapitel „Termine planen“ */
.guide-remind {
  padding: 6px 16px;
}

.guide-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.guide-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (min-width: 900px) {
  .guide {
    padding-inline: 24px;
  }

  .guide-title {
    font-size: 52px;
  }

  .guide-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 32px;
  }

  .guide-toc {
    position: sticky;
    top: 16px;
    width: 280px;
    flex-shrink: 0;
  }

  /* Links neben den Kapiteln nur die Titel, damit das Verzeichnis in die Höhe des Fensters passt */
  .guide-toc .menu-row {
    min-height: 48px;
    padding-block: 4px;
  }

  .guide-toc .menu-row__icon {
    width: 32px;
    height: 32px;
  }

  .guide-toc .menu-row__subtitle,
  .guide-toc .menu-row__chevron {
    display: none;
  }

  .guide-content {
    flex: 1 1 0;
    max-width: 640px;
  }

  .guide-cases {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
