/**
 * ThemeTree RTL Design System & VIPS Semantic Tokens
 * Architecture: Low-CoR, Pure CSS, Zero-Runtime Framework
 * Typography: Tajawal / Cairo Native Arabic Stacks
 * Version: 3.1.0 — Unified Design System
 *
 * v3.1 changes (R5):
 *  - §1c: semantic success / info / warning status colors (light + dark).
 *  - Scoped .gc-inv-* tokens: all inks used ON inverse-surface panels now
 *    flip correctly in dark mode (previously hardcoded #fff/#94a3b8 and
 *    invisible on the flipped light panel).
 *  - Scoped .gc-screen-* tokens: simulated device screens stay dark by design.
 *
 * v3 changes:
 *  - Single source of truth: ALL components (legacy + VIPS) consume these tokens.
 *  - Legacy token bridge (—uicolor, —miniradius, —fsize, …) maps the old
 *    variable names onto the M3 system so legacy templates inherit the
 *    unified palette instead of drifting to hardcoded colors.
 *  - Font imports removed (render-blocking @import); fonts are linked in
 *    #header/part.php with preconnect + display=swap.
 *  - —font-display / —font-body now formally defined.
 * Load order: this file → hover.css → main.css → responsive.css →
 * unified-components.css (final harmonization layer).
 */

:root {
  /* ==========================================================================
     1. COLOR TOKENS (Material 3 Derived - Precision Palette)
     ========================================================================== */
  --color-primary: #004ac6;
  --color-primary-container: #2563eb;
  --color-primary-fixed: #dbe1ff;
  --color-primary-fixed-dim: #b4c5ff;
  --color-on-primary: #ffffff;
  --color-on-primary-container: #eeefff;
  --color-on-primary-fixed: #00174b;
  --color-on-primary-fixed-variant: #003ea8;
  --color-inverse-primary: #b4c5ff;

  /* Sys Aliases for M3 compatibility */
  --sys-primary: var(--color-primary);
  --sys-primary-container: var(--color-primary-container);
  --sys-primary-fixed: var(--color-primary-fixed);
  --sys-primary-fixed-dim: var(--color-primary-fixed-dim);
  --sys-on-primary: var(--color-on-primary);
  --sys-on-primary-container: var(--color-on-primary-container);
  --sys-on-primary-fixed: var(--color-on-primary-fixed);
  --sys-inverse-primary: var(--color-inverse-primary);

  --color-secondary: #006c4a;
  --color-secondary-container: #82f5c1;
  --color-secondary-fixed: #85f8c4;
  --color-secondary-fixed-dim: #68dba9;
  --color-on-secondary: #ffffff;
  --color-on-secondary-container: #00714e;
  --sys-secondary: var(--color-secondary);
  --sys-secondary-container: var(--color-secondary-container);
  --sys-secondary-fixed: var(--color-secondary-fixed);
  --sys-secondary-fixed-dim: var(--color-secondary-fixed-dim);
  --sys-on-secondary: var(--color-on-secondary);
  --sys-on-secondary-container: var(--color-on-secondary-container);
  --sys-on-secondary-fixed: var(--color-on-secondary-fixed);

  --color-tertiary: #4b566a;
  --color-tertiary-container: #636e83;
  --color-tertiary-fixed: #d8e3fb;
  --color-tertiary-fixed-dim: #bcc7de;
  --color-on-tertiary: #ffffff;
  --color-on-tertiary-container: #ecf1ff;
  --color-on-tertiary-fixed: #111c2d;
  --color-on-tertiary-fixed-variant: #3c475a;

  --sys-tertiary: var(--color-tertiary);
  --sys-tertiary-container: var(--color-tertiary-container);
  --sys-tertiary-fixed: var(--color-tertiary-fixed);
  --sys-on-tertiary: var(--color-on-tertiary);

  --color-surface: #faf8ff;
  --color-surface-dim: #d2d9f4;
  --color-surface-bright: #faf8ff;
  --color-surface-variant: #dae2fd;
  --color-surface-container-lowest: #ffffff;
  --color-surface-container-low: #f2f3ff;
  --color-surface-container: #eaedff;
  --color-surface-container-high: #e2e7ff;
  --color-surface-container-highest: #dae2fd;
  --color-surface-tint: #0053db;
  --color-primary-rgb: 0, 74, 198;   /* rgb channels of --color-primary (used by legacy rgba() tints) */

  --sys-surface: var(--color-surface);
  --sys-surface-dim: var(--color-surface-dim);
  --sys-surface-variant: var(--color-surface-variant);
  --sys-surface-container-lowest: var(--color-surface-container-lowest);
  --sys-surface-container-low: var(--color-surface-container-low);
  --sys-surface-container: var(--color-surface-container);
  --sys-surface-container-high: var(--color-surface-container-high);
  --sys-surface-container-highest: var(--color-surface-container-highest);

  --color-on-surface: #131b2e;
  --color-on-surface-variant: #434655;
  --color-outline: #737686;
  --color-outline-variant: #c3c6d7;
  --color-inverse-surface: #283044;
  --color-inverse-on-surface: #eef0ff;

  --sys-on-surface: var(--color-on-surface);
  --sys-on-surface-variant: var(--color-on-surface-variant);
  --sys-outline: var(--color-outline);
  --sys-outline-variant: var(--color-outline-variant);
  --sys-inverse-surface: var(--color-inverse-surface);
  --sys-inverse-on-surface: var(--color-inverse-on-surface);

  --color-error: #ba1a1a;
  --color-error-container: #ffdad6;
  --color-on-error: #ffffff;
  --color-on-error-container: #93000a;

  --sys-error: var(--color-error);
  --sys-error-container: var(--color-error-container);
  --sys-on-error: var(--color-on-error);
  --sys-on-error-container: var(--color-on-error-container);

  /* ----------------------------------------------------------------------
     1c. SEMANTIC STATUS COLORS (v2.2.0) — success / info / warning.
     Previously the case-study & city-hub templates hardcoded mockup hexes
     (#34d399 / #38bdf8 / #d97706). Light values are tone-tuned for AA text
     contrast on M3 light surfaces; the bright "display" variants for dark
     panels live in the .gc-inv-* / .gc-screen-* scopes below.
     ---------------------------------------------------------------------- */
  --color-success: #0e7a4f;
  --color-success-container: #d3f5e4;
  --color-info: #0b6b9e;
  --color-info-container: #d3ecfb;
  --color-warning: #a35a00;
  --color-warning-container: #ffe7c2;

  --sys-success: var(--color-success);
  --sys-success-container: var(--color-success-container);
  --sys-info: var(--color-info);
  --sys-info-container: var(--color-info-container);
  --sys-warning: var(--color-warning);
  --sys-warning-container: var(--color-warning-container);

  /* Scoped tokens — content rendered ON TOP of an inverse-surface panel
     (KPI cards, ops console, CTA bands). In light mode that panel is dark
     navy #283044, so inks are light; §4d flips every value for dark mode,
     where the same panel resolves to LIGHT #e3e2ec. */
  --gc-inv-tile-bg: rgba(255, 255, 255, 0.08);
  --gc-inv-tile-border: rgba(255, 255, 255, 0.10);
  --gc-inv-ink: var(--color-inverse-on-surface);
  --gc-inv-muted: #94a3b8;
  --gc-inv-success: #34d399;
  --gc-inv-info: #38bdf8;
  --gc-inv-chip-bg: rgba(56, 189, 248, 0.15);
  --gc-inv-chip-ink: #38bdf8;
  --gc-inv-success-alpha: rgba(52, 211, 153, 0.15);
  --gc-secondary-alpha: rgba(0, 108, 74, 0.20);

  /* Scoped tokens — simulated device screens (FLIR camera / hydrostatic
     gauge readouts). The screen is intentionally dark in BOTH modes, so
     these stay constant across schemes. */
  --gc-screen-bg: #0f172a;
  --gc-screen-bg-deep: #0a0e1a;
  --gc-screen-ink: #f8fafc;
  --gc-screen-muted: #94a3b8;
  --gc-screen-success: #34d399;
  --gc-screen-info: #38bdf8;
  --gc-screen-error: #f43f5e;

  /* Scoped tokens — deep stop of the primary brand gradient used on the
     post-sidebar CTA card (.vpost-cta-card). The card is intentionally a
     dark navy panel in BOTH modes (same reasoning as the screens above):
     it sits on the sticky sidebar and must read as "premium contrast"
     against any surface. Light-mode value #1e3a8a comes from the ux
     mockup; dark mode darkens it slightly so the gradient still leads
     with the (mode-flipped) primary. */
  --gc-grad-deep: #1e3a8a;
  --gc-grad-live: #4ade80; /* status dot on the CTA card — constant bright green */
  --gc-grad-chip-bg: rgba(255, 255, 255, 0.15); /* pill on the gradient card — constant */
  --gc-grad-ink-soft: rgba(255, 255, 255, 0.85); /* softened ink on the gradient card */
  --gc-wa: #25D366; /* WhatsApp brand green — constant across schemes */

  /* Font size token aliases */
  --font-display-hero: var(--text-display-hero);
  --font-headline-xl: var(--text-headline-xl);
  --font-headline-lg: var(--text-headline-lg);
  --font-headline-md: var(--text-headline-md);
  --font-headline-sm: var(--text-headline-sm);
  --font-body-xl: var(--text-body-xl);
  --font-body-lg: var(--text-body-lg);
  --font-body-md: var(--text-body-md);
  --font-body-sm: var(--text-body-sm);
  --font-label-lg: var(--text-label-lg);
  --font-label-md: var(--text-label-md);
  --font-label-micro: var(--text-label-micro);

  /* ==========================================================================
     2. SPACING & CONTAINER SYSTEM
     ========================================================================== */
  --space-2xs: 0.25rem;  /* 4px */
  --space-xs:  0.5rem;   /* 8px */
  --space-sm:  0.75rem;  /* 12px */
  --space-md:  1rem;     /* 16px */
  --space-lg:  1.5rem;   /* 24px */
  --space-xl:  2rem;     /* 32px */
  --space-2xl: 3rem;     /* 48px */
  --space-3xl: 4.5rem;   /* 72px */
  --space-4xl: 6rem;     /* 96px */

  --container-max: 1280px;
  --gutter-desktop: 2rem;
  --gutter-mobile: 1rem;

  /* ==========================================================================
     3. RADII & SHADOW TOKENS
     ========================================================================== */
  --radius-sm:   0.25rem; /* 4px */
  --radius-md:   0.5rem;  /* 8px */
  --radius-lg:   0.75rem; /* 12px */
  --radius-xl:   1rem;    /* 16px */
  --radius-2xl:  1.5rem;  /* 24px */
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px rgba(19, 27, 46, 0.04);
  --shadow-sm: 0 1px 3px rgba(19, 27, 46, 0.06), 0 1px 2px rgba(19, 27, 46, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(19, 27, 46, 0.08), 0 2px 4px -1px rgba(19, 27, 46, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(19, 27, 46, 0.08), 0 4px 6px -2px rgba(19, 27, 46, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(19, 27, 46, 0.1), 0 10px 10px -5px rgba(19, 27, 46, 0.04);

  /* ==========================================================================
     4. TYPOGRAPHY SYSTEM (RTL ARABIC FIRST)
     ========================================================================== */
  --font-family-base: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-display: 'Cairo', 'Tajawal', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Typographic Scale with Arabic Optical Line-Heights */
  --text-display-hero: clamp(2.1rem, 4.5vw, 3rem);
  --leading-display-hero: 1.25;

  --text-headline-xl: clamp(1.75rem, 3.2vw, 2.25rem);
  --leading-headline-xl: 1.3;

  --text-headline-lg: 1.75rem; /* 28px */
  --leading-headline-lg: 1.35;

  --text-headline-md: 1.375rem; /* 22px */
  --leading-headline-md: 1.4;

  --text-headline-sm: 1.125rem; /* 18px */
  --leading-headline-sm: 1.45;

  --text-body-xl: 1.125rem; /* 18px */
  --leading-body-xl: 1.8;

  --text-body-lg: 1rem; /* 16px */
  --leading-body-lg: 1.7;

  --text-body-md: 0.875rem; /* 14px */
  --leading-body-md: 1.65;

  --text-body-sm: 0.8125rem; /* 13px */
  --leading-body-sm: 1.6;

  --text-label-lg: 0.875rem; /* 14px */
  --leading-label-lg: 1.4;

  --text-label-md: 0.75rem; /* 12px */
  --leading-label-md: 1.4;

  --text-label-micro: 0.6875rem; /* 11px */
  --leading-label-micro: 1.3;

  /* ==========================================================================
     4b. FONT FAMILY RESOLUTION
     ========================================================================== */
  --font-display: var(--font-family-display); /* Cairo — headings */
  --font-body: var(--font-family-base);       /* Tajawal — prose */

  /* ==========================================================================
     4c. LEGACY TOKEN BRIDGE (NutHub/Kleer era → M3 system)
     --------------------------------------------------------------------------
     main.css + legacy widgets read these names. Mapping them here (instead of
     hardcoding hex values) makes every legacy component follow the unified
     palette and the Customizer options automatically.
     ========================================================================== */
  --uicolor: var(--color-primary);
  --uicolor2: var(--color-secondary);
  --uicolor3: var(--color-inverse-surface);
  --primary-text: var(--color-on-surface);
  --textcolor: var(--color-on-surface);
  --secondarytext: var(--color-on-surface-variant);
  --bgcolor: var(--color-surface-container-lowest);
  --bkground: var(--color-surface);
  --bghover: var(--color-surface-container-low);
  --diver: var(--color-outline-variant);
  --ui_color_header: var(--color-surface-container-lowest);
  --ui_footer: var(--color-inverse-surface);

  --fsize: 0.9375rem;                /* 15px unified body size */
  --ffamily: var(--font-family-base);
  --ffamilystrong: var(--font-family-display);
  --f-number: 'Plus Jakarta Sans', var(--font-family-base);
  --miniradius: var(--radius-md);    /* 8px  (was 15px) */
  --largeradius: var(--radius-xl);   /* 16px (was 30px) */
  --background_button: var(--color-primary);
  --button-border: 2px solid var(--color-primary);
  --main-color-rgb: var(--color-primary-rgb); /* rgb of --color-primary #004ac6 */

  --box-shadow: var(--shadow-sm);
  --box-shadow-1: var(--shadow-md);
  --box-shadow-2: var(--shadow-lg);

  /* Dark band (footer / CTA sections) — legacy hardcodes
     #1a1a2e / #0F172A in places; unify on inverse-surface. */
  --dark-band: #0f172a;
  --dark-band-soft: #283044;
  --dark-band-text: #cbd5e1;
}

/* ==========================================================================
   4d. DARK SCHEME — M3 dark tonal palette, same primary hue as light
   --------------------------------------------------------------------------
   The mode is carried by the body[mode] attribute (default "light", emitted
   by #header/part.php; flipped client-side by the gc-mode toggle in
   setup.js and persisted in localStorage). :root above stays LIGHT — every
   value below is declared ON BODY so the legacy bridge (re-asserted on body
   in unified-components.css §1) resolves against the dark palette too.
   Fixed tokens (--color-*-fixed) intentionally do NOT change: per M3 they
   are constant across schemes.
   ========================================================================== */
body[mode="dark"] {
  color-scheme: dark;

  --color-primary: #b4c5ff;
  --color-on-primary: #002268;
  --color-primary-container: #0053db;
  --color-on-primary-container: #d8e3fb;
  --color-inverse-primary: #0053db;
  --color-primary-rgb: 180, 197, 255;

  --color-secondary: #68dba9;
  --color-on-secondary: #003824;
  --color-secondary-container: #005234;
  --color-on-secondary-container: #82f5c1;

  --color-tertiary: #bcc7de;
  --color-on-tertiary: #253140;
  --color-tertiary-container: #3c475a;
  --color-on-tertiary-container: #d8e3fb;

  --color-surface: #11141c;
  --color-surface-dim: #11141c;
  --color-surface-bright: #363a48;
  --color-surface-variant: #333642;
  --color-surface-container-lowest: #0b0e16;
  --color-surface-container-low: #191c26;
  --color-surface-container: #1d202b;
  --color-surface-container-high: #282b37;
  --color-surface-container-highest: #333642;

  --color-on-surface: #e3e2ec;
  --color-on-surface-variant: #c3c6d8;
  --color-outline: #8d90a5;
  --color-outline-variant: #434658;

  --color-inverse-surface: #e3e2ec;
  --color-inverse-on-surface: #2f303a;

  --color-error: #ffb4ab;
  --color-on-error: #690005;
  --color-error-container: #93000a;
  --color-on-error-container: #ffdad6;

  /* Status colors — brightened for dark surfaces (AA on #11141c family). */
  --color-success: #86d9ad;
  --color-success-container: #0c5136;
  --color-info: #8ecffb;
  --color-info-container: #0a4a6e;
  --color-warning: #ffc06e;
  --color-warning-container: #6b3a00;

  /* Inverse panels flip to LIGHT surfaces in dark mode (§4d) — every
     scoped ink on them must flip to dark, tonal values. */
  --gc-inv-tile-bg: rgba(15, 23, 42, 0.06);
  --gc-inv-tile-border: rgba(15, 23, 42, 0.10);
  --gc-inv-muted: #5a6478;
  --gc-inv-success: var(--color-success);
  --gc-inv-info: var(--color-info);
  --gc-inv-chip-bg: rgba(11, 107, 158, 0.12);
  --gc-inv-chip-ink: var(--color-info);
  --gc-inv-success-alpha: rgba(14, 122, 79, 0.12);
  --gc-secondary-alpha: rgba(104, 219, 169, 0.30);

  /* Dark-mode deep stop for the .vpost-cta-card gradient (see §1c). */
  --gc-grad-deep: #172554;

  /* Shadows need MORE alpha on dark canvases to stay perceptible. */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.40), 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.45), 0 2px 4px -1px rgba(0, 0, 0, 0.30);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.50), 0 4px 6px -2px rgba(0, 0, 0, 0.30);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.55), 0 10px 10px -5px rgba(0, 0, 0, 0.35);

  --dark-band: #0b0e16;
  --dark-band-soft: #1d202b;
  --dark-band-text: #c3c6d8;
}

/* ==========================================================================
   5. BASE RESET & LOW-COR NORMALIZATION
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  direction: rtl;
  text-align: right;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--text-body-md);
  line-height: var(--leading-body-md);
  color: var(--color-on-surface);
  background-color: var(--color-surface);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-display);
  color: var(--color-on-surface);
  font-weight: 700;
  line-height: 1.3;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease-in-out;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   6. VIPS LAYOUT SEGMENTATION PRIMITIVES
   ========================================================================== */
.container-vips,
.vips-container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter-mobile);
}

@media (min-width: 1024px) {
  .container-vips,
  .vips-container {
    padding-inline: var(--gutter-desktop);
  }
}

/* VIPS Semantic Section with High Degree of Coherence (DoC) */
.vips-section {
  position: relative;
  width: 100%;
  padding-block: var(--space-xl);
}

@media (min-width: 1024px) {
  .vips-section {
    padding-block: var(--space-3xl);
  }
}

/* VIPS Visual Separator */
.vips-separator {
  border: 0;
  border-top: 1px solid var(--color-outline-variant);
  opacity: 0.35;
  margin-block: var(--space-2xl);
}

/* 12-Column Layout Grid (Low DOM Depth) */
.vips-grid-12 {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--space-xl);
  align-items: center;
}

@media (min-width: 1024px) {
  .vips-grid-12 {
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space-2xl);
  }
  
  .col-span-7 {
    grid-column: span 7 / span 7;
  }
  
  .col-span-5 {
    grid-column: span 5 / span 5;
  }
  
  .col-span-4 {
    grid-column: span 4 / span 4;
  }
  
  .col-span-8 {
    grid-column: span 8 / span 8;
  }
  
  .col-span-6 {
    grid-column: span 6 / span 6;
  }
}

/* ==========================================================================
   7. CENTERPIECE ANNOTATION CONTAINER
   ========================================================================== */
.centerpiece-module {
  position: relative;
  background-color: var(--color-surface-container-lowest);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-lg);
  border: 1px solid rgba(195, 198, 215, 0.3);
  overflow: hidden;
  z-index: 10;
}

@media (min-width: 1024px) {
  .centerpiece-module {
    padding: var(--space-xl);
  }
}

.centerpiece-module::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 4px;
  background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
}

/* ==========================================================================
   8. STRUCTURED INFORMATION CARDS (EAV Matrix)
   ========================================================================== */
.eav-card {
  background-color: var(--color-surface-container-lowest);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-surface-container-high);
  box-shadow: var(--shadow-sm);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
  backface-visibility: hidden;
}

.eav-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.eav-specs-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding-block: var(--space-xs);
  border-block: 1px solid var(--color-surface-container);
}

.eav-spec-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: var(--text-body-sm);
}

.eav-spec-key {
  color: var(--color-on-surface-variant);
  font-weight: 500;
}

.eav-spec-value {
  color: var(--color-on-surface);
  font-weight: 700;
}

/* ==========================================================================
   9. ATOMIC UTILITY HELPERS (Zero Bloat)
   ========================================================================== */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--text-label-micro);
  font-weight: 700;
  text-transform: uppercase;
}

.badge-status.active {
  background-color: var(--color-secondary-container);
  color: var(--color-on-secondary-container);
}

.badge-status.primary {
  background-color: var(--color-primary-fixed);
  color: var(--color-on-primary-fixed);
}

.badge-status.neutral {
  background-color: var(--color-surface-container);
  color: var(--color-on-surface-variant);
}

.badge-status.error {
  background-color: var(--color-error-container);
  color: var(--color-on-error-container);
}

.btn-action-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  min-height: 44px;
  border-radius: var(--radius-lg);
  background-color: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  border: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-action-primary:hover {
  background-color: var(--color-primary-container);
}

.btn-action-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  min-height: 44px;
  border-radius: var(--radius-full);
  background-color: var(--color-secondary);
  color: var(--color-on-secondary);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  border: none;
  transition: background-color 0.15s ease;
}

.btn-action-whatsapp:hover {
  background-color: var(--color-on-secondary-container);
}

/* ==========================================================================
   11. MATERIAL SYMBOLS & ICON COMPONENT NORMALIZATION
   ========================================================================== */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined' !important;
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  unicode-bidi: isolate;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ==========================================================================
   12. HEADER ARCHITECTURE (Modern Sticky Flow - Non-overlapping)
   ========================================================================== */
body > root > rootinse > header,
header.header-out-single,
header.fixed {
  position: sticky !important;
  top: 0 !important;
  inset-inline: 0;
  width: 100% !important;
  z-index: 1000 !important;
  /* R12: token-driven frosted bar — was rgba(255,255,255,.98) !important,
     which pinned the header WHITE through dark mode (user-reported bug).
     Light value stays visually identical (white @ 98%). */
  background-color: color-mix(in srgb, var(--color-surface-container-lowest) 98%, transparent) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--sys-outline-variant, #c3c6d7);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  margin: 0 !important;
  transition: all 0.25s ease;
}

/* Unified z-index scale — legacy popups ran to 9999999999 and covered the
   sticky header; every overlay now lives in one coherent ladder. */
header { z-index: 1000 !important; }
#button { z-index: 900 !important; }
.search_header, .search_box, .Parent-Boxed--Context---overlays,
.Popver--CoursesAlert, .Loading--Context { z-index: 1200 !important; }
.floating-btn { z-index: 1100 !important; }

body {
  overflow-x: hidden;
  min-height: 100vh;
}

root,
rootinse {
  overflow-x: clip !important;
  min-height: 100vh;
  display: block;
}

/* ==========================================================================
   13. HERO SECTION STACKING CONTEXT & CLEARANCE (VIPS Protection)
   ========================================================================== */
.hero-section,
.vips-city-hero,
.vips-telemetry-bar,
.vips-section {
  position: relative !important;
  isolation: isolate;
  width: 100%;
  clear: both;
}

.vips-city-hero {
  padding-block: var(--space-xl) var(--space-2xl) !important;
}

.vips-telemetry-bar {
  padding-block: var(--space-sm) !important;
}

/* ==========================================================================
   14. VIPS PROSE & EDITORIAL TYPOGRAPHY (Tajawal / Cairo Hierarchy)
   ========================================================================== */
.service-body-content,
.article-prose-content {
  font-family: var(--font-body, 'Tajawal', sans-serif);
  font-size: var(--text-body-lg, 17px);
  line-height: var(--leading-body-xl, 1.85);
  color: var(--color-on-surface, #1e293b);
  word-break: break-word;
}

.service-body-content p,
.article-prose-content p {
  margin-bottom: var(--space-lg, 20px);
  line-height: 1.85;
}

.service-body-content h2,
.article-prose-content h2 {
  font-family: var(--font-display, 'Cairo', sans-serif);
  font-size: var(--text-headline-md, 24px);
  font-weight: 800;
  color: var(--color-on-surface, #0f172a);
  margin-top: var(--space-2xl, 32px);
  margin-bottom: var(--space-md, 16px);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-primary-fixed, #dbe1ff);
}

.service-body-content h3,
.article-prose-content h3 {
  font-family: var(--font-display, 'Cairo', sans-serif);
  font-size: var(--text-headline-sm, 20px);
  font-weight: 700;
  color: var(--color-primary, #004ac6);
  margin-top: var(--space-xl, 24px);
  margin-bottom: var(--space-sm, 12px);
}

.service-body-content ul,
.article-prose-content ul,
.service-body-content ol,
.article-prose-content ol {
  margin-bottom: var(--space-lg, 20px);
  padding-inline-start: var(--space-xl, 24px);
}

.service-body-content li,
.article-prose-content li {
  margin-bottom: var(--space-xs, 8px);
  line-height: 1.8;
}

.service-body-content table,
.article-prose-content table {
  width: 100%;
  border-collapse: collapse;
  margin-block: var(--space-xl, 24px);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
}

.service-body-content th,
.article-prose-content th {
  background: var(--color-surface-container-high, #e2e8f0);
  color: var(--color-on-surface, #1e293b);
  padding: 12px 16px;
  font-weight: 700;
  text-align: start;
}

.service-body-content td,
.article-prose-content td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-outline-variant, #cbd5e1);
  /* R12: was #ffffff — table cells stayed white in dark mode. */
  background: var(--color-surface-container-lowest);
}

/* EZ-TOC Modern Overrides */
#ez-toc-container {
  background: var(--color-surface-container-lowest, #ffffff) !important;
  border: 1px solid var(--color-outline-variant, #e2e8f0) !important;
  border-radius: var(--radius-xl, 16px) !important;
  padding: var(--space-lg, 20px) !important;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05)) !important;
  margin-bottom: var(--space-2xl, 32px) !important;
}

#ez-toc-container .ez-toc-title {
  font-family: var(--font-display, 'Cairo', sans-serif) !important;
  font-weight: 800 !important;
  font-size: 18px !important;
  color: var(--color-primary, #004ac6) !important;
}

#ez-toc-container ul li a {
  color: var(--color-on-surface-variant, #475569) !important;
  font-family: var(--font-body, 'Tajawal', sans-serif) !important;
  text-decoration: none !important;
  transition: color 0.15s ease !important;
}

#ez-toc-container ul li a:hover {
  color: var(--color-primary, #004ac6) !important;
}

/* ==========================================================================
   15. VIPS BLOG CARD HOVER (Pure CSS - No Inline JS)
   ========================================================================== */
.vips-article-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
}

.vips-article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   16. PAGINATION STYLING (wp_paginate_links type=list)
   ========================================================================== */
.vips-pagination-wrap ul.page-numbers {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.vips-pagination-wrap ul.page-numbers li {
  display: inline-flex;
}

.vips-pagination-wrap ul.page-numbers li a,
.vips-pagination-wrap ul.page-numbers li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 14px;
  border-radius: var(--radius-lg, 12px);
  font-size: var(--text-body-md, 14px);
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
  border: 1px solid var(--color-outline-variant, #e2e8f0);
  background: var(--color-surface-container-lowest, #ffffff);
  color: var(--color-on-surface-variant, #475569);
}

.vips-pagination-wrap ul.page-numbers li a:hover {
  background: var(--color-surface-container-high, #f1f5f9);
  color: var(--color-primary, #004ac6);
  border-color: var(--color-primary-fixed, #dbe1ff);
}

.vips-pagination-wrap ul.page-numbers li span.current {
  background: var(--color-primary, #004ac6);
  color: var(--color-on-primary, #ffffff);
  border-color: var(--color-primary, #004ac6);
}

.vips-pagination-wrap ul.page-numbers li a .material-symbols-outlined {
  font-size: 18px;
}

/* ==========================================================================
   17. SIDEBAR MOBILE OVERRIDE
   ========================================================================== */
@media (max-width: 1023px) {
  .col-span-8,
  .col-span-4 {
    grid-column: 1 / -1 !important;
  }

  aside.col-span-4 {
    position: static !important;
    top: auto !important;
  }
}

/* ==========================================================================
   18. CATEGORY PILLS TOUCH TARGET
   ========================================================================== */
.category-pills-bar a {
  min-height: 44px;
  display: inline-flex !important;
  align-items: center !important;
}

