/* ==========================================================================
   Padó Pizza — Official Brand Design System Tokens
   Supports:
     - Light Mode (default) & Dark Mode (`[data-theme="dark"]`)
     - English LTR (`[dir="ltr"]`) & Arabic RTL (`[dir="rtl"]`)

   Extracted Palette:
     - Deep Espresso Plum:  #3F1E24
     - Powder Sky Blue:     #A8C1D1
     - Pizza Bunny Pink:    #D98EA1
     - Warm Dough Cream:    #FBF8F6
     - Soft Flour Blush:    #F3ECEA
   ========================================================================== */

:root {
  color-scheme: light;

  /* Core Immutable Brand Colors */
  --color-brand-plum: #3F1E24;                 /* hsl(349, 35%, 18%) */
  --color-brand-plum-deep: #2B1318;            /* hsl(348, 39%, 12%) */
  --color-brand-plum-raised: #4E272E;          /* hsl(349, 33%, 23%) */
  --color-brand-plum-soft: #5E333B;            /* hsl(349, 30%, 28%) */

  --color-brand-blue: #A8C1D1;                 /* hsl(203, 31%, 74%) */
  --color-brand-blue-deep: #5B8098;            /* hsl(204, 25%, 48%) */
  --color-brand-blue-soft: #E9F1F6;            /* hsl(203, 42%, 94%) */

  --color-brand-pink: #D98EA1;                 /* hsl(345, 50%, 70%) */
  --color-brand-pink-hover: #E4A1B2;           /* hsl(345, 56%, 76%) */
  --color-brand-pink-deep: #B85E76;            /* hsl(344, 39%, 55%) */
  --color-brand-pink-soft: #F9EDF0;            /* hsl(345, 52%, 95%) */

  /* Semantic Surface & Text Tokens — LIGHT MODE (Default) */
  --color-bg-primary: #FBF8F6;                 /* Warm Dough Cream */
  --color-bg-secondary: #F3ECEA;               /* Soft Flour Blush */
  --color-bg-elevated: #FFFFFF;                /* Crisp Card Surface */
  --color-bg-dark: var(--color-brand-plum);    /* Espresso Plum Accent Band */
  --color-bg-dark-elevated: var(--color-brand-plum-raised);

  --color-text-primary: var(--color-brand-plum);
  --color-text-secondary: #68494F;             /* Muted Plum Ink */
  --color-text-muted: #8C7076;                 /* Soft Dusty Mauve */
  --color-text-inverse: #FBF8F6;
  --color-text-inverse-muted: #DECED2;

  --color-eyebrow: var(--color-brand-pink-deep);
  --color-accent: var(--color-brand-plum);
  --color-accent-hover: var(--color-brand-plum-deep);
  --color-accent-text: #FBF8F6;
  --color-accent-pop: var(--color-brand-pink);
  --color-accent-soft: var(--color-brand-pink-soft);
  --color-olive: var(--color-brand-blue-deep);
  --color-olive-soft: var(--color-brand-blue-soft);

  --color-border: rgba(63, 30, 36, 0.12);
  --color-border-strong: rgba(63, 30, 36, 0.24);
  --color-border-inverse: rgba(251, 248, 246, 0.18);
  --color-dot-pattern: rgba(63, 30, 36, 0.035);

  --color-success: #246A46;
  --color-success-bg: #E6F4EC;
  --color-error: #B4323F;
  --color-error-bg: #FCEBEC;

  /* Typography — English (LTR) Default */
  --font-display-en: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body-en: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Typography — Arabic (RTL) Companion */
  --font-display-ar: 'Alexandria', 'Cairo', 'Geeza Pro', 'Tahoma', sans-serif;
  --font-body-ar: 'IBM Plex Sans Arabic', 'Cairo', 'Tahoma', sans-serif;

  --font-display: var(--font-display-en);
  --font-body: var(--font-body-en);

  /* Type Scale */
  --text-xs: clamp(0.75rem, 0.72rem + 0.12vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.85rem + 0.12vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.18vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.06rem + 0.28vw, 1.25rem);
  --text-xl: clamp(1.375rem, 1.24rem + 0.5vw, 1.65rem);
  --text-2xl: clamp(1.85rem, 1.55rem + 1.15vw, 2.65rem);
  --text-3xl: clamp(2.4rem, 1.9rem + 2.2vw, 3.85rem);
  --text-hero: clamp(2.75rem, 2.1rem + 3.1vw, 4.65rem);

  --leading-tight: 1.08;
  --leading-snug: 1.26;
  --leading-normal: 1.62;
  --leading-relaxed: 1.75;

  --tracking-tight: -0.025em;
  --tracking-normal: 0em;
  --tracking-wide: 0.08em;
  --tracking-wider: 0.14em;

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 6rem;
  --space-10: 8rem;

  /* Layout */
  --container-max: 1200px;
  --container-narrow: 860px;
  --header-height: 78px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Elevation & Depth */
  --shadow-subtle: 0 2px 10px rgba(63, 30, 36, 0.06);
  --shadow-card: 0 14px 32px -12px rgba(63, 30, 36, 0.14), 0 2px 6px rgba(63, 30, 36, 0.05);
  --shadow-elevated: 0 24px 56px -16px rgba(43, 19, 24, 0.28);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 180ms;
  --duration-base: 300ms;
  --duration-slow: 560ms;
}

@media (max-width: 760px) {
  :root {
    --header-height: 54px;
  }
}

/* ==========================================================================
   DARK MODE — Official Padó Deep Espresso Plum Theme (`[data-theme="dark"]`)
   ========================================================================== */
[data-theme='dark'] {
  color-scheme: dark;

  --color-bg-primary: #3F1E24;                 /* Official Brand Plum Base */
  --color-bg-secondary: #32161C;               /* Deep Plum Band */
  --color-bg-elevated: #4C262D;                /* Raised Plum Card */
  --color-bg-dark: #2B1318;                    /* Deepest Espresso Plum */
  --color-bg-dark-elevated: #3F1E24;

  --color-text-primary: #FBF8F6;               /* Warm Dough Cream */
  --color-text-secondary: #DECED2;             /* Soft Blush Grey */
  --color-text-muted: #B89EA4;                 /* Muted Rose Mauve */
  --color-text-inverse: #3F1E24;
  --color-text-inverse-muted: #68494F;

  --color-eyebrow: var(--color-brand-pink);
  --color-accent: var(--color-brand-pink);     /* Bunny Pink CTA on Dark */
  --color-accent-hover: var(--color-brand-pink-hover);
  --color-accent-text: #3F1E24;
  --color-accent-soft: rgba(217, 142, 161, 0.16);
  --color-olive: var(--color-brand-blue);
  --color-olive-soft: rgba(168, 193, 209, 0.16);

  --color-border: rgba(251, 248, 246, 0.14);
  --color-border-strong: rgba(168, 193, 209, 0.32);
  --color-border-inverse: rgba(63, 30, 36, 0.2);
  --color-dot-pattern: rgba(168, 193, 209, 0.06);

  --color-success: #7EE0A8;
  --color-success-bg: rgba(36, 106, 70, 0.28);
  --color-error: #FF9EA8;
  --color-error-bg: rgba(180, 50, 63, 0.28);

  --shadow-subtle: 0 2px 12px rgba(18, 6, 9, 0.28);
  --shadow-card: 0 16px 36px -12px rgba(18, 6, 9, 0.45);
  --shadow-elevated: 0 26px 60px -16px rgba(12, 4, 6, 0.62);
}

/* ==========================================================================
   ARABIC RTL TYPOGRAPHY OVERRIDES (`[dir="rtl"]` / `[lang="ar"]`)
   Note: Arabic letter-spacing is always 0 to preserve connected glyphs.
   ========================================================================== */
[dir='rtl'],
[lang='ar'] {
  --font-display: var(--font-display-ar);
  --font-body: var(--font-body-ar);

  --leading-tight: 1.24;
  --leading-snug: 1.38;
  --leading-normal: 1.72;
  --leading-relaxed: 1.85;

  --tracking-tight: 0em;
  --tracking-wide: 0em;
  --tracking-wider: 0em;
}
