/* ============================================================================
   base.css – Rada Kobiet Gminy Mirsk
   Reset + Design-Tokens + Utility-Grundlagen
   Stand: 13.09.2026 (Stufe 2) · Quelle: design/TOKENS.md, design/DESIGN.md
   Produktions-Hinweis (SPEC §7): die drei Stylesheets werden für den Live-Betrieb
   zu EINES minimierten Stylesheets zusammengeführt; @import wird nicht verwendet.
   ============================================================================ */

/* ---------- Reset (klein, bewährt) ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  /* Basis-Scroll-Anker: Skip-Link-Ziel */
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

/* Tabellen: nur Inhalt */
table {
  border-collapse: collapse;
  width: 100%;
}

/* ---------- Design-Tokens (Single-Source: design/TOKENS.md) ---------- */
:root {
  /* Farben – Brand aus logo.jpg (Pixel-Mediane, nicht geraten) */
  --brand-navy: #144585;        /* exaktes Logo-Navy */
  --brand-navy-deep: #0e2f57;   /* Hover/Footer-Fläche */
  --primary: #123e75;           /* Headlines, primäre Links (Navy, UI-geeignet) */
  --secondary: #5b6b84;         /* Sekundärtext, Quellen */
  --tertiary: #b4543f;          /* Interaktion (Koralle, abgedunkelt) */
  --neutral: #faf8f4;           /* Seiten-Hintergrund, warmes Off-White */
  --surface: #ffffff;           /* Karten, Header */
  --neutral-text: #2a2f38;      /* Fließtext */
  --muted: #5b6b84;             /* = secondary, semantic */
  --border: #d8d2c6;
  --brand-sand: #f3ede3;        /* Badges, dezent Flächen */
  --on-white: #ffffff;
  --error-text: #8c2b1b;        /* Formular-Fehler als Text, ≥4.5:1 auf Sand */
  --focus-ring: var(--tertiary);

  /* Typografie – System-Font-Stack (SPEC §7: keine externen Fonts) */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-h1: clamp(2rem, 1.5rem + 2.5vw, 2.5rem);
  --text-h2: clamp(1.5rem, 1.25rem + 1.25vw, 1.75rem);
  --text-h3: 1.25rem;
  --text-body: 1rem;
  --text-small: 0.875rem;
  --text-label: 0.75rem;

  /* Abstände – 4-px-Basis */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px (mobil) */
  --space-2xl: 3rem;     /* 48px */

  /* Radien */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Elevation – Default: keiner (SPEC §10) */
  --shadow-none: none;
  --shadow-1: 0 1px 3px rgba(14, 47, 87, 0.12);

  /* Layout */
  --container-max: 72rem;   /* 1152px */
  --gutter: var(--space-md);
  --header-h: 4rem;

  /* Bewegung */
  --transition-fast: 150ms ease;
}

@media (min-width: 48em) {
  :root {
    --space-xl: 3rem;   /* 48px Desktop */
    --space-2xl: 6rem;  /* 96px Desktop */
  }
}

/* ---------- Basis-Elemente ---------- */
body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  color: var(--neutral-text);
  background-color: var(--neutral);
}

h1,
h2,
h3 {
  font-family: var(--font-sans);
  color: var(--primary);
  line-height: 1.15;
  overflow-wrap: break-word;
}

h1 {
  font-size: var(--text-h1);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
}

h2 {
  font-size: var(--text-h2);
  font-weight: 600;
  margin-bottom: var(--space-md);
}

h3 {
  font-size: var(--text-h3);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: var(--space-sm);
}

p {
  margin-bottom: var(--space-md);
  overflow-wrap: break-word;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--tertiary);
}

/* Kleine Schrift / Metadaten */
.small {
  font-size: var(--text-small);
  color: var(--muted);
}

/* Kapital-Label (nur mit Text, nie nur Farbe) */
.label-caps {
  font-size: var(--text-label);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary);
}

/* Maschinenlesbare Datums-Pill (SPEC §4.4: time-Attribut + Text) */
.date-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: var(--brand-sand);
  color: var(--primary);
  border-radius: var(--radius-full);
  padding: var(--space-xs) var(--space-md);
  font-size: var(--text-small);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

/* Quellenangabe (ZG-2: belegbar, SPEC §3) */
.source-note {
  font-size: var(--text-small);
  color: var(--muted);
  border-left: 2px solid var(--border);
  padding-left: var(--space-sm);
  margin-top: var(--space-md);
}

/* ---------- Fokus (WCAG 2.1 AA: sichtbar, kontrastreich, nie outline:none) ---------- */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- Skip-Link (unsichtbar, bei Fokus sichtbar) ---------- */
.skip-link {
  position: absolute;
  left: var(--space-md);
  top: -100px;
  z-index: 100;
  background: var(--surface);
  color: var(--primary);
  font-weight: 600;
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--tertiary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-sm);
}

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

/* ---------- Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.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;
}
