/**
 * S6O9 Design System - Foundation Tokens
 *
 * Wave 1: Token Layer (Additive Only)
 *
 * This file establishes the design system token foundation.
 * It is enqueued early (priority 5) to ensure tokens are available
 * to all consuming CSS layers (Elementor, plugin CSS, theme CSS).
 *
 * Wave 1 is ADDITIVE ONLY:
 * - No existing CSS removed
 * - No existing selectors changed
 * - No page styling modified
 * - Existing custom properties preserved via backward-compat aliases
 *
 * Tokens are organized in three tiers:
 * 1. Anchor tokens (raw values)
 * 2. Semantic tokens (role-based aliases)
 * 3. Backward-compatibility aliases (preserve existing --base-peach, etc.)
 *
 * @version 1.0.0
 * @phase Phase 2 Wave 1
 * @date 2026-05-20
 */

:root {
  /* ══════════════════════════════════════════════════════════════════
   * SURFACE HIERARCHY
   * ══════════════════════════════════════════════════════════════════
   * Five surfaces define the S6O9 environmental layer system.
   * Canvas → Functional → Callout → Paper → Night
   */

  /* Canvas: Primary environment background */
  --s6o9-canvas: #f5e6da;

  /* Functional: Elevated functional surfaces (cards, panels, modals) */
  --s6o9-surface-func: #faf3eb;

  /* Callout: Warm tinted surfaces (highlights, notifications, callouts) */
  --s6o9-callout-tint: #efdcca;

  /* Paper: Bright clean surface (forms, overlays, maximum contrast) */
  --s6o9-paper: #ffffff;

  /* Night: Inverted surface for lock states and dramatic contrast */
  --s6o9-surface-night: #1a1410;

  /* ══════════════════════════════════════════════════════════════════
   * CTA HIERARCHY
   * ══════════════════════════════════════════════════════════════════
   * Pink primary (required), Blue secondary, Rust editorial-only.
   * Rust must NEVER be used as CTA fill (editorial emphasis only).
   */

  /* Pink CTA (Primary) */
  --s6o9-cta-pink: #c86f8c;
  --s6o9-cta-pink-hover: #d98aa3;

  /* Blue CTA (Secondary) */
  --s6o9-cta-blue: #294d86;
  --s6o9-cta-blue-hover: #213f6d;

  /* Rust (Editorial Emphasis ONLY - never CTA fill) */
  --s6o9-rust-solid: #8f3f32;
  --s6o9-rust-muted: rgba(143, 63, 50, 0.859);

  /* ══════════════════════════════════════════════════════════════════
   * INK RAMP (TEXT COLORS)
   * ══════════════════════════════════════════════════════════════════
   * Rust-derived text color ramp for editorial content.
   * Strong → Ink → Soft → Faint → Whisper → Line
   */

  --s6o9-ink-strong: rgba(63, 37, 30, 0.94);
  --s6o9-ink: rgba(63, 37, 30, 0.84);
  --s6o9-ink-soft: rgba(63, 37, 30, 0.66);
  --s6o9-ink-faint: rgba(62, 37, 30, 0.459);
  --s6o9-ink-whisper: rgba(63, 37, 30, 0.22);
  --s6o9-line: rgba(63, 37, 30, 0.14);

  /* ══════════════════════════════════════════════════════════════════
   * TYPOGRAPHY (Backward-Compatibility Aliases)
   * ══════════════════════════════════════════════════════════════════
   * Font family tokens preserve existing CSS references.
   * These are compatibility aliases, not prescriptive architecture.
   */

  --s6o9-font-display: 'EB Garamond', Georgia, serif;
  --s6o9-font-serif: 'Roboto Slab', Georgia, serif;
  --s6o9-font-body: 'Roboto', sans-serif;
  --s6o9-font-condensed: 'Roboto Condensed', sans-serif;

  /* ══════════════════════════════════════════════════════════════════
   * LAYOUT TOKENS
   * ══════════════════════════════════════════════════════════════════
   * Container widths and layout constraints.
   */

  --s6o9-width-boxed: 1140px;
  --s6o9-width-max-fixed: 1400px;

  /* ══════════════════════════════════════════════════════════════════
   * BACKWARD-COMPATIBILITY ALIASES
   * ══════════════════════════════════════════════════════════════════
   * Preserve existing custom properties used in production CSS.
   * These map legacy names to new semantic tokens.
   *
   * DO NOT REMOVE these aliases until Wave 5 (component consolidation).
   * Production CSS depends on these names.
   */

  /* Color aliases (from Batch A token compatibility audit) */
  --muted-cta-pink: var(--s6o9-cta-pink);
  --muted-cta-pink-hover: var(--s6o9-cta-pink-hover);
  --base-peach: var(--s6o9-canvas);
  --base-peach-mult: #f8aa8b; /* Preserved as-is (no semantic equivalent) */
  --deep-red: #751c1d; /* Preserved as-is (exact match to existing) */
  --deep-blue: #344060; /* Preserved as-is (legacy variant) */
  --events-bottom-teal: #7fafbd; /* Preserved as-is (section-specific) */
  --rules-top-line: #fdcac2; /* Preserved as-is (section-specific) */
  --rooms-top-line: #7fafbd; /* Preserved as-is (section-specific) */
  --s6o9-events-blue: var(--s6o9-cta-blue);
  --s6o9-events-blue-hover: var(--s6o9-cta-blue-hover);

  /* Event card aliases (from Batch A) */
  --ec-peach: #edbb9c; /* Preserved as-is (card-specific gradient) */
  --ec-navy: var(--s6o9-cta-blue);
  --ec-body: var(--s6o9-surface-night);
  --ec-badge: #5e9089; /* Preserved as-is (badge-specific) */
  --ec-meta: #5a4a40; /* Preserved as-is (metadata color) */

  /* Typography aliases (from Batch A) - NOTE: These were already correct */
  --s6o9-font-primary: var(--s6o9-font-body);

  /* Rust alias (existing production usage) */
  --s6o9-rust: var(--s6o9-rust-muted);
}
