/* ==========================================================================
   BUHA — Basis / Reset / Typografie-Skala
   Mobile-first. Basisregeln gelten für xs; min-width-Queries erweitern.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* verhindert horizontalen Scroll durch das off-canvas Mobile-Menü
     (position:fixed + translateX(100%)) */
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: 1rem; /* 16px Basis */
  line-height: 1.65;
  color: var(--c-ink-700);
  background-color: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Platz für die mobile Bottom-Bar (Designsystem 6.11) */
  padding-bottom: 64px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1200px) {
  body {
    padding-bottom: 0; /* ab 1200px keine Bottom-Bar mehr */
  }
}

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

a {
  color: var(--c-navy-600);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--c-navy-700);
}

ul,
ol {
  list-style: none;
}

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

button {
  cursor: pointer;
  background: none;
  border: none;
}

/* --- Sichtbarer Fokusring (Designsystem 13/14) ---------------------------- *
 * E-7: nutzt das Design-Token --focus-ring (0 0 0 3px rgba(30,74,140,.45)).
 * outline bleibt zusätzlich als Fallback (z. B. Windows-Kontrastmodus, wo
 * box-shadow unterdrückt wird) und transparent, um Doppel-Ringe zu vermeiden. */
:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}

/* Programmatisch fokussierte, nicht-interaktive Elemente (Überschriften,
   #main, Akkordeon-Panels) erhalten KEINEN sichtbaren Ring — der Fokus dient
   nur der Screenreader-Ansage (z. B. beim Schrittwechsel im Formular). */
h1[tabindex="-1"]:focus,
h2[tabindex="-1"]:focus,
h3[tabindex="-1"]:focus,
h4[tabindex="-1"]:focus,
[id="main"]:focus,
.accordion-panel[tabindex="-1"]:focus {
  outline: none;
  box-shadow: none;
}

/* --- Skip-Link (Designsystem 6.2 / 13) ------------------------------------ */
.skip-link {
  position: absolute;
  left: 8px;
  top: -64px;
  z-index: var(--z-toast);
  background: var(--c-navy-700);
  color: #fff;
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-sm);
  font-weight: 600;
  transition: top 150ms ease-out;
}

.skip-link:focus {
  top: 8px;
  color: #fff;
}

/* --- Nur für Screenreader ------------------------------------------------- */
.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;
}

/* ==========================================================================
   Typografie-Skala (Designsystem 3.2) — Mobil-Werte; Desktop in Media-Query.
   ========================================================================== */

h1,
h2,
h3,
h4 {
  color: var(--c-navy-700);
  font-weight: 500;
  line-height: 1.2;
}

/* Display (Hero-H1) */
.t-display {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 2.25rem; /* 36px */
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--c-navy-700);
}

/* H1 */
h1,
.t-h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 2rem; /* 32px */
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* H2 */
h2,
.t-h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.625rem; /* 26px */
  line-height: 1.2;
  letter-spacing: -0.005em;
}

/* H3 */
h3,
.t-h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.3125rem; /* 21px */
  line-height: 1.3;
}

/* H4 */
h4,
.t-h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.125rem; /* 18px */
  line-height: 1.35;
}

/* Body-L (Lead/Intro) */
.t-lead {
  font-size: 1.125rem; /* 18px */
  line-height: 1.6;
  color: var(--c-ink-700);
}

/* Body-S */
.t-small {
  font-size: 0.9375rem; /* 15px */
  line-height: 1.55;
}

/* Caption / Label */
.t-caption {
  font-size: 0.8125rem; /* 13px */
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

/* Overline / Kicker (Designsystem 3.3) */
.t-overline {
  display: inline-block;
  font-size: 0.75rem; /* 12px mobil */
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-amber-600);
  margin-bottom: var(--s-3);
}

/* Fließtext-Absätze */
p {
  margin-bottom: var(--s-4);
}

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

/* Lesetext-Spalte: max. ~70 Zeichen (Designsystem 3.3) */
.t-measure {
  max-width: 36rem;
}

/* --- Aufzählungen mit Custom-Bullet (Designsystem 3.3) -------------------- */
.list-checks,
.list-bullets {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.list-bullets li {
  position: relative;
  padding-left: var(--s-5);
}

/* 6px-Quadrat in Bernstein */
.list-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  background: var(--c-amber-500);
}

/* Häkchen-Liste (Trust-Aufzählungen) */
.list-checks li {
  position: relative;
  padding-left: var(--s-7);
  line-height: 1.55;
}

.list-checks li .icon {
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--c-success);
}

/* --- Strong / Highlight --------------------------------------------------- */
strong,
b {
  font-weight: 600;
  color: var(--c-ink-900);
}

/* --- Tabellen (schlicht) -------------------------------------------------- */
.table-simple {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.table-simple th,
.table-simple td {
  text-align: left;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--c-line);
}

.table-simple th {
  font-weight: 600;
  color: var(--c-navy-700);
  background: var(--c-navy-050);
}

/* --- Inline-Code / Platzhalter-Marker ------------------------------------- */
code,
.placeholder-token {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* Sichtbarer Platzhalter-Marker für Redaktion (z. B. [STADT]) */
.placeholder-token {
  background: var(--c-amber-100);
  color: var(--c-amber-600);
  padding: 0 4px;
  border-radius: 4px;
  font-weight: 600;
}

/* ==========================================================================
   Desktop-Typografie (Designsystem 3.2, 12)
   ========================================================================== */
@media (min-width: 1024px) {
  .t-display {
    font-size: 3.5rem; /* 56px */
  }

  h1,
  .t-h1 {
    font-size: 2.75rem; /* 44px */
  }

  h2,
  .t-h2 {
    font-size: 2.125rem; /* 34px */
  }

  h3,
  .t-h3 {
    font-size: 1.5rem; /* 24px */
  }

  h4,
  .t-h4 {
    font-size: 1.1875rem; /* 19px */
  }

  .t-lead {
    font-size: 1.25rem; /* 20px */
  }

  .t-overline {
    font-size: 0.8125rem; /* 13px */
  }
}

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