/* eventboy – Bedienungsanleitung (anleitung.html). Farben, Schrift und Abstände nach GESTALTUNG.md.
   Oben die Darstellung am Bildschirm, unten (@media print) das PDF. Erzeugt wird die Seite von werkzeuge/anleitung-bauen.mjs. */

.anleitung .deckblatt { display: none; }
/* Die Anleitung ist zum Nachschlagen da: kein sanftes Einblenden wie auf den Werbeseiten (eventboy.js), alles ist sofort lesbar */
.anleitung .einblenden { opacity: 1 !important; transform: none !important; transition: none !important; }
.anleitung main { --rot: #C4342A; --rot-dunkel: #A12920; --schwarz: #111111; --text: #1C1B18; --grau: #6E6C64; --linie: #DAD8D2; --grund: #F5F4F1; --gruen: #2E7D5B; }
html:has(body.anleitung) { scroll-behavior: smooth; }
.anleitung section[id], .anleitung .teil, .anleitung #inhalt { scroll-margin-top: 92px; }

/* Kopfbereich */
.anleitung .held { max-width: 1200px; margin: 0 auto; padding: 32px 24px 32px; display: flex; flex-direction: column; gap: 18px; }
.anleitung .kicker { font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--grau); }
.anleitung .kicker a { color: var(--grau); }
.anleitung .held h1 { font-size: clamp(36px, 5vw, 72px); font-weight: 800; line-height: 1.02; color: var(--schwarz); max-width: 900px; hyphens: auto; }
.anleitung .einleitung { font-size: 20px; max-width: 700px; color: var(--grau); }
.anleitung .held-knoepfe2 { display: flex; gap: 12px; flex-wrap: wrap; }
.anleitung .knopf-rot, .anleitung .knopf-rand { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 14px 24px; border-radius: 10px; font-weight: 700; }
.anleitung .knopf-rot { background: var(--rot); color: #fff; }
.anleitung .knopf-rot:hover { background: var(--rot-dunkel); color: #fff; text-decoration: none; }
.anleitung .knopf-rand { border: 2px solid var(--schwarz); color: var(--schwarz); }
.anleitung .knopf-rand:hover { background: var(--schwarz); color: #fff; text-decoration: none; }
.anleitung .stand { font-size: 14px; color: var(--grau); }

/* Zwei Spalten: links das Inhaltsverzeichnis (bleibt stehen), rechts der Text */
.anleitung .raster { max-width: 1200px; margin: 0 auto; padding: 16px 24px 88px; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 48px; align-items: start; }
.anleitung .seitennav { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; padding: 4px 4px 24px 0; scrollbar-width: thin; }
.anleitung .seitennav summary { font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--grau); list-style: none; padding: 8px 0; cursor: default; }
.anleitung .seitennav summary::-webkit-details-marker { display: none; }
.anleitung .nav-liste, .anleitung .nav-liste ol { list-style: none; margin: 0; padding: 0; }
.anleitung .nav-liste > li { margin-bottom: 14px; }
.anleitung .nav-liste .teil-link { display: block; font-size: 13px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--schwarz); padding: 6px 10px; }
.anleitung .nav-liste ol a { display: flex; gap: 8px; align-items: baseline; padding: 7px 10px; border-radius: 8px; color: var(--text); font-size: 15px; line-height: 1.3; border-left: 3px solid transparent; }
.anleitung .nav-liste ol a span { flex: 0 0 22px; color: var(--grau); font-size: 13px; font-variant-numeric: tabular-nums; }
.anleitung .nav-liste a:hover { background: #ECEAE5; text-decoration: none; color: var(--schwarz); }
.anleitung .nav-liste a[aria-current] { background: #fff; border-left-color: var(--rot); font-weight: 700; color: var(--schwarz); }

.anleitung article { min-width: 0; font-size: 17px; line-height: 1.6; color: var(--text); }
.anleitung article p { margin: 0 0 16px; max-width: 74ch; }
.anleitung .inhalt-seite { display: none; }

/* Teile und Kapitel */
.anleitung .teil { margin: 72px 0 8px; padding: 28px 28px 26px; background: var(--schwarz); border-radius: 16px; color: #fff; }
.anleitung .teil:first-of-type { margin-top: 0; }
.anleitung .teil span { display: block; font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rot); margin-bottom: 6px; }
.anleitung .teil h2 { font-size: clamp(28px, 3.5vw, 40px); font-weight: 800; line-height: 1.05; color: #fff; }
.anleitung .kapitel { padding: 44px 0 12px; border-bottom: 1px solid var(--linie); }
.anleitung .kapitel-kopf { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.anleitung .kapitel-nr { flex: 0 0 auto; font-size: 15px; font-weight: 800; color: #fff; background: var(--rot); min-width: 34px; height: 34px; border-radius: 17px; display: inline-flex; align-items: center; justify-content: center; padding: 0 9px; position: relative; top: -4px; }
.anleitung .kapitel h2 { font-size: clamp(28px, 3.5vw, 40px); font-weight: 800; line-height: 1.08; color: var(--schwarz); hyphens: auto; }
.anleitung .kapitel h3 { font-size: 21px; font-weight: 800; color: var(--schwarz); margin-bottom: 12px; }
.anleitung .nach-oben { margin: 18px 0 0; font-size: 14px; }
.anleitung .nach-oben a { color: var(--grau); font-weight: 600; }

/* Bilder im Geräterahmen */
.anleitung .bild { margin: 26px 0 28px; }
.anleitung .bild a { display: block; background: var(--schwarz); border-radius: 14px; padding: 10px 10px 18px; position: relative; }
.anleitung .bild a::after { content: ""; position: absolute; left: 50%; bottom: 7px; width: 56px; height: 4px; margin-left: -28px; border-radius: 2px; background: #3a3a3a; }
.anleitung .bild img { width: 100%; height: auto; border-radius: 7px; background: #fff; }
.anleitung .bild figcaption { margin-top: 10px; font-size: 15px; color: var(--grau); line-height: 1.45; }
.anleitung .bild figcaption b { color: var(--schwarz); margin-right: 6px; }
.anleitung .handys { display: flex; gap: 28px; flex-wrap: wrap; align-items: flex-start; margin: 8px 0 20px; }
.anleitung .bild.handy { flex: 0 1 230px; margin: 14px 0; }
.anleitung .bild.handy a { border-radius: 28px; padding: 9px; }
.anleitung .bild.handy a::after { display: none; }
.anleitung .bild.handy img { border-radius: 20px; }
.anleitung .pdf-seiten { display: flex; gap: 20px; flex-wrap: wrap; margin: 8px 0 20px; }
.anleitung .bild.pdf { flex: 0 1 220px; margin: 14px 0; }
.anleitung .bild.pdf a { background: none; padding: 0; border: 1px solid var(--linie); border-radius: 4px; overflow: hidden; }
.anleitung .bild.pdf a::after { display: none; }
.anleitung .bild.pdf img { border-radius: 0; }
.anleitung .laeden { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 24px; }
.anleitung .laeden img { width: 188px; height: 56px; border-radius: 9px; }

/* Kästen: Schritte, Überblick, Tipp, Wichtig */
.anleitung .schritte, .anleitung .kasten, .anleitung .tabelle-rahmen, .anleitung .kontakt { background: #fff; border: 1px solid var(--linie); border-radius: 16px; padding: 24px 26px; margin: 26px 0; }
.anleitung .schritte ol { list-style: none; margin: 0; padding: 0; counter-reset: schritt; }
.anleitung .schritte li { counter-increment: schritt; position: relative; padding: 9px 0 9px 46px; border-top: 1px solid #EFEEE9; }
.anleitung .schritte li:first-child { border-top: 0; }
.anleitung .schritte li::before { content: counter(schritt); position: absolute; left: 0; top: 8px; width: 30px; height: 30px; border-radius: 15px; background: var(--schwarz); color: #fff; font-size: 15px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.anleitung .kasten ul { margin: 0; padding: 0; list-style: none; }
.anleitung .kasten li { position: relative; padding: 7px 0 7px 28px; }
.anleitung .kasten li::before { content: "✓"; position: absolute; left: 0; top: 7px; color: var(--gruen); font-weight: 800; }
.anleitung .tipp, .anleitung .warnung { border-left: 4px solid var(--gruen); background: #E8F3ED; border-radius: 0 12px 12px 0; padding: 14px 18px; margin: 24px 0; max-width: none; }
.anleitung .tipp b, .anleitung .warnung b { display: block; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 2px; color: #1D4F39; }
.anleitung .warnung { border-left-color: var(--rot); background: #FBECEB; }
.anleitung .warnung b { color: #7D1D16; }

/* Tabellen */
.anleitung .tabelle-rahmen { overflow-x: auto; }
.anleitung table { width: 100%; border-collapse: collapse; font-size: 16px; }
.anleitung thead th { text-align: left; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--grau); padding: 8px 12px 8px 0; border-bottom: 2px solid var(--schwarz); }
.anleitung tbody th, .anleitung tbody td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--linie); font-weight: 400; }
.anleitung tbody th { font-weight: 700; color: var(--schwarz); }
.anleitung td.ja { color: var(--gruen); font-weight: 700; white-space: nowrap; }
.anleitung td.nein { color: var(--grau); }

/* „Im Einzelnen“: die Hilfetexte aus der App */
.anleitung .einzeln { margin: 34px 0 8px; }
.anleitung .einzeln-hinweis { font-size: 15px; color: var(--grau); }
.anleitung .einzeln-gruppe { font-size: 17px; font-weight: 800; margin: 26px 0 0; color: var(--schwarz); }
.anleitung dl { margin: 0; }
.anleitung .einzeln dl > div, .anleitung .fragen > div { padding: 14px 0; border-top: 1px solid var(--linie); display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr); gap: 6px 24px; }
.anleitung dt { font-weight: 800; color: var(--schwarz); }
.anleitung dd { margin: 0; }
.anleitung .fragen > div { grid-template-columns: 1fr; }
.anleitung .fragen dt { font-size: 19px; }
.anleitung .kontakt { display: flex; flex-direction: column; gap: 6px; }
.anleitung .kontakt b { font-size: 19px; color: var(--schwarz); margin-bottom: 4px; }

/* Handy und Tablet: eine Spalte, Inhaltsverzeichnis zum Aufklappen */
@media (max-width: 999px) {
  .anleitung .held { padding: 28px 16px 20px; }
  .anleitung .raster { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 8px 16px 64px; }
  .anleitung .seitennav { position: sticky; top: 64px; z-index: 10; max-height: none; overflow: visible; padding: 0; margin: 0 -16px; }
  .anleitung .seitennav details { background: rgba(245, 244, 241, 0.97); border-bottom: 1px solid var(--linie); padding: 0 16px; }
  .anleitung .seitennav details[open] { background: #F5F4F1; max-height: calc(100vh - 70px); overflow-y: auto; padding-bottom: 16px; box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12); }
  .anleitung .seitennav summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; justify-content: space-between; color: var(--schwarz); }
  .anleitung .seitennav summary::after { content: "anzeigen ▾"; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--rot); }
  .anleitung .seitennav details[open] summary::after { content: "schließen ▴"; }
  .anleitung .nav-liste ol a { min-height: 44px; align-items: center; font-size: 16px; }
  .anleitung section[id], .anleitung .teil { scroll-margin-top: 124px; }
  .anleitung .teil { margin: 48px 0 0; padding: 22px 20px; }
  .anleitung .kapitel { padding-top: 32px; }
  .anleitung .einzeln dl > div { grid-template-columns: 1fr; gap: 2px; }
  .anleitung .schritte, .anleitung .kasten, .anleitung .tabelle-rahmen, .anleitung .kontakt { padding: 18px 16px; }
  .anleitung .bild a { padding: 6px 6px 12px; border-radius: 10px; }
  .anleitung .bild a::after { bottom: 4px; }
  .anleitung .handys { justify-content: center; gap: 16px; }
  .anleitung .bild.handy { flex-basis: 150px; }
  .anleitung .held-knoepfe2 a { flex: 1 1 100%; }
}

/* ============================ PDF (Druck) ============================ */
@page { size: A4; margin: 16mm 14mm 17mm; }
@page :first { margin: 0; }
@media print {
  html, body.anleitung { background: #fff !important; font-size: 10.5pt; }
  .anleitung * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .anleitung > header, .anleitung > footer, .anleitung .seitennav, .anleitung .held, .anleitung .nach-oben, .anleitung .cta-zwischen { display: none !important; }
  .anleitung .einblenden { opacity: 1 !important; transform: none !important; }

  .anleitung .deckblatt { display: flex; flex-direction: column; justify-content: center; height: 297mm; padding: 0 22mm; background: #111111; color: #fff; break-after: page; }
  .anleitung .deckblatt-logo { font-size: 54pt; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
  .anleitung .deckblatt-logo span { color: #C4342A; }
  .anleitung .deckblatt-strich { width: 30mm; height: 1.6mm; background: #C4342A; border-radius: 1mm; margin: 12mm 0 10mm; }
  .anleitung .deckblatt h1 { font-size: 34pt; font-weight: 800; line-height: 1.05; color: #fff; }
  .anleitung .deckblatt p { font-size: 15pt; color: #B9B6AE; margin-top: 5mm; max-width: 130mm; }
  .anleitung .deckblatt-fuss { margin-top: 60mm; font-size: 10.5pt; line-height: 1.6; color: #B9B6AE; }

  .anleitung .raster { display: block; max-width: none; padding: 0; margin: 0; }
  .anleitung article { font-size: 10.5pt; line-height: 1.5; }
  .anleitung article p { max-width: none; margin-bottom: 3mm; orphans: 3; widows: 3; }
  .anleitung a { color: inherit; text-decoration: none; }

  .anleitung .inhalt-seite { display: block; break-after: page; }
  .anleitung .inhalt-seite h2 { font-size: 24pt; font-weight: 800; margin-bottom: 8mm; color: #111; }
  .anleitung .inhalt-liste, .anleitung .inhalt-liste ol { list-style: none; margin: 0; padding: 0; }
  .anleitung .inhalt-liste { columns: 2; column-gap: 12mm; }
  .anleitung .inhalt-liste > li { margin-bottom: 5mm; break-inside: avoid; }
  .anleitung .inhalt-liste .teil-link { display: block; font-size: 9pt; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #C4342A; margin-bottom: 1.5mm; }
  .anleitung .inhalt-liste ol a { display: flex; gap: 2mm; padding: 1.3mm 0; border-bottom: 0.2mm solid #DAD8D2; font-size: 10pt; color: #1C1B18; }
  .anleitung .inhalt-liste ol a span { flex: 0 0 8mm; color: #6E6C64; font-variant-numeric: tabular-nums; }

  .anleitung .teil { margin: 0 0 6mm; padding: 9mm 9mm 8mm; border-radius: 3mm; break-before: page; break-after: avoid; }
  .anleitung .teil span { font-size: 9pt; }
  .anleitung .teil h2 { font-size: 22pt; }
  .anleitung .kapitel { padding: 0 0 4mm; border: 0; break-before: page; }
  .anleitung .teil + .kapitel { break-before: avoid; }
  .anleitung .kapitel-kopf { margin-bottom: 4mm; break-after: avoid; }
  .anleitung .kapitel-nr { font-size: 10pt; min-width: 8mm; height: 8mm; border-radius: 4mm; top: -1mm; }
  .anleitung .kapitel h2 { font-size: 20pt; }
  .anleitung .kapitel h3 { font-size: 12.5pt; margin-bottom: 2.5mm; break-after: avoid; }

  .anleitung .bild { margin: 4mm 0 5mm; break-inside: avoid; }
  .anleitung .bild a { padding: 1.6mm 1.6mm 3mm; border-radius: 2.4mm; }
  .anleitung .bild a::after { bottom: 1.1mm; width: 10mm; height: 0.7mm; margin-left: -5mm; }
  /* Höchstens 92 mm hoch: So passen zwei Bildschirmfotos samt Text auf eine Seite, und es bleiben keine halben Seiten leer */
  .anleitung .bild img { border-radius: 1.2mm; max-height: 92mm; width: auto; max-width: 100%; margin: 0 auto; }
  .anleitung .bild.laptop a { width: fit-content; margin: 0 auto; }
  .anleitung .bild figcaption { font-size: 8.5pt; margin-top: 1.6mm; }
  .anleitung .handys { gap: 8mm; margin: 2mm 0 4mm; break-inside: avoid; }
  .anleitung .bild.handy { flex: 0 0 46mm; margin: 2mm 0; }
  .anleitung .bild.handy a { border-radius: 5mm; padding: 1.6mm; }
  .anleitung .bild.handy img { border-radius: 3.6mm; max-height: none; width: 100%; }
  .anleitung .pdf-seiten { gap: 6mm; break-inside: avoid; }
  .anleitung .bild.pdf { flex: 0 0 52mm; margin: 2mm 0; }
  .anleitung .bild.pdf img { max-height: none; width: 100%; }
  .anleitung .laeden img { width: 44mm; height: auto; }

  .anleitung .schritte, .anleitung .kasten, .anleitung .tabelle-rahmen, .anleitung .kontakt { padding: 5mm 6mm; margin: 5mm 0; border-radius: 3mm; break-inside: avoid; }
  .anleitung .schritte li { padding: 1.6mm 0 1.6mm 10mm; }
  .anleitung .schritte li::before { width: 6.4mm; height: 6.4mm; border-radius: 3.2mm; font-size: 9pt; top: 1.2mm; }
  .anleitung .kasten li { padding: 1.2mm 0 1.2mm 6mm; }
  .anleitung .kasten li::before { top: 1.2mm; }
  .anleitung .tipp, .anleitung .warnung { padding: 3mm 4mm; margin: 5mm 0; break-inside: avoid; border-radius: 0 2mm 2mm 0; }
  .anleitung .tipp b, .anleitung .warnung b { font-size: 8pt; }
  .anleitung table { font-size: 9.5pt; }
  .anleitung thead th { font-size: 8pt; padding: 1.5mm 3mm 1.5mm 0; }
  .anleitung tbody th, .anleitung tbody td { padding: 1.8mm 3mm 1.8mm 0; }

  .anleitung .einzeln { margin: 6mm 0 2mm; }
  .anleitung .zusammen { break-inside: avoid; }
  .anleitung .zusammen dl > div { border-bottom: 0; }
  .anleitung .einzeln-hinweis { font-size: 8.5pt; }
  .anleitung .einzeln-gruppe { font-size: 10.5pt; margin-top: 5mm; break-after: avoid; }
  .anleitung .einzeln dl > div { grid-template-columns: 42mm minmax(0, 1fr); gap: 1mm 5mm; padding: 2.2mm 0; break-inside: avoid; font-size: 9.5pt; line-height: 1.45; }
  .anleitung .fragen > div { padding: 3mm 0; break-inside: avoid; }
  .anleitung .fragen dt { font-size: 11.5pt; }
  .anleitung .kontakt b { font-size: 12pt; }
}
