/* Jubail Commons — design tokens.
   Three layers, by precedence:
   1. :root            — platform defaults (ratified palette, brand pass 2026-11-02;
                         see docs/brand.md — replace values, never variable names).
   2. [data-community] — per-community overrides, applied at runtime from the
                         community's config row (brand lives in the DB).
   3. [data-look]      — per-event looks (halloween, haq_al_laila, …), applied on top.
   Modules style against variables only — never raw colors.

   OVERRIDE GUARDRAIL — layers 2 and 3 may set accent, brand-deep, surfaces,
   ink and shape tokens. They must NEVER set the four semantic signals:
     --jc-info    (teal — allergy-friendly / informational, reserved)
     --jc-danger  (red — alert)
     --jc-warn    (amber — warning)
     --jc-good    (green — available / confirmed)
   A community that restyles a safety signal breaks it for its residents.
   The config loader DROPS these keys from override rows; keep it that way. */

:root{
  color-scheme:dark;          /* the site is already dark: no browser auto-darkening (2026-11-05) */
  /* surfaces — warm dark (product default) */
  --jc-bg:#141210;
  --jc-surface:#1f1c17;
  --jc-surface-2:#2a2620;
  --jc-line:#3b352c;
  /* text */
  --jc-ink:#f6f2e9;
  --jc-muted:#a9a294;
  --jc-faint:#9a9384;  /* R3c: ≥ 4.5:1 on bg AND both surfaces (6.12 / 5.56 / 4.93; was #878072: 4.33 on surface, 3.84 on surface-2 — axe) */
  /* roles */
  --jc-accent:#3e9b76;        /* primary action — mangrove */
  --jc-accent-ink:#06231b;    /* text on accent */
  --jc-brand-deep:#14453a;    /* brand chrome: headers, admin band, the mark */
  --jc-good:#6fcf8f;
  --jc-warn:#f2b33c;
  --jc-danger:#ef7b7b;
  --jc-info:#58c4d4;          /* allergy-friendly / informational marker */
  --jc-mine:#8fb4ff;          /* "yours" on court slots: a hue no other slot state uses (Zee 2026-11-09: green on green) */
  --jc-mine-ink:#0b1633;      /* text on --jc-mine */
  --jc-me:#3a86ff;            /* the "you are here" dot on maps — the blue people recognise (Zee 2026-11-11); same in light */
  /* shape & type */
  --jc-radius:14px;
  --jc-radius-pill:999px;
  --jc-font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans Arabic",
            "Geeza Pro",sans-serif;  /* one stack serves EN + AR */
  --jc-font-display:var(--jc-font);
}

/* Light — print, docs, light surfaces (warm sand) */
[data-theme="light"]{
  color-scheme:light;
  --jc-bg:#fbf7ef;
  --jc-surface:#ffffff;
  --jc-surface-2:#f4eee2;
  --jc-line:#e2d8c6;
  --jc-ink:#1b1a16;
  --jc-muted:#6a6456;
  --jc-faint:#7a6c50;        /* darkened from proposed #8a7a5c — 4.81:1 on sand (was 3.92) */
  --jc-accent:#1c6b52;        /* mangrove deep — mid green lacks contrast on sand */
  --jc-accent-ink:#fbf7ef;    /* #06231b on deep green is 2.59:1 — light ink required here */
}

/* Pin rings (T5.2 PR 5a): the question marked "ring" colours each pin's border, one colour
   per choice in order. Kept clear of the four signals and of the looks' accents. */
:root{
  --jc-ring-0:#ffffff; --jc-ring-1:#b388ff; --jc-ring-2:#ff7eb6;
  --jc-ring-3:#7cc4ff; --jc-ring-4:#c6f36b; --jc-ring-5:#111111;
}

/* Event looks (T5.2 PR 5a) — layer 3: the event page sets html[data-look] from the
   event's `look`; an events-list card carries its own data-look. "plain" = no overlay.
   Same guardrail: never the four signals. */
[data-look="halloween"]{
  --jc-bg:#15101c; --jc-surface:#201a2b; --jc-surface-2:#2b2338; --jc-line:#3a3150;
  --jc-accent:#f28c28; --jc-accent-ink:#1a0d00; --jc-brand-deep:#3a1f4d;
}
[data-look="haq_al_laila"]{     /* deep navy + lantern gold (Zee's concept, Oct 2026) */
  --jc-bg:#131129; --jc-surface:#1b1838; --jc-surface-2:#252148; --jc-line:#36316b;
  --jc-accent:#e8c05a; --jc-accent-ink:#1a1400; --jc-brand-deep:#2a2560;
}
[data-look="gathering"]{ --jc-accent:#e8956a; --jc-accent-ink:#2a1206; }
[data-look="market"]{ --jc-accent:#d9a441; --jc-accent-ink:#241800; }
[data-look="yard_sale"]{ --jc-accent:#6fb3e8; --jc-accent-ink:#06192a; }
[data-look="holiday_lights"]{   /* R2b-2: an evergreen night + warm string-light gold */
  --jc-bg:#0b1411; --jc-surface:#13201b; --jc-surface-2:#1b2b24; --jc-line:#2a4036;
  --jc-accent:#ffcf66; --jc-accent-ink:#241a00; --jc-brand-deep:#173328;
}

/* RTL: layout must flow from direction, not from side-specific rules.
   Use margin-inline / padding-inline / inset-inline in all Commons CSS. */
[dir="rtl"]{ --jc-dir:rtl; }
[dir="ltr"]{ --jc-dir:ltr; }
