/* Basis-Styles, übernommen aus docs/design/base.css (MZLA-Website).
   Angepasst fürs Portal: Schriftpfade unter /static/fonts/, ohne
   Einblenden beim Scrollen (braucht ein Skript), ohne Website-Selektoren.
   Alle Farben, Größen und Abstände kommen aus tokens.css. Portal-eigene
   Komponenten stehen in portal.css. */

/* ---- Schrift: Lexend (SIL OFL), lokal ausgeliefert, kein externer Abruf ---- */
@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/static/fonts/lexend-latin.woff2') format('woff2');
  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;
}
@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/static/fonts/lexend-latin-ext.woff2') format('woff2');
  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;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---- Grundlayout ---- */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-weight: var(--weight-regular);
  color: var(--color-text);
  background: var(--color-surface);
}
main { flex: 1 0 auto; }
main:focus { outline: none; }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--page-padding);
}

/* ---- Überschriften ---- */
h1, h2, h3, h4 {
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-brand);
  text-wrap: balance;
  hyphens: auto;
  overflow-wrap: break-word;
}
h1 { font-size: clamp(var(--text-3xl), 4vw, var(--text-4xl)); line-height: var(--leading-tight); }
h2 { font-size: clamp(var(--text-xl), 2.4vw, var(--text-2xl)); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

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

/* ---- Fokus: überall deutlich sichtbar ---- */
:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  z-index: 1000;
  padding: var(--space-3) var(--space-5);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-pill);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; color: var(--color-on-primary); }

/* ---- Fließtext (redaktionelle Inhalte) ---- */
.prose {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  max-width: 62ch;
}
.prose > * + * { margin-top: var(--space-4); }
.prose > h2 { margin-top: var(--space-7); }
.prose > h3 { margin-top: var(--space-6); }
.prose > h2 + *, .prose > h3 + * { margin-top: var(--space-3); }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: var(--space-2); }
.prose strong { font-weight: var(--weight-semibold); }
.prose a { overflow-wrap: anywhere; }

/* Tabellen im Fließtext: auf schmalen Bildschirmen innerhalb der Tabelle
   horizontal scrollbar statt die ganze Seite zu verbreitern */
.table-wrap { overflow-x: auto; }
@media (max-width: 47.99em) {
  .prose table { display: block; overflow-x: auto; }
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-base);
  line-height: var(--leading-snug);
}
.prose caption {
  padding-bottom: var(--space-3);
  text-align: left;
  font-weight: var(--weight-semibold);
  color: var(--color-text-brand);
}
.prose th, .prose td {
  padding: var(--space-3);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-border);
}
.prose thead th {
  color: var(--color-on-primary);
  background: var(--color-primary);
  font-weight: var(--weight-semibold);
}
.prose tbody tr:nth-child(even) { background: var(--color-surface-raised); }
.prose td ul { padding-left: 1.1em; }
.prose td li + li { margin-top: var(--space-1); }
.prose small, .footnote { font-size: var(--text-sm); color: var(--color-text-secondary); }

/* Hervorgehobener Hinweis im Fließtext – in Markdown mit „>“ am Zeilenanfang */
.note,
.prose blockquote {
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface-tint);
  border-left: 4px solid var(--color-secondary);
  border-radius: var(--radius-md);
}
.note > * + *,
.prose blockquote > * + * { margin-top: var(--space-2); }

/* ---- Buttons ---- */
.button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  text-decoration: none;
  color: var(--color-on-primary);
  background: var(--color-primary);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-pill);
}
.button:hover { color: var(--color-on-primary); background: var(--color-primary-hover); border-color: var(--color-primary-hover); }

/* Drück-Rückmeldung */
.button { transition: transform var(--duration-press) var(--ease-out); }
.button:active { transform: scale(0.97); }
@media (prefers-reduced-motion: reduce) {
  .button:active { transform: none; }
}

/* ---- Druck ---- */
@media print {
  .skip-link, .kopf form, .band form { display: none !important; }
}
