/* moxu.ch – Zusatz für die Unterlagen (/unterlagen.html, eltern, lehrpersonen, schulen, schulvereinbarung).
   Nach main.css und recht.css geladen. Nur Tokens aus main.css, damit hell und dunkel stimmen.
   Umbrüche in em (README, Prüfrunde 4). Ohne Skript bleibt alles lesbar: Inhalt offen, Akkordeons zu. */

.doku-kopf { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; align-items: center; padding-block: .5rem 1.75rem; }
.doku-kopf h1 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem); margin-bottom: .5rem; }
.doku-kopf .vorspann { margin-bottom: 1.25rem; }
.doku-kopf picture img, .doku-kopf > img { width: min(30vw, 11rem); height: auto; justify-self: center; }
.doku-kopf picture { justify-self: center; }
@media (max-width: 37.49em) { .doku-kopf picture { display: none; } }
@media (min-width: 45em) { .doku-kopf { grid-template-columns: minmax(0, 1fr) auto; } }
.doku-aktionen { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin: 0; padding: 0; list-style: none; }
/* Grosse Schrift auf schmalen Geräten: Knöpfe umbrechen statt hinausragen */
.doku-aktionen .knopf, .unterlage .knopf, .vereinbarung-karte .knopf { max-width: 100%; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
.doku-aktionen .klein { color: var(--text-leise); font-size: .95rem; }
.doku-meta { color: var(--text-leise); font-size: .95rem; margin: .75rem 0 0; }

/* Zweispaltig ab 60em: Inhaltsverzeichnis links (klebt), Text rechts */
.doku { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding-bottom: 4rem; }
@media (min-width: 60em) {
  .doku { grid-template-columns: 15.5rem minmax(0, 1fr); gap: 3rem; align-items: start; }
  .doku-nav { position: sticky; top: 5.5rem; max-height: calc(100vh - 6.5rem); overflow-y: auto; overscroll-behavior: contain; }
}
.doku-toc { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 1.25rem; }
.doku-toc > summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 3rem; padding: .6rem 1.1rem; font-weight: 900; cursor: pointer; border-radius: 1.25rem;
}
.doku-toc > summary::-webkit-details-marker { display: none; }
.doku-toc > summary::after {
  content: ""; width: .6rem; height: .6rem; border-right: 3px solid var(--koralle-tief); border-bottom: 3px solid var(--koralle-tief);
  transform: rotate(45deg) translateY(-25%);
}
.doku-toc[open] > summary::after { transform: rotate(-135deg) translateY(-25%); }
.doku-toc ol { list-style: none; margin: 0; padding: 0 .5rem .75rem; }
.doku-toc a {
  display: flex; gap: .5rem; align-items: baseline; min-height: 2.75rem; padding: .55rem .65rem; border-radius: .75rem;
  color: var(--text); text-decoration: none; font-weight: 700; line-height: 1.3; border-left: 3px solid transparent;
}
.doku-toc a:hover { background: var(--bg-mint); color: var(--text); }
.doku-toc a .nr { color: var(--text-leise); font-variant-numeric: tabular-nums; min-width: 1.4rem; }
.doku-toc a[aria-current] { background: var(--bg-mint); border-left-color: var(--tuerkis-tief); font-weight: 900; }
@media (min-width: 60em) { .doku-toc > summary { cursor: default; } .doku-toc > summary::after { display: none; } }

/* Abschnitte */
.doku-inhalt { min-width: 0; }
.kapitel { padding-top: .5rem; margin-bottom: 2.75rem; }
.kapitel > h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); font-weight: 900; margin-bottom: .75rem; }
.kapitel > h2 .nr {
  display: inline-grid; place-items: center; min-width: 2.2rem; height: 2.2rem; padding-inline: .4rem; border-radius: 999px;
  margin-right: .65rem; vertical-align: .2em; background: var(--tuerkis); color: var(--tinte); font-size: 1rem; line-height: 1;
}
.kapitel h3 { font-size: 1.15rem; margin-top: 1.5rem; }
.kapitel ul, .kapitel ol { padding-left: 1.3rem; }
.kapitel li { margin-bottom: .35rem; }

/* Karten im Raster */
.raster { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16.5rem), 1fr)); list-style: none; padding: 0; margin: 0 0 1.5rem; }
.kapitel .raster { padding-left: 0; }
.feld { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 1.25rem; padding: 1rem 1.15rem; box-shadow: var(--schatten-klein); margin: 0; }
.feld h3, .feld h4 { margin: 0 0 .35rem; font-size: 1.1rem; }
.feld p:last-child, .feld ul:last-child { margin-bottom: 0; }
.feld .marke { display: block; font-size: .8rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--tuerkis-text); margin-bottom: .2rem; }
@media (prefers-color-scheme: dark) { .feld .marke { color: var(--tuerkis); } }

/* Schritte 1, 2, 3 */
.schritte { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; counter-reset: schritt; }
.kapitel .schritte { padding-left: 0; }
.schritte > li { counter-increment: schritt; position: relative; padding: 1rem 1.15rem 1rem 4rem; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 1.25rem; box-shadow: var(--schatten-klein); margin: 0; }
.schritte > li::before {
  content: counter(schritt); position: absolute; left: 1rem; top: 1rem; width: 2.2rem; height: 2.2rem; border-radius: 999px;
  display: grid; place-items: center; background: var(--koralle); color: var(--tinte); font-weight: 900;
}
.schritte h3 { margin: .2rem 0 .35rem; font-size: 1.1rem; }
.schritte p:last-child { margin-bottom: 0; }
.schritte .bild { margin-top: .75rem; }
@media (min-width: 50em) { .schritte--quer { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Aufklappbare Schritte (Lehrpersonen) und Fragen: .faq aus main.css, hier die Nummer */
.akk { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; margin: 0 0 1.5rem; }
.doku .faq details, .doku .feld, .doku .schritte > li { min-width: 0; }
.akk summary .nr {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 999px; margin-right: .75rem; vertical-align: middle;
  background: var(--koralle); color: var(--tinte); font-weight: 900;
}
.akk summary > span:first-child { display: block; min-width: 0; }
.akk .antwort { color: var(--text); }
.akk .antwort ul { padding-left: 1.3rem; }

/* Kennzahlen */
.zahlen { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr)); list-style: none; padding: 0; margin: 0 0 1.5rem; }
.kapitel .zahlen { padding-left: 0; }
.zahlen li { margin: 0; padding: 1rem; border-radius: 1.25rem; background: var(--bg-mint); border: 1px solid var(--linie); }
.zahlen strong { display: block; font-size: clamp(1.25rem, 1rem + 1.2vw, 1.7rem); font-weight: 900; line-height: 1.15; color: var(--tuerkis-text); overflow-wrap: normal; word-break: normal; hyphens: manual; -webkit-hyphens: manual; }
@media (prefers-color-scheme: dark) { .zahlen strong { color: var(--tuerkis); } }
.zahlen span { color: var(--text-leise); font-size: .95rem; line-height: 1.35; display: block; margin-top: .25rem; }

/* Tabellen: auf dem Telefon waagrecht scrollbar (Region mit Tastatur-Fokus) */
.doku .tabelle { overflow-x: auto; margin: 0 0 1.25rem; border-radius: 1rem; border: 1px solid var(--linie); background: var(--flaeche); }
.doku table { border-collapse: collapse; width: 100%; min-width: 34rem; margin: 0; font-size: .95rem; }
.doku .tabelle--schmal table { min-width: 0; }
.doku th, .doku td { text-align: left; vertical-align: top; padding: .6rem .8rem; border-bottom: 1px solid var(--linie); }
.doku thead th { background: var(--bg-mint); font-weight: 800; }
.doku tbody th { font-weight: 800; }
.doku tr:last-child > * { border-bottom: 0; }
.doku td.zahl, .doku th.zahl { text-align: right; font-variant-numeric: tabular-nums; }
.doku caption { caption-side: bottom; text-align: left; padding: .6rem .8rem; color: var(--text-leise); font-size: .9rem; }

/* Bilder */
.bild { margin: 0 0 1.5rem; }
.bild img { width: 100%; height: auto; border-radius: 1rem; border: 1px solid var(--linie); box-shadow: var(--schatten-klein); background: var(--flaeche-2); }
.bild figcaption { color: var(--text-leise); font-size: .95rem; margin-top: .5rem; }
.bild--tel { max-width: min(100%, 13rem); }
.bilder { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); margin: 0 0 1.5rem; }
.bilder--breit { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.bilder .bild { margin: 0; }
.tiere { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); list-style: none; padding: 0; margin: 0 0 1.5rem; }
.kapitel .tiere { padding-left: 0; }
.tiere li { margin: 0; text-align: center; font-weight: 700; font-size: .9rem; }
.tiere img { width: 4.5rem; height: 4.5rem; margin: 0 auto .2rem; }

/* Kästen: «Gut zu wissen», «Wichtig» (Farben aus recht.css .kasten) */
.kasten h3, .kasten .titel { margin: 0 0 .35rem; font-size: 1.05rem; font-weight: 900; }
.kasten ul { margin-bottom: 0; }
.kasten--wichtig { background: var(--bg-pfirsich); }

/* Lücken in Vorlagen (zum Ausfüllen) und der Musterbrief */
.luecke { display: inline; -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 .4rem; border-bottom: 2px dotted var(--text-leise); color: var(--text-leise); font-style: italic; }
.brief { background: var(--flaeche); border: 1px solid var(--linie); border-left: 4px solid var(--tuerkis-tief); border-radius: 1rem; padding: 1rem 1.25rem; margin: 0 0 1.5rem; }
.brief p:last-child { margin-bottom: 0; }

/* Übersicht /unterlagen.html */
.unterlagen-liste { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; list-style: none; padding: 0; margin: 0 0 2.5rem; }
@media (min-width: 50em) { .unterlagen-liste { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.unterlage { display: flex; flex-direction: column; gap: .5rem; margin: 0; padding: 1.35rem; border-radius: var(--radius); background: var(--flaeche); border: 1px solid var(--linie); box-shadow: var(--schatten-klein); }
.unterlage h2 { font-size: 1.35rem; margin: 0; }
.unterlage p { margin: 0; }
.unterlage .meta { color: var(--text-leise); font-size: .95rem; }
.unterlage .knoepfe { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: auto; padding-top: .75rem; }
.unterlage .knopf { min-height: 2.9rem; padding: .55rem 1.1rem; }
.unterlage .bild { margin: 0 0 .5rem; }
.unterlage .bild img { aspect-ratio: 16 / 9; object-fit: cover; object-position: top; }
.vereinbarung-karte { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: center; padding: 1.35rem; border-radius: var(--radius); background: var(--bg-mint); border: 1px solid var(--linie); margin-bottom: 3rem; }
.vereinbarung-karte h2 { margin: 0 0 .35rem; font-size: 1.35rem; }
.vereinbarung-karte p { margin: 0; }
@media (min-width: 50em) { .vereinbarung-karte { grid-template-columns: minmax(0, 1fr) auto; } }

/* Weiter zu den anderen Unterlagen */
.weiter { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--linie); }
.weiter h2 { font-size: 1.25rem; margin: 0 0 .5rem; }
.weiter ul { list-style: none; padding: 0; margin: 0; }
.weiter a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }

/* Nach oben: ohne Skript als Link am Seitenende, mit Skript zusätzlich schwebend nach dem Scrollen */
.nach-oben { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; font-weight: 800; }
.nach-oben--schwebend {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 40; padding: .6rem 1rem; border-radius: 999px;
  background: var(--tinte); color: #fff; box-shadow: var(--schatten-klein); text-decoration: none;
}
.nach-oben--schwebend:hover { color: #fff; background: #2B5560; }
@media (prefers-color-scheme: dark) { .nach-oben--schwebend, .nach-oben--schwebend:hover { background: var(--tuerkis); color: var(--tinte); } }
.nach-oben--schwebend[hidden] { display: none; }
.knopf[hidden] { display: none; }
.icon--klein { width: 1.1rem; height: 1.1rem; }

@media print {
  .pfad, .doku-nav, .doku-aktionen, .nach-oben, .weiter, .vereinbarung-karte .knopf { display: none !important; }
  .doku { display: block; padding-bottom: 0; }
  .doku-kopf { grid-template-columns: 1fr; padding-top: 0; }
  .doku-kopf picture, .doku-kopf > img { display: none; }
  .feld, .schritte > li, .zahlen li, .bild, .kasten, .faq details, .tabelle, tr { break-inside: avoid; box-shadow: none; }
  .kapitel > h2, .kapitel h3 { break-after: avoid; }
  .doku table { min-width: 0; }
  .doku .tabelle { overflow: visible; }
  .bild img { max-width: 70%; box-shadow: none; }
  .bild--tel img, .bilder .bild img { max-width: 100%; }
  .bilder { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  details::details-content { content-visibility: visible; display: block; }
  .faq summary::after, .doku-toc > summary::after { display: none; }
  a { color: inherit; text-decoration: none; }
}

@media (forced-colors: active) {
  .doku-toc a[aria-current] { border-left-color: Highlight; }
  .feld, .unterlage, .schritte > li { border: 1px solid CanvasText; }
}
.doku-uebersicht { padding-bottom: 4rem; }

/* Grosse Schrift auf schmalen Geräten (200 %, 320 px): lange Wörter trennen statt hinausragen */
.doku, .doku-uebersicht { overflow-wrap: break-word; }
.doku-toc a > span:last-child { min-width: 0; }
.doku .knopf, .doku-uebersicht .knopf { max-width: 100%; overflow-wrap: anywhere; }
.doku-uebersicht .notiz p { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 37.49em) { .doku, .doku-uebersicht, .doku-kopf { hyphens: auto; -webkit-hyphens: auto; } }
