/* =============================================================
   base.css — Reset, Typografie-Grundlagen, Fokus, reduced-motion
   ============================================================= */

/* ---- Modernes Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-16));
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-400);
  line-height: var(--lh-normal);
  font-weight: var(--fw-regular);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  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, ol { padding: 0; }

:lang(ar) { font-family: var(--font-arabic); }

/* ---- Überschriften ---- */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  text-wrap: balance;
}

h1 {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
}
h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: 1.2;
}
h3 {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
}
h4 {
  font-family: var(--font-body);
  font-size: var(--fs-h4);
  font-weight: var(--fw-bold);
}
h5 {
  font-family: var(--font-body);
  font-size: var(--fs-h5);
  font-weight: var(--fw-bold);
}
h6 {
  font-family: var(--font-body);
  font-size: var(--fs-600);
  font-weight: var(--fw-semibold);
}

p { text-wrap: pretty; }

p, ul, ol {
  max-width: var(--measure);
}

/* ---- Links ---- */
a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--color-link-hover); }

/* ---- Fokus-Sichtbarkeit (WCAG 2.2) ---- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Selektion ---- */
::selection {
  background-color: var(--color-primary-tint-2);
  color: var(--color-text);
}

/* ---- Skip-Link ---- */
.skip-link {
  position: absolute;
  inset-inline-start: var(--space-16);
  top: var(--space-16);
  z-index: 1000;
  padding: var(--space-12) var(--space-24);
  background-color: var(--color-primary);
  color: var(--color-text-on-primary);
  border-radius: var(--radius-md);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform var(--dur-fast) var(--ease-standard);
}
.skip-link:focus {
  transform: translateY(0);
  color: var(--color-text-on-primary);
}

/* ---- Bildschirmleser-only ---- */
.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;
}

/* ---- Hilfsklassen Text ---- */
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }

.overline {
  display: inline-block;
  font-size: var(--fs-300);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-accent-strong);
  line-height: 1.2;
  margin-bottom: var(--space-12);
}

.lead {
  font-size: var(--fs-500);
  line-height: var(--lh-normal);
  color: var(--color-text-muted);
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
