/* ============================================================
   مركز عبدالرحمن جاسم كانو — Design System (theme.css)
   نظام تصميم مشترك: الرموز اللونية، الخطوط، المكونات الأساسية
   ============================================================ */

/* -------- 1. Design Tokens -------- */
:root {
  /* Brand — Sage green */
  --sage-900: #4f5a45;
  --sage-700: #65745a;
  --sage-600: #788768;
  --sage-500: #8f9d83;   /* primary */
  --sage-400: #a4b199;
  --sage-300: #bfc8b2;
  --sage-200: #d6dccb;
  --sage-100: #e8ecdf;
  --sage-50:  #f1f4ec;

  /* Warm dark olive (stats / contrast sections) */
  --olive-900: #3a3529;
  --olive-700: #4c4637;
  --olive-500: #5d5645;

  /* Accents */
  --gold:      #b59b62;
  --gold-soft: #d8c79b;
  --gold-50:   #f1ebdb;
  --blue:      #7f99a6;
  --blue-50:   #e8eff2;
  --mauve:     #c5a9a9;
  --mauve-50:  #efe3e3;

  /* Neutrals */
  --bg:        #f6f7f2;   /* page background (warm off-white) */
  --bg-soft:   #f8faf6;   /* alternate light section */
  --surface:   #ffffff;   /* cards */
  --surface-2: #f2f3ec;   /* subtle panels */
  --ink:       #4f5a45;   /* headings */
  --ink-soft:  #54564b;   /* body text */
  --muted:     #8c8e82;   /* secondary text */
  --line:      #e7e8df;   /* borders / dividers */
  --line-soft: #f0f1ea;

  /* Typography */
  --font: "Tajawal", "Segoe UI", Tahoma, system-ui, sans-serif;
  --fs-xs: .75rem;
  --fs-sm: .875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.25rem;
  --fs-3xl: 3rem;

  /* Spacing scale (4px base) */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px; --sp-20: 80px; --sp-24: 96px;

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* Shadows */
  --sh-xs: 0 1px 2px rgba(42,43,37,.05);
  --sh-sm: 0 2px 8px rgba(42,43,37,.06);
  --sh-md: 0 8px 24px rgba(42,43,37,.08);
  --sh-lg: 0 18px 50px rgba(42,43,37,.12);

  /* Layout */
  --container: 1200px;
  --header-h: 76px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* -------- 2. Reset -------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.75;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5 { color: var(--ink); line-height: 1.3; font-weight: 800; }
:focus-visible { outline: 2px solid var(--sage-500); outline-offset: 2px; border-radius: 4px; }

/* -------- 3. Layout helpers -------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}
.section { padding-block: var(--sp-20); }
.section--tight { padding-block: var(--sp-12); }
.section--soft { background: var(--bg-soft); }

/* Section heading (right-aligned label with rule line) */
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}
.sec-head__title {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--ink);
}
.sec-head__title .ico { width: 30px; height: 30px; color: var(--sage-600); flex: none; }
.sec-head__more {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--muted);
  font-weight: 500;
  transition: color .2s var(--ease);
}
.sec-head__more:hover { color: var(--sage-600); }
.sec-head__more .ico { width: 16px; height: 16px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--sage-600);
  letter-spacing: .2px;
}

/* -------- 4. Buttons -------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 11px 22px;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: var(--fs-sm);
  line-height: 1;
  white-space: nowrap;
  transition: transform .15s var(--ease), background .2s var(--ease),
              box-shadow .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn .ico { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--sage-500); color: #fff; box-shadow: var(--sh-sm); }
.btn--primary:hover { background: var(--sage-600); box-shadow: var(--sh-md); }

.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #000; }

.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn--ghost:hover { border-color: var(--sage-400); color: var(--sage-700); background: var(--sage-50); }

.btn--light { background: var(--surface); color: var(--ink); box-shadow: var(--sh-xs); border: 1px solid var(--line); }
.btn--light:hover { background: var(--sage-50); border-color: var(--sage-200); }

.btn--sm { padding: 8px 14px; font-size: var(--fs-xs); }
.btn--lg { padding: 14px 30px; font-size: var(--fs-base); }
.btn--block { width: 100%; }

/* -------- 5. Badges & chips -------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1;
}
.badge--live { background: var(--surface); color: var(--gold); box-shadow: var(--sh-sm); }
.badge--live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px var(--gold-50); }
.badge--sage { background: var(--sage-100); color: var(--sage-700); }
.badge--gold { background: var(--gold-50); color: var(--gold); }
.badge--blue { background: var(--blue-50); color: var(--blue); }
.badge--closed { background: var(--mauve-50); color: #9b5a5a; }
.badge--closed .dot { width: 7px; height: 7px; border-radius: 50%; background: #b08a8a; box-shadow: 0 0 0 3px rgba(197,169,169,.35); }
.badge--soon { background: #fff1e0; color: #b3650f; box-shadow: var(--sh-sm); }
.badge--soon .dot { width: 7px; height: 7px; border-radius: 50%; background: #ea8a2c; box-shadow: 0 0 0 3px rgba(234,138,44,.28); }
.badge--expired { background: #fbe4e1; color: #b3321f; box-shadow: var(--sh-sm); }
.badge--expired .dot { width: 7px; height: 7px; border-radius: 50%; background: #d63b25; box-shadow: 0 0 0 3px rgba(214,59,37,.25); }
.badge--inactive { background: #fbe4e1; color: #b3321f; box-shadow: var(--sh-sm); }
.badge--inactive .dot { width: 7px; height: 7px; border-radius: 50%; background: #d63b25; box-shadow: 0 0 0 3px rgba(214,59,37,.25); }

/* -------- 6. Card base -------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.card--hover:hover { transform: translateY(-4px); box-shadow: var(--sh-md); border-color: var(--sage-200); }

/* -------- 7. Forms -------- */
.field {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field::placeholder { color: var(--muted); }
.field:focus { outline: none; border-color: var(--sage-400); box-shadow: 0 0 0 3px var(--sage-50); }

/* -------- 8. Decorative geometric logo mark -------- */
.brand { display: inline-flex; align-items: center; gap: var(--sp-3); }
.brand__mark {
  width: 42px; height: 42px; flex: none;
  color: var(--sage-600);
}
img.brand__mark { object-fit: contain; border-radius: 8px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-weight: 800; font-size: var(--fs-md); color: var(--ink); letter-spacing: -.3px; }
.brand__tag { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }

/* -------- 9. Utilities -------- */
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8;
       stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico--fill { fill: currentColor; stroke: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--muted); }
.text-sage { color: var(--sage-600); }
.divider { height: 1px; background: var(--line); border: 0; }

/* Progress bar */
.progress { height: 8px; border-radius: var(--r-pill); background: var(--sage-100); overflow: hidden; }
.progress__fill { height: 100%; border-radius: inherit; background: var(--sage-500);
                  transition: width 1s var(--ease); }

/* Reveal-on-scroll animation — gated by .js so content is visible without/before JS */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* Hidden SVG sprite host */
#icon-sprite { display: none; }
