/* =========================================================================
   Jamaity — sections

   Page-level furniture: headers, footers, CTAs, figure blocks, the category
   tiles, and the brand patterns behind them. Components (buttons, tags,
   cards) live in components.css; these are the things a page is *made of*.

   Template parts:
     .c-iconcard  -> template-parts/card/category.php
     .c-pattern   -> template-parts/ui/pattern.php
     .c-header--* -> template-parts/header/{modern,editorial,brand}.php
     .c-footer--* -> template-parts/footer/{modern,editorial,brand}.php
     .c-stats--*  -> template-parts/section/stats-{rule,grid,band}.php
     .c-cta--*    -> template-parts/section/cta-{band,split,card}.php
   ========================================================================= */

/* -------------------------------------------------------------------------
   Brand patterns

   The logo has no texture of its own, so the patterns are built from its
   grammar rather than from the mark: the dot motif as a field, and nested
   open arcs as the shelter motif. Never the mark itself tiled — a repeated
   logo is wallpaper, not a pattern.
   ------------------------------------------------------------------------- */

.c-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: var(--shape-accent);
  opacity: var(--pattern-opacity, 0.18);
}

/* The dot motif, as a field. currentColor so it re-tints per context. */
.c-pattern--dots {
  background-image: radial-gradient(currentColor 1.5px, transparent 1.6px);
  background-size: var(--pattern-size, 22px) var(--pattern-size, 22px);
}

/* Fades the field out so it never competes with the text sitting on it. */
.c-pattern--fade {
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
  mask-image: linear-gradient(to bottom, #000, transparent);
}

/* -------------------------------------------------------------------------
   Category tile — .c-iconcard

   For the thematic entry points (Gouvernance, Environnement, Genre…).
   Vertical by default; --row for sidebars and dense lists.
   ------------------------------------------------------------------------- */

.c-iconcard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-6);
  background: var(--surface-raised);
  border: var(--stroke) solid var(--border);
  text-decoration: none;
  color: inherit;
  block-size: 100%;

  /* Same asymmetric corner as the record cards — one family. */
  border-start-start-radius: var(--radius-xl);
  border-start-end-radius:   var(--radius-xl);
  border-end-end-radius:     var(--radius-xl);
  border-end-start-radius:   var(--radius-sm);

  transition:
    border-color var(--dur-base) var(--ease-out),
    background   var(--dur-base) var(--ease-out);
}

.c-iconcard:hover {
  border-color: var(--border-strong);
  background: var(--surface-sunken);
}

/* Mint ground, blue mark — 7.8:1, and the logo's own pairing used as it is
   meant to be: as shape, not as type. */
.c-iconcard__icon {
  display: grid;
  place-items: center;
  inline-size: var(--icon-plate, 52px);
  block-size: var(--icon-plate, 52px);
  flex: none;
  border-radius: var(--radius-md);
  background: var(--surface-accent);
  color: var(--blue-700);
  transition: scale var(--dur-base) var(--ease-out);
}

.c-iconcard:hover .c-iconcard__icon { scale: 1.06; }

/* The glyph is 55% of the plate, whatever the plate is set to. A webfont icon
   has no box to scale, so the ratio has to go through font-size instead. */
.c-iconcard__icon svg.icon { inline-size: 55%; block-size: 55%; }
.c-iconcard__icon i.ph    { font-size: calc(var(--icon-plate, 52px) * 0.55); }

.c-iconcard__label {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
}

.c-iconcard__count {
  font-size: var(--fs-xs-raw);   /* chrome — constant across languages */
  color: var(--text-muted);
}

.c-iconcard__body { display: flex; flex-direction: column; gap: var(--sp-1); min-inline-size: 0; }

/* Pushes the count to the bottom so a grid of tiles keeps one baseline
   even when labels wrap to two lines. */
.c-iconcard:not(.c-iconcard--row) .c-iconcard__body { margin-block-start: auto; }

/* --- Horizontal ---------------------------------------------------------- */

.c-iconcard--row {
  flex-direction: row;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  block-size: auto;
}

.c-iconcard--row .c-iconcard__body { flex: 1; }
.c-iconcard--row .c-iconcard__label { font-size: var(--fs-sm); }

.c-iconcard--row .c-iconcard__chevron {
  flex: none;
  color: var(--text-subtle);
  transition: translate var(--dur-base) var(--ease-out);
}

.c-iconcard--row:hover .c-iconcard__chevron { translate: 3px 0; color: var(--text-link); }
[dir="rtl"] .c-iconcard--row .c-iconcard__chevron { scale: -1 1; }
[dir="rtl"] .c-iconcard--row:hover .c-iconcard__chevron { translate: -3px 0; }

.c-iconcard--row { --icon-plate: 40px; }

/* -------------------------------------------------------------------------
   HEADERS
   ------------------------------------------------------------------------- */

/* -------------------------------------------------------------------------
   Logo swap

   The logo is near-invisible on a dark ground (wordmark 1.03:1, blue mark
   1.66:1), so headers and footers on a THEMED ground ship both files and swap
   them. Grounds that are always blue — .c-header--brand, .c-footer--brand —
   use jamaity-logo-on-brand.svg in both themes instead and need no swap.

   In PHP this is one template part that emits both <img>s.
   ------------------------------------------------------------------------- */

.c-logo--dark { display: none; }

:root[data-theme="dark"] .c-logo--light { display: none; }
:root[data-theme="dark"] .c-logo--dark  { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .c-logo--light { display: none; }
  :root:not([data-theme="light"]) .c-logo--dark  { display: block; }
}

/* --- Language switch -----------------------------------------------------
   All three are visible. A dropdown hides the fact that the site is
   trilingual, which on a bilingual-by-content platform is the wrong thing to
   hide — and an Arabic reader should not have to open a menu in a language
   they are not reading to find their own. */

.c-langs {
  display: flex;
  align-items: center;
  gap: var(--stroke);
  padding: 3px;
  border: var(--stroke) solid var(--border);
  border-radius: var(--radius-pill);
}

.c-langs__item {
  display: grid;
  place-items: center;
  min-inline-size: 30px;
  padding-inline: var(--sp-2);
  padding-block: 3px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-2xs-raw);
  font-weight: var(--fw-semibold);
  line-height: 1.6;
  letter-spacing: var(--tracking-wide);
  text-decoration: none;
  color: var(--text-muted);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

/* Arabic is never letter-spaced — the script joins. */
.c-langs__item[lang="ar"] { letter-spacing: 0; font-size: var(--fs-xs-raw); }

.c-langs__item:hover { color: var(--text); }
.c-langs__item.is-on { background: var(--surface-brand); color: var(--text-on-brand); }

.c-header--over .c-langs { border-color: hsl(0 0% 100% / 0.3); }
.c-header--over .c-langs__item { color: hsl(0 0% 100% / 0.72); }
.c-header--over .c-langs__item:hover { color: #fff; }
.c-header--over .c-langs__item.is-on { background: var(--surface-accent); color: var(--text-on-accent); }

.c-header { position: relative; }
.c-header__inner { display: flex; align-items: center; gap: var(--sp-8); }
.c-header__logo { block-size: 30px; inline-size: auto; }
.c-header__actions { display: flex; align-items: center; gap: var(--sp-3); margin-inline-start: auto; }

.c-nav { display: flex; align-items: center; gap: var(--sp-6); }

.c-nav__link {
  position: relative;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  text-decoration: none;
  padding-block: var(--sp-2);
  transition: color var(--dur-fast) var(--ease-out);
}

.c-nav__link:hover { color: var(--text); }
.c-nav__link[aria-current="page"] { color: var(--text); font-weight: var(--fw-semibold); }

/* The dot motif earning its keep: it marks the current page. */
.c-nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset-block-end: -2px;
  inset-inline-start: 50%;
  translate: -50% 0;
  inline-size: 5px;
  block-size: 5px;
  border-radius: var(--radius-pill);
  background: var(--text-link);
}

/* --- 1. Modern: one row, quiet, sticky ----------------------------------- */

.c-header--modern {
  position: sticky;
  inset-block-start: 0;
  z-index: var(--z-header);
  background: var(--surface);
  border-block-end: var(--stroke) solid var(--border);
}

.c-header--modern .c-header__inner { padding-block: var(--sp-4); }

/* --- 2. Editorial: two tiers, generous, restrained ------------------------ */

.c-header--editorial { background: var(--surface); }

.c-header--editorial .c-header__top {
  background: var(--surface-sunken);
  border-block-end: var(--stroke) solid var(--border);
  font-size: var(--fs-2xs-raw);
}

.c-header--editorial .c-header__top .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-block: var(--sp-2);
}

.c-header--editorial .c-header__top a {
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: var(--tracking-wide);
}
.c-header--editorial .c-header__top a:hover { color: var(--text); }

.c-header--editorial .c-header__inner {
  padding-block: var(--sp-8);
  border-block-end: var(--stroke) solid var(--border);
}

.c-header--editorial .c-header__logo { block-size: 38px; }

/* Tracked small caps rather than sentence-case links: the one place the
   system raises its voice typographically instead of chromatically. */
.c-header--editorial .c-nav { gap: var(--sp-8); }
.c-header--editorial .c-nav__link {
  font-size: var(--fs-2xs-raw);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  font-weight: var(--fw-semibold);
}
[lang="ar"] .c-header--editorial .c-nav__link,
[dir="rtl"] .c-header--editorial .c-nav__link {
  text-transform: none;
  letter-spacing: 0;
}

/* --- 3. Branded: on the blue --------------------------------------------- */

.c-header--brand {
  background: var(--surface-brand);
  color: var(--text-on-brand);
  overflow: hidden;
}

.c-header--brand .c-header__inner { padding-block: var(--sp-5); position: relative; z-index: 1; }
.c-header--brand .c-nav__link { color: var(--text-on-brand-muted); }
.c-header--brand .c-nav__link:hover,
.c-header--brand .c-nav__link[aria-current="page"] { color: var(--text-on-brand); }

/* Mint as the marker — shape, not type. */
.c-header--brand .c-nav__link[aria-current="page"]::after { background: var(--shape-accent); }

.c-header--brand .c-pattern { --pattern-opacity: 0.14; }

/* -------------------------------------------------------------------------
   FOOTERS
   ------------------------------------------------------------------------- */

.c-footer { position: relative; }
.c-footer__logo { block-size: 34px; inline-size: auto; margin-block-end: var(--sp-4); }

.c-footer__cols {
  display: grid;
  gap: var(--sp-10) var(--sp-8);
  grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr));
}

.c-footer__heading {
  font-size: var(--fs-2xs-raw);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-block-end: var(--sp-4);
}

[lang="ar"] .c-footer__heading, [dir="rtl"] .c-footer__heading {
  text-transform: none;
  letter-spacing: 0;
}

.c-footer__list { display: flex; flex-direction: column; gap: var(--sp-3); }

.c-footer__list a {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
.c-footer__list a:hover { color: var(--text); }

.c-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-block-start: var(--sp-12);
  padding-block-start: var(--sp-6);
  border-block-start: var(--stroke) solid var(--border);
  font-size: var(--fs-xs-raw);
  color: var(--text-muted);
}

/* The studio credit. Sized down from the footer's own type rather than set in
   pixels, so it stays subordinate to the copyright line beside it. */
.c-credit {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  /* --muted, not --subtle: measured against the footer, --subtle came out at
     3.12:1. A credit is small type, so it needs the contrast, not less of it. */
  color: var(--text-muted);
}

.c-credit__mark {
  display: inline-flex;
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
.c-credit__mark:hover { color: var(--text); }
.c-credit__mark svg { block-size: 19px; inline-size: auto; }

/* The wordmark is Latin, so it keeps its own direction inside an Arabic
   footer — mirrored, the marks and the name swap sides. */
[dir="rtl"] .c-credit__mark { direction: ltr; }

/* --- 1. Modern: columns + newsletter ------------------------------------- */

.c-footer--modern {
  background: var(--surface-sunken);
  padding-block: var(--sp-16);
  border-block-start: var(--stroke) solid var(--border);
}

.c-footer--modern .c-footer__lead { max-inline-size: 30ch; }

/* --- 2. Editorial: sparse, wordmark-led ---------------------------------- */

.c-footer--editorial {
  background: var(--surface);
  padding-block: var(--sp-20);
  border-block-start: var(--stroke-bold) solid var(--text);
}

.c-footer--editorial .c-footer__logo { block-size: 52px; margin-block-end: var(--sp-6); }
.c-footer--editorial .c-footer__cols { gap: var(--sp-12) var(--sp-16); }
.c-footer--editorial .c-footer__list { gap: var(--sp-4); }
.c-footer--editorial .c-footer__list a { font-size: var(--fs-md); color: var(--text); }
.c-footer--editorial .c-footer__list a:hover { color: var(--text-link); }
.c-footer--editorial .c-footer__bottom { margin-block-start: var(--sp-16); }

/* --- 3. Branded: on the blue, mark bleeding off the corner ---------------- */

.c-footer--brand {
  background: var(--surface-brand);
  color: var(--text-on-brand);
  padding-block: var(--sp-16);
  overflow: hidden;
}

.c-footer--brand > * { position: relative; z-index: 1; }
.c-footer--brand .c-footer__heading { color: var(--shape-accent); }
.c-footer--brand .c-footer__list a { color: var(--text-on-brand-muted); }
.c-footer--brand .c-footer__list a:hover { color: var(--text-on-brand); }
.c-footer--brand .c-footer__bottom {
  border-block-start-color: var(--border-on-brand);
  color: var(--text-on-brand-muted);
}
.c-footer--brand .c-pattern { --pattern-opacity: 0.12; }

/* -------------------------------------------------------------------------
   FUN FACTS — three treatments of the same numbers
   ------------------------------------------------------------------------- */

/* --- 1. Rule: inline figures, hairline separated (the quietest) ----------- */
/*     .c-stats / .c-stat live in components.css.                            */

/* --- 2. Grid: each figure in its own tile -------------------------------- */

.c-stats--grid {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
}

.c-stats--grid .c-stat {
  padding: var(--sp-6);
  border: var(--stroke) solid var(--border);
  background: var(--surface-raised);
  gap: var(--sp-2);
  padding-inline: var(--sp-6);
  border-start-start-radius: var(--radius-lg);
  border-start-end-radius:   var(--radius-lg);
  border-end-end-radius:     var(--radius-lg);
  border-end-start-radius:   var(--radius-xs);
}

.c-stats--grid .c-stat + .c-stat { border-inline-start: var(--stroke) solid var(--border); }
.c-stats--grid .c-stat__value { font-size: var(--fs-3xl); }
.c-stats--grid .c-stat__icon { color: var(--text-link); margin-block-end: var(--sp-2); }

/* --- 3. Band: on the blue, over the dot field ---------------------------- */

.c-stats--band { position: relative; z-index: 1; }

/* -------------------------------------------------------------------------
   CTAs — three treatments
   ------------------------------------------------------------------------- */

.c-cta { position: relative; overflow: hidden; }
.c-cta__body { position: relative; z-index: 1; max-inline-size: 46ch; }
.c-cta__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-5); }

/* --- 1. Band: full blue, arcs filling the open side ---------------------- */

.c-cta--band {
  background: var(--surface-brand);
  color: var(--text-on-brand);
  padding-block: var(--section-y);
}

.c-cta--band :is(h1, h2, h3) { color: inherit; }
.c-cta--band .u-eyebrow { color: var(--text-on-brand-muted); }

/* --- 2. Split: content against a mint panel ------------------------------ */

.c-cta--split {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--surface-sunken);
  border: var(--stroke) solid var(--border);
  border-radius: var(--radius-2xl);
}

@media (min-width: 880px) {
  .c-cta--split { grid-template-columns: 1.15fr 1fr; }
}

.c-cta--split .c-cta__body {
  padding: var(--sp-16) var(--sp-12);
  max-inline-size: 42ch;
}

.c-cta--split .c-cta__panel {
  position: relative;
  overflow: hidden;
  min-block-size: 260px;
  background: var(--surface-accent);
  /* Mirrors the card corner, at section scale. */
  border-start-end-radius: var(--radius-2xl);
  border-end-end-radius:   var(--radius-2xl);
}

/* --- 3. Card: contained, centred, over a hairline grid ------------------- */

.c-cta--card {
  background: var(--surface-raised);
  border: var(--stroke) solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--sp-16) var(--gutter);
  text-align: center;
}

.c-cta--card .c-cta__body { max-inline-size: 52ch; margin-inline: auto; }
.c-cta--card .c-cta__actions { justify-content: center; }
.c-cta--card .c-pattern {
  --pattern-opacity: 0.5;
  color: var(--border);
}

/* -------------------------------------------------------------------------
   HEROES — three

   The hero sets the page's rhythm, so none of these is a centred box on a
   perfect grid. Each is deliberately off-balance: weight on one side, the
   brand shapes answering on the other.
   ------------------------------------------------------------------------- */

.c-hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(2.5rem, 1.5rem + 5vw, 6rem);
}

.c-hero__body { position: relative; z-index: 1; }

/* Its own clamp, not --fs-4xl: a hero headline has to come down further on a
   phone than body copy does. */
.c-hero__title {
  font-size: clamp(2.1rem, 1.35rem + 3.3vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

.c-hero__lead {
  font-size: var(--fs-lg);
  color: var(--text-muted);
  max-inline-size: 48ch;
}

.c-hero__cues { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* --- 1. Search-led: the directory front door ----------------------------- */

.c-hero--search { background: var(--surface-sunken); }

/* The measure caps the CHILDREN, not the container.
   .c-hero__body is itself the .container, and .container centres itself with
   auto margins — so capping it at 46rem centred the whole block in the page
   (375..1111 of 1500) rather than leaving it at the container's start edge.
   Capping the children instead keeps the page gutter where it belongs and
   lets the text start where the reader starts: left in French and English,
   right in Arabic, with no direction-specific rule. */
.c-hero--search .c-hero__body > * { max-inline-size: 46rem; }

/* --- 2. Bento: the headline is itself a tile ----------------------------- */

.c-hero--bento { background: var(--surface); }

/* --- 3. Split: type against a full-height panel -------------------------- */

.c-hero--split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  /* stretch, not center: the panel is a full-height side, not a floating box */
  align-items: stretch;
  padding-block: 0;
}

/* Aligns the type with the site container while the panel keeps bleeding to
   the viewport edge — the classic half-gutter trick, in logical properties. */
.c-hero--split .c-hero__body {
  padding-block: clamp(2.5rem, 1.5rem + 5vw, 6rem);
  padding-inline-start: max(var(--gutter), calc((100vw - var(--container)) / 2));
  padding-inline-end: var(--gutter);
}

/* The panel positions; a separate layer paints and clips. Splitting the two
   is what lets the card lap OUT of the panel: clipping the panel itself would
   cut the card off, and not clipping it would let the arcs escape its corner. */
.c-hero--split .c-hero__panel {
  position: relative;
  min-block-size: 280px;
}

.c-hero__panelbg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--surface-brand);
  border-start-start-radius: var(--radius-2xl);
  border-end-start-radius: var(--radius-2xl);
}

/* A live record card lapping out of the panel's start edge — the one overlap
   the system allows, because it says "this is real content" better than a
   label would. Anchored to the PANEL, never to the text column, so it cannot
   land on the headline however long that headline gets. */
.c-hero--split .c-hero__float {
  position: absolute;
  inset-block-end: var(--sp-10);
  inset-inline-start: calc(-1 * clamp(1.5rem, 4vw, 4rem));
  inline-size: min(320px, 80%);
  /* .c-card is block-size:100%; on an abs-positioned box that resolves against
     the containing block and stretches the card to the full hero height. */
  block-size: auto;
  box-shadow: var(--shadow-xl);
  z-index: 2;
}

@media (min-width: 900px) {
  .c-hero--split { grid-template-columns: 1.05fr 1fr; }
}

/* Stacked: the panel sits under the type and simply holds the card. */
@media (max-width: 899px) {
  .c-hero__panelbg {
    border-start-end-radius: var(--radius-2xl);
    border-end-start-radius: 0;
  }
  .c-hero--split .c-hero__panel {
    display: flex;
    align-items: flex-end;
    min-block-size: 0;
  }
  .c-hero--split .c-hero__float {
    position: relative;
    inset: auto;
    inline-size: auto;
    flex: 1;
    margin: var(--sp-8);
    box-shadow: var(--shadow-lg);
  }
}

/* -------------------------------------------------------------------------
   BENTO

   A deliberately uneven grid. One column on a phone — a bento that keeps its
   spans on a 375px screen is just a broken layout — then 6 columns with mixed
   spans and `dense` packing so the gaps fill themselves.
   ------------------------------------------------------------------------- */

.c-bento {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr;
}

.c-bento__item {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-6);
  min-block-size: 168px;
  background: var(--surface-raised);
  border: var(--stroke) solid var(--border);
  text-decoration: none;
  color: inherit;

  border-start-start-radius: var(--radius-xl);
  border-start-end-radius:   var(--radius-xl);
  border-end-end-radius:     var(--radius-xl);
  border-end-start-radius:   var(--radius-sm);

  transition:
    border-color var(--dur-base) var(--ease-out),
    background   var(--dur-base) var(--ease-out);
}

a.c-bento__item:hover { border-color: var(--border-strong); background: var(--surface-sunken); }

.c-bento__item > * { position: relative; z-index: 1; }

.c-bento__title { font-size: var(--fs-lg); font-weight: var(--fw-bold); line-height: var(--lh-snug); }
.c-bento__meta  { font-size: var(--fs-xs-raw); color: var(--text-muted); }

/* Tile treatments — the variety is what stops it reading as a grid of boxes. */
.c-bento__item--brand {
  background: var(--surface-brand);
  border-color: transparent;
  color: var(--text-on-brand);
}
.c-bento__item--brand .c-bento__meta { color: var(--text-on-brand-muted); }
a.c-bento__item--brand:hover { background: var(--surface-brand-dp); }

.c-bento__item--accent {
  background: var(--surface-accent);
  border-color: transparent;
  color: var(--text-on-accent);
}
.c-bento__item--accent .c-bento__meta { color: var(--blue-700); }

.c-bento__item--media { padding: 0; justify-content: flex-end; min-block-size: 220px; }
.c-bento__item--media img {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  z-index: 0;
}
.c-bento__item--media .c-bento__cap {
  position: relative;
  z-index: 1;
  padding: var(--sp-6);
  color: #fff;
  background: linear-gradient(to top, hsl(225 60% 8% / 0.85), transparent);
}
.c-bento__item--media .c-bento__meta { color: hsl(0 0% 100% / 0.78); }

/* A figure tile: the number is the content. */
.c-bento__item--figure { justify-content: center; gap: var(--sp-1); }
.c-bento__item--figure .c-bento__figure {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: lining-nums tabular-nums;
}

@media (min-width: 680px) {
  .c-bento {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-flow: dense;
  }
  .c-bento__item        { grid-column: span 3; }
  .c-bento__item--lg    { grid-column: span 4; grid-row: span 2; }
  .c-bento__item--tall  { grid-column: span 2; grid-row: span 2; }
  .c-bento__item--sm    { grid-column: span 2; }
  .c-bento__item--wide  { grid-column: span 6; }
  .c-bento__item--lg .c-bento__title { font-size: var(--fs-2xl); }
}

/* -------------------------------------------------------------------------
   RESPONSIVE

   Collected here rather than scattered, because "is it responsive" is a
   question you answer once per breakpoint, not once per component.
   ------------------------------------------------------------------------- */

/* Nav collapses to a disclosure below the point where the links stop fitting.
   The button is hidden from assistive tech when the nav is inline. */
.c-header__burger { display: none; }

/* Below 520 the login button shows only its icon. The icon is present at every
   width so the control does not change shape as the label goes — it just
   stops carrying text. */
.c-header__login .icon { display: none; }

/* Phone only. On a tablet there is room for the word, and "Se connecter" is
   worth more than the symmetry with the burger. */
@media (max-width: 519px) {
  .c-header__login .icon { display: inline-flex; }
  .c-header__login-label { display: none; }
  /* Once the label goes it is a lone glyph, so it takes the burger's shape
     rather than staying a stubby pill beside a circle. Matched to the burger
     by measurement, not by eye: same padding, same 1:1 ratio, same pill
     radius, so the two read as a pair. */
  .c-header__login {
    /* 40px explicitly, not `padding + aspect-ratio`: the burger is a plain
       --icon button and this one is --sm, so the same padding around the same
       16px glyph resolved to 46px against the burger's 40 — close enough to
       look like a mistake rather than a pair. The burger's own size is
       12px padding either side of a 16px icon, which is stable. */
    inline-size: 40px;
    block-size: 40px;
    padding: 0;
    border-radius: var(--radius-pill);
  }
}

/* Just above the collapse point the row is still tight, so the gaps close
   before anything is taken away. */
@media (min-width: 1080px) and (max-width: 1199px) {
  .c-header__inner { gap: var(--sp-5); }
  .c-header .c-nav { gap: var(--sp-4); }
}

/* 1080, not 899. The switcher now carries all three languages instead of one
   toggle, and measured at 900px the row wants 917px of an 829px container —
   seven nav links, a three-way switcher and two buttons do not fit. Raising
   the collapse point is the honest answer; the alternative was dropping the
   login button from the header, which costs more than the disclosure does. */
/* The drawer's own chrome and the scrim exist at every width but are only
   shown inside the collapse query below. */
.c-nav__head,
.c-nav__extras { display: none; }

/* The drawer lives inside .c-header, which is `position: relative; z-index: 2`
   and therefore its own stacking context — so the panel's z-index is capped at
   the HEADER's 2 no matter how high it is set, and the hero painted straight
   over an opaque drawer. The header is lifted above the scrim for as long as
   the drawer is open, and dropped back afterwards so it does not sit over
   modals and toasts the rest of the time. */
/* Above --z-header (200), or the sticky bar paints over both of them. */
.c-navscrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: hsl(225 60% 4% / 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}
.c-navscrim[hidden] { display: none; }
.c-navscrim.is-on { opacity: 1; }

@media (max-width: 1079px) {
  .c-header__inner { gap: var(--sp-4); }
  .c-header__burger { display: inline-flex; }

  /* Off-canvas, not an accordion under the bar.
     Stacked in flow, the seven links pushed the whole page down and the menu
     competed with the hero for the fold; as a panel it overlays instead, and
     the page behind it keeps its scroll position.
     It slides from the INLINE-END edge, so it enters from the right in French
     and from the left in Arabic — the side the burger is on in each.

     Not scoped to `.c-header`: while it is open, site.js moves this element to
     the end of <body>. On the home page the header is rendered inside
     .c-hero__panel, which sets `isolation: isolate` — so the panel is its own
     stacking context and NOTHING inside it can be raised above a body-level
     backdrop, however high its z-index. Lifting the header to 802 did nothing
     for exactly that reason. */
  .c-nav {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    z-index: calc(var(--z-overlay) + 1);
    inline-size: min(88vw, 340px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--sp-5) var(--sp-6) var(--sp-8);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--surface);
    border-inline-start: var(--stroke) solid var(--border);
    box-shadow: var(--shadow-xl);

    /* Closed state. `visibility` rather than `display: none` so the slide has
       something to animate from, and so nothing inside is focusable while the
       drawer is shut. */
    visibility: hidden;
    translate: 100% 0;
    transition:
      translate  var(--dur-drawer) var(--ease-out),
      visibility 0s linear var(--dur-drawer);
  }
  /* `translate` is physical and never mirrors, so the closed position has to
     be stated for RTL or the drawer parks on top of the page instead of off
     the opposite edge. */
  [dir="rtl"] .c-nav { translate: -100% 0; }

  .c-nav.is-open,
  [dir="rtl"] .c-nav.is-open {
    visibility: visible;
    translate: 0 0;
    transition:
      translate  var(--dur-drawer) var(--ease-out),
      visibility 0s;
  }

  .c-nav__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    margin-block-end: var(--sp-4);
    padding-block-end: var(--sp-4);
    border-block-end: var(--stroke) solid var(--border);
  }
  .c-nav__brand { display: flex; flex: none; text-decoration: none; }
  .c-nav__logo { block-size: 28px; inline-size: auto; }

  .c-nav__link { padding-block: var(--sp-3); font-size: var(--fs-md); }
  /* The active dot moves beside the label once the links stack. It marks the
     START of the row, not the far edge: the links run the full width of the
     drawer, so an end-anchored dot sat alone against the opposite margin with
     nothing to attach itself to. */
  .c-nav__link[aria-current="page"]::after {
    inset-block-end: auto;
    inset-block-start: 50%;
    inset-inline-end: auto;
    inset-inline-start: calc(var(--sp-4) * -1);
    translate: 0 -50%;
  }

  .c-nav__extras {
    display: grid;
    gap: var(--sp-3);
    margin-block-start: auto;
    padding-block-start: var(--sp-6);
  }
  .c-nav__extras .c-btn { inline-size: 100%; }

  /* The bar's floating-on-hero treatment does not follow the drawer.
     `.c-header--over` paints borders and labels white because there is a dark
     hero behind the BAR; measured in the light theme, the idle language chips
     came out at 1.0:1 against the white panel — white on white. Once the
     drawer is moved to body level those rules stop matching and these take
     over, which is why they are only two classes deep. */
  .c-nav .c-langs { border-color: var(--border); }
  .c-nav .c-langs__item { color: var(--text-muted); }
  .c-nav .c-langs__item:hover { color: var(--text); }
  .c-nav .c-langs__item.is-on {
    background: var(--surface-brand);
    color: var(--text-on-brand);
  }

  .c-nav .c-btn--outline {
    border-color: var(--border-strong);
    color: var(--text);
  }
  .c-nav .c-btn--outline:hover {
    background: var(--surface-sunken);
    border-color: var(--text);
    color: var(--text);
  }
  .c-nav .c-btn--primary {
    background: var(--surface-brand);
    color: var(--text-on-brand);
  }
  .c-nav .c-btn--primary:hover { background: var(--surface-brand-hover); }

  /* Full-width switcher: in the drawer there is room to show the three
     languages as equal thirds rather than as a compact toggle. */
  .c-langs--wide { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
  .c-langs--wide .c-langs__item { text-align: center; }

  .c-header--editorial .c-header__inner { padding-block: var(--sp-5); }
  .c-header--editorial .c-header__top .container { flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); }
  .c-header--editorial .c-header__logo { block-size: 30px; }
}

/* -------------------------------------------------------------------------
   Back to top

   Sits opposite the reading direction's start, so it lands under the thumb on
   a phone in either script. It stays out of the way until there is enough page
   behind the visitor for the trip back to be worth a control.
   ------------------------------------------------------------------------- */

.c-totop {
  position: fixed;
  inset-block-end: clamp(var(--sp-4), 3vw, var(--sp-8));
  inset-inline-end: clamp(var(--sp-4), 3vw, var(--sp-8));
  z-index: var(--z-sticky);
  display: grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  border-radius: var(--radius-pill);
  border: var(--stroke) solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-md);

  /* Closed state. Kept out of the tab order by `visibility` rather than
     `display`, so the fade has something to animate and a hidden control is
     never focusable. */
  visibility: hidden;
  opacity: 0;
  translate: 0 8px;
  transition:
    opacity    var(--dur-base) var(--ease-out),
    translate  var(--dur-base) var(--ease-out),
    visibility 0s linear var(--dur-base),
    background var(--dur-fast) var(--ease-out);
}
.c-totop[hidden] { display: none; }

.c-totop.is-on {
  visibility: visible;
  opacity: 1;
  translate: 0 0;
  transition:
    opacity    var(--dur-base) var(--ease-out),
    translate  var(--dur-base) var(--ease-out),
    visibility 0s,
    background var(--dur-fast) var(--ease-out);
}

.c-totop:hover { background: var(--surface-brand-soft); border-color: var(--border-strong); }
.c-totop:focus-visible { outline: var(--stroke-bold) solid var(--text-link); outline-offset: 2px; }

/* In the revealed ground zone the page is inverted, so the button takes the
   zone's surface tokens with it rather than staying a light chip on dark. */
.u-ground .c-totop { background: var(--surface-raised); border-color: var(--border); color: var(--text); }

/* The drawer animates; a visitor who asked for less motion gets the same
   panel without the slide. */
@media (prefers-reduced-motion: reduce) {
  .c-nav { transition: none; }
  .c-navscrim { transition: none; }
}

@media (max-width: 680px) {
  .c-cta--split .c-cta__body,
  .c-cta--card { padding: var(--sp-10) var(--sp-6); }
  .c-cta--split .c-cta__panel { min-block-size: 200px; }

  .c-footer--modern,
  .c-footer--brand { padding-block: var(--sp-12); }
  .c-footer--editorial { padding-block: var(--sp-12); }
  .c-footer--editorial .c-footer__logo { block-size: 40px; }
  .c-footer__cols { gap: var(--sp-8) var(--sp-6); }
  .c-footer__bottom { margin-block-start: var(--sp-8); }

  .c-stats--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c-stats--grid .c-stat { padding: var(--sp-4); }
  .c-stats--grid .c-stat__value { font-size: var(--fs-2xl); }


}

@media (max-width: 420px) {
  .c-cta__actions { flex-direction: column; align-items: stretch; }
  .c-cta__actions .c-btn { inline-size: 100%; }
  .c-stats--grid { grid-template-columns: 1fr; }
}
/* -------------------------------------------------------------------------
   SECTION LAYOUTS

   The homepage is not one grid repeated eight times. These are the layout
   patterns the real jamaity.org sections get rebuilt with — a section picks
   one, and the cards inside it stay the same components.

     .c-sectionhead  title + count + "see all"
     .c-rail         horizontal scroll row (snap), for browse-y content
     .c-sticky       sticky title column beside a list
     .c-twin         two large entry panels
     .c-daystrip     the week, as columns
     .c-logowall     organisation logos
     .c-list         dense rows, divided
   ------------------------------------------------------------------------- */

.c-sectionhead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3) var(--sp-6);
  margin-block-end: var(--sp-8);
}

.c-sectionhead__title { font-size: var(--fs-2xl); }
.c-sectionhead__sub { font-size: var(--fs-sm); color: var(--text-muted); }
.c-sectionhead__link {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  white-space: nowrap;
}
.c-sectionhead__link .icon { transition: translate var(--dur-base) var(--ease-out); }
.c-sectionhead__link:hover .icon { translate: 3px 0; }
[dir="rtl"] .c-sectionhead__link .icon { scale: -1 1; }
[dir="rtl"] .c-sectionhead__link:hover .icon { translate: -3px 0; }

/* --- Rail: scrolls sideways, snaps, bleeds off the gutter ---------------- */

.c-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(min(var(--rail-item, 270px), 82%), 1fr);
  gap: var(--sp-4);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  scrollbar-width: thin;
  /* Bleed to the viewport edge so the row reads as continuing past the fold,
     then pad back so the first card still lines up with the container. */
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  padding-block-end: var(--sp-3);
}

.c-rail > * { scroll-snap-align: start; }

@media (min-width: 900px) {
  .c-rail { margin-inline: 0; padding-inline: 0; }
}

/* --- Sticky: the title stays while the list scrolls past ----------------- */

.c-sticky { display: grid; gap: var(--sp-8); }

@media (min-width: 900px) {
  .c-sticky { grid-template-columns: 300px 1fr; gap: var(--sp-16); }
  .c-sticky__aside {
    position: sticky;
    inset-block-start: var(--sp-8);
    align-self: start;
  }
}

/* --- Twin: two large entry panels ---------------------------------------- */

.c-twin { display: grid; gap: var(--sp-4); }

@media (min-width: 760px) { .c-twin { grid-template-columns: 1fr 1fr; } }

.c-twin__panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  justify-content: flex-end;
  min-block-size: 230px;
  padding: var(--sp-8);
  text-decoration: none;
  border: var(--stroke) solid var(--border);
  border-start-start-radius: var(--radius-2xl);
  border-start-end-radius:   var(--radius-2xl);
  border-end-end-radius:     var(--radius-2xl);
  border-end-start-radius:   var(--radius-md);
  transition: background var(--dur-base) var(--ease-out);
}

.c-twin__panel > * { position: relative; z-index: 1; }
.c-twin__panel--brand  { background: var(--surface-brand);  color: var(--text-on-brand); border-color: transparent; }
.c-twin__panel--accent { background: var(--surface-accent); color: var(--text-on-accent); border-color: transparent; }
.c-twin__panel--brand:hover  { background: var(--surface-brand-dp); }
.c-twin__panel--accent:hover { background: var(--mint-300); }
.c-twin__title { font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: var(--lh-snug); }

/* --- Taxonomy index ------------------------------------------------------
   Replaces the two large filled panels. The panels put a whole section's
   worth of colour behind two links, which read as advertising rather than as
   navigation, and they carried no information beyond their own labels. A
   ruled directory says the same thing, carries the real counts, and lets a
   visitor go straight to the term they want instead of through a door. */

.c-index { display: grid; gap: var(--sp-10); }

@media (min-width: 860px) {
  .c-index { grid-template-columns: 1fr 1fr; gap: var(--sp-12); }
}

.c-index__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-block-end: var(--sp-3);
  margin-block-end: var(--sp-2);
  border-block-end: var(--stroke-bold) solid var(--text);
}

.c-index__title {
  font-size: var(--fs-2xs-raw);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.c-index__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 0 var(--sp-8);
}

.c-index__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-block: var(--sp-3);
  border-block-end: var(--stroke) solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: color var(--dur-fast) var(--ease-out);
}

.c-index__row:hover { color: var(--text-link); }
.c-index__name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }

/* Chrome uses the raw scale so the counts align across languages. */
.c-index__n {
  font-size: var(--fs-xs-raw);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  flex: none;
}

/* --- News: one image-led story, three stacked beside it ------------------
   The bento it replaced packed four tiles of three different sizes, so the
   three text stories each got a different shape and read as unrelated. Here
   they are one column of equal rows — a list beside a lead. */

.c-news { display: grid; gap: var(--sp-4); }

@media (min-width: 900px) {
  .c-news { grid-template-columns: 1.35fr 1fr; align-items: stretch; }
}

.c-news__side {
  display: grid;
  gap: var(--sp-4);
  /* Equal rows, so the three share the lead's height rather than each sizing
     to its own title. */
  grid-auto-rows: 1fr;
}

/* These reuse .c-bento__item for its card styling, but the bento's own
   placement rules come with it — --media carries `grid-column: span 3`, which
   spanned the lead across the whole row and pushed the side column onto a
   second line. Placement is reset; only the appearance is borrowed. */
.c-news > .c-bento__item,
.c-news__side > .c-bento__item { grid-column: auto; grid-row: auto; }

.c-news__lead { min-block-size: clamp(300px, 34vw, 420px); }
.c-news__item { justify-content: center; }

/* --- Orbit ---------------------------------------------------------------
   The mark at the centre, partner logos going round it. Two rings at
   different radii and speeds so it never reads as one rigid wheel.

   Each satellite is counter-rotated twice: once by --a to undo the tilt its
   own placement gives it, and once by the ring's animation in reverse. Both
   are needed, or the logos cartwheel as they travel. */

/* A definite width, not min(100%, …). Everything inside is absolutely
   positioned, so the box has no content width of its own; a percentage
   against an `auto` grid column resolved to 100% of nothing and the whole
   orbit collapsed to 0×0. */
/* Forced LTR. The orbit is a geometric figure with no text in it, and its
   internals mix logical placement (inset-inline-start) with physical rotation
   (`rotate`/`transform`, which never mirror). Under RTL only half of that
   flips, so the ring's centre and the badges' placement stop agreeing and
   every logo lands on one side. Pinning the figure to LTR makes both halves
   resolve the same way in either page direction. */
.c-orbit {
  position: relative;
  direction: ltr;
  inline-size: clamp(200px, 26vw, 340px);
  aspect-ratio: 1;
  margin-inline: auto;
  flex: none;
}

/* Below the panel's two-column breakpoint the orbit has the whole width to
   itself, so the 26vw slope — tuned to the width of the SECOND COLUMN — left
   it stuck at its 200px floor from 768px all the way down. 68vw keeps it
   inside the panel's padding at 360 (245 against a 264px column) and reaches
   the 340px cap by 500. Still viewport-based rather than a percentage: the
   orbit's children are all absolutely positioned, so a percentage width in an
   auto-sized column resolves against nothing and collapses the figure to 0. */
@media (max-width: 899px) {
  .c-orbit { inline-size: min(340px, 68vw); }
}

.c-orbit__ring {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  inline-size: calc(var(--r) * 2);
  block-size: calc(var(--r) * 2);
  translate: -50% -50%;
  border: var(--stroke) solid hsl(0 0% 100% / 0.14);
  border-radius: 50%;
  animation: fx-orbit var(--dur, 34s) linear infinite;
}

/* The satellite is a full-size layer that rotates about the ring's centre,
   with the badge pinned to its top edge. Nothing here multiplies --r, so the
   radius can stay a percentage and the whole thing scales with the box.
   (Placing the badge directly and translating by --r does not work: a
   percentage translate resolves against the badge's own size, not the
   radius, so every logo landed a few pixels from the centre.) */
.c-orbit__sat {
  position: absolute;
  inset: 0;
  rotate: var(--a);
}

.c-orbit__badge {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 50%;
  inline-size: var(--sat, 46px);
  block-size: var(--sat, 46px);
  margin-inline-start: calc(var(--sat, 46px) / -2);
  margin-block-start: calc(var(--sat, 46px) / -2);
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: #fff;
  /* The inset lives on the IMAGE, not here. Percentage padding resolves
     against the containing block — the ring — so it would differ between the
     two rings and drift as the orbit scales; a fixed 6px left the mark barely
     half the badge once the badge shrank. Sizing the image as a share of its
     own plate is the only version that holds at every size. */
  padding: 0;
  /* The plate is a circle and the logos are squares. Without this the corners
     of every harvested mark sat outside the disc — 41 of them have a white
     background baked into the file, so it showed as a square halo rather than
     as a crop. */
  overflow: hidden;
  box-shadow: 0 2px 10px hsl(225 90% 6% / 0.3);

  /* Two counter-rotations, both required: `transform` cancels the tilt this
     badge inherits from its own --a placement, and the `rotate` animation
     cancels the ring's spin. Without either one the logos cartwheel as they
     travel. They compose because `rotate` is applied before `transform`. */
  transform: rotate(calc(var(--a) * -1));
  animation: fx-orbit-rev var(--dur, 34s) linear infinite;
}

.c-orbit__badge img { inline-size: 76%; block-size: 76%; object-fit: contain; }

/* The core is plated like the satellites — same white disc, same shadow — so
   it reads as the centre of one family rather than a different kind of thing.
   Because the plate is white in BOTH themes, the mark on it is always the
   brand artwork; the on-brand (white + mint) file was invisible here. */
.c-orbit__core {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  inline-size: 26%;
  aspect-ratio: 1;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: #fff;
  /* Percentage padding resolves against the ORBIT's width, not the core's.
     At 18% that was 61px a side — more than the whole box — so border-box
     grew the plate to the padding and left the mark zero content width. It
     rendered at 0px, i.e. not at all.

     This is also the knob for the mark's size: the plate stays at 26% of the
     orbit, and the padding decides how much of it the artwork fills. */
  padding: 6.5%;
  box-shadow: 0 2px 14px hsl(225 90% 6% / 0.32);
}

.c-orbit__core img { inline-size: 100%; block-size: 100%; object-fit: contain; }

/* Two glows behind the core. Separate elements rather than box-shadows so
   they can breathe on their own timings — a single pulse reads mechanical. */
.c-orbit__glow {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  translate: -50% -50%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, var(--glow-c, var(--shape-accent)) 0%, transparent 70%);
  opacity: var(--glow-o, 0.5);
  filter: blur(var(--glow-b, 14px));
  animation: fx-glow var(--glow-dur, 6s) var(--ease-in-out) infinite alternate;
}

.c-orbit__glow--a { inline-size: 42%; aspect-ratio: 1; --glow-c: var(--mint-300); --glow-o: .55; --glow-dur: 6s; }
.c-orbit__glow--b { inline-size: 60%; aspect-ratio: 1; --glow-c: var(--blue-400);  --glow-o: .38; --glow-dur: 9s; --glow-b: 22px; }

@keyframes fx-glow {
  from { transform: scale(0.88); opacity: calc(var(--glow-o) * 0.6); }
  to   { transform: scale(1.12); opacity: var(--glow-o); }
}

@media (prefers-reduced-motion: reduce) {
  .c-orbit__glow { animation: none; }
}

@keyframes fx-orbit     { to { rotate: 360deg; } }
@keyframes fx-orbit-rev { to { rotate: -360deg; } }

@media (prefers-reduced-motion: reduce) {
  .c-orbit__ring, .c-orbit__sat > * { animation: none; }
}

/* --- Panel ---------------------------------------------------------------
   The hero's treatment, lifted out so the rest of the site can use it: an
   inset rounded box carrying the same layered ground — deep blue gradient,
   mesh, dot pattern, grain — with the card's asymmetric corner.

   This is what makes the hero read as complex but clean. The complexity is
   entirely in the GROUND (four stacked layers, none of them literal) and the
   foreground stays plain type on a flat colour. The failed version of this
   was the full-bleed flat band: one colour, edge to edge, nothing behind the
   words, so the colour did the shouting instead of the depth.

   Inset rather than full-bleed matters too — the page ground stays visible
   around it, so the panel reads as an object on the page rather than as a
   stripe across it. */

.c-brandpanel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--text-on-brand);
  padding: clamp(var(--sp-8), 5vw, var(--sp-16));
  border-start-start-radius: var(--radius-2xl);
  border-start-end-radius:   var(--radius-2xl);
  border-end-end-radius:     var(--radius-2xl);
  border-end-start-radius:   var(--radius-md);
}

.c-brandpanel__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 80% 0%, hsl(225 90% 34%) 0%, transparent 60%),
    linear-gradient(160deg, hsl(225 85% 17%) 0%, hsl(225 90% 12%) 100%);
}

/* Everything that is not the ground sits above it. */
.c-brandpanel > *:not(.c-brandpanel__bg) { position: relative; z-index: 1; }

.c-brandpanel :is(h1, h2, h3, h4) { color: inherit; }
.c-brandpanel .u-eyebrow { color: var(--text-on-brand-muted); }
.c-brandpanel .u-muted   { color: hsl(0 0% 100% / 0.72); }

/* Mint stays a shape colour: on this ground it is only ever the button fill
   or .fx-accent, never body copy. */
.c-brandpanel .fx-accent { color: var(--mint-200); }

/* Body and actions side by side once there is room, stacked before that. */
/* Centred, not bottom-aligned. `align-items: end` sat the copy on the panel's
   floor while the orbit — a circle, optically centred — held the middle, so
   the two halves read as belonging to different rows. */
.c-brandpanel__grid { display: grid; gap: var(--sp-8); align-items: center; }

@media (min-width: 880px) {
  .c-brandpanel__grid {
    grid-template-columns: 1.4fr auto;
    gap: var(--sp-12);
  }
}

.c-brandpanel__grid > * { min-inline-size: 0; }

/* The section link is a blue text link by default; on the panel's ground it
   inverts, and the arrow keeps its direction-aware nudge. */
.c-sectionhead__link--on-brand { color: #fff; }
.c-sectionhead__link--on-brand:hover { color: var(--mint-200); }

/* --- CTA, plain ----------------------------------------------------------
   A fourth treatment alongside band / split / deep. The filled bands put a
   full-bleed blue behind a single sentence; at that size the colour is doing
   the shouting and the words are incidental. This one keeps the page ground
   and lets the type carry it, with one rule to mark the break. */

.c-cta--plain {
  background: var(--surface);
  color: var(--text);
  padding-block: var(--section-y);
  border-block-start: var(--stroke) solid var(--border);
}

.c-cta--plain .u-eyebrow { color: var(--text-muted); }
.c-cta--plain :is(h1, h2, h3) { color: inherit; }

/* --- Day strip: the week as columns -------------------------------------- */

/* --- Month grid ----------------------------------------------------------
   A calendar month the way a calendar app draws one. The rules between cells
   are the grid's own gap showing the container colour through, rather than a
   border on each cell — borders would double up between neighbours and land
   on half-pixels at most widths. */

.c-month__bar {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  margin-block-end: var(--sp-4);
}

.c-month__label { font-size: var(--fs-lg); font-weight: var(--fw-bold); text-transform: capitalize; }
.c-month__note  { font-size: var(--fs-xs-raw); color: var(--text-muted); }

.c-month {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--stroke);
  background: var(--border);
  border: var(--stroke) solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.c-month__dow {
  background: var(--surface-sunken);
  padding-block: var(--sp-2);
  text-align: center;
  font-size: var(--fs-2xs-raw);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted);
}

[lang="ar"] .c-month__dow, [dir="rtl"] .c-month__dow { text-transform: none; letter-spacing: 0; }

.c-month__cell {
  background: var(--surface);
  min-block-size: 104px;
  padding: var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

/* Days belonging to the neighbouring months: present so the grid stays
   rectangular, recessed so they never compete with the real month. */
.c-month__cell--out { background: var(--surface-sunken); }
.c-month__cell--out .c-month__num { color: var(--text-muted); }

.c-month__num {
  font-size: var(--fs-xs-raw);
  font-weight: var(--fw-semibold);
  font-variant-numeric: lining-nums tabular-nums;
  align-self: flex-start;
}

.c-month__cell--today .c-month__num {
  display: grid;
  place-items: center;
  inline-size: 1.65rem;
  block-size: 1.65rem;
  border-radius: var(--radius-pill);
  background: var(--surface-accent);
  color: var(--text-on-accent);
}

.c-month__ev {
  font-size: var(--fs-2xs-raw);
  line-height: var(--lh-snug);
  text-decoration: none;
  color: inherit;
  padding-inline-start: var(--sp-2);
  border-inline-start: var(--stroke-bold) solid var(--shape-accent);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.c-month__ev:hover { color: var(--text-link); }

.c-month__more {
  font-size: var(--fs-2xs-raw);
  color: var(--text-muted);
  text-decoration: none;
  margin-block-start: auto;
}

/* Dots are the compact stand-in for event titles; hidden until the cells get
   too narrow to carry text. */
.c-month__dots { display: none; gap: 3px; margin-block-start: auto; }
.c-month__dots > span {
  inline-size: 5px; block-size: 5px; border-radius: 50%;
  background: var(--shape-accent);
}

/* Below this the cells are ~90px wide — too narrow for a title, so the grid
   keeps the shape of the month and the dots carry "something happened here". */
@media (max-width: 860px) {
  .c-month__cell { min-block-size: 58px; }
  .c-month__ev, .c-month__more { display: none; }
  .c-month__dots { display: flex; }
}

@media (max-width: 480px) {
  .c-month__cell { min-block-size: 44px; padding: var(--sp-1); }
  .c-month__num { font-size: var(--fs-2xs-raw); }
}

/* A week is seven columns or it is not a week. auto-fit was wrapping it into
   whatever fitted — four columns at tablet, two at phone — which splits the
   week across rows and stops reading as a calendar at all. Below the width
   where seven columns still hold, it becomes a vertical day list instead:
   consecutive days, top to bottom, which is how a phone agenda should read. */
.c-daystrip {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

@media (max-width: 1000px) {
  .c-daystrip { grid-template-columns: 1fr; }
  .c-day {
    min-block-size: 0;
    flex-direction: row;
    align-items: baseline;
    gap: var(--sp-4);
    flex-wrap: wrap;
  }
  /* Fixed-width date column so the titles line up down the list. */
  .c-day__head { flex: none; inline-size: 7.5rem; }
  .c-day__event, .c-day__empty { flex: 1 1 12rem; border-block-start: 0; padding-block-start: 0; margin-block: 0; }
}

.c-day {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: var(--stroke) solid var(--border);
  border-start-start-radius: var(--radius-lg);
  border-start-end-radius:   var(--radius-lg);
  border-end-end-radius:     var(--radius-lg);
  border-end-start-radius:   var(--radius-xs);
  min-block-size: 150px;
}

.c-day--today { background: var(--surface-accent); border-color: transparent; }
.c-day--today .c-day__name, .c-day--today .c-day__num { color: var(--text-on-accent); }

.c-day__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); }
.c-day__name {
  font-size: var(--fs-2xs-raw);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted);
}
[lang="ar"] .c-day__name, [dir="rtl"] .c-day__name { text-transform: none; letter-spacing: 0; }
.c-day__num { font-size: var(--fs-lg); font-weight: var(--fw-bold); font-variant-numeric: lining-nums tabular-nums; }

.c-day__event {
  display: block;
  font-size: var(--fs-xs-raw);
  line-height: var(--lh-snug);
  text-decoration: none;
  color: inherit;
  padding-block-start: var(--sp-2);
  border-block-start: var(--stroke) solid var(--border);
}
.c-day--today .c-day__event { border-block-start-color: hsl(225 100% 18% / 0.2); }
.c-day__event:hover { color: var(--text-link); }
.c-day__empty { font-size: var(--fs-xs-raw); color: var(--text-subtle); margin-block: auto; }

/* --- Logo wall ----------------------------------------------------------- */

.c-logowall {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr));
}

.c-logowall__cell {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 2;
  padding: var(--sp-4);
  background: var(--surface-raised);
  border: var(--stroke) solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--dur-base) var(--ease-out);
}
.c-logowall__cell:hover { border-color: var(--border-strong); }
.c-logowall__cell img { max-block-size: 100%; object-fit: contain; }

/* --- List: dense divided rows -------------------------------------------- */

.c-list { display: flex; flex-direction: column; }

.c-list__row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding-block: var(--sp-4);
  border-block-end: var(--stroke) solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background var(--dur-fast) var(--ease-out);
}
.c-list__row:last-child { border-block-end: 0; }
.c-list__row:hover { background: var(--surface-sunken); }
.c-list__main { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: 2px; }
.c-list__title { font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: var(--lh-snug); }
.c-list__meta { font-size: var(--fs-xs-raw); color: var(--text-muted); }
.c-list__end { flex: none; font-size: var(--fs-xs-raw); color: var(--text-muted); text-align: end; }

@media (max-width: 560px) {
  .c-list__row { flex-wrap: wrap; }
  .c-list__end { inline-size: 100%; text-align: start; }
}

/* --- CTA band: actions take the open side now the arcs are gone ---------- */

@media (min-width: 900px) {
  .c-cta--band .container { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-12); }
  .c-cta--band .c-cta__body { margin: 0; }
  .c-cta--band .c-cta__actions { flex: none; padding-block-end: var(--sp-2); }
}
/* -------------------------------------------------------------------------
   THEMES — a field of pills that fall as you scroll

   Split out of the old two-column "Explorer" index. A theme list is not a
   ranking, which a numbered index implied; it is a field of subjects.

   The fall is scroll-SCRUBBED, not a one-shot entrance: --fall-t is written by
   fx.js as the section crosses the viewport, and each pill derives its own
   progress from it. Scroll back up and they lift again. No physics, on purpose
   — these are 46 links, and a collision pile puts them at random angles with
   unpredictable tap targets, overlapping labels and a tab order that no longer
   matches what is on screen.
   ------------------------------------------------------------------------- */

/* Clipped to its own section.
   The largest pills fall ~280px, which took them up over the news cards in the
   section above — transient, but on screen it reads as a stray element rather
   than as something falling in. `clip` rather than `hidden` because hidden
   would make this a scroll container and break the sticky reveal further down
   the page. The extra top padding is the runway: enough that a pill is already
   inside the section, and fading up, before it becomes visible. */
.c-themes { overflow: clip; }

.c-themes__field {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3);
  margin: 0;
  margin-block-start: var(--sp-10);
  padding: 0;
  padding-block-start: var(--sp-8);
  list-style: none;
}

.c-themes__cell { display: flex; }

/* Per-pill progress, derived from the section's --fall-t.

   --i is a scattered order index (a coprime stride through the list), so the
   pills resolve like rain rather than left to right. --lead is how many pills
   are mid-flight at once: at 1 they would fall strictly one after another and
   the last would still be waiting when the section left the screen.

   The + --lead in the multiplier is what guarantees the LAST pill reaches
   p = 1 while t is still <= 1. Without it the tail never lands. */
.c-themes__pill {
  /* --lead is how many pills are in flight at once: it stretches each pill's
     own fall over more scroll and puts more of them moving at the same
     moment. */
  --lead: 10;
  --p: clamp(
    0,
    calc((var(--fall-t, 1) * (var(--fall-count, 40) + var(--lead)) - var(--i, 0)) / var(--lead)),
    1
  );

  /* Gravity, not a linear slide.
     --g is the distance still to fall, and 1 - p² means it barely moves at the
     start and then rushes the last stretch — which is what falling looks like.
     A linear ramp travels at a constant speed and reads as a panel sliding.
     calc() can multiply two unitless custom properties, which is the whole
     trick here. */
  --g: calc(1 - var(--p) * var(--p));

  --drop: 4.5rem;

  display: inline-flex;
  align-items: baseline;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border: var(--stroke) solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;

  /* translate / rotate / scale as separate properties rather than one
     transform, so they compose independently and the pointer-response tilt in
     fx.js can still sit on top without fighting this.

     --dx drifts the pill sideways as it falls, so they converge into the field
     instead of dropping down 46 parallel columns. */
  translate:
    calc(var(--g) * var(--dx, 0px))
    calc(var(--g) * var(--drop) * var(--far, 1) * -1);

  /* Rotates from a mid-air angle to EXACTLY zero. There used to be a resting
     --tilt of a few degrees left on every pill, which is what made the landed
     field look skewed instead of settled — the animation ended but the rows
     never straightened up. Everything here multiplies by --g, so at rest the
     pill is untransformed and the flex rows align as rows. */
  rotate: calc(var(--g) * var(--swing, 0deg));

  /* Slightly small on the way in; arrives at exactly full size. */
  scale: calc(1 - 0.06 * var(--g));

  /* Opaque by roughly a third of the way down, NOT at the end.
     `opacity: var(--p)` was the real reason this looked subtle: a pill 30% of
     the way through its fall was 30% visible, so almost the entire movement
     happened while it was too faint to see and only the last moment registered.
     Now the pill appears early and you watch it travel. */
  opacity: clamp(0, calc(var(--p) * 2.2), 1);

  transition:
    border-color var(--dur-fast) var(--ease-out),
    background   var(--dur-fast) var(--ease-out),
    color        var(--dur-fast) var(--ease-out);
}

.c-themes__pill:hover {
  border-color: var(--border-strong);
  background: var(--surface-brand-soft);
  color: var(--text);
}
.c-themes__pill:focus-visible { outline: var(--stroke-bold) solid var(--text-link); outline-offset: 2px; }

/* Three sizes, assigned by tercile in the template. Weight carries the
   difference as much as size does, so the steps read at a glance without the
   largest pill becoming a headline. */
.c-themes__pill--sm { font-size: var(--fs-sm); }
.c-themes__pill--md { font-size: var(--fs-md); font-weight: var(--fw-medium); }
.c-themes__pill--lg {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  padding-inline: var(--sp-5);
  --drop: 6rem;   /* heavier pills fall further, so the field does not land flat */
}

.c-themes__n { font-size: var(--fs-2xs-raw); color: var(--text-muted); }
.c-themes__pill:hover .c-themes__n { color: var(--text-link); }

/* Reduced motion, and the no-JS case.

   fx.js only ever writes --fall-t; when it does not run, the fallback of 1 in
   the clamp above means every pill is already landed. So the section is
   correct with the script absent, blocked, or still loading — which is also
   what stops the field flashing empty on a slow connection. */
@media (prefers-reduced-motion: reduce) {
  .c-themes__pill {
    translate: none;
    rotate: none;
    scale: none;
    opacity: 1;
  }
}

@media (max-width: 620px) {
  .c-themes__field { gap: var(--sp-2); margin-block-start: var(--sp-8); }
  .c-themes__pill  { padding: var(--sp-2) var(--sp-3); --drop: 2.75rem; --dx: 0px; }
  .c-themes__pill--lg { font-size: var(--fs-md); padding-inline: var(--sp-4); }
}
/* -------------------------------------------------------------------------
   REGIONS — the map, and the list that is the real interface

   Sits inside the ground zone, so every colour here resolves against the
   inverted token set rather than being restated.

   The map is a SELECTOR, not a choropleth. Shading needs a spread the live
   counts do not have (24 governorates across 1..44, driven largely by four
   nationwide projects), and a ramp built on that reads as broken rather than
   as subtle. Uniform fills with a highlight state are honest at this size and
   stay honest after the full import; shading can be added on top later.
   ------------------------------------------------------------------------- */

.c-regions__grid {
  display: grid;
  gap: var(--sp-10);
  margin-block-start: var(--sp-10);
  align-items: start;
}

@media (min-width: 900px) {
  /* List first, map second — the source order, so the visual order mirrors in
     Arabic for free.

     `1fr auto`: the list takes the space it needs for two columns of names and
     the map column sizes to whatever is left after the gap. The gap is much
     wider than a normal grid gutter because the map is a picture, not a panel;
     butted up against a table of numbers it read as one crowded object. */
  .c-regions__grid {
    grid-template-columns: 1fr auto;
    column-gap: clamp(var(--sp-10), 5vw, var(--sp-20));
    align-items: stretch;
  }
  .c-regions__grid--listonly { grid-template-columns: 1fr; }
}

/* Geography does not mirror. Same idiom as the orbit and the marquee: pin the
   figure to LTR and let only the list beside it flip. */
.c-regions__map {
  direction: ltr;
  margin: 0;
  position: relative;
}

/* The map matches the LIST's height rather than setting its own.

   It used to be capped at min(62svh, 560px), which left it a 243px sliver
   beside a 700px table — technically legible, visually an afterthought. Making
   the figure a stretched grid row and the SVG fill it means the country is
   exactly as tall as the data beside it, and it scales with the list instead of
   needing a new magic number every time a row is added.

   min-block-size: 0 is what actually lets it shrink: a grid item's automatic
   minimum is its content size, so without it the SVG would push the row taller
   rather than fit inside it. */
.c-regions__map {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-block-size: 0;
}

.c-regions__map svg {
  display: block;
  block-size: 100%;
  inline-size: auto;
  max-inline-size: 100%;
  min-block-size: 0;
  justify-self: center;
  overflow: visible;
}

@media (max-width: 899px) {
  /* Stacked, the map is a header for the list rather than a companion to it,
     so it goes back to a fixed height of its own. */
  .c-regions__map { grid-template-rows: auto auto; }
  .c-regions__map svg { block-size: min(48svh, 420px); margin-inline: auto; }
}

.c-map__gov {
  fill: var(--surface-raised);
  stroke: var(--border-strong);
  stroke-width: 0.75;
  stroke-linejoin: round;
  transition:
    fill   var(--dur-fast) var(--ease-out),
    stroke var(--dur-fast) var(--ease-out);
}

/* Recessed, not hidden. A governorate with no records is still part of
   Tunisia; it simply is not a destination yet. */
.c-map__gov.is-empty { fill: var(--surface-sunken); stroke: var(--border); }

.c-map__gov.is-on {
  fill: var(--surface-brand);
  stroke: var(--surface-brand-hover);
}

/* The national bucket lights the whole country at once. */
.c-regions__map.is-all .c-map__gov { fill: var(--surface-brand); stroke: var(--surface-brand-hover); }

/* --- The list ------------------------------------------------------------ */

.c-regions__rows {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: var(--sp-6);
}

@media (max-width: 520px) { .c-regions__rows { columns: 1; } }

.c-regions__row,
.c-regions__intl,
.c-regions__all {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-block: var(--sp-2);
  border-block-end: var(--stroke) solid var(--border);
  color: var(--text);
  text-decoration: none;
  /* break-inside, or a row lands half in one column and half in the next. */
  break-inside: avoid;
}

.c-regions__row:hover,
.c-regions__row.is-on,
.c-regions__intl:hover,
.c-regions__all:hover { color: var(--text-link); border-block-end-color: var(--border-strong); }

.c-regions__row.is-empty { color: var(--text-subtle); }

.c-regions__n { font-size: var(--fs-2xs-raw); color: var(--text-muted); flex: none; }

/* The whole country, first and heaviest — about a fifth of the catalogue is
   tagged nationally rather than to a governorate, so this is the largest single
   bucket on the page, not a footnote. */
.c-regions__all {
  margin-block-end: var(--sp-5);
  padding: var(--sp-4) var(--sp-5);
  border: var(--stroke) solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
}
.c-regions__all .c-regions__n { font-size: var(--fs-sm); }

.c-regions__intl { margin-block-start: var(--sp-5); border-block-end: 0; color: var(--text-muted); }

.c-regions__hint {
  margin-block-start: var(--sp-5);
  font-size: var(--fs-2xs);
  color: var(--text-subtle);
}
.c-regions__credit {
  margin-block-start: var(--sp-3);
  font-size: var(--fs-2xs-raw);
  color: var(--text-subtle);
  text-align: center;
}
.c-regions__credit a { color: inherit; text-decoration: none; }
.c-regions__credit a:hover { color: var(--text-muted); text-decoration: underline; }
/* -------------------------------------------------------------------------
   DONORS and EXPERTS — two sections, not one split

   These replaced a pair of identical text panels, then briefly shared one
   two-column section. Separating them was the right call: the pairing only
   ever existed because the old layout needed something in the other column,
   and the two datasets want opposite shapes. Donors have 24 real logos and
   want width; experts have no photographs at all and want a list.
   ------------------------------------------------------------------------- */

.c-experts .c-people { margin-block-start: var(--sp-8); }

/* -------------------------------------------------------------------------
   Closing this week

   A list, not cards. Three attempts got here:

   The band of bare dates said "soon" without saying what anything was. The
   cards fixed that and introduced two worse problems — every item in a
   one-week window closes on the same day, so four identical amber blocks
   carried no information and read as decoration; and a fixed label gutter
   plus a trailing arrow made three zones inside a small box, squeezing the
   title into a three-line clamp that broke mid-word.

   These four listings are also in the grid directly below. Giving them the
   same visual weight makes the page argue with itself, so this is quieter
   than a card by design: one tinted panel, hairline rules, and the deadline
   set at the same size as the title rather than shouted.
   ------------------------------------------------------------------------- */

.c-closing {
  margin-block-end: var(--sp-10);
  padding: var(--sp-5) var(--sp-6);
  border: var(--stroke) solid color-mix(in oklab, var(--warn) 24%, transparent);
  border-radius: var(--radius-xl);
  /* A wash, not a fill. At full --warn-bg the panel competes with the cards
     underneath it; at a quarter strength it reads as one grouped thing. */
  background: color-mix(in oklab, var(--warn-bg) 55%, var(--surface));
}

.c-closing__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-4);
  margin-block-end: var(--sp-2);
}

.c-closing__title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  letter-spacing: .01em;
  color: var(--warn);
}

.c-closing__all {
  font-size: var(--fs-xs-raw);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}
.c-closing__all:hover { color: var(--text); text-decoration: underline; }

.c-closing__list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  column-gap: var(--sp-8);
}
@media (min-width: 900px) { .c-closing__list { grid-template-columns: 1fr 1fr; } }

/* Hairlines between rows rather than gaps between boxes. Four items fill two
   rows of two, so the rule is dropped from whichever items sit on the first
   row at that breakpoint. */
/* Deliberately a hairline, not --stroke. This is a divider inside a panel,
   not the panel's own edge; at the site's 2px monoline four of these would
   stripe the block and compete with the border around it. */
.c-closing__list li { border-block-start: 1px solid color-mix(in oklab, var(--warn) 22%, transparent); }
.c-closing__list li:first-child { border-block-start: 0; }
@media (min-width: 900px) { .c-closing__list li:nth-child(2) { border-block-start: 0; } }

.c-deadline {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: baseline;
  /* Was a symmetric sp-3 and the rule sat almost on top of the organisation
     line. The title's line-box carries leading above it and the org's does
     not carry any below, so equal padding is not equal space — the bottom
     needs more to look the same. */
  padding-block: var(--sp-3) var(--sp-4);
  color: inherit;
  text-decoration: none;
}
.c-deadline:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

/* With the day stated once in the heading, the row is just the listing and
   the column it used to sit in would be an empty indent. */
.c-closing--sameday .c-deadline { grid-template-columns: minmax(0, 1fr); }

/* Ranged toward the title so the numbers sit against the text they belong to,
   and tabular so "2 jours" and "12 jours" line up. `end` mirrors in Arabic. */
.c-deadline__when {
  text-align: end;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.c-deadline__when b { color: var(--warn); font-weight: var(--fw-bold); }
.c-deadline.is-today .c-deadline__when { color: var(--warn); font-weight: var(--fw-semibold); }

.c-deadline__text { display: grid; gap: 2px; min-inline-size: 0; }

/* One line. A clamped three-line title in a narrow column breaks mid-word and
   still does not finish the sentence — the full title is one click away. */
.c-deadline__title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug, 1.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c-deadline:hover .c-deadline__title { text-decoration: underline; }

.c-deadline__org {
  font-size: var(--fs-2xs-raw);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* Holds the line open when a record has no organisation, so every row is
     the same height whether or not the second line has words in it. The
     line-height is stated explicitly rather than inherited: without it the
     empty span resolved 2px shorter than a filled one, which is exactly
     enough to see across two columns. */
  line-height: 1.4;
  min-block-size: 1.4em;
}

/* --- Logo marquee -------------------------------------------------------- */

/* Two rows travelling in opposite directions.

   This was a six-across grid. Thirty donors do not fit one without either
   shrinking the plates past legibility or running five rows deep, and five
   rows of grey marks stops reading as a wall and starts reading as a table of
   contents. Two counter-running rows carry all thirty in the height of two,
   and the opposing travel reads as movement rather than as a slider the
   visitor is expected to operate.

   Pinned to LTR for the same reason .c-marquee is: the loop works by
   translating one track exactly its own width, which only lands on the
   duplicate if the flex row has a known order. Travel is NOT mirrored under
   RTL the way the single strip is — with two rows already running against
   each other, mirroring only swaps which row goes which way. */
.c-logomarquee {
  --plate-w: clamp(124px, 15vw, 168px);
  /* Nearer 4:3 than 3:2. With padding this generous a 3:2 plate left the mark
     only 66px of height at full size, which is smaller than the plate makes it
     look — the extra height goes to the logo, not to the white. */
  --plate-h: calc(var(--plate-w) * 0.72);
  --plate-pad: clamp(var(--sp-4), 1.6vw, var(--sp-6));
  --lm-gap: var(--sp-3);

  display: grid;
  gap: var(--lm-gap);
  margin-block-start: var(--sp-8);
}

.c-logomarquee__row {
  display: flex;
  direction: ltr;
  gap: var(--lm-gap);
  /* A grid item's automatic minimum size is its content's min-content width,
     and this row's content is a 3 500px track. Without this the ROW is
     3 500px wide, `overflow: clip` clips nothing, and the whole page gains a
     horizontal scrollbar. Same trap the single strip hit. */
  min-inline-size: 0;
  /* clip, not hidden: `hidden` would make this a scroll container and the
     plates' focus ring would scroll the row instead of being clipped. */
  overflow: clip;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
}

.c-logomarquee__track {
  display: flex;
  align-items: center;
  gap: var(--lm-gap);
  flex: none;
  margin: 0;
  padding: var(--sp-1) 0;
  list-style: none;
  animation: fx-logomarquee var(--lm-dur, 64s) linear infinite;
}

/* The second row runs the other way. `animation-direction` rather than a
   second keyframe, so the two rows cannot drift apart. */
.c-logomarquee__row--back .c-logomarquee__track { animation-direction: reverse; }

/* Pausing on the SECTION, not the row: catching one row mid-travel while the
   other keeps going looks like a bug rather than a hover affordance. */
.c-logomarquee:hover .c-logomarquee__track,
.c-logomarquee:focus-within .c-logomarquee__track { animation-play-state: paused; }

@keyframes fx-logomarquee {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-100% - var(--lm-gap))); }
}

.c-logomarquee__item {
  flex: none;
  inline-size: var(--plate-w);
}

.c-logomarquee__plate {
  display: grid;
  place-items: center;
  inline-size: 100%;
  /* A computed height, not `aspect-ratio`. The ratio is only ever a minimum:
     the image inside can push the box taller, and a square logo did — the
     plate came out 168x168 instead of 168x112. */
  block-size: var(--plate-h);
  /* Generous, and scaling with the plate. A partner logo needs quiet space
     around it far more than it needs to be large: at var(--sp-3) the marks ran
     to the plate's rounded corners and the wall read as a row of stickers. */
  padding: var(--plate-pad);
  border-radius: var(--radius-lg);
  /* White in BOTH themes, like the orbit badges and the avatar plates: the
     mark itself may carry a baked-in white background, so the plate has to be
     the same colour or the file shows as a rectangle. */
  background: #fff;
  border: var(--stroke) solid var(--border);

  transition: border-color var(--dur-base) var(--ease-out);
}

.c-logomarquee__plate:hover,
.c-logomarquee__plate:focus-visible { border-color: var(--border-strong); }

/* The muting goes on the IMAGE, never on the plate.
   `opacity` on the plate took the white background down with the mark, so
   over the inverted ground every plate turned grey-blue and the wall read as
   disabled. The plate has to stay opaque white in both themes: 41 of the
   harvested logos have a white background baked into the file, and the plate
   is what hides that seam. Only the artwork is desaturated — thirty brand
   palettes at full strength read as confetti. */
/* The height cap is in PIXELS, not a percentage — the same trap the marquee
   chip documents. `block-size: 100%` on a grid item resolves against its grid
   area, that area comes from an `auto` row, and the row is sized by this very
   image: a cyclic dependency the browser breaks by resolving to `auto`. The
   declaration did nothing, a 500x500 logo rendered at its 101px column width
   inside a 58px slot, and every square mark hung 28px out of the bottom of its
   plate. Deriving the cap from --plate-h sidesteps the cycle entirely. */
.c-logomarquee__plate img {
  inline-size: auto;
  block-size: auto;
  max-inline-size: 100%;
  max-block-size: calc(var(--plate-h) - var(--plate-pad) * 2);
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.8;
  transition:
    filter  var(--dur-base) var(--ease-out),
    opacity var(--dur-base) var(--ease-out);
}

.c-logomarquee__plate:hover img,
.c-logomarquee__plate:focus-visible img {
  filter: none;
  opacity: 1;
}

/* Stopping the animation is not enough on its own: a halted track leaves
   twenty of the thirty donors clipped off the side. Reduced motion gets the
   wall back — the two halves wrap instead of travelling, and the duplicate
   copies that only exist to make the loop seamless are dropped. */
@media (prefers-reduced-motion: reduce) {
  .c-logomarquee__row {
    display: block;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .c-logomarquee__track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
  }
  .c-logomarquee__track[aria-hidden="true"] { display: none; }
}

/* --- People -------------------------------------------------------------- */

/* Three columns at full width, stepping down. Twelve names in one column was a
   400px ribbon down the left of an empty section; across three it is four rows
   and reads as a group. */
.c-people {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 1;
  column-gap: var(--sp-10);
}

@media (min-width: 620px) { .c-people { columns: 2; } }
@media (min-width: 960px) { .c-people { columns: 3; } }

.c-people__row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding-block: var(--sp-2);
  color: var(--text);
  text-decoration: none;
  /* Or a row lands half in one column and half in the next. */
  break-inside: avoid;
}

.c-people__row:hover { color: var(--text-link); }
.c-people__row:hover .c-avatar { border-color: var(--border-strong); }

.c-people__name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* -------------------------------------------------------------------------
   CARD STACK — the scroll-scrubbed reveal, applied to card grids

   Same machinery as the falling pills: fx.js writes one --fall-t per grid and
   each card derives its own progress from it, so there is one property write
   per container per frame rather than one per card.

   It replaces the one-shot IntersectionObserver reveal the grids used to use
   (data-anim / data-fx). That fired once and could not be scrubbed back, so
   scrolling up past a section left it already resolved — the page only ever
   animated in one direction.

   Cards rise rather than fall, and they overlap on the way in: each one starts
   lower and behind, so a row resolves like a hand of cards being dealt out
   rather than like six boxes fading up together.
   ------------------------------------------------------------------------- */

.u-stack-in > * {
  --lead: 4;
  --p: clamp(
    0,
    calc((var(--fall-t, 1) * (var(--fall-count, 12) + var(--lead)) - var(--i, 0)) / var(--lead)),
    1
  );
  /* Ease-OUT here, not the pills' ease-in: a card is being placed, not
     dropped, so it should arrive decelerating. */
  --g: calc((1 - var(--p)) * (1 - var(--p)));

  translate: 0 calc(var(--g) * 2.5rem);
  scale: calc(1 - 0.05 * var(--g));
  opacity: clamp(0, calc(var(--p) * 2.4), 1);
}

/* The news bento is the same idea with a shorter queue: four tiles, so the
   default lead of four would start them all at once. --fall-count is NOT
   overridable from here — fx.js writes it as an inline style, which outranks
   any stylesheet — so the shortening is done with --lead, which is only ever
   read from CSS. */
.c-news.u-stack-in > * { --lead: 2; }

@media (prefers-reduced-motion: reduce) {
  .u-stack-in > * {
    translate: none;
    scale: none;
    opacity: 1;
  }
}
