/* ==========================================================================
   Visitors marketplace — Design Tokens
   Source of truth for colors, type, spacing, radius, elevation, motion.
   Light theme only. RTL (Arabic) first.
   Import once at the app root, e.g. in globals.css:  @import "./tokens.css";
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;

  /* ---------- Neutrals ---------- */
  --kw-bg: #F3F4F7;          /* page background */
  --kw-surface: #FFFFFF;     /* cards, header, inputs */
  --kw-tint: #F6F7FA;        /* subtle fills: fact cells, search box, notes */
  --kw-ink: #141B2D;         /* primary text, dark chips */
  --kw-muted: #5A6275;       /* secondary text */
  --kw-subtle: #687082;      /* captions, labels, meta (≥4.5:1 on tint) */
  --kw-border: #E2E5EC;      /* card & control borders */
  --kw-line: #EDEFF4;        /* dividers, tracks, inner grid lines */
  --kw-star-off: #D5D9E2;    /* empty rating stars */

  /* ---------- Brand: primary (sync Visitors shell #0042ff) ---------- */
  --kw-primary: #0042ff;
  --kw-primary-2: #0036d6;   /* gradient end, pressed */
  --kw-primary-ink: #FFFFFF; /* text on primary */
  --kw-primary-soft: #e6edff;/* selected chips, positive tags, soft buttons */

  /* ---------- Brand: Gold (subscription / locked / ratings) ---------- */
  --kw-gold: #B7791F;        /* icons, stars, fills, borders */
  --kw-gold-strong: #93600F; /* gold buttons (white text 5.4:1) + gold text on gold-soft (4.8:1) */
  --kw-gold-ink: #FFFFFF;
  --kw-gold-soft: #FBF1DC;
  --kw-gold-line: #EBCF96;

  /* ---------- Semantic ---------- */
  --kw-verified: #2457C5;    /* "هوية موثّقة" shield icon */
  --kw-media: #6B3FBF;       /* video / media accents */
  --kw-media-soft: #EFE9FA;
  --kw-danger: #B42318;      /* delete, errors */
  --kw-danger-soft: #FCE9E7;
  --kw-scrim: rgba(20, 27, 45, 0.42);

  /* ---------- Gradients ---------- */
  --kw-grad-navy: linear-gradient(165deg, #0042ff 0%, #0038dd 52%, #0036d6 100%);
  --kw-grad-gold: linear-gradient(120deg, #C08A2E, #8A5A12);
  --kw-grad-purple: linear-gradient(120deg, #6B3FBF, #3F2380);
  --kw-grad-slate: linear-gradient(120deg, #3A4560, #141B2D);
  --kw-grad-logo: linear-gradient(135deg, #0042ff, #0036d6);

  /* ---------- Typography ---------- */
  --kw-font: "Cairo", "Segoe UI", Tahoma, system-ui, sans-serif;
  --kw-fw-regular: 400;
  --kw-fw-medium: 500;
  --kw-fw-semibold: 600;
  --kw-fw-bold: 700;
  --kw-fw-extrabold: 800;

  --kw-fs-micro: 11px;   /* fact labels (dt), code badges */
  --kw-fs-caption: 12px; /* chips, meta, counters */
  --kw-fs-small: 13px;   /* small buttons, secondary lines */
  --kw-fs-body-sm: 14px; /* buttons, list text, form fields */
  --kw-fs-body: 15px;    /* default body */
  --kw-fs-lead: 17px;    /* headline under name */
  --kw-fs-title: 19px;   /* card/section titles (sec-title) */
  --kw-fs-h3: 22px;      /* home section headings (الأقسام) */
  --kw-fs-h2: 24px;      /* slider title, CV name */
  --kw-fs-h1: 30px;      /* candidate name on details page */
  --kw-fs-display: 48px; /* rating average */

  --kw-lh-body: 1.6;
  --kw-lh-heading: 1.3;

  /* ---------- Spacing (4px base) ---------- */
  --kw-space-1: 4px;
  --kw-space-2: 8px;
  --kw-space-3: 12px;
  --kw-space-4: 16px;
  --kw-space-5: 20px;
  --kw-space-6: 24px;
  --kw-space-7: 28px;
  --kw-space-8: 32px;
  --kw-space-10: 40px;

  /* ---------- Radius ---------- */
  --kw-radius-xs: 6px;    /* tiny buttons (copy), focus ring */
  --kw-radius-sm: 8px;    /* sort select, nav link, small badges */
  --kw-radius-md: 10px;   /* buttons, inputs */
  --kw-radius-lg: 12px;   /* fact grids, thumbnails, contact rows, icon tiles */
  --kw-radius-xl: 16px;   /* category tile, media stage */
  --kw-radius-2xl: 18px;  /* cards */
  --kw-radius-3xl: 20px;  /* ads slider */
  --kw-radius-pill: 999px;

  /* ---------- Elevation ---------- */
  --kw-shadow-card: 0 4px 18px rgba(20, 27, 45, 0.06);
  --kw-shadow-hover: 0 14px 32px rgba(20, 27, 45, 0.10);
  --kw-shadow-portrait: 0 8px 24px rgba(20, 27, 45, 0.16);
  --kw-shadow-drawer: 0 0 40px rgba(20, 27, 45, 0.20);
  --kw-shadow-toast: 0 10px 30px rgba(0, 0, 0, 0.20);

  /* ---------- Layout ---------- */
  --kw-container: 1320px;
  --kw-gutter: 20px;          /* 16px under 640px */
  --kw-header-h: 66px;
  --kw-sidebar-w: 350px;      /* details page aside */
  --kw-grid-gap: 20px;

  /* ---------- Z-index ---------- */
  --kw-z-secnav: 15;
  --kw-z-header: 20;
  --kw-z-scrim: 40;
  --kw-z-drawer: 41;
  --kw-z-toast: 60;

  /* ---------- Motion ---------- */
  --kw-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --kw-dur-fast: 150ms;   /* borders, colors */
  --kw-dur-base: 200ms;   /* card hover lift */
  --kw-dur-slide: 550ms;  /* ads slider transition */
  --kw-slider-interval: 5500ms;
  /* Wide hero banner — match uploads at 1320×363 (1024×282 source ratio) */
  --kw-slider-aspect: 512 / 141;
}

@media (max-width: 640px) {
  :root {
    --kw-gutter: 16px;
    --kw-header-h: 58px;
    /* Fallback when no dedicated mobile slide art (crop wide desktop banner) */
    --kw-slider-mobile-min-h: 200px;
    /* Dedicated mobile uploads (2:1) — see dashboard slider hints */
    --kw-slider-mobile-aspect: 2 / 1;
  }
}

/* ---------- Scoped base (Visitors Home — do not override global layout) ---------- */
.kw-home {
  background: var(--kw-bg);
  color: var(--kw-ink);
  font-family: var(--kw-font);
  font-size: var(--kw-fs-body);
  line-height: var(--kw-lh-body);
}
.kw-home h1,
.kw-home h2,
.kw-home h3 {
  margin: 0;
  line-height: var(--kw-lh-heading);
  text-wrap: balance;
}
.kw-home p { margin: 0; }
.kw-home :focus-visible {
  outline: 2px solid var(--kw-primary);
  outline-offset: 2px;
  border-radius: var(--kw-radius-xs);
}
.kw-num { font-variant-numeric: tabular-nums; }
.kw-ltr { direction: ltr; unicode-bidi: isolate; }
.kw-container {
  max-width: var(--kw-container);
  margin-inline: auto;
  padding-inline: var(--kw-gutter);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
