/* ====================================================================
   Gemeinsames Blatt fuer die Seiten um den Trainer herum:
   index.html, anleitung.html, impressum.html, datenschutz.html

   Die Farben, die Schrift und die sieben Groessenstufen sind
   dieselben wie in app/index.html. Sie stehen hier nur deshalb
   noch einmal, weil der Trainer bewusst eine einzige Datei ist
   und bleiben soll - er muss auch per Doppelklick laufen.
   Aendert sich dort ein Wert, aendert er sich hier mit.

   Schrift LOKAL, nicht ueber fonts.googleapis.com: sonst ginge die
   IP jedes Besuchers an Google. Das LG Muenchen I sah darin 2022
   einen DSGVO-Verstoss (Az. 3 O 17493/20). Genau deshalb braucht
   diese Seite auch kein Einwilligungsbanner.
   ==================================================================== */

@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("literata-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Literata";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("literata-latin-italic.woff2") format("woff2");
}

:root {
  --papier:      #faf6ef;
  --karte:       #fffdf9;
  --tinte:       #2e2a24;
  --tinte-leise: #6b6459;
  --linie:       #e3dbcd;
  --akzent:      #9e4c1b;
  --akzent-hell: #f4e7dc;
  --tinte-auf-farbe: #ffffff;
  --richtig:     #2f6b42;
  --richtig-bg:  #e6f1e8;
  --falsch:      #a12d2d;
  --falsch-bg:   #f8e6e4;
  --terminal-bg: #2b2721;
  --terminal-fg: #f2ece1;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Die sieben Stufen. Eine achte wird hier eingetragen und
     begruendet, sonst faellt ein roher Wert nirgends auf.
     Geprueft von 08-resources/pruefe-schrift.py. */
  --s-marke: .8rem;
  --s-klein: .88rem;
  --s-text:  1rem;
  --s-gross: 1.12rem;
  --s-titel: 1.5rem;
  --s-kopf:  1.8rem;
  --s-schau: 2.1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --papier:      #1c1a17;
    --karte:       #26231f;
    --tinte:       #ece5d8;
    --tinte-leise: #a49b8c;
    --linie:       #3d382f;
    --akzent:      #e08b4c;
    --akzent-hell: #3a2c21;
    --tinte-auf-farbe: #1a120b;
    --richtig:     #7fc194;
    --richtig-bg:  #22331f;
    --falsch:      #e08b84;
    --falsch-bg:   #37201f;
    --terminal-bg: #14120f;
    --terminal-fg: #ece5d8;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 1rem 4rem;
  background: var(--papier);
  color: var(--tinte);
  font-family: "Literata", Georgia, serif;
  font-size: 16px;
  line-height: 1.72;
  -webkit-text-size-adjust: 100%;
}

.huelle { max-width: 44rem; margin: 0 auto; }

/* Fliesstext gekappt, Kaesten nicht - Konsolenausgaben brauchen
   die Breite, sonst rollt es waagerecht. */
p, ul, ol, .lauftext { max-width: 68ch; }

/* ---------- Kopf ---------- */

header.seitenkopf {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 1.4rem 0 1rem;
  border-bottom: 1px solid var(--linie);
  margin-bottom: 2rem;
}
header.seitenkopf .marke {
  font-size: var(--s-titel); font-weight: 600; letter-spacing: .01em;
  text-decoration: none; color: var(--tinte);
}
header.seitenkopf nav {
  display: flex; gap: 1.2rem; flex-wrap: wrap;
  font-family: var(--sans); font-size: var(--s-klein);
}
header.seitenkopf nav a { color: var(--tinte-leise); text-decoration: none; }
header.seitenkopf nav a:hover,
header.seitenkopf nav a[aria-current="page"] { color: var(--akzent); }

/* ---------- Ueberschriften ---------- */

h1 {
  font-size: var(--s-kopf); font-weight: 600; line-height: 1.25;
  letter-spacing: .01em; margin: 0 0 .8rem; text-wrap: balance;
}
h2 {
  font-size: var(--s-titel); font-weight: 600; line-height: 1.3;
  margin: 2.6rem 0 .7rem; text-wrap: balance;
}
h3 {
  font-size: var(--s-gross); font-weight: 600;
  margin: 1.8rem 0 .5rem;
}
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.3rem; margin: 0 0 1rem; }
li { margin-bottom: .35rem; }

a { color: var(--akzent); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--akzent); outline-offset: 2px;
}

.vorspann {
  font-size: var(--s-gross); color: var(--tinte-leise);
  margin-bottom: 1.6rem;
}

/* ---------- Kennzahlen ---------- */

.zahlen {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 1px; background: var(--linie);
  border: 1px solid var(--linie); border-radius: 10px; overflow: hidden;
  margin: 0 0 2rem;
}
.zahlen div { background: var(--karte); padding: .9rem 1rem; }
.zahlen dt {
  font-family: var(--sans); font-size: var(--s-marke);
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--tinte-leise); margin: 0 0 .15rem;
}
.zahlen dd {
  margin: 0; font-size: var(--s-titel); font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- Knoepfe ---------- */

.knopfreihe { display: flex; gap: .7rem; flex-wrap: wrap; margin: 1.6rem 0 0; }
.knopf {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans); font-size: var(--s-text); font-weight: 500;
  padding: .7rem 1.3rem; min-height: 44px;
  border-radius: 999px; text-decoration: none;
  border: 1px solid var(--akzent);
  background: var(--akzent); color: var(--tinte-auf-farbe);
}
.knopf.zweit { background: transparent; color: var(--akzent); }
.knopf .neben {
  font-size: var(--s-marke); opacity: .8; font-weight: 400;
}

/* ---------- Karten ---------- */

.karte {
  background: var(--karte); border: 1px solid var(--linie);
  border-radius: 10px; padding: 1.1rem 1.3rem; margin: 0 0 1.2rem;
}
.karte > :last-child { margin-bottom: 0; }
.karte h3 { margin-top: 0; }

.reihe {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem; margin: 0 0 1.2rem;
}
.reihe .karte { margin: 0; }

/* Hinweis mit farbiger Kante - Rolle, nicht Dekoration */
.hinweis-kasten {
  border-left: 3px solid var(--akzent); background: var(--akzent-hell);
  border-radius: 0 8px 8px 0; padding: .9rem 1.1rem; margin: 0 0 1.2rem;
}
.hinweis-kasten.warnung {
  border-left-color: var(--falsch); background: var(--falsch-bg);
}
.hinweis-kasten > :last-child { margin-bottom: 0; }
.hinweis-kasten .titel {
  font-family: var(--sans); font-size: var(--s-marke);
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--akzent); margin: 0 0 .3rem;
}
.hinweis-kasten.warnung .titel { color: var(--falsch); }

/* ---------- Konsole ---------- */

pre {
  background: var(--terminal-bg); color: var(--terminal-fg);
  border-radius: 8px; padding: .9rem 1.1rem;
  font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace;
  font-size: var(--s-klein); line-height: 1.6;
  overflow-x: auto; margin: 0 0 1.2rem;
}
pre .c { color: #9c9285; }
pre .f { color: #e08b84; }
code {
  font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace;
  font-size: var(--s-klein);
  background: var(--akzent-hell); color: var(--tinte);
  padding: .05em .35em; border-radius: 4px;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

/* ---------- Tabellen ---------- */

.tabellenhuelle { overflow-x: auto; margin: 0 0 1.2rem; }
table { border-collapse: collapse; width: 100%; font-size: var(--s-klein); }
th {
  text-align: left; font-family: var(--sans); font-size: var(--s-marke);
  letter-spacing: .06em; text-transform: uppercase; font-weight: 400;
  color: var(--tinte-leise); border-bottom: 1px solid var(--linie);
  padding: 0 .8rem .4rem 0; white-space: nowrap;
}
td {
  padding: .55rem .8rem .55rem 0;
  border-bottom: 1px solid var(--linie); vertical-align: top;
}
tr:last-child td { border-bottom: none; }

/* ---------- Beispielfrage auf der Startseite ---------- */

.probe { border: 1px solid var(--linie); border-radius: 10px; overflow: hidden; margin: 0 0 1.4rem; }
.probe .kopfzeile {
  background: var(--akzent-hell); padding: .5rem 1.1rem;
  font-family: var(--sans); font-size: var(--s-marke);
  letter-spacing: .06em; text-transform: uppercase; color: var(--akzent);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.probe .inhalt { background: var(--karte); padding: 1.1rem 1.3rem; }
.probe .inhalt > :last-child { margin-bottom: 0; }
.probe .frage { font-size: var(--s-gross); margin-bottom: .9rem; }
.probe ol.antworten { list-style: none; padding: 0; margin: 0 0 1.1rem; }
.probe ol.antworten li {
  border: 1px solid var(--linie); border-radius: 8px;
  padding: .5rem .8rem; margin-bottom: .4rem; font-size: var(--s-klein);
}
.probe ol.antworten li.ist-richtig {
  border-color: var(--richtig); background: var(--richtig-bg);
}
.probe .etikett {
  font-family: var(--sans); font-size: var(--s-marke); font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--tinte-leise); margin: 1.2rem 0 .3rem;
}
.probe .etikett.gut { color: var(--richtig); }

/* ---------- Fuss ---------- */

footer.seitenfuss {
  margin-top: 3.5rem; padding-top: 1.2rem;
  border-top: 1px solid var(--linie);
  font-family: var(--sans); font-size: var(--s-klein);
  color: var(--tinte-leise);
  display: flex; gap: 1.2rem; flex-wrap: wrap; justify-content: space-between;
}
footer.seitenfuss nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
footer.seitenfuss a { color: var(--tinte-leise); }

@media (pointer: coarse), (max-width: 640px) {
  header.seitenkopf nav a { min-height: 44px; display: inline-flex; align-items: center; }
  footer.seitenfuss a { min-height: 44px; display: inline-flex; align-items: center; }
}
