/* =============================================================
   BASE – Reset, Grundtypografie, Barrierefreiheit
   ============================================================= */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anker-Ziele nicht unter den Sticky-Header rutschen lassen */
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--c-ink);
  background-color: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

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

input,
button,
textarea,
select { font: inherit; color: inherit; }

button { cursor: pointer; }

ul[role="list"],
ol[role="list"] { list-style: none; padding: 0; }

a { color: var(--c-link); text-underline-offset: 0.18em; }
a:hover { text-decoration: none; }

/* ---------- Überschriften ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  font-weight: var(--fw-bold);
  color: var(--c-ink);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p { text-wrap: pretty; max-width: 68ch; }

strong, b { font-weight: var(--fw-semibold); }

/* ---------- Fokus: immer deutlich sichtbar ---------- */
:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 3px;
  border-radius: 4px;
}
/* Kein doppelter Fokusring bei Maus-Klick */
:focus:not(:focus-visible) { outline: none; }

/* ---------- Skip-Link ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: var(--z-toast);
  background: var(--c-cta);
  color: var(--c-cta-text);
  padding: 0.75rem 1.25rem;
  border-radius: var(--r-sm);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus-visible { top: 0.75rem; }

/* ---------- Nur für Screenreader ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Auswahlfarbe ---------- */
::selection {
  background: var(--c-accent);
  color: var(--c-ink);
}
