/* ============================================================================
   BRAND THEME — beralmuraba (الجمعية الخيرية بمركز المربع)

   Tokens only. The structural differences from the other association sites on this
   codebase (letterhead header, typographic hero, service-area route, light footer) live
   in overrides.css beside this file; this file decides how everything is PAINTED.

   ── WHERE THE PALETTE COMES FROM ───────────────────────────────────────────
   The association's emblem (brands/beralmuraba/assets/images/logo.png, taken from its
   own 2023 annual report): a deep pine-green roundel with two minarets and a wheat
   stalk, inside an olive-gold wreath. Its 2024 report adds a teal-green + charcoal
   cover. So: PINE for everything that carries the brand, OLIVE for the wreath's warmth
   (rules, dots, the emblem's echo — never text), warm STONE for the ground instead of
   white bands. Hue 158° — 66° from المرامية's olive green (92°) and 20° from
   تلعة نزا's emerald (138°), and darker than both, so the three sites do not read as
   one design recoloured.

   ── CONTRAST BUDGET (WCAG 2.x, every figure COMPUTED — recompute on any change) ──
     --pine-900 #0E2C22 on white .......... 14.98:1  ✓ headings
     --pine-900 on --stone-50 ............. 13.73:1  ✓
     white ON --pine-800 #12402F .......... 11.67:1  ✓ the deep ground (nav bar, route band)
     --on-deep-muted (.78) ON --pine-800 ..  7.76:1  ✓
     --on-deep-faint (.66) ON --pine-800 ..  6.03:1  ✓
     --pine     #156548 on white ..........  7.03:1  ✓ links, primary fill
     --pine     on --stone-50 .............  6.44:1  ✓ eyebrows / links on the stone band
     white ON --pine ......................  7.03:1  ✓ primary button label
     --pine-700 #0F4F38 on white ..........  9.56:1  ✓ hover / pressed / --info
     --pine-900 ON --pine-200 ............. 11.48:1  ✓ glyph in an icon tile
     --ink      #1B231F on white .......... 16.07:1  ✓ body
     --ink-muted #56615B on white .........  6.45:1  ✓ / --stone-50 5.91 / --stone 5.02 ✓
     --olive-ink #6A621C on white .........  6.22:1  ✓ THE warm text colour
     --olive-ink on --olive-wash ..........  5.43:1  ✓ / on --stone-50 5.70 ✓
     --ok       #2E6B1F on white ..........  6.48:1  ✓ (hue 108°, 50° off the brand)
     --olive    #A69B45 on white ..........  2.84:1  ✗ DECORATIVE ONLY — never text
     --olive    on --pine-800 .............  4.11:1  ✗ still barred as text on the dark ground
     --pine-300 #5E9C83 on white ..........  3.20:1  ✗ DECORATIVE ONLY
     --ink-faint #8B948F on white .........  3.12:1  ✗ separators / disabled only
   ============================================================================ */

:root {
  /* ── Identity palette ───────────────────────────────────────────────────── */
  --pine-900: #0E2C22;
  --pine-800: #12402F;
  --pine:     #156548;
  --pine-700: #0F4F38;
  --pine-300: #5E9C83;   /* decorative only */
  --pine-200: #D2E6DC;   /* icon tiles, avatars, media placeholders — 1.30:1 vs white */
  --pine-100: #EAF4EE;
  --olive:      #A69B45; /* the wreath — rules, dots, emblem echoes. NEVER text */
  --olive-ink:  #6A621C; /* the warm TEXT colour */
  --olive-wash: #F4F0DB;
  --stone:    #E8E3D3;
  --stone-50: #F7F5EE;

  /* ── Semantic roles (site.css names only these) ─────────────────────────── */
  --brand:        var(--pine);
  --brand-strong: var(--pine-900);
  --brand-hover:  var(--pine-700);
  --brand-decor:  var(--pine-300);
  --accent:       var(--olive);
  --accent-ink:   var(--olive-ink);
  --accent-wash:  var(--olive-wash);

  --paper:          #FFFFFF;
  --surface-soft:   var(--stone-50);
  --surface-strong: var(--stone);
  --surface-deep:   var(--pine-800);

  --ink:            #1B231F;
  --ink-muted:      #56615B;
  --ink-faint:      #8B948F;
  --on-deep:        #FFFFFF;
  --on-deep-muted:  rgba(255, 255, 255, .78);
  --on-deep-faint:  rgba(255, 255, 255, .66);

  --line:           #E2E0D6;
  --line-soft:      #EEECE4;
  --line-strong:    #D0CCBD;
  --line-deep:      rgba(255, 255, 255, .16);
  --row-hover:      #FBFAF6;
  --surface-hover:  #F0EDE2;

  --info:      var(--pine-700);
  --info-wash: var(--pine-100);
  --info-line: #C9DDD2;

  --danger:       #B3261E;
  --danger-wash:  #FDECEA;
  --danger-line:  #F2C7C3;
  --danger-ink:   #4A100C;
  --danger-hover: #8E1E17;
  --ok:           #2E6B1F;
  --ok-wash:      #EAF3E2;
  --ok-line:      #C3DBB3;
  --warn:         #7A4B10;
  --warn-wash:    #FBEEDC;
  --warn-line:    #E4C48E;

  --field-bg:          #FFFFFF;
  --field-fg:          var(--ink);
  --field-line:        #C3CAC5;
  --field-placeholder: #8E9792;
  --focus-ring:        var(--brand);
  /* --pine restated as rgba — no color-mix() on the Chrome 81 floor (D12). MOVES WITH --pine.
     #156548 = rgb(21, 101, 72). */
  --focus-ring-soft:   rgba(21, 101, 72, .28);
  --focus-ring-deep:   #FFFFFF;

  --scrim:                 rgba(14, 26, 21, .52);
  --lightbox-bg:           rgba(14, 26, 21, .94);
  --lightbox-chrome:       rgba(255, 255, 255, .10);
  --lightbox-chrome-hover: rgba(255, 255, 255, .22);
  --lightbox-chrome-line:  rgba(255, 255, 255, .40);
  --deep-fill:             rgba(255, 255, 255, .07);
  --deep-fill-strong:      rgba(255, 255, 255, .12);

  --skeleton-a: #EEECE4;
  --skeleton-b: #F7F5EE;

  --chip-neutral-bg:   var(--stone-50);
  --chip-neutral-fg:   #47524C;
  --chip-neutral-line: var(--line-strong);
  --doc-pdf-bg: #F7E3E1;  --doc-pdf-fg: #8E1E17;
  --doc-doc-bg: #E1E9F5;  --doc-doc-fg: #1B4576;

  --st-submitted-bg: #EEF1EF;  --st-submitted-fg: #3D4842;              --st-submitted-line: #D6DCD8;
  --st-review-bg:    var(--olive-wash);  --st-review-fg: var(--olive-ink); --st-review-line: var(--olive);
  --st-needsinfo-bg: var(--warn-wash);   --st-needsinfo-fg: var(--warn);   --st-needsinfo-line: var(--warn-line);
  --st-approved-bg:  var(--ok-wash);     --st-approved-fg: var(--ok);      --st-approved-line: var(--ok-line);
  --st-rejected-bg:  var(--danger-wash); --st-rejected-fg: var(--danger);  --st-rejected-line: var(--danger-line);
  --st-closed-bg:    transparent;        --st-closed-fg: var(--ink-muted); --st-closed-line: var(--line-strong);

  /* Stroke = --ink-muted #56615B. A data URI cannot take a var(); recolour it with --ink-muted. */
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%2356615B' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");

  /* ── Type ───────────────────────────────────────────────────────────────── */
  /* IBM Plex Sans Arabic: a humanist, slightly condensed face with open counters — reads as an
     institution's letterhead rather than the rounder Cairo/Tajawal of the sibling sites. */
  --font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, -apple-system, sans-serif;
  --font-display: var(--font);

  --fs-xs:   0.8125rem;
  --fs-sm:   clamp(0.875rem, 0.85rem + 0.12vw, 0.9375rem);
  --fs-base: clamp(1rem, 0.96rem + 0.18vw, 1.0625rem);
  --fs-md:   clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  --fs-lg:   clamp(1.1875rem, 1.1rem + 0.45vw, 1.4375rem);
  --fs-xl:   clamp(1.4375rem, 1.25rem + 0.9vw, 1.9375rem);
  --fs-2xl:  clamp(1.75rem, 1.4rem + 1.7vw, 2.5rem);
  --fs-3xl:  clamp(2.125rem, 1.4rem + 3.4vw, 3.75rem);
  --fs-stat: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  --fs-tagline: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  --fs-unit: 0.42em;

  --lh-body: 1.95;
  --lh-tight: 1.4;
  --lh-hero: 1.3;
  --lh-display: 1.22;

  /* Only 400/500/700 are shipped (fonts/plex-arabic.css); 800 would be faux-bolded. */
  --h-weight: 700;
  --h-weight-strong: 700;
  --h-tracking: 0;
  --h-color: var(--brand-strong);

  --measure: 72ch;
  --measure-narrow: 64ch;
  --measure-lead: 56ch;

  /* ── Space and rhythm ───────────────────────────────────────────────────── */
  --s0: 2px;
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --s10: 128px;

  --container: 1180px;
  --container-narrow: 800px;
  --container-wide: 1320px;
  --gutter: clamp(16px, 4vw, 32px);

  /* More air than the siblings: this site has no photography to carry its bands. */
  --band-y: clamp(48px, 8vw, 104px);
  --band-y-tight: clamp(32px, 5vw, 64px);
  --band-y-hero: clamp(48px, 7vw, 96px);
  --grid-gap: var(--s5);

  /* ── Shape ──────────────────────────────────────────────────────────────── */
  /* Square-cut surfaces with ROUND actions: cards and media take a 6px corner, while buttons,
     chips and avatars are fully round — the circle is the emblem's own shape. */
  --r-xs: 3px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;
  --r-pill: 999px;
  --r-btn: var(--r-pill);
  --r-card: var(--r-md);
  --r-field: var(--r-sm);
  --r-chip: var(--r-pill);
  --r-media: var(--r-sm);
  --r-avatar: var(--r-pill);

  --bd: 1px;
  --bd-strong: 2px;

  --card-bg: var(--paper);
  --card-border-color: var(--line);
  --card-shadow: none;
  --card-hover-border: var(--pine-300);
  --card-hover-lift: 0px;
  --card-pad: var(--s5);

  --btn-radius: var(--r-btn);
  --btn-weight: 700;
  --btn-min-h: 46px;
  --btn-pad-x: 28px;
  --btn-pad-y: 10px;
  --btn-fs: var(--fs-sm);
  --btn-transform: none;
  --btn-tracking: 0;

  /* The signature mark: a long, thin olive rule (the wreath's stem), not a short bar. */
  --rule-w: 44px;
  --rule-h: 2px;
  --rule-color: var(--accent);

  --shadow-pop: 0 12px 30px -16px rgba(14, 44, 34, .28);

  /* ── Hero (the shared .hero is not used on the home page here — see overrides.css) ── */
  --hero-bg: var(--surface-deep);
  --hero-image-opacity: .14;
  /* --pine-800 restated as rgba. MOVES WITH --pine-800. #12402F = rgb(18, 64, 47). */
  --hero-overlay: linear-gradient(to left, rgba(18, 64, 47, .96) 0%, rgba(18, 64, 47, .84) 100%);
  --hero-y: clamp(48px, 9vw, 112px);

  /* ── Motion ─────────────────────────────────────────────────────────────── */
  --dur: 160ms;
  --dur-slow: 220ms;
  --dur-enter: 420ms;
  --ease: cubic-bezier(.2, .7, .3, 1);

  /* ── Z-index ────────────────────────────────────────────────────────────── */
  --z-base:     0;
  --z-sticky:   100;
  --z-dropdown: 110;
  --z-scrim:    140;
  --z-drawer:   150;
  --z-modal:    160;
  --z-lightbox: 300;
  --z-toast:    400;
  --z-skip:     500;

  color-scheme: light;
  accent-color: var(--brand);
}
