/* Reset, Typografie-Grundlagen, Fokus, Hilfsklassen */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: calc(var(--kopf-hoehe) + 1rem); }

/* Muss die display-Regeln der Komponenten schlagen. */
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media (max-width: 767px) {
  html { scroll-padding-bottom: calc(var(--handleiste-hoehe) + env(safe-area-inset-bottom)); }
}

body {
  margin: 0;
  background: var(--weiss);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, h4 {
  line-height: var(--lh-titel);
  margin: 0 0 0.5em;
  text-wrap: balance;
  color: var(--navy);
}

h1, h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.005em;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); max-width: 32ch; }

/* H3 in normaler Laufweite: Hierarchie ueber Breite und Gewicht, nicht nur Groesse. */
h3 {
  font-family: var(--font-body);
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: 0;
}

p { margin: 0 0 1em; text-wrap: pretty; max-width: 68ch; }
p:last-child { margin-bottom: 0; }

a { color: var(--navy); text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

img, svg, picture { max-width: 100%; }
img { height: auto; display: block; }

ul, ol { margin: 0 0 1em; padding-left: 1.25rem; }
li { margin-bottom: 0.35em; }
li:last-child { margin-bottom: 0; }

:focus-visible {
  outline: 3px solid var(--fokus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Auf dunklen Flaechen wird der Fokusring weiss, in weissen Karten wieder navy. */
.sektion--navy, .rechner--navy, .seitenkopf, .fuss { --fokus: var(--weiss); }
.rechner__karte, .stimme { --fokus: var(--navy); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Hilfsklassen */

.spur { width: var(--spur); margin-inline: auto; }
.spur-schmal { width: var(--spur-schmal); margin-inline: auto; }

.sektion { padding-block: var(--raum-sektion); }
.sektion--papier { background: var(--papier); }
.sektion--himmel { background: var(--himmel); }
.sektion--navy { background: var(--navy); color: var(--weiss); }
.sektion--navy h2, .sektion--navy h3 { color: var(--weiss); }
.sektion--navy a:not(.knopf) { color: var(--weiss); }

.nur-screenreader {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 100;
  background: var(--navy);
  color: var(--weiss);
  padding: 0.7rem 1.1rem;
  border-radius: 0 0 var(--radius-m) var(--radius-m);
  text-decoration: none;
  font-weight: 600;
  transition: top var(--dauer-schnell) var(--ease);
}
.skip-link:focus-visible { top: 0; }

.blei { font-size: var(--fs-gross); color: var(--text-leise); line-height: 1.55; max-width: 44ch; }
.sektion--navy .blei { color: rgba(255, 255, 255, 0.86); }

.quelle { font-size: var(--fs-caption); color: var(--text-leise); line-height: 1.55; max-width: 78ch; margin: 0; }
.quelle.quelle--abstand { margin-top: 1rem; }

/* Sichtbare Markierung fuer fehlende Pflichtangaben (nur ausserhalb der Vorschau). */
.offen {
  display: inline;
  font-weight: 600;
  color: var(--navy);
  background: var(--orange-nebel);
  border-bottom: 2px dashed var(--orange-ikon);
  padding: 0 0.25rem;
}
