/* ============================================================================
   Basis: Reset, Typografie, Fokus, Grundbausteine
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
body { overscroll-behavior-y: none; }

#app { min-height: 100dvh; }

h1, h2, h3, h4 { margin: 0; font-weight: 640; line-height: 1.22; letter-spacing: -0.018em; }
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-lead); letter-spacing: -0.012em; }
p  { margin: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); }

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; padding: 0; cursor: pointer; }

img { max-width: 100%; display: block; }

/* Icons haben keine intrinsische Größe. Ohne Standardmaß blähen sie sich im
   Flex-Layout auf die volle Breite auf — deshalb hier einmal global statt an
   jeder Fundstelle einzeln. Spezifischere Regeln (.nav__item svg, .icon-btn
   svg, .empty svg …) stehen in den späteren Dateien und gewinnen. */
svg[viewBox="0 0 24 24"] { width: 18px; height: 18px; flex: none; }

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

/* Fokus: durchgehend sichtbar, nie wegoptimiert. */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* Text, der nur für Screenreader existiert. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Skip-Link zum Inhalt (Tastaturbedienung). */
.skip {
  position: fixed; top: calc(var(--sat) + var(--s2)); left: var(--s3);
  z-index: var(--z-toast); transform: translateY(-200%);
  background: var(--accent); color: var(--accent-ink);
  padding: var(--s2) var(--s4); border-radius: var(--r-sm); font-weight: 600;
}
.skip:focus-visible { transform: none; }

/* Zahlen in Listen und Tabellen laufen nicht auseinander. */
.tnum { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Scrollen */
.scroll-x {
  display: flex; gap: var(--s2);
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  /* Rand-zu-Rand scrollen, Inhalt trotzdem am Raster ausgerichtet */
  margin-inline: calc(var(--pad) * -1);
  padding-inline: var(--pad);
}
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x > * { scroll-snap-align: start; }

/* --------------------------------------------------------------- Seitenmaß */
/* --pad ist der horizontale Seitenrand; Views setzen ihn, Kinder erben ihn. */
.page { --pad: var(--s4); padding-inline: var(--pad); }
@media (min-width: 700px) { .page { --pad: var(--s6); } }
@media (min-width: 1200px) { .page { --pad: var(--s7); } }
