/* ============================================================================
   STRUCTURAL LAYER — beralmuraba (الجمعية الخيرية بمركز المربع)

   Loaded AFTER site.css (brand.json → overridesCssUrl). theme.css decides how things are
   painted; this file decides their SHAPE where this association's design departs from the
   shared one: the two-tier letterhead header, the typographic hero with the emblem as its
   image, the ruled figures row, the service-area route, the programme index, the editorial
   chairman's word, the two-doors band and the light footer.

   Consumes var(--token) only — no colour literal lives here either.

   CHROME 81 FLOOR (D12): no flex `gap` (Chrome 84), no :is()/:where() (88), no `inset` (87),
   no aspect-ratio (88). Grid `gap` is fine. Flex rows space their children with margins.
   ============================================================================ */

/* ── 1. Letterhead header ─────────────────────────────────────────────────── */

:root { --mh-top-h: 112px; }
@media (max-width: 1059px) { :root { --mh-top-h: 0px; } }

/* The whole header sticks, but with a NEGATIVE top equal to the letterhead tier: scrolling slides
   the letterhead off and the nav bar stays pinned. Below 1060px there is no bar and the compact
   letterhead itself is what sticks (top: 0). */
.mh {
  position: sticky; top: calc(-1 * var(--mh-top-h)); z-index: var(--z-sticky);
  background: var(--surface-soft);
  transition: box-shadow var(--dur) var(--ease);
}
.mh.is-stuck { box-shadow: var(--shadow-pop); }

.mh__top { border-bottom: var(--bd) solid var(--line); }
.mh__top-inner {
  display: grid; align-items: center;
  grid-template-columns: 1fr auto auto;
  min-height: 68px;
}
@media (min-width: 1060px) {
  .mh__top-inner { grid-template-columns: 1fr auto 1fr; height: var(--mh-top-h); }
}

.mh__brand {
  display: flex; align-items: center; text-decoration: none; color: var(--brand-strong);
  justify-self: start;
}
.mh__brand img { inline-size: 46px; block-size: auto; flex: none; }
.mh__brand > * + * { margin-inline-start: var(--s3); }
.mh__name { display: grid; line-height: 1.3; }
.mh__name > span { font-weight: var(--h-weight-strong); font-size: clamp(.95rem, .88rem + .3vw, 1.0625rem); }
.mh__name > small { font-size: var(--fs-xs); color: var(--accent-ink); font-weight: 500; margin-block-start: 2px; }
@media (min-width: 1060px) {
  /* Centred lockup: the emblem above the name, the way a letterhead is set. */
  .mh__brand { grid-column: 2; grid-row: 1; justify-self: center; text-align: center; }
  .mh__brand img { inline-size: 58px; }
  .mh__name > span { font-size: 1.0625rem; }
}

.mh__contact { display: none; }
@media (min-width: 1060px) {
  .mh__contact {
    grid-column: 1; grid-row: 1;
    display: flex; flex-wrap: wrap; align-items: center; justify-self: start;
    font-size: var(--fs-xs); color: var(--ink-muted);
  }
  .mh__contact a {
    display: inline-flex; align-items: center; min-height: 32px;
    color: var(--ink-muted); text-decoration: none;
    margin-inline-end: var(--s4);
  }
  .mh__contact a:hover { color: var(--brand); }
  .mh__contact a > svg { color: var(--brand); margin-inline-end: 6px; flex: none; }
}

.mh__cta { display: none; }
@media (min-width: 1060px) {
  .mh__cta { grid-column: 3; grid-row: 1; display: flex; justify-self: end; }
  .mh__cta > * + * { margin-inline-start: var(--s2); }
}
/* The give button is olive-OUTLINED, not a second green fill: two identical pills side by side
   would not tell the two audiences apart. Its label is --accent-ink, never --accent (2.84:1). */
.mh__give { --btn-bg: transparent; --btn-fg: var(--accent-ink); --btn-bd: var(--accent); }
.mh__give:hover { --btn-bg: var(--accent-wash); --btn-bd: var(--accent-ink); --btn-fg: var(--accent-ink); }

.mh__cta-mobile { display: flex; justify-self: end; }
@media (min-width: 1060px) { .mh__cta-mobile { display: none; } }
@media (max-width: 360px) {
  .mh__cta-mobile .btn { padding-inline-start: var(--s3); padding-inline-end: var(--s3); }
  .mh__cta-mobile .btn > span { display: none; }
  .mh__cta-mobile .btn > svg:first-child:not(:last-child) { margin-inline-end: 0; }
}
.mh .burger { justify-self: end; }
@media (max-width: 1059px) { .mh__name > small { display: none; } }

/* The bar — deep pine, centred links, an olive underline on the current page. */
.mh__bar { display: none; background: var(--surface-deep); }
@media (min-width: 1060px) { .mh__bar { display: block; } }
.mh__nav { display: flex; justify-content: center; align-items: center; }
.mh__nav > * { position: relative; }
.mh__nav > a, .mh__nav > details > summary {
  display: inline-flex; align-items: center;
  min-height: 52px; padding: 0 var(--s4);
  color: var(--on-deep-muted); font-size: var(--fs-sm); font-weight: 500;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.mh__nav > a:hover, .mh__nav > details > summary:hover { color: var(--on-deep); background: var(--deep-fill); }
.mh__nav > a[aria-current='page'], .mh__nav > details > summary[aria-current='page'] { color: var(--on-deep); }
.mh__nav > a[aria-current='page']::after, .mh__nav > details > summary[aria-current='page']::after {
  content: ''; position: absolute; right: var(--s4); left: var(--s4); bottom: 0;
  block-size: 3px; background: var(--accent);
}
.mh__nav summary > svg { margin-inline-start: 6px; }
.mh__nav details > summary { list-style: none; }
.mh__nav details > summary::-webkit-details-marker { display: none; }
.mh__nav details[open] > summary { color: var(--on-deep); background: var(--deep-fill-strong); }
.mh__nav .nav__panel { margin-block-start: 0; border-top: 3px solid var(--accent); border-radius: 0 0 var(--r-card) var(--r-card); }
.mh__nav .nav__panel a {
  display: flex; align-items: center; min-height: 42px; padding: 0 var(--s3);
  color: var(--brand-strong); font-size: var(--fs-sm); text-decoration: none; border-radius: var(--r-sm);
}
.mh__nav .nav__panel a:hover, .mh__nav .nav__panel a[aria-current='page'] { background: var(--surface-soft); color: var(--brand); }
.mh :focus-visible { outline-color: var(--focus-ring); }
.mh__bar :focus-visible { outline-color: var(--focus-ring-deep); }
.mh__bar :focus { outline-color: var(--focus-ring-deep); }

/* ── 2. Shared section heading for this brand ─────────────────────────────── */

.mh-head { margin-bottom: var(--s6); max-width: var(--measure-narrow); }
.mh-head h2 { font-size: var(--fs-2xl); line-height: var(--lh-tight); margin: var(--s2) 0 0; }
.mh-head p { color: var(--ink-muted); margin: var(--s3) 0 0; max-width: var(--measure-lead); }
.mh-head .link-more { display: inline-block; margin-block-start: var(--s4); }
.mh-head--deep h2 { color: var(--on-deep); }
.mh-head--deep p { color: var(--on-deep-muted); }
.mh-head--deep .eyebrow { color: var(--on-deep-muted); }

/* Side-headed sections: heading in a narrow start column, content beside it. */
.mh-split { display: grid; gap: var(--s6); }
@media (min-width: 960px) {
  .mh-split { grid-template-columns: 300px 1fr; gap: var(--s8); align-items: start; }
  .mh-head--side { position: sticky; top: calc(52px + var(--s5)); margin-bottom: 0; }
}

/* ── 3. Hero — typographic, emblem as the image ───────────────────────────── */

.mh-hero {
  background: var(--surface-soft);
  border-bottom: var(--bd) solid var(--line);
  overflow: hidden;
}
.mh-hero__inner {
  display: grid; align-items: center; gap: var(--s6);
  padding-block-start: var(--band-y-hero); padding-block-end: var(--band-y-hero);
}
@media (min-width: 900px) { .mh-hero__inner { grid-template-columns: 1.3fr .7fr; gap: var(--s8); } }

.mh-hero__kicker {
  display: inline-flex; align-items: center; margin: 0 0 var(--s4);
  color: var(--accent-ink); font-size: var(--fs-sm); font-weight: 500;
}
.mh-hero__kicker::before {
  content: ''; inline-size: var(--rule-w); block-size: var(--rule-h); background: var(--rule-color);
  margin-inline-end: var(--s3); flex: none;
}
.mh-hero__title {
  font-size: var(--fs-3xl); line-height: var(--lh-display); color: var(--brand-strong);
  margin: 0; max-width: 16ch;
}
.mh-hero__slogan {
  margin: var(--s5) 0 0; padding-inline-start: var(--s4);
  border-inline-start: 3px solid var(--accent);
  font-size: var(--fs-tagline); color: var(--brand); font-weight: 500; line-height: 1.6;
}
.mh-hero__cta { display: flex; flex-wrap: wrap; margin-block-start: var(--s6); }
.mh-hero__cta > * { margin-inline-end: var(--s3); margin-block-end: var(--s3); }
.mh-hero__cta .btn--ghost { --btn-bg: var(--paper); }
.mh-hero__reach {
  display: flex; align-items: center; margin: var(--s3) 0 0;
  color: var(--ink-muted); font-size: var(--fs-sm);
}
.mh-hero__reach > svg { color: var(--brand); margin-inline-end: var(--s2); flex: none; }
.mh-hero__reach b { color: var(--brand-strong); }

/* The seal: the emblem inside two concentric olive rings — the wreath, restated as geometry. */
.mh-hero__seal {
  position: relative; justify-self: center;
  inline-size: min(78vw, 380px); block-size: min(78vw, 380px);
  display: grid; place-items: center;
}
.mh-hero__ring { position: absolute; border-radius: 50%; border: var(--bd) solid var(--accent); }
.mh-hero__ring--1 { top: 0; right: 0; bottom: 0; left: 0; opacity: .55; }
.mh-hero__ring--2 { top: 9%; right: 9%; bottom: 9%; left: 9%; border-color: var(--line-strong); background: var(--paper); }
.mh-hero__seal img { position: relative; inline-size: 64%; block-size: auto; }
@media (max-width: 899px) {
  .mh-hero__seal { inline-size: 220px; block-size: 220px; grid-row: 1; }
}

/* ── 4. Figures — oversized numerals on one ruled line ────────────────────── */

.mh-figures { padding-block-start: var(--band-y); padding-block-end: var(--band-y); background: var(--paper); }
.mh-figures__row {
  display: grid; grid-template-columns: 1fr;
  border-top: var(--bd-strong) solid var(--brand-strong);
}
@media (min-width: 560px) { .mh-figures__row { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .mh-figures__row { grid-template-columns: repeat(4, 1fr); } }
.mh-figure {
  padding-block-start: var(--s5); padding-block-end: var(--s5);
  padding-inline-start: 0; padding-inline-end: var(--s4);
  border-bottom: var(--bd) solid var(--line);
  display: grid; align-content: start; gap: var(--s2);
}
@media (min-width: 960px) {
  .mh-figure { border-bottom: 0; padding-inline-end: var(--s5); }
  .mh-figure + .mh-figure { border-inline-start: var(--bd) solid var(--line); padding-inline-start: var(--s5); }
}
.mh-figure__value {
  font-size: var(--fs-stat); font-weight: var(--h-weight-strong); color: var(--brand-strong);
  line-height: 1.1; font-variant-numeric: tabular-nums;
}
.mh-figure__unit { font-size: var(--fs-unit); color: var(--accent-ink); margin-inline-start: 6px; font-weight: 500; }
.mh-figure__label { color: var(--ink-muted); font-size: var(--fs-sm); line-height: 1.7; }
.mh-figure .pmark { justify-self: start; }

/* ── 5. Service-area route ────────────────────────────────────────────────── */

.mh-route {
  background: var(--surface-deep); color: var(--on-deep);
  padding-block-start: var(--band-y); padding-block-end: var(--band-y);
}
.mh-route__stops { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; position: relative; }
.mh-route__stops li {
  position: relative; display: flex; align-items: center;
  min-height: 52px; padding-inline-start: var(--s6);
  font-size: var(--fs-md); font-weight: 500; color: var(--on-deep);
}
/* Vertical route on small screens: the line runs down the inline-start edge through each dot. */
.mh-route__stops li::before {
  content: ''; position: absolute; top: 0; bottom: 0; right: 9px; inline-size: 2px; background: var(--line-deep);
}
[dir='ltr'] .mh-route__stops li::before { right: auto; left: 9px; }
.mh-route__stops li:first-child::before { top: 50%; }
.mh-route__stops li:last-child::before { bottom: 50%; }
.mh-route__dot {
  position: absolute; right: 2px; top: 50%; margin-top: -8px;
  inline-size: 16px; block-size: 16px; border-radius: 50%;
  background: var(--surface-deep); border: 3px solid var(--accent);
}
[dir='ltr'] .mh-route__dot { right: auto; left: 2px; }
.mh-route__stops li:first-child .mh-route__dot { background: var(--accent); }

@media (min-width: 900px) {
  /* Horizontal route: one line across, a dot over each stop, the name under it. */
  .mh-route__stops { grid-auto-flow: column; grid-auto-columns: 1fr; }
  .mh-route__stops li {
    flex-direction: column; justify-content: flex-start; text-align: center;
    padding: 40px var(--s2) 0; min-height: 0;
  }
  .mh-route__stops li::before { top: 15px; bottom: auto; right: 0; left: 0; inline-size: auto; block-size: 2px; }
  [dir='ltr'] .mh-route__stops li::before { left: 0; }
  .mh-route__stops li:first-child::before { top: 15px; right: 50%; }
  .mh-route__stops li:last-child::before { bottom: auto; left: 50%; }
  [dir='ltr'] .mh-route__stops li:first-child::before { right: 0; left: 50%; }
  [dir='ltr'] .mh-route__stops li:last-child::before { left: 0; right: 50%; }
  .mh-route__dot { top: 8px; margin-top: 0; right: 50%; margin-right: -8px; }
  [dir='ltr'] .mh-route__dot { left: 50%; right: auto; margin-left: -8px; margin-right: 0; }
}

/* ── 6. Programme index ───────────────────────────────────────────────────── */

.mh-programmes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: var(--bd) solid var(--line); }
@media (min-width: 700px) { .mh-programmes { grid-template-columns: 1fr 1fr; column-gap: var(--s6); } }
.mh-programmes li { margin: 0; border-bottom: var(--bd) solid var(--line); }
.mh-programme {
  display: flex; align-items: center; min-height: 76px; padding: var(--s3) 0;
  color: var(--brand-strong); text-decoration: none;
}
.mh-programme > * + * { margin-inline-start: var(--s4); }
.mh-programme__icon {
  flex: none; inline-size: 46px; block-size: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--info-wash); color: var(--brand);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.mh-programme__title { flex: 1; min-width: 0; font-weight: 500; font-size: var(--fs-base); line-height: 1.6; }
.mh-programme__tag {
  flex: none; font-size: var(--fs-xs); color: var(--accent-ink);
  background: var(--accent-wash); border-radius: var(--r-chip); padding: 2px 10px;
}
.mh-programme__go { flex: none; color: var(--brand); font-size: var(--fs-lg); transition: transform var(--dur) var(--ease); }
.mh-programme:hover { color: var(--brand); }
.mh-programme:hover .mh-programme__icon { background: var(--brand); color: var(--on-deep); }
.mh-programme:hover .mh-programme__go { transform: translateX(-4px); }
[dir='ltr'] .mh-programme:hover .mh-programme__go { transform: translateX(4px); }
@media (max-width: 459px) { .mh-programme__tag { display: none; } }

/* ── 7. The chairman's word ───────────────────────────────────────────────── */

.mh-word { display: grid; gap: var(--s4); }
@media (min-width: 900px) { .mh-word { grid-template-columns: 120px minmax(0, var(--measure)); justify-content: center; gap: var(--s6); } }
.mh-word__mark {
  font-size: 9rem; line-height: .8; color: var(--accent); font-weight: 700;
  font-family: Georgia, 'Times New Roman', serif;
  user-select: none;
}
@media (max-width: 899px) { .mh-word__mark { font-size: 5rem; } }
.mh-word__body h2 { font-size: var(--fs-2xl); margin: var(--s2) 0 var(--s5); }
.mh-word__sign {
  display: flex; align-items: center; margin-block-start: var(--s6);
  padding-block-start: var(--s5); border-top: var(--bd) solid var(--line-strong);
}
.mh-word__sign > * + * { margin-inline-start: var(--s4); }
.mh-word__sign img { border-radius: var(--r-avatar); object-fit: cover; }
.mh-word__name { font-weight: 700; color: var(--brand-strong); font-size: var(--fs-md); }
.mh-word__role { color: var(--accent-ink); font-size: var(--fs-sm); }

/* ── 8. Transparency count ────────────────────────────────────────────────── */

.mh-count { display: grid; gap: var(--s1); }
.mh-count b { font-size: var(--fs-stat); line-height: 1.1; color: var(--brand-strong); font-variant-numeric: tabular-nums; }
.mh-count span { color: var(--ink-muted); font-size: var(--fs-sm); line-height: 1.8; }

/* ── 9. Two doors ─────────────────────────────────────────────────────────── */

.mh-doors { padding-block-start: var(--band-y-tight); padding-block-end: var(--band-y); background: var(--paper); }
.mh-doors__grid { display: grid; gap: var(--s4); }
@media (min-width: 760px) { .mh-doors__grid { grid-template-columns: 1fr 1fr; gap: var(--s5); } }
.mh-door {
  display: grid; align-content: start; gap: var(--s2);
  padding: var(--s6); min-height: 220px;
  background: var(--surface-soft); border: var(--bd) solid var(--line); border-radius: var(--r-card);
  color: var(--brand-strong); text-decoration: none;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.mh-door:hover { border-color: var(--brand); color: var(--brand-strong); }
.mh-door__icon {
  inline-size: 56px; block-size: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--paper); color: var(--brand); border: var(--bd) solid var(--line); margin-block-end: var(--s3);
}
.mh-door__k { font-size: var(--fs-xs); color: var(--accent-ink); font-weight: 500; }
.mh-door__t { font-size: var(--fs-xl); font-weight: 700; line-height: 1.35; }
.mh-door__d { color: var(--ink-muted); font-size: var(--fs-sm); line-height: 1.8; }
.mh-door--deep { background: var(--surface-deep); border-color: var(--surface-deep); color: var(--on-deep); }
.mh-door--deep:hover { border-color: var(--accent); color: var(--on-deep); }
.mh-door--deep .mh-door__icon { background: var(--deep-fill-strong); border-color: var(--line-deep); color: var(--on-deep); }
.mh-door--deep .mh-door__k { color: var(--on-deep-muted); }
.mh-door--deep .mh-door__d { color: var(--on-deep-muted); }
.mh-door--deep:focus-visible { outline-color: var(--focus-ring-deep); }

/* ── 10. Footer — light stone, a deep give-strip on top ───────────────────── */

.mf { background: var(--surface-soft); color: var(--ink-muted); font-size: var(--fs-sm); border-top: var(--bd) solid var(--line); }
.mf a { color: var(--brand-strong); text-decoration: none; }
.mf a:hover { color: var(--brand); text-decoration: underline; }

.mf__give { background: var(--surface-deep); color: var(--on-deep-muted); }
.mf__give a { color: var(--on-deep); }
.mf__give a:hover { color: var(--on-deep); }
.mf__give :focus-visible { outline-color: var(--focus-ring-deep); }
.mf__give-inner {
  display: grid; gap: var(--s3); align-items: center;
  padding-block-start: var(--s5); padding-block-end: var(--s5);
}
@media (min-width: 900px) { .mf__give-inner { grid-template-columns: auto 1fr auto; gap: var(--s6); } }
.mf__give-label { display: grid; line-height: 1.6; }
.mf__give-label b { color: var(--on-deep); font-size: var(--fs-md); }
.mf__iban { display: flex; flex-wrap: wrap; align-items: center; }
.mf__iban > * { margin-inline-end: var(--s3); margin-block-start: 2px; margin-block-end: 2px; }
.mf__iban-k { color: var(--on-deep-faint); font-size: var(--fs-xs); }
.mf__iban-v {
  direction: ltr; unicode-bidi: isolate; user-select: all;
  color: var(--on-deep); font-size: var(--fs-md); letter-spacing: .04em; font-variant-numeric: tabular-nums;
}
/* The value is direction:ltr, which flips ITS logical margins — so the gap is owned by the
   element after it (RTL), never by the IBAN itself. */
.mf__iban > .mf__iban-v { margin-inline-end: 0; margin-inline-start: 0; }
.mf__iban > .mf__iban-v + * { margin-inline-start: var(--s4); }
.mf__give-more { font-size: var(--fs-sm); text-decoration: underline; }

.mf__main {
  display: grid; gap: var(--s6);
  padding-block-start: var(--s8); padding-block-end: var(--s6);
}
@media (min-width: 700px) { .mf__main { grid-template-columns: repeat(3, 1fr); } .mf__brand { grid-column: 1 / -1; } }
@media (min-width: 1040px) { .mf__main { grid-template-columns: 2fr 1fr 1fr 1fr; } .mf__brand { grid-column: auto; } }
.mf__brand { display: flex; align-items: flex-start; }
.mf__brand > img { flex: none; inline-size: 76px; block-size: auto; margin-inline-end: var(--s4); }
.mf__name { display: block; color: var(--brand-strong); font-size: var(--fs-md); }
.mf__tagline { margin: var(--s1) 0 var(--s3); color: var(--accent-ink); font-weight: 500; }
.mf__muted { margin: 0 0 var(--s3); line-height: 1.8; }
.mf__facts { margin: 0; display: grid; gap: var(--s1); }
.mf__facts > div { display: flex; flex-wrap: wrap; }
.mf__facts dt { margin-inline-end: var(--s2); }
.mf__facts dt::after { content: ':'; }
.mf__facts dd { margin: 0; color: var(--ink); }
.mf__col h2 {
  font-size: var(--fs-base); color: var(--brand-strong); margin: 0 0 var(--s3);
  padding-bottom: var(--s2); border-bottom: var(--bd-strong) solid var(--accent); display: inline-block;
}
.mf__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.mf__col li { margin: 0; line-height: 1.8; }
.mf__wa { margin-inline-start: var(--s2); font-size: var(--fs-xs); color: var(--accent-ink) !important; }

.mf__legal { border-top: var(--bd) solid var(--line-strong); background: var(--surface-strong); }
.mf__legal-inner { padding-block-start: var(--s4); padding-block-end: var(--s4); display: grid; gap: var(--s2); font-size: var(--fs-xs); }
.mf__registry { display: flex; flex-wrap: wrap; }
.mf__registry > span { margin-inline-end: var(--s5); }
.mf__registry b { color: var(--ink); font-weight: 500; }
.mf__legal-row { display: flex; flex-wrap: wrap; justify-content: space-between; }
.mf__legal-row > * { margin-block-end: var(--s1); }
.mf__legal-links > a + a { margin-inline-start: var(--s4); }

/* ── 11. Inner pages: the crumbs bar sits on stone under the pinned nav ───── */
.crumbs { background: var(--paper); }
