/*
 * =============================================================================
 * SPEICHER 7 – BASE CSS
 * =============================================================================
 * Reset, @font-face, Body-Defaults, Typografie-Hierarchie, globale Utilities.
 * Importiert nach tokens.css, vor layout.css und components.css.
 *
 * FONT-SELBST-HOSTING (DSGVO-konform):
 *   Variable Fonts – heruntergeladen von fonts.gstatic.com (Google Fonts CDN).
 *   Beide Fonts sind variable Fonts: ein File deckt alle Gewichte ab.
 *
 *   assets/fonts/inter/
 *     inter-latin.woff2       (47 KB – latin, Gewichte 400–600)
 *     inter-latin-ext.woff2   (83 KB – latin-ext inkl. Sonderzeichen)
 *   assets/fonts/playfair/
 *     playfair-latin.woff2      (38 KB – latin, Gewichte 600–700)
 *     playfair-latin-ext.woff2  (20 KB – latin-ext)
 * =============================================================================
 */

/* ─────────────────────────────────────────────────────────────────────────────
   @FONT-FACE DECLARATIONS
───────────────────────────────────────────────────────────────────────────── */

/* Playfair Display – latin-ext (Sonderzeichen) */
@font-face {
  font-family: 'Playfair Display';
  src: url('../assets/fonts/playfair/playfair-latin-ext.woff2') format('woff2');
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Playfair Display – latin */
@font-face {
  font-family: 'Playfair Display';
  src: url('../assets/fonts/playfair/playfair-latin.woff2') format('woff2');
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Inter – latin-ext */
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter/inter-latin-ext.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Inter – latin */
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter/inter-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


/* ─────────────────────────────────────────────────────────────────────────────
   RESET
───────────────────────────────────────────────────────────────────────────── */

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

html {
  font-size: 100%; /* 16px Browser-Standard */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Bilder */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* Formulare */
input,
button,
textarea,
select {
  font: inherit;
}

/* Interaktive Elemente */
button {
  cursor: pointer;
  background: none;
  border: none;
}

/* Listen */
ul,
ol {
  list-style: none;
}

/* Tabellen */
table {
  border-collapse: collapse;
  border-spacing: 0;
}


/* ─────────────────────────────────────────────────────────────────────────────
   TYPOGRAFIE-HIERARCHIE
───────────────────────────────────────────────────────────────────────────── */

h1,
h2 {
  font-family: var(--font-headline);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-primary);
}

h3,
h4,
h5,
h6 {
  font-family: var(--font-body);
  font-weight: 600;
  line-height: var(--leading-snug);
  color: var(--color-text);
}

/* Fluid-Größen via clamp(): skaliert flüssig zwischen den Breakpoints */
h1 {
  font-size: clamp(2rem, 5vw, var(--text-4xl));
}

h2 {
  font-size: clamp(1.625rem, 3.5vw, var(--text-3xl));
  margin-bottom: var(--space-sm);
}

h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-xs);
}

h4 {
  font-size: var(--text-lg);
}

h5,
h6 {
  font-size: var(--text-base);
}

p {
  max-width: 70ch;
  margin-bottom: var(--space-md);
}

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

/* Overline / Label */
.overline {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-xs);
}

/* Lead-Text */
.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  max-width: 60ch;
}

/* Small / Caption */
small,
.text-sm {
  font-size: var(--text-sm);
}

.text-xs {
  font-size: var(--text-xs);
}

.text-muted {
  color: var(--color-text-muted);
}


/* ─────────────────────────────────────────────────────────────────────────────
   LINKS
───────────────────────────────────────────────────────────────────────────── */

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}


/* ─────────────────────────────────────────────────────────────────────────────
   FOCUS STYLES (Accessibility – WCAG 2.1 AA)
───────────────────────────────────────────────────────────────────────────── */

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* Sichtbaren Fokus für Elemente, die :focus-visible nicht unterstützen */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}


/* ─────────────────────────────────────────────────────────────────────────────
   HORIZONTALE LINIE
───────────────────────────────────────────────────────────────────────────── */

hr {
  border: none;
  border-top: var(--border-width) solid var(--color-border);
  margin-block: var(--space-xl);
}


/* ─────────────────────────────────────────────────────────────────────────────
   ACCESSIBILITY UTILITIES
───────────────────────────────────────────────────────────────────────────── */

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

/* Skip-Link für Tastaturnavigation */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  z-index: calc(var(--z-banner) + 1);
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-sm);
  outline: 2px solid var(--color-accent);
}
