/* Gundlach - base.css
 * Reset, Page-Background (W1), Body-Typo, Container, Breakpoints, Fokus-States (a11y)
 * Kein Inhalt hier - nur globale Grundlagen. Setzt tokens.css voraus.
 */

/* ────────────────────────────────────────────────
 *  BOX MODEL RESET
 * ──────────────────────────────────────────────── */

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

/* ────────────────────────────────────────────────
 *  ROOT / PAGE
 * ──────────────────────────────────────────────── */

html {
  scroll-behavior: smooth;
  /* Topbar ist position:fixed → Anker-Sprünge um Topbar-Höhe versetzen */
  scroll-padding-top: var(--topbar-h);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  padding: 0;
  /* W1 als Page-Background - NIE #FFFFFF */
  background-color: var(--color-w1);
  color: var(--color-black);
  font-family: var(--font-sans);
  font-size: var(--type-body);
  font-weight: var(--weight-regular);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ────────────────────────────────────────────────
 *  TYPOGRAFISCHE BASISREGELN
 * ──────────────────────────────────────────────── */

/* Heading-Hierarchie - semantisch korrekt, kein Skipping */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-black);
  font-weight: var(--weight-bold);
  line-height: var(--lh-h1);
}

p {
  margin: 0;
  line-height: var(--lh-body);
}

/* Links - monochrome, kein farbiger Default außer B3R als sparsamem Hover */
a {
  color: var(--color-black);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-b3r);  /* B3R sehr sparsam als einzig erlaubter Farbhover */
  text-decoration: underline;
}

/* Italic - nur für Pull-Quotes (Disziplin-Prinzip) */
em {
  font-style: italic;
}

/* ────────────────────────────────────────────────
 *  FOKUS-STATES (a11y - sichtbar, markenkonform)
 * ──────────────────────────────────────────────── */

/* Sichtbarer Fokus-Ring für Tastatur-Navigation */
:focus-visible {
  outline: 2px solid var(--color-b4);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Fokus nur bei Tastatur-Navigation (nicht bei Mausklick) */
:focus:not(:focus-visible) {
  outline: none;
}

/* Auf dunklen Elementen weißer Fokus-Ring */
.on-dark :focus-visible,
.cmp-drama :focus-visible,
.cmp-footer :focus-visible {
  outline-color: var(--color-white);
}

/* ────────────────────────────────────────────────
 *  CONTAINER
 * ──────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

@media (max-width: 768px) {
  .container {
    padding-inline: var(--container-pad-mobile);
  }
}

/* ────────────────────────────────────────────────
 *  LANDMARK-ELEMENTE (semantisch korrekt)
 * ──────────────────────────────────────────────── */

header, nav, main, footer, section, article, aside {
  display: block;
}

main {
  /* Verhindert, dass main unter der sticky Topbar verschwindet */
  padding-top: var(--topbar-h);
}

/* ────────────────────────────────────────────────
 *  BILDER + MEDIEN
 * ──────────────────────────────────────────────── */

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

img {
  /* Lazy-loading als default - sections übersteuern ggf. mit loading="eager" */
  height: auto;
}

/* ────────────────────────────────────────────────
 *  LISTEN-RESET (für Komponenten-intern)
 * ──────────────────────────────────────────────── */

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

/* ────────────────────────────────────────────────
 *  UTILITY-KLASSEN (minimal - nur was Phase 0 braucht)
 * ──────────────────────────────────────────────── */

/* Sektionen alternieren über G1-BG (nie über Farbe) */
.section--alt {
  background-color: var(--color-g1);
}

/* Skip-Link für Screen-Reader (a11y Pflicht) */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  background: var(--color-b4);
  color: var(--color-white);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 0 0 var(--radius-card-sm) var(--radius-card-sm);
  font-size: var(--type-body);
  font-weight: var(--weight-medium);
  text-decoration: none;
  z-index: 9999;
  transition: top 0.1s ease;
}

.skip-link:focus {
  top: 0;
}

/* Visuell versteckt, aber zugänglich für Screen-Reader */
.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;
}

/* Alias für .sr-only - identische Regeln.
   §02 nutzt .visually-hidden; beide Namen sind korrekt. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ────────────────────────────────────────────────
 *  PRINT-RESET (Minimal - keine Bilder-URLs)
 * ──────────────────────────────────────────────── */

@media print {
  body {
    background: var(--color-w1);
    color: var(--color-black);
  }
  .cmp-topbar { display: none !important; }
}
