/* ============================================================
   الأكاديمية الحزبية لحزب الإصلاح — Design Tokens
   نظام المتغيرات (ألوان/خطوط/مسافات/زوايا/ظلال) + الوضع الليلي
   يعتمد CSS Custom Properties لتبديل فوري بين الوضعين.
   ============================================================ */

:root {
  /* ---------- ألوان الهوية (Brand) ---------- */
  --brand-primary: #1f2c8f;      /* الأزرق الملكي */
  --brand-primary-700: #161f66;
  --brand-primary-300: #5b6be0;
  --brand-primary-100: #e7e9f7;
  --brand-secondary: #2e7d32;    /* أخضر الإصلاح */
  --brand-secondary-700: #1f5b23;
  --brand-secondary-100: #e6f2e7;
  --brand-accent: #6a2c91;       /* بنفسجي السوسن */
  --brand-accent-100: #f0e7f6;
  --brand-highlight: #ce1126;    /* أحمر العلم (نادر) */
  --brand-gold: #c9a227;         /* ذهبي السنبلة */

  /* ---------- المحايدات (Neutrals) ---------- */
  --ink: #0f1729;
  --slate: #44546a;
  --muted: #6b7280;
  --line: #e5e7eb;
  --surface: #f5f7fa;
  --surface-2: #eef1f6;
  --card: #ffffff;
  --bg: #ffffff;

  /* ---------- ألوان دلالية (Semantic) ---------- */
  --success: #2e7d32;
  --info: #1f6feb;
  --warning: #c9a227;
  --danger: #ce1126;

  /* ---------- أدوار مشتقة (تُبدَّل في الوضع الليلي) ---------- */
  --color-primary: var(--brand-primary);
  --color-primary-contrast: #ffffff;
  --text-strong: var(--ink);
  --text: #1f2937;
  --text-muted: var(--muted);
  --bg-body: var(--bg);
  --bg-surface: var(--surface);
  --bg-surface-2: var(--surface-2);
  --bg-card: var(--card);
  --border-color: var(--line);
  --header-bg: rgba(255, 255, 255, 0.85);
  --footer-bg: #0f1729;
  --footer-text: #c7cede;

  /* ---------- الطباعة (Typography) ---------- */
  --font-ar-body: "Tajawal", "Segoe UI", system-ui, sans-serif;
  --font-ar-head: "Cairo", "Tajawal", system-ui, sans-serif;
  --font-en-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-en-head: "Poppins", "Inter", system-ui, sans-serif;
  --font-body: var(--font-ar-body);
  --font-head: var(--font-ar-head);

  --fs-800: clamp(2.25rem, 1.6rem + 3vw, 3.25rem); /* Hero */
  --fs-700: clamp(1.9rem, 1.4rem + 2vw, 2.6rem);   /* H1 */
  --fs-600: clamp(1.6rem, 1.3rem + 1.3vw, 2.1rem); /* H2 */
  --fs-500: clamp(1.3rem, 1.15rem + 0.6vw, 1.6rem);/* H3 */
  --fs-400: 1.25rem;   /* H4 */
  --fs-300: 1.0625rem; /* lead */
  --fs-200: 1rem;      /* body */
  --fs-100: 0.875rem;  /* small */
  --fs-50: 0.78rem;    /* micro */

  --lh-tight: 1.2;
  --lh-body: 1.75;

  /* ---------- المسافات (8pt Spacing Scale) ---------- */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;
  --section-y: clamp(3rem, 2rem + 4vw, 6rem);

  /* ---------- الزوايا (Radius) ---------- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* ---------- الظلال (Shadows) ---------- */
  --shadow-sm: 0 1px 2px rgba(15, 23, 41, 0.06), 0 1px 3px rgba(15, 23, 41, 0.08);
  --shadow-md: 0 6px 18px rgba(15, 23, 41, 0.08), 0 2px 6px rgba(15, 23, 41, 0.06);
  --shadow-lg: 0 18px 40px rgba(15, 23, 41, 0.14), 0 6px 14px rgba(15, 23, 41, 0.08);
  --shadow-primary: 0 10px 24px rgba(31, 44, 143, 0.28);

  /* ---------- الحركة (Motion) ---------- */
  --t-fast: 0.2s ease;
  --t-base: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);

  /* ---------- التخطيط (Layout) ---------- */
  --container-max: 1200px;
  --header-h: 76px;
  --z-header: 1030;
  --z-dropdown: 1040;
  --z-modal: 1060;
}

/* ============================================================
   الوضع الليلي (Dark Mode)
   ============================================================ */
[data-theme="dark"] {
  --color-primary: var(--brand-primary-300);
  --color-primary-contrast: #0b1020;
  --text-strong: #f4f6fc;
  --text: #e6e9f2;
  --text-muted: #9aa6c2;
  --bg-body: #0b1020;
  --bg-surface: #111a2e;
  --bg-surface-2: #16213c;
  --bg-card: #16213c;
  --border-color: #24304f;
  --header-bg: rgba(11, 16, 32, 0.85);
  --footer-bg: #080c18;
  --footer-text: #9aa6c2;

  --brand-primary-100: #1c2648;
  --brand-secondary-100: #14351a;
  --brand-accent-100: #2a1b3a;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.55);
}

/* دعم تفضيل النظام قبل اختيار المستخدم يدويًا */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --color-primary: var(--brand-primary-300);
    --color-primary-contrast: #0b1020;
    --text-strong: #f4f6fc;
    --text: #e6e9f2;
    --text-muted: #9aa6c2;
    --bg-body: #0b1020;
    --bg-surface: #111a2e;
    --bg-surface-2: #16213c;
    --bg-card: #16213c;
    --border-color: #24304f;
    --header-bg: rgba(11, 16, 32, 0.85);
    --footer-bg: #080c18;
    --footer-text: #9aa6c2;
  }
}

/* عائلة الخط تتبع لغة الصفحة تلقائيًا */
html[lang="en"] {
  --font-body: var(--font-en-body);
  --font-head: var(--font-en-head);
}
