/*
 * Tour Generator — Design Tokens
 * Source of truth: docs/customer-tour-generator-design-spec.md §1
 * Version: 1.0 · Last updated: 2026-05-24
 *
 * Token tiers
 *   --_*   PRIMITIVE  internal raw values, do NOT reference from components
 *   --*    SEMANTIC   public API, use these everywhere in UI code
 *
 * This file is self-contained. It does NOT depend on frontend/web/css/v2/base.css.
 * Tour-Generator pages should load this file plus any per-component CSS.
 *
 * Fonts (Fraunces, Inter) are loaded via the page <head>:
 *   https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400..600&family=Inter:wght@400..700&display=swap
 */

:root {
  /* ============================================================
   * § PRIMITIVE · Color  (internal — do not reference directly)
   * ============================================================ */
  --_cream-50:       #FBF8F2;
  --_cream-100:      #F8F5EF;
  --_cream-200:      #F1EBE0;
  --_cream-300:      #E8E2D6;
  --_cream-400:      #D8CFBC;

  --_ink-300:        #928A7D;
  --_ink-500:        #6B655C;
  --_ink-700:        #201C18;
  --_ink-900:        #1B1A18;

  --_terracotta-50:  #FAEDE6;
  --_terracotta-100: #F3DDD4;
  --_terracotta-300: #D08A6E;
  --_terracotta-500: #A8553B;
  --_terracotta-700: #7E3D27;

  --_green-100:      #E4F2EA;
  --_green-700:      #1F7A4D;
  --_amber-100:      #FFF2D8;
  --_amber-700:      #A66B18;
  --_red-100:        #F9E1DE;
  --_red-700:        #A33A32;

  --_white:          #FFFFFF;

  /* ============================================================
   * § SEMANTIC · Color — Backgrounds
   * ============================================================ */
  --bg-page:         var(--_cream-100);
  --bg-surface:      var(--_white);
  --bg-surface-alt:  var(--_cream-200);
  --bg-input:        var(--_cream-50);
  --bg-muted:        var(--_cream-50);
  --bg-overlay:      rgba(27, 26, 24, 0.48);

  /* ============================================================
   * § SEMANTIC · Color — Text
   * ============================================================ */
  --text-primary:    var(--_ink-900);
  --text-secondary:  var(--_ink-500);
  --text-tertiary:   var(--_ink-300);
  --text-on-accent:  var(--_white);
  --text-on-ink:     var(--_cream-100);

  /* ============================================================
   * § SEMANTIC · Color — Borders
   * ============================================================ */
  --border-default:  var(--_cream-300);
  --border-strong:   var(--_cream-400);
  --border-focus:    var(--_terracotta-500);

  /* ============================================================
   * § SEMANTIC · Color — Accent (Brand)
   * ============================================================ */
  --accent:          var(--_terracotta-500);
  --accent-hover:    var(--_terracotta-700);
  --accent-soft:     var(--_terracotta-100);
  --accent-subtle:   var(--_terracotta-50);

  /* ============================================================
   * § SEMANTIC · Color — Status
   * ============================================================ */
  --status-ok-fg:    var(--_green-700);
  --status-ok-bg:    var(--_green-100);
  --status-warn-fg:  var(--_amber-700);
  --status-warn-bg:  var(--_amber-100);
  --status-risk-fg:  var(--_red-700);
  --status-risk-bg:  var(--_red-100);

  /* ============================================================
   * § SEMANTIC · Typography — Families
   * ============================================================ */
  --font-display:    'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  /* ============================================================
   * § SEMANTIC · Typography — Weights
   * ============================================================ */
  --font-weight-regular:   400;
  --font-weight-medium:    500;
  --font-weight-semibold:  600;
  --font-weight-bold:      700;

  /* ============================================================
   * § SEMANTIC · Typography — Sizes
   * ============================================================ */
  --font-size-display:    48px;
  --font-size-h1:         32px;
  --font-size-h2:         22px;
  --font-size-h3:         18px;
  --font-size-body-lg:    16px;
  --font-size-body:       14px;
  --font-size-body-sm:    13px;
  --font-size-caps:       11px;
  --font-size-num-lg:     32px;
  --font-size-num:        18px;
  --font-size-button:     14px;

  /* ============================================================
   * § SEMANTIC · Typography — Line Heights
   * ============================================================ */
  --line-height-display:  56px;
  --line-height-h1:       40px;
  --line-height-h2:       28px;
  --line-height-h3:       24px;
  --line-height-body-lg:  24px;
  --line-height-body:     20px;
  --line-height-body-sm:  18px;
  --line-height-caps:     14px;
  --line-height-num-lg:   36px;
  --line-height-num:      22px;
  --line-height-button:   16px;

  /* ============================================================
   * § SEMANTIC · Typography — Letter Spacing (Tracking)
   * ============================================================ */
  --tracking-tight:       -0.02em;
  --tracking-snug:        -0.015em;
  --tracking-h2:          -0.01em;
  --tracking-h3:          -0.005em;
  --tracking-normal:      0;
  --tracking-wide:        0.12em;

  /* ============================================================
   * § SEMANTIC · Space (4-er Skala)
   * ============================================================ */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-7:  32px;
  --space-8:  48px;
  --space-9:  64px;

  /* ============================================================
   * § SEMANTIC · Radius
   * ============================================================ */
  --radius-xs:    4px;
  --radius-sm:    8px;
  --radius-md:   12px;
  --radius-full: 999px;

  /* ============================================================
   * § SEMANTIC · Shadows
   * ============================================================ */
  --shadow-sm:    0 1px 2px rgba(28, 24, 18, 0.06);
  --shadow-md:    0 4px 12px rgba(28, 24, 18, 0.08);
  --shadow-lg:    0 18px 42px rgba(42, 37, 32, 0.08);
  --shadow-xl:    0 24px 48px rgba(28, 24, 18, 0.12);
  --shadow-focus: 0 0 0 2px var(--bg-page), 0 0 0 4px var(--border-focus);

  /* ============================================================
   * § SEMANTIC · Motion — Durations
   * ============================================================ */
  --duration-instant:  80ms;
  --duration-quick:   120ms;
  --duration-base:    200ms;
  --duration-emph:    320ms;
  --duration-route:   400ms;

  /* ============================================================
   * § SEMANTIC · Motion — Easings
   * ============================================================ */
  --ease-standard:  cubic-bezier(0.2, 0, 0, 1);
  --ease-emphasis:  cubic-bezier(0.3, 0, 0, 1);
  --ease-exit:      cubic-bezier(0.4, 0, 1, 1);

  /* ============================================================
   * § SEMANTIC · Z-Index
   * ============================================================ */
  --z-base:        0;
  --z-sticky:     10;
  --z-map-overlay: 20;
  --z-dropdown:   30;
  --z-sheet:      40;
  --z-modal:      50;
  --z-toast:      60;
  --z-tooltip:    70;

  /* ============================================================
   * § SEMANTIC · Breakpoints (für JS / Media-Query-Konsistenz)
   * Reine Dokumentation — CSS-Media-Queries verwenden die px-Werte
   * direkt. Diese Tokens dienen JS-Hooks (z. B. matchMedia).
   * ============================================================ */
  --bp-xs:   0px;
  --bp-sm:   480px;
  --bp-md:   768px;
  --bp-lg:   1024px;
  --bp-xl:   1280px;
  --bp-2xl:  1540px;

  /* ============================================================
   * § SEMANTIC · Container Max-Widths
   * ============================================================ */
  --container-lg:   1240px;
  --container-xl:   1440px;
  --container-2xl:  1540px;

  /* ============================================================
   * § SEMANTIC · Workspace (Editor-Layout)
   * Drei-Spalten-Grid für Result-View und Edit-Mode (lg+)
   * ============================================================ */
  --workspace-timeline-width:  320px;
  --workspace-summary-width:   300px;
  --workspace-map-min-width:   560px;
  --workspace-gap:             16px;
  --workspace-topbar-height:    64px;
  --workspace-topbar-sticky-offset: 80px;  /* topbar + 16 */
}

/* ============================================================
 * Accessibility overrides
 * ============================================================ */

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-instant: 0ms;
    --duration-quick:   0ms;
    --duration-base:    0ms;
    --duration-emph:    0ms;
    --duration-route:   0ms;
  }
}

@media (prefers-reduced-transparency: reduce) {
  :root {
    /* Opaque-Replacement für Overlays / Backdrop-Filter-Kontexte.
       Komponenten mit backdrop-filter sollen diesen Wert nutzen
       und backdrop-filter selbst deaktivieren. */
    --bg-overlay: rgba(27, 26, 24, 0.96);
  }
}
