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

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
p a, .link { color: var(--primary-text); text-decoration: underline; text-underline-offset: 2px; }

h1 { font-size: var(--text-h1); line-height: 2rem; font-weight: 600; letter-spacing: -0.015em; }
h2 { font-size: var(--text-h2); line-height: 1.75rem; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: var(--text-h3); line-height: 1.5rem; font-weight: 600; }

.tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.text-sm { font-size: var(--text-sm); line-height: 1.25rem; }
.text-xs { font-size: var(--text-xs); line-height: 1rem; }

/* Fokus: einheitlicher Ring, nur bei Tastaturbedienung */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* hidden-Attribut gewinnt immer, auch gegen display-Regeln von Komponenten */
[hidden] { display: none !important; }

/* Icons (Lucide-Sprite) */
.icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-lg { width: 20px; height: 20px; }

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

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -48px;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--space-4); }

::selection { background: var(--primary-subtle); color: var(--text); }
