/* ============================================================
   umschulungslotse — Design-Tokens
   SSOT der Regeln: docs/design-richtlinien.md
   🔴 Farbwerte NIE direkt in eine Seite schreiben, immer über Token.
   Alle Kombinationen sind auf WCAG AA gerechnet (Werte in Klammern).
   ============================================================ */

:root {
  /* Marke */
  --brand: #0f5e63; /* Petrol — 7.12:1 auf --bg */
  --brand-dark: #0a4448; /* Hover */
  --brand-soft: #e7f0f0; /* ruhige Fläche */

  /* Aktion — nur EIN Hauptknopf pro Bildschirm */
  --cta: #a85d15; /* mit Weiß 4.95:1 */
  --cta-dark: #8a4b10; /* Hover */
  --cta-soft: #e8a13d; /* NUR als Fläche mit dunklem Text (6.74:1), nie als Textfarbe */

  /* Grundflächen */
  --bg: #faf9f6; /* Off-White, wärmer als reines Weiß */
  --surface: #ffffff;
  --line: #e2e0d9;

  /* Text */
  --fg: #1f2933; /* 14.01:1 auf --bg */
  --muted: #5a6b7b; /*  5.22:1 auf --bg */

  /* Ampel — ausschließlich für Förderchance, nie dekorativ */
  --ampel-gruen: #1a7f4b; /* 4.77:1 */
  --ampel-gelb: #8a5d0f; /* 5.46:1 */
  --ampel-rot: #a32e1a; /* 6.73:1 */
  --ampel-gruen-bg: #edf8f2;
  --ampel-gelb-bg: #fdf6e8;
  --ampel-rot-bg: #fbefec;

  /* Form */
  --radius: 14px;
  --radius-sm: 10px;
  --wrap: 1080px;
  --wrap-text: 760px;

  /* Schrift — Source Sans 3, self-hosted, keine fremden Server */
  --font:
    "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --fs-base: 18px; /* Basis, im Fließtext nie unter 16px */
  --lh-base: 1.65;

  --shadow-cta: 0 2px 10px rgba(168, 93, 21, 0.24);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #5fb3b8;
    --brand-dark: #7fc7cb;
    --brand-soft: #14262a;

    --cta: #e8a13d; /* im Dunkeln trägt der helle Ton, mit dunklem Text */
    --cta-dark: #f0b45e;
    --cta-soft: #4a3517;

    --bg: #12171c;
    --surface: #181e24;
    --line: #2a333c;

    --fg: #e9eef4;
    --muted: #9dacba;

    --ampel-gruen: #4ec98a;
    --ampel-gelb: #e0b054;
    --ampel-rot: #e8836c;
    --ampel-gruen-bg: #10201a;
    --ampel-gelb-bg: #1f1a10;
    --ampel-rot-bg: #221512;

    --shadow-cta: 0 2px 10px rgba(0, 0, 0, 0.4);
  }
}

/* Manuelle Wahl im Footer. Gewinnt über die Systemeinstellung. */
:root[data-theme="dark"] {
    --brand: #5fb3b8;
    --brand-dark: #7fc7cb;
    --brand-soft: #14262a;

    --cta: #e8a13d; /* im Dunkeln trägt der helle Ton, mit dunklem Text */
    --cta-dark: #f0b45e;
    --cta-soft: #4a3517;

    --bg: #12171c;
    --surface: #181e24;
    --line: #2a333c;

    --fg: #e9eef4;
    --muted: #9dacba;

    --ampel-gruen: #4ec98a;
    --ampel-gelb: #e0b054;
    --ampel-rot: #e8836c;
    --ampel-gruen-bg: #10201a;
    --ampel-gelb-bg: #1f1a10;
    --ampel-rot-bg: #221512;

    --shadow-cta: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* Selbst gehostete Schrift. Variabel, damit ein Datei-Abruf alle Schnitte trägt. */
@font-face {
  font-family: "Source Sans 3";
  src: url("./fonts/SourceSans3-VariableFont_wght.woff2")
    format("woff2-variations");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

/* Grundlagen, die jede Seite erbt */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand);
}

/* Touch-Ziele mindestens 44px — gilt auch für Fußzeilen-Links */
a,
button {
  min-height: 44px;
}
a:not(.inline),
button {
  display: inline-flex;
  align-items: center;
}
p a,
li a,
td a {
  display: inline;
  min-height: 0;
}

/* Sichtbarer Fokus, nicht wegoptimieren */
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Ein Teil der Zielgruppe hat das aus gutem Grund aktiviert */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   Farbmodus-Umschalter im Fußbereich
   Ohne JavaScript bleibt er verborgen (data-theme-ready fehlt dann),
   damit niemand einen toten Knopf sieht — die Systemeinstellung
   greift in dem Fall weiterhin.
   ============================================================ */
.theme-toggle {
  display: none;
}
:root[data-theme-ready] .theme-toggle {
  display: inline-flex;
  margin: 0 0 18px;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 15px;
  color: var(--muted);
  font: inherit;
  font-size: 14.5px;
  cursor: pointer;
  min-height: 44px;
}
.theme-toggle:hover {
  color: var(--fg);
  border-color: var(--muted);
}
.theme-toggle svg {
  width: 17px;
  height: 17px;
  flex: none;
}
/* Es wird immer das Symbol des ZIELS gezeigt, nicht des aktuellen Zustands. */
.theme-toggle .i-mond {
  display: block;
}
.theme-toggle .i-sonne {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .i-mond,
:root:not([data-theme="light"]) .theme-toggle .i-mond {
  display: block;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-mond {
    display: none;
  }
  :root:not([data-theme="light"]) .theme-toggle .i-sonne {
    display: block;
  }
}
:root[data-theme="dark"] .theme-toggle .i-mond {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .i-sonne {
  display: block;
}
:root[data-theme="light"] .theme-toggle .i-mond {
  display: block;
}
:root[data-theme="light"] .theme-toggle .i-sonne {
  display: none;
}
