/* ==========================================================================
   ERZEUGT — nicht von Hand ändern.
   Quelle: website/css/base.css
   Neu erzeugen mit: node build/theme.mjs
   ========================================================================== */

/* ==========================================================================
   Base — Schriftarten, Reset, Grundtypografie, globale Elementstile
   ========================================================================== */

/* --- Schrift: Albert Sans, selbst gehostet --------------------------------
   Vom Verein bereitgestellte Dateien (assets/fonts/, lateinische Teilmenge).
   Selbst gehostet heißt: keine Verbindung zu Google Fonts, keine Übertragung
   von IP-Adressen an Dritte.                                              */

@font-face {
  font-family: "Albert Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/albert-sans-v4-latin-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Albert Sans";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/albert-sans-v4-latin-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Albert Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/albert-sans-v4-latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Albert Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/albert-sans-v4-latin-700.woff2") format("woff2");
}
@font-face {
  font-family: "Albert Sans";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/albert-sans-v4-latin-800.woff2") format("woff2");
}
@font-face {
  font-family: "Albert Sans";
  font-style: italic;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/albert-sans-v4-latin-800italic.woff2") format("woff2");
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem; /* fixierter Header */
}

body {
  margin: 0;
  background-color: var(--sv-color-background);
  color: var(--sv-color-text);
  font-family: var(--sv-font-body);
  font-size: var(--sv-text-base);
  line-height: var(--sv-leading-normal);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

/* --- Überschriften ------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--sv-space-16);
  font-family: var(--sv-font-heading);
  font-weight: var(--sv-weight-semibold);
  line-height: var(--sv-leading-tight);
  color: var(--sv-color-primary);
  letter-spacing: -0.01em;
  text-wrap: balance;
  /* Lange deutsche Komposita (z. B. „Wettkampfergebnisse“) sauber trennen
     statt mitten im Wort umbrechen. Erfordert lang="de" am <html>.

     `break-word` ist das Sicherheitsnetz darunter: Reicht die Silbentrennung
     nicht — weil der Browser kein deutsches Trennwörterbuch geladen hat oder
     das Wort auch getrennt zu lang bleibt —, bricht das Wort statt aus dem
     Container zu laufen. Es greift NUR in diesem Fall; solange ein Wort
     passt oder trennbar ist, ändert sich nichts.

     Bewusst nicht `anywhere`: Das würde die Mindestbreite (min-content) auf
     ein Zeichen senken und Rasterspalten schrumpfen lassen. `break-word`
     lässt die Mindestbreite unangetastet. */
  hyphens: auto;
  overflow-wrap: break-word;
}

h1 { font-size: var(--sv-text-4xl); }
h2 { font-size: var(--sv-text-3xl); }
h3 { font-size: var(--sv-text-xl); }
h4 { font-size: var(--sv-text-lg); }
h5, h6 { font-size: var(--sv-text-base); }

p, ul, ol, dl, figure, table, blockquote {
  margin: 0 0 var(--sv-space-16);
}

p { max-width: 68ch; }

ul, ol { padding-left: 1.35em; }

/* Anschriften stehen im Layout wie Fließtext, nicht kursiv */
address { font-style: normal; }
li + li { margin-top: var(--sv-space-8); }

/* Listen, die ihr Layout selbst regeln, regeln auch ihre Abstände selbst —
   über `gap`. Der Fließtext-Abstand oben würde jedes Element AUSSER dem
   ersten zusätzlich nach unten schieben; die Kacheln stünden dann nicht
   mehr auf einer Linie.

   Bewusst an EINER Stelle statt als `li { margin: 0 }` in jeder Komponente.

   Der Selektor spiegelt absichtlich `li + li`: Beide haben die Spezifität
   (0,0,2), und die spätere Regel gewinnt. `:where()` steuert nichts zur
   Spezifität bei — stünde hier nur `> li`, wäre die Regel schwächer als
   `li + li` und wirkungslos. Komponentenregeln wie `.badge-list li { margin: 0 }`
   sind spezifischer und behalten Vorrang.

   `build/check-designsystem.mjs` prüft, dass jede neue Raster- oder
   Flex-Liste hier auftaucht. */
:where(
  .grid, .stats, .media-grid, .gallery-grid, .header-mosaic, .hist-facts,
  .hist-media-grid, .chapter-nav, .spacing-scale, .logo-grid, .quick-links,
  .event-list, .search-results, .card__media-chips, .badge-list,
  .breadcrumb__list, .jump-nav__list, .nav-primary__list, .page-toc__list,
  .pagination__list, .person-card__roles, .sport-tile__meta, .marquee__group
) > li + li { margin-top: 0; }

small { font-size: var(--sv-text-sm); }

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

/* --- Links --------------------------------------------------------------- */

a {
  color: var(--sv-color-action);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover { color: var(--sv-color-action-dark); }

.theme-dark a { color: var(--sv-color-text-inverse); }

/* --- Fokus: immer sichtbar ----------------------------------------------- */

:focus-visible {
  outline: var(--sv-focus-width) solid var(--sv-color-focus);
  outline-offset: var(--sv-focus-offset);
  border-radius: var(--sv-radius-sm);
}

/* Browser ohne :focus-visible-Unterstützung */
:focus:not(:focus-visible) { outline: none; }

/* --- Medien -------------------------------------------------------------- */

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

svg { fill: none; }

figure { margin: 0; }

/* Bildunterschrift steht immer mit etwas Abstand unter dem Bild */
figcaption { margin-top: var(--sv-space-16); }

/* --- Formularelemente: Grundlage ---------------------------------------- */

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

button { cursor: pointer; }

/* --- Tabellen ------------------------------------------------------------ */

table {
  width: 100%;
  border-collapse: collapse;
}

/* --- Hilfsklassen -------------------------------------------------------- */

.visually-hidden:not(:focus):not(:active) {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--sv-space-8);
  left: var(--sv-space-8);
  z-index: var(--sv-z-skiplink);
  transform: translateY(-200%);
  padding: var(--sv-space-16) var(--sv-space-24);
  background: var(--sv-color-surface);
  color: var(--sv-color-primary);
  font-weight: var(--sv-weight-semibold);
  border-radius: var(--sv-radius-sm);
  box-shadow: var(--sv-shadow-md);
  transition: transform var(--sv-transition-fast);
}

.skip-link:focus { transform: translateY(0); }

[hidden] { display: none !important; }

/* --- Reduzierte Bewegung ------------------------------------------------- */

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

/* --- Druck --------------------------------------------------------------- */

@media print {
  .site-header, .site-footer, .skip-link, .filter-bar { display: none; }
  body { background: #fff; }
}
