/* ============================================================
   FAZ OSC — Design Tokens
   Source: Figma "FAZ Styleguide" (Mini Styleguide) via MCP.
   Primitives -> Semantic tokens. Light/dark aware.
   Components should consume SEMANTIC tokens (--c-*, --t-*, --s-*),
   not raw primitives, so theming stays in one place.
   ============================================================ */

:root {
  /* ---- Font families ---- */
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans:  "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* ---- Brand primitives ---- */
  --faz-darkblue: #110A35;
  --faz-grey:     #E8EDEE;   /* FAZ-Grey/light (dark: #323D46) */
  --faz-grey-dark: #323D46;  /* FAZ-Grey/dark — permanent dark panels (e.g. .osc-promo) */
  --faz-gold:     #8C7421;   /* "FAZ-Störer Permanent" — same in both modes */
  --white:        #FFFFFF;
  --mg-dark:      #212529;

  /* Grey ramp (light) — Figma "MG-Grey-*" */
  --grey-100: #393939;
  --grey-200: #555555;
  --grey-300: #717171;   /* Platzhaltertext Input Felder */
  --grey-400: #8E8E8E;   /* Outline Input Felder */
  --grey-500: #AAAAAA;
  --grey-600: #C6C6C6;
  --grey-700: #E3E3E3;   /* Trenner */
  --grey-900: #F7F7F7;   /* Außerhalb der Website / hinter Anzeigen */

  /* Signal + status primitives */
  --signal-green: #478517;   /* Graphen, positives Feedback */
  --signal-red:   #C60000;   /* Graphen */
  --faz-error:    #A85100;   /* Error-Texte und -Outlines von Inputfeldern */

  /* Topic tints (light) — good backgrounds for Hinweis banners */
  --topic-01: #E7F3EE;  /* green  */
  --topic-02: #FBF2E9;  /* warm   */
  --topic-03: #EBEBE5;  /* neutral*/
  --topic-04: #E7EFF5;  /* blue   */

  /* ---- Semantic colour tokens (LIGHT is the default) ---- */
  --c-bg:            #FFFFFF;   /* White/light */
  --c-surface:       #FFFFFF;
  --c-surface-2:     #F7F7F7;   /* Grey-900 — subtle raised / zebra */
  --c-surface-grey:  #E8EDEE;   /* FAZ-Grey — ground for "Primary on FAZ Grey" */
  --c-overlay:       rgba(0, 0, 0, 0.2);   /* verified: OSC dialogue overlay */

  --c-text:          var(--mg-dark);   /* MG-Dark — Schriftfarbe, also all headlines */
  --c-text-muted:    var(--grey-200);
  --c-text-subtle:   var(--grey-300);
  --c-text-on-brand: #FFFFFF;
  --c-text-disabled: #AAAAAA;   /* "Neues OSC": text/interactive/disabled (ended subscriptions) */
  --c-divider:       #E3E3E3;   /* "Neues OSC": faz-color-border-default (dividers in menu, cards, detail) */

  --c-primary:       var(--faz-darkblue);   /* FAZ-Darkblue/light */
  --c-accent:        var(--faz-gold);

  --c-border:        #E3E3E3;   /* Grey-700 — Trenner */
  --c-border-strong: #C6C6C6;   /* Grey-600 */
  --c-field-border:  #8E8E8E;   /* Grey-400 — Outline Input Felder */
  --c-field-bg:      #FFFFFF;
  --c-focus:         var(--faz-darkblue);   /* focus ring (not specified in Figma) */

  /* Buttons (verified from styleguide Button component):
     "Primary"            = FAZ-Grey fill + darkblue text  (default, also on darkblue)
     "Primary on FAZ Grey"= darkblue fill + white text     (on FAZ-Grey surfaces) */
  --c-btn-bg:        #E8EDEE;
  --c-btn-fg:        #110A35;
  --c-btn-brand-bg:  #110A35;
  --c-btn-brand-fg:  #FFFFFF;
  --c-btn-line:      #212529;   /* secondary border, tertiary + underline text */
  --c-btn-strong-bg: #110A35;   /* main action in OSC flows (F.A.Z. prototype): dark in light mode … */
  --c-btn-strong-fg: #FFFFFF;
  --c-btn-strong-disabled: #A1A4B1;   /* "Neues OSC": background/interactive/button-primary/disabled */

  --c-success:    var(--signal-green);
  --c-danger:     var(--signal-red);
  --c-warning:    var(--faz-error);
  --c-info:       var(--faz-darkblue);

  --c-success-bg: #EDF7ED;   /* F.A.Z. prototype status strip (Figma topic-01 is #E7F3EE) */
  --c-warning-bg: var(--topic-02);
  --c-neutral-bg: var(--topic-03);
  --c-info-bg:    var(--topic-04);
  --c-danger-bg:  #FBE9E9;   /* project extension — not in Figma */
  --c-success-text: #1B5E20;   /* status texts on the tinted strips (F.A.Z. prototype) */
  --c-warning-text: #561E1E;
  --c-neutral-text: #5D4D19;

  /* ---- Shadows ---- */
  --shadow-soft:    0 0 75px rgba(17, 10, 53, 0.10);   /* Figma "shadow" */
  --shadow-card:    0 1px 2px rgba(17, 10, 53, 0.06), 0 8px 24px rgba(17, 10, 53, 0.08);
  --shadow-panel:   0 2px 8px rgba(17, 10, 53, 0.06);   /* OSC detail panel (F.A.Z. prototype) */
  --shadow-product: 0 10px 21px rgba(0, 0, 0, 0.15);   /* Figma "Product Shadow Light" */
  --shadow-modal:   0 4px 37px rgba(0, 0, 0, 0.25);   /* verified: OSC dialog */

  /* ---- Radii ----
     Verified against Figma: the system radius is a subtle 2px, used on
     BaseButton, Input, Checkbox and Teaser. Modals/dialogs are square (0).
     Larger radii in the Figma file belong to styleguide presentation
     furniture, not product components. */
  --r-sm:   2px;
  --r-md:   2px;
  --r-lg:   2px;
  --r-modal: 0;
  --r-pill: 2px;    /* status tags are rectangular chips, not pills */

  /* ---- Spacing scale (4pt) ---- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;

  /* ---- Layout ----
     Breakpoints (FAZ styleguide, verbatim):
       < 375           not supported ("kein Anspruch zu funktionieren")
       375 –  767      Mobile: kompakter Header, vertikales Layout, Touch
       768 –  999      Tablet: Hybrid — mobiler Header + Desktop-Teaserformate
      1000 – 1279      Desktop: detaillierter Header, große Bildformate
       ≥ 1280          Layout skaliert nicht mehr (Maximalbreite)
     Typo page: "Mobile 0–811px" / "Desktop 812px+" — the "M" text styles
     switch at 812px, NOT at the 768px layout breakpoint.
     Media queries can't read custom properties — use these literals:
       @media (min-width: 768px)   tablet+ (layout)
       @media (min-width: 812px)   "M" type styles
       @media (min-width: 1000px)  desktop+
     Raster (Teaser-Sammelseiten): 12 Spalten · 40px Margin · 28px Gutter
     → max content width 1280 − 2×40 = 1200px */
  --container:    1200px;
  --grid-margin:  40px;
  --grid-gutter:  28px;
  --measure:      65ch;
  --modal-width:  560px;

  /* ---- Z-index ---- */
  --z-header: 100;
  /* above the F.A.Z. header template (its sticky header covered dialogs at 1000, 2026-11-12) */
  --z-overlay: 100000;
  --z-modal: 100001;
  --z-toast: 100100;

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur:  180ms;

  /* ---- Type ramp (shorthand: weight size/line family) ----
     1:1 from the Figma variable set. "M" = the larger companion cut
     used from 812px ("Desktop 812px+" on the Typo page).
     Letter-spacing can't ride in the shorthand — apply separately where noted. */
  --t-headline-2:    500 24px/1.3  var(--font-serif);
  --t-headline-2-m:  500 50px/1.1  var(--font-serif);
  --t-headline-3:    500 22px/1.2  var(--font-serif);
  --t-subhead-1:     700 19px/1.5  var(--font-sans);
  --t-subhead-1-m:   700 22px/1.6  var(--font-sans);
  --t-subhead-2:     700 17px/1.3  var(--font-sans);
  --t-subhead-3:     700 15px/1.3  var(--font-sans);
  --t-subhead-3-m:   700 20px/1.3  var(--font-sans);
  --t-intro:         700 17px/1.6  var(--font-sans);
  --t-intro-m:       700 20px/1.6  var(--font-sans);
  --t-body-1:        400 17px/1.6  var(--font-serif);
  --t-body-1-m:      400 20px/1.6  var(--font-serif);
  --t-body-2-m:      400 18px/1.7  var(--font-sans);
  --t-teaser-2:      400 14px/1.4  var(--font-serif);
  --t-button:        600 14px/1.1  var(--font-sans);   /* ls -0.1px */
  --t-menu-item:     600 12px/1.4  var(--font-sans);   /* ls 0.1px */
  --t-meta-0:        400 15px/16px var(--font-sans);
  --t-meta-1:        700 14px/1.4  var(--font-sans);   /* italic variant exists */
  --t-meta-1-5:      600 14px/1.4  var(--font-sans);
  --t-meta-2:        400 14px/1.4  var(--font-sans);   /* italic + link variants */
  --t-meta-3:        400 10px/1.4  var(--font-sans);
  --t-overline-2-m:  400 17px/1.4  var(--font-sans);   /* ls 0.5px */
  --t-overline:      400 13px/1.1  var(--font-sans);   /* Overline 3, ls 0.2px */

  /* Project extensions — NOT in the Figma set, used for shell/doc text.
     Prefer the ramp above inside product UI. */
  --t-headline-1:    500 clamp(32px, 5vw, 50px)/1.1 var(--font-serif);
  --t-body-2:        400 16px/1.6  var(--font-sans);
}

/* ============================================================
   DARK THEME — 1:1 from the Figma "Farben Dark-Modus" column:
   White/dark #212529 (ground), MG-Dark/dark #FFFFFF (text),
   FAZ-Darkblue/dark #E8EDEE, FAZ-Grey/dark #323D46,
   Grey-200/dark #E3E3E3, Grey-300/dark #C6C6C6, Grey-400/dark #AAAAAA,
   Grey-600/dark #717171, Grey-700/dark #555555, Grey-900/dark #393939,
   TopicColor01–04/dark, Green/Red/Error dark signals.
   Dark buttons (Figma "Dark Mode" column): Primary stays FAZ-Grey +
   darkblue text; "on FAZ Grey" stays darkblue + white; lines go white.
   OS preference first, then explicit [data-theme] override
   (the toggle stamps data-theme on <html>, must win both ways).
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --c-bg:            #212529;
    --c-surface:       #212529;
    --c-surface-2:     #393939;
    --c-surface-grey:  #323D46;
    --c-overlay:       rgba(0, 0, 0, 0.5);

    --c-text:          #FFFFFF;
    --c-text-muted:    #E3E3E3;
    --c-text-subtle:   #C6C6C6;
    --c-text-on-brand: #110A35;   /* dark text on the light "primary" in dark mode */
    --c-text-disabled: #555555;
    --c-divider:       #393939;

    --c-primary:       #E8EDEE;

    --c-border:        #555555;
    --c-border-strong: #717171;
    --c-field-border:  #AAAAAA;
    --c-field-bg:      #212529;
    --c-focus:         #E8EDEE;

    --c-btn-bg:        #E8EDEE;
    --c-btn-fg:        #110A35;
    --c-btn-brand-bg:  #110A35;
    --c-btn-brand-fg:  #FFFFFF;
    --c-btn-line:      #FFFFFF;
    --c-btn-strong-bg: #E8EDEE;   /* … light in dark mode */
    --c-btn-strong-fg: #110A35;
    --c-btn-strong-disabled: #7C8086;   /* not in Figma (no dark flow yet): the light button, dimmed */

    --c-success:    #55AC26;
    --c-danger:     #FF4242;
    --c-warning:    #F89A44;
    --c-info:       #E8EDEE;

    --c-success-bg: #264038;
    --c-warning-bg: #561E1E;
    --c-neutral-bg: #5D4D19;
    --c-info-bg:    #183950;
    --c-danger-bg:  #3A1B1B;
    --c-success-text: #55AC26;
    --c-warning-text: #F89A44;
    --c-neutral-text: #E3E3E3;

    --shadow-soft:    0 0 75px rgba(0, 0, 0, 0.5);
    --shadow-card:    0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-modal:   0 4px 37px rgba(0, 0, 0, 0.6);
  }
}

/* Explicit dark: data-theme="dark" (styleguide toggle) or the F.A.Z.
   header/footer template's .darkmode class on <html> or <body>.
   The OSC itself has no toggle (decided) — it follows the system setting,
   like the template; these hooks only keep both in sync if the template
   ever forces a mode. Keep in sync with the media-query block above. */
:root[data-theme="dark"], html.darkmode, body.darkmode {
  color-scheme: dark;
  --c-bg:#212529;--c-surface:#212529;--c-surface-2:#393939;--c-surface-grey:#323D46;--c-overlay:rgba(0,0,0,.5);
  --c-text:#FFFFFF;--c-text-muted:#E3E3E3;--c-text-subtle:#C6C6C6;--c-text-on-brand:#110A35;--c-text-disabled:#555555;--c-divider:#393939;
  --c-primary:#E8EDEE;
  --c-border:#555555;--c-border-strong:#717171;--c-field-border:#AAAAAA;--c-field-bg:#212529;--c-focus:#E8EDEE;
  --c-btn-bg:#E8EDEE;--c-btn-fg:#110A35;--c-btn-brand-bg:#110A35;--c-btn-brand-fg:#FFFFFF;--c-btn-line:#FFFFFF;--c-btn-strong-bg:#E8EDEE;--c-btn-strong-fg:#110A35;--c-btn-strong-disabled:#7C8086;
  --c-success:#55AC26;--c-danger:#FF4242;--c-warning:#F89A44;--c-info:#E8EDEE;
  --c-success-text:#55AC26;--c-warning-text:#F89A44;--c-neutral-text:#E3E3E3;
  --c-success-bg:#264038;--c-warning-bg:#561E1E;--c-neutral-bg:#5D4D19;--c-info-bg:#183950;--c-danger-bg:#3A1B1B;
  --shadow-soft:0 0 75px rgba(0,0,0,.5);
  --shadow-card:0 1px 2px rgba(0,0,0,.4),0 10px 30px rgba(0,0,0,.35);
  --shadow-modal:0 4px 37px rgba(0,0,0,.6);
}

/* Explicit light: the template's .lightmode class wins over a dark system
   setting. (data-theme="light" needs no block: the media query above is
   guarded with :not([data-theme="light"]).) Same values as bare :root. */
html.lightmode, body.lightmode {
  color-scheme: light;
  --c-bg:#FFFFFF;--c-surface:#FFFFFF;--c-surface-2:#F7F7F7;--c-surface-grey:#E8EDEE;--c-overlay:rgba(0,0,0,.2);
  --c-text:#212529;--c-text-muted:#555555;--c-text-subtle:#717171;--c-text-on-brand:#FFFFFF;--c-text-disabled:#AAAAAA;--c-divider:#E3E3E3;
  --c-primary:#110A35;
  --c-border:#E3E3E3;--c-border-strong:#C6C6C6;--c-field-border:#8E8E8E;--c-field-bg:#FFFFFF;--c-focus:#110A35;
  --c-btn-bg:#E8EDEE;--c-btn-fg:#110A35;--c-btn-brand-bg:#110A35;--c-btn-brand-fg:#FFFFFF;--c-btn-line:#212529;--c-btn-strong-bg:#110A35;--c-btn-strong-fg:#FFFFFF;--c-btn-strong-disabled:#A1A4B1;
  --c-success:#478517;--c-danger:#C60000;--c-warning:#A85100;--c-info:#110A35;
  --c-success-bg:#EDF7ED;--c-warning-bg:#FBF2E9;--c-neutral-bg:#EBEBE5;--c-info-bg:#E7EFF5;--c-danger-bg:#FBE9E9;
  --c-success-text:#1B5E20;--c-warning-text:#561E1E;--c-neutral-text:#5D4D19;
  --shadow-soft:0 0 75px rgba(17,10,53,.10);
  --shadow-card:0 1px 2px rgba(17,10,53,.06),0 8px 24px rgba(17,10,53,.08);
  --shadow-modal:0 4px 37px rgba(0,0,0,.25);
}
