/* ==========================================================================
   Zuhri Academy — public site
   Family of the parent portal (Inter, glassy white, green→teal glows, dot grid),
   pushed editorial: Fraunces display + long-form, Amiri for Arabic.
   ========================================================================== */

:root {
  --paper: #F7FBF9;
  --surface: #FFFFFF;
  --ink: #10202A;
  --ink-2: #2E4150;
  --muted: #5F6C7B;
  --teal: #1F6077;
  --teal-deep: #123E4E;
  --teal-night: #0D2C38;
  --green: #2EA37D;
  --green-2: #3BAE7E;
  --green-ink: #19785B;
  --mint: #83DFD2;
  --mint-soft: #E4F6F1;
  --gold: #EDB836;
  --grey: #A7A9AC;
  --line: rgba(31, 96, 119, .14);
  --line-2: rgba(31, 96, 119, .08);
  --glass: rgba(255, 255, 255, .86);
  --shadow: 0 30px 80px -30px rgba(18, 62, 78, .28), 0 2px 6px rgba(18, 62, 78, .05);
  --shadow-sm: 0 14px 34px -18px rgba(18, 62, 78, .25);
  --brand-grad: linear-gradient(135deg, #19785B 0%, #1F6077 100%);
  --wing-grad: linear-gradient(135deg, #2EA37D 0%, #1F6077 100%);

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --arabic: "Amiri", "Traditional Arabic", "Times New Roman", serif;

  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1200px;
  --header-h: 72px;
  --r-xl: 34px;
  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 12px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink-2);
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 620px at 6% -6%, rgba(46, 163, 125, .16), transparent 62%),
    radial-gradient(900px 600px at 102% 4%, rgba(31, 96, 119, .13), transparent 60%);
  background-repeat: no-repeat;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, iframe { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--teal); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--green-ink); }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
h1, h2, h3, h4 { color: var(--ink); margin: 0 0 .5em; font-weight: 500; }
address { font-style: normal; }
table { border-collapse: collapse; }
[lang="ar"] { font-family: var(--arabic); font-weight: 400; line-height: 1.4; }

:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }
.legacy :focus-visible, .site-footer :focus-visible, .programme-maktab :focus-visible { outline-color: var(--gold); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600;
}
.skip:focus { top: 12px; color: #fff; }
main:focus { outline: none; }

.wrap { width: 100%; max-width: calc(var(--maxw) + 2 * var(--gutter)); margin: 0 auto; padding-inline: var(--gutter); }
.narrow { max-width: calc(780px + 2 * var(--gutter)); }
.center { text-align: center; }

/* ---------- type ---------- */
.display, .h2, .display-2, .h3 {
  font-family: var(--serif);
  font-optical-sizing: auto;
  letter-spacing: -.015em;
  color: var(--ink);
}
.display {
  font-size: clamp(2.5rem, 1.55rem + 4.4vw, 5.1rem);
  line-height: 1.02;
  font-weight: 400;
  letter-spacing: -.028em;
  margin-bottom: .35em;
  text-wrap: balance;
}
.display-2 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); line-height: 1.05; font-weight: 400; letter-spacing: -.025em; text-wrap: balance; }
.h2 { font-size: clamp(1.8rem, 1.35rem + 1.8vw, 2.75rem); line-height: 1.08; font-weight: 400; text-wrap: balance; }
.h3 { font-size: clamp(1.3rem, 1.15rem + .5vw, 1.55rem); line-height: 1.2; font-weight: 500; }
.lede { font-size: clamp(1.1rem, 1.02rem + .35vw, 1.3rem); line-height: 1.55; color: var(--ink-2); max-width: 38em; }
.body-l { font-size: 1.15rem; line-height: 1.7; }
.fine { font-size: .875rem; color: var(--muted); margin-top: .9em; }

/* ---------- buttons ---------- */
.btn {
  --b-bg: transparent; --b-fg: var(--teal); --b-bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 46px; padding: .7em 1.3em;
  font: 600 .975rem/1.15 var(--sans); letter-spacing: -.005em;
  color: var(--b-fg); background: var(--b-bg); border: 1.5px solid var(--b-bd);
  border-radius: 999px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s, color .2s, border-color .2s;
}
.btn .i { width: 18px; height: 18px; flex: none; }
.btn:hover { color: var(--b-fg); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { --b-fg: #fff; background: var(--brand-grad); box-shadow: 0 10px 24px -12px rgba(25, 120, 91, .7); }
.btn-primary:hover { box-shadow: 0 14px 30px -12px rgba(25, 120, 91, .8); }
.btn-portal { --b-fg: var(--teal); --b-bd: rgba(31, 96, 119, .35); --b-bg: rgba(255, 255, 255, .7); }
.btn-portal:hover { --b-bd: var(--teal); --b-bg: #fff; }
.btn-quiet { --b-bg: rgba(31, 96, 119, .08); --b-fg: var(--teal); }
.btn-quiet:hover { --b-bg: rgba(31, 96, 119, .14); }
.btn-line { --b-bd: var(--line); --b-fg: var(--teal); --b-bg: #fff; }
.btn-line:hover { --b-bd: var(--teal); }
.btn-gold { --b-bg: var(--gold); --b-fg: var(--ink); box-shadow: 0 12px 26px -14px rgba(173, 124, 10, .8); }
.btn-light { --b-bg: #fff; --b-fg: var(--teal-deep); }
.btn-sm { min-height: 40px; padding: .55em 1.05em; font-size: .9rem; }
.btn-lg { min-height: 54px; padding: .85em 1.6em; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-block + .btn-block { margin-top: 10px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cta-center { justify-content: center; }
.link-more {
  display: inline-flex; align-items: center; gap: .4em; font-weight: 600; font-size: .95rem;
  color: var(--teal); text-decoration: none; border-bottom: 1.5px solid rgba(31, 96, 119, .25); padding-bottom: 2px;
}
.link-more:hover { border-color: currentColor; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: border-color .25s, box-shadow .25s;
}
/* blur lives on a pseudo-element so it doesn't trap the fixed mobile menu */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(247, 251, 249, .84);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
}
.nav-open .site-header::before { background: var(--paper); }
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 10px 30px -24px rgba(18, 62, 78, .5); }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: var(--header-h); flex-wrap: wrap; }
.brand { display: inline-flex; flex: none; border-radius: 8px; }
.brand img { height: 34px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.nav-list { display: flex; gap: 4px; list-style: none; }
.nav-list a {
  display: block; padding: 10px 12px; border-radius: 999px;
  font-weight: 500; font-size: .96rem; color: var(--ink); text-decoration: none;
}
.nav-list a:hover { background: rgba(31, 96, 119, .07); color: var(--teal); }
.nav-list a[aria-current="page"] { color: var(--teal); background: rgba(46, 163, 125, .12); }
.nav-actions { display: flex; gap: 10px; align-items: center; }
.nav-toggle {
  margin-left: auto; display: none; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; color: var(--ink); font: 600 .95rem var(--sans); cursor: pointer;
}
.nav-toggle .nav-toggle-open, .nav-toggle .nav-toggle-close { display: inline-flex; align-items: center; gap: 6px; }
.nav-toggle .nav-toggle-close { display: none; }

@media (max-width: 1079px) {
  /* Without JS the nav stays visible as a scrollable row under the logo. */
  .site-nav { width: 100%; margin: 0 0 10px; gap: 10px; overflow-x: auto; scrollbar-width: none; }
  .no-js .header-inner { padding-top: 12px; gap: 8px 20px; }
  .site-nav::-webkit-scrollbar { display: none; }
  .nav-list a { white-space: nowrap; padding: 8px 10px; font-size: .92rem; }
  .nav-actions .btn { min-height: 38px; padding: .45em .9em; font-size: .88rem; }

  .js .nav-toggle { display: inline-flex; }
  .js .nav-toggle[hidden] { display: inline-flex; }
  .js .site-nav {
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 49; margin: 0; width: auto;
    flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 28px;
    padding: 28px var(--gutter) calc(32px + env(safe-area-inset-bottom));
    background:
      radial-gradient(600px 400px at 100% 0%, rgba(46, 163, 125, .16), transparent 60%),
      var(--paper);
    overflow-y: auto;
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .22s var(--ease), transform .22s var(--ease), visibility 0s linear .22s;
  }
  .js .nav-open .site-nav { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
  .js .nav-open .nav-toggle-open { display: none; }
  .js .nav-open .nav-toggle-close { display: inline-flex; }
  .js .nav-list { flex-direction: column; gap: 0; }
  .js .nav-list a {
    font-family: var(--serif); font-size: 2rem; font-weight: 400; letter-spacing: -.02em;
    padding: 12px 4px; border-radius: 0; border-bottom: 1px solid var(--line); background: none;
  }
  .js .nav-list a[aria-current="page"] { color: var(--green-ink); }
  .js .nav-actions { flex-direction: column; align-items: stretch; }
  .js .nav-actions .btn { min-height: 54px; font-size: 1.02rem; }
  .nav-open { overflow: hidden; }
}
@media (max-width: 520px) {
  :root { --header-h: 64px; }
  .brand img { height: 28px; }
}

/* ---------- sections ---------- */
.section { padding-block: clamp(64px, 5vw + 36px, 120px); position: relative; }
.section-head { max-width: 760px; margin-bottom: clamp(28px, 3vw, 48px); }
.section-head .h2 { margin-bottom: .3em; }
.section-head-row { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.section-head-row .h2 { margin: 0; }
.section-lede { color: var(--muted); font-size: 1.1rem; max-width: 40em; margin: 0; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(36px, 5vw, 84px) clamp(64px, 7vw, 120px); isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background-image: radial-gradient(rgba(31, 96, 119, .22) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 80% 30%, #000 0%, transparent 70%);
          mask-image: radial-gradient(ellipse 70% 80% at 80% 30%, #000 0%, transparent 70%);
  opacity: .55;
}
.hero-art { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-mark {
  position: absolute; width: clamp(360px, 46vw, 680px); height: auto;
  right: max(-120px, calc(50% - 760px)); top: -40px; opacity: .13; transform: rotate(-6deg);
}
.hero-ar {
  position: absolute; right: max(-20px, calc(50% - 640px)); bottom: .2rem;
  font-size: clamp(7rem, 15vw, 15rem); line-height: 1; color: var(--teal); opacity: .06;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px;
  padding: 6px 14px 6px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .75); color: var(--teal); font-weight: 600; font-size: .9rem;
}
.hero-kicker .i { width: 17px; height: 17px; color: var(--green-ink); }
.hero h1 { max-width: 9.5em; }
.hero .lede { margin-bottom: 30px; }
.hero-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 44px 0 0; max-width: 620px; }
.hero-facts div { padding: 14px 18px 0 0; border-top: 1.5px solid var(--line); }
.hero-facts div + div { padding-left: 18px; border-left: 1px solid var(--line-2); }
.hero-facts dt { font-size: .82rem; font-weight: 600; color: var(--green-ink); margin-bottom: 2px; }
.hero-facts dd { margin: 0; font-family: var(--serif); font-size: 1.12rem; line-height: 1.25; color: var(--ink); }

/* hero load sequence — the one orchestrated moment */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise .9s var(--ease) both; }
  .hero-copy > :nth-child(1) { animation-delay: .05s; }
  .hero-copy > :nth-child(2) { animation-delay: .14s; }
  .hero-copy > :nth-child(3) { animation-delay: .26s; }
  .hero-copy > :nth-child(4) { animation-delay: .36s; }
  .hero-copy > :nth-child(5) { animation-delay: .46s; }
  .hero-side { animation: rise 1s var(--ease) .3s both; }
  .hero-mark { animation: wing 1.8s var(--ease) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
  @keyframes wing { from { opacity: 0; transform: rotate(-16deg) translate(-30px, 40px) scale(.94); } to { opacity: .13; transform: rotate(-6deg); } }
}

/* ---------- prayer card ---------- */
.prayer {
  position: relative; padding: 26px 26px 20px; border-radius: var(--r-xl);
  background: var(--glass); border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.prayer-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.prayer-title { font-family: var(--serif); font-size: 1.35rem; font-weight: 500; margin: 0; }
.prayer-date { margin: 0; font-size: .85rem; color: var(--muted); }
.prayer-next {
  margin: 18px 0 16px; padding: 18px 20px; border-radius: var(--r-lg);
  background: linear-gradient(140deg, var(--teal-deep), var(--teal) 70%, #1F7A68);
  color: #fff; position: relative; overflow: hidden;
}
.prayer-next::after {
  content: ""; position: absolute; right: -30px; top: -40px; width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(131, 223, 210, .35), transparent 70%);
}
.prayer-next p { margin: 0; position: relative; z-index: 1; }
.prayer-next-label { font-size: .85rem; color: rgba(255, 255, 255, .8); }
.prayer-next-name { font-family: var(--serif); font-size: 2.3rem; line-height: 1.1; letter-spacing: -.02em; }
.prayer-next-time { font-size: 1rem; color: rgba(255, 255, 255, .92); font-variant-numeric: tabular-nums; }
.prayer-countdown:not(:empty) {
  display: inline-block; margin-left: 6px; padding: 2px 10px; border-radius: 999px;
  background: rgba(237, 184, 54, .2); color: #FFE7A6; font-size: .85rem; font-weight: 600;
}
.prayer-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.prayer-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px; border-radius: 12px; font-size: .95rem; color: var(--ink-2);
}
.prayer-list time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.prayer-list li.is-next { background: var(--mint-soft); color: var(--teal-deep); font-weight: 600; }
.prayer-list li.is-next span::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); margin-right: 8px; vertical-align: middle; box-shadow: 0 0 0 3px rgba(237, 184, 54, .25);
}
.prayer-list li.is-sunrise { color: var(--muted); }
.prayer-note { margin: 14px 2px 0; font-size: .8rem; color: var(--muted); line-height: 1.45; }
.no-js .prayer-next, .no-js .prayer-list { display: none; }
.prayer.is-error .prayer-next, .prayer.is-error .prayer-list { display: none; }

/* ---------- flagship programmes ---------- */
.flagship-grid {
  display: grid; gap: 20px;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  grid-template-areas: "a b" "a c";
}
.programme {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.programme-body { padding: clamp(24px, 2.6vw, 34px); display: flex; flex-direction: column; gap: 4px; flex: 1; position: relative; z-index: 1; }
.programme-for {
  display: inline-block; align-self: flex-start; margin: 0 0 10px; padding: 3px 11px; border-radius: 999px;
  font-size: .82rem; font-weight: 600; color: var(--green-ink); background: rgba(46, 163, 125, .12);
}
.programme-title { font-family: var(--serif); font-size: clamp(1.6rem, 1.3rem + 1vw, 2.2rem); font-weight: 400; line-height: 1.08; letter-spacing: -.02em; margin-bottom: .4em; }
.programme-title a { color: inherit; text-decoration: none; }
.programme-title a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; }
.programme p { max-width: 34em; }
.programme-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: auto; padding-top: 10px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0 0 14px; font-size: .92rem; color: var(--muted); }
.facts li { display: inline-flex; align-items: center; gap: 8px; }
.facts li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.programme-maktab { grid-area: a; border: 0; color: rgba(255, 255, 255, .9); background: linear-gradient(160deg, #1A5D57 0%, var(--teal-deep) 55%, var(--teal-night) 100%); box-shadow: var(--shadow); }
.programme-maktab::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(500px 360px at 0% 100%, rgba(46, 163, 125, .45), transparent 70%),
    radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1.2px) 0 0 / 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 60%);
          mask-image: linear-gradient(180deg, transparent, #000 60%);
}
.programme-maktab .programme-body { justify-content: flex-end; min-height: 440px; }
.programme-maktab .programme-title { color: #fff; font-size: clamp(2rem, 1.4rem + 2vw, 3.1rem); }
.programme-maktab .programme-title a:focus-visible { outline-color: var(--gold); }
.programme-maktab .programme-for { color: var(--teal-night); background: var(--mint); }
.programme-maktab p { font-size: 1.12rem; color: rgba(255, 255, 255, .86); }
.programme-maktab .link-more { color: #fff; border-color: rgba(255, 255, 255, .4); }
.programme-maktab .btn-primary { background: #fff; color: var(--teal-deep); --b-fg: var(--teal-deep); box-shadow: none; }
.programme-sanatain { grid-area: b; }
.programme-aalim { grid-area: c; }
.programme-photo img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.programme-maktab .programme-photo img { aspect-ratio: 16 / 10; }

.programme-art { position: absolute; right: -40px; bottom: -14px; width: 360px; height: auto; opacity: .16; transform: rotate(-8deg); pointer-events: none; }
.programme-art path { fill: var(--mint); }
.facts-light { color: rgba(255, 255, 255, .85); font-size: 1rem; margin-top: 6px; }
.facts-light li::before { background: var(--gold); }

/* ---------- short courses ---------- */
.short-courses { padding-top: 0; }
.short-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1.5px solid var(--ink); }
.short { padding: 28px 28px 8px 0; display: flex; flex-direction: column; align-items: flex-start; }
.short + .short { padding-left: 28px; border-left: 1px solid var(--line); }
.short-title { font-family: var(--serif); font-size: 1.6rem; font-weight: 400; letter-spacing: -.015em; margin-bottom: .7em; }
.short-title a { color: inherit; text-decoration: none; }
.short-title a:hover { color: var(--teal); }
.short .btn { margin-top: auto; }
.ticks { list-style: none; display: grid; gap: 10px; margin: 0 0 24px; }
.ticks li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; line-height: 1.45; }
.ticks .i { width: 20px; height: 20px; color: var(--green-ink); margin-top: 2px; stroke-width: 2.2; }

/* ---------- legacy band ---------- */
.legacy {
  position: relative; overflow: hidden; color: rgba(255, 255, 255, .86);
  padding-block: clamp(72px, 7vw + 30px, 140px);
  background: linear-gradient(150deg, var(--teal-night) 0%, var(--teal-deep) 40%, #1A5D6E 80%, #1D6B66 100%);
  isolation: isolate;
}
.legacy::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(131, 223, 210, .22) 1px, transparent 1.2px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 60%);
          mask-image: linear-gradient(90deg, #000, transparent 60%);
}
.legacy::after {
  content: ""; position: absolute; z-index: -1; width: 700px; height: 700px; right: -200px; bottom: -360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(46, 163, 125, .35), transparent 65%);
}
.legacy .h2 { color: #fff; }
.legacy a:not(.btn) { color: var(--mint); }
.legacy-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(36px, 6vw, 96px); align-items: center; }
.legacy-ar { text-align: left; font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); color: var(--mint); margin-bottom: 18px; }
.legacy blockquote { margin: 0; }
.legacy blockquote p {
  font-family: var(--serif); font-weight: 300; font-style: italic;
  font-size: clamp(1.85rem, 1.2rem + 2.6vw, 3.3rem); line-height: 1.12; letter-spacing: -.02em; color: #fff;
  margin: 0 0 .6em; text-indent: -.42em; text-wrap: balance;
}
.legacy blockquote p::before { content: "\201C"; color: var(--mint); }
.legacy blockquote p::after { content: "\201D"; color: var(--mint); }
.legacy blockquote footer { font-size: .95rem; color: rgba(255, 255, 255, .7); }
.legacy blockquote footer::before { content: ""; display: inline-block; width: 32px; height: 1.5px; background: var(--gold); vertical-align: middle; margin-right: 12px; }
.legacy-copy p { font-size: 1.08rem; }
.legacy-copy .btn { margin-top: 10px; }

/* timeline (About) */
.legacy-timeline .h2 { max-width: 14em; margin-bottom: clamp(36px, 4vw, 60px); }
.timeline { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; top: 13px; height: 1.5px; background: linear-gradient(90deg, rgba(131, 223, 210, .7), rgba(237, 184, 54, .8)); }
.timeline li { position: relative; padding-top: 44px; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--teal-deep); border: 2px solid var(--mint); box-shadow: 0 0 0 6px rgba(18, 62, 78, .9);
}
.timeline li:last-child::before { border-color: var(--gold); background: var(--gold); }
.timeline-when { display: block; font-family: var(--serif); font-size: 2.2rem; line-height: 1; color: #fff; letter-spacing: -.02em; margin-bottom: 10px; }
.timeline h3 { font-family: var(--sans); font-size: 1.02rem; font-weight: 600; color: var(--mint); margin-bottom: .4em; }
.timeline p { font-size: .98rem; margin: 0; }

/* ---------- principles ---------- */
.principles-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 44px); }
.principle h3 { font-family: var(--serif); font-size: 1.45rem; font-weight: 500; margin: 18px 0 .4em; }
.principle p { margin: 0; color: var(--ink-2); }
.principle-icon {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px;
  background: linear-gradient(140deg, rgba(46, 163, 125, .16), rgba(31, 96, 119, .12)); color: var(--teal);
}
.principle-icon .i { width: 26px; height: 26px; }
.principles-tinted { background: linear-gradient(180deg, transparent, rgba(131, 223, 210, .14) 30%, rgba(131, 223, 210, .14) 70%, transparent); }
.principles-tinted .cta-row { margin-top: 48px; }

/* ---------- news ---------- */
.news-strip { padding-top: 0; }
.news-list { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1.5px solid var(--ink); }
.news-item { padding: 22px 22px 10px 0; display: flex; flex-direction: column; align-items: flex-start; }
.news-item + .news-item { padding-left: 22px; border-left: 1px solid var(--line); }
.news-item time { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.news-item h3, .news-item .h3 { font-family: var(--serif); font-size: 1.3rem; font-weight: 500; line-height: 1.2; margin: 8px 0 .5em; }
.news-item h3 a, .news-item .h3 a { color: var(--ink); text-decoration: none; }
.news-item h3 a:hover, .news-item .h3 a:hover { color: var(--teal); text-decoration: underline; }
.news-item p { font-size: .97rem; color: var(--ink-2); }
.tag { display: inline-block; margin-top: auto; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; color: var(--teal); background: rgba(31, 96, 119, .08); }
.news-photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r-md); margin-bottom: 14px; }
.news-list-full { grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 0; gap: 0 48px; }
.news-list-full .news-item { padding: 28px 0; border-left: 0 !important; border-top: 1.5px solid var(--ink); padding-left: 0 !important; }
.news-list-full .news-item .h3 { font-size: 1.7rem; }
.news-list-compact { grid-template-columns: 1fr; border-top: 0; }
.news-list-compact .news-item { padding: 18px 0; border-left: 0 !important; padding-left: 0 !important; border-top: 1px solid var(--line); }

/* ---------- visit & donate ---------- */
.visit { padding-top: 0; }
.visit-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; }
.visit-card, .donate-card, .aside-card, .contact-form-card, .reg-card {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: clamp(26px, 3vw, 44px);
  background: var(--glass); border: 1px solid #fff; box-shadow: var(--shadow-sm);
}
.visit-card .h2, .donate-card .h2 { font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.4rem); }
.info-list { list-style: none; display: grid; gap: 14px; margin: 0 0 26px; }
.info-list li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; }
.info-list .i { width: 22px; height: 22px; color: var(--green-ink); margin-top: 2px; }
.info-list strong { color: var(--ink); font-weight: 600; }
.info-list-sm { margin: 22px 0 0; font-size: .92rem; color: var(--muted); }
.info-list-sm .i { width: 18px; height: 18px; }
.donate-card { background: linear-gradient(165deg, #FFFFFF 0%, #FFF9EA 100%); border-color: rgba(237, 184, 54, .35); }
.donate-card > *:not(.donate-mark) { position: relative; z-index: 1; }
.donate-mark { position: absolute; right: -40px; bottom: -50px; width: 240px; height: auto; opacity: .1; transform: rotate(-8deg); }

/* ---------- CTA band ---------- */
.cta-band { padding-block: clamp(72px, 7vw + 20px, 130px); text-align: center; position: relative; isolation: isolate; overflow: hidden; }
.cta-band::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 300px at 50% 100%, rgba(46, 163, 125, .2), transparent 70%),
    radial-gradient(rgba(31, 96, 119, .2) 1px, transparent 1.2px) 0 0 / 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 60% 80% at 50% 60%, #000, transparent 75%);
          mask-image: radial-gradient(ellipse 60% 80% at 50% 60%, #000, transparent 75%);
}
.cta-band-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.cta-band .display-2 { margin: 0; }
.cta-band .lede { margin: 0; }
.cta-band .cta-row { justify-content: center; }

/* ---------- inner page hero ---------- */
.page-hero { padding-block: clamp(20px, 3vw, 40px) clamp(40px, 5vw, 80px); position: relative; overflow: hidden; }
.page-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: center; margin-top: clamp(20px, 3vw, 44px); }
.page-hero .display { font-size: clamp(2.4rem, 1.5rem + 3.8vw, 4.6rem); max-width: 13em; }
.page-hero .lede { margin: 0; }
.page-hero-mark { width: clamp(120px, 15vw, 210px); height: auto; filter: drop-shadow(0 30px 40px rgba(31, 96, 119, .18)); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: .88rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin: 0 10px; color: rgba(95, 108, 123, .6); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--teal); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); font-weight: 500; }

.fact-strip { display: flex; flex-wrap: wrap; gap: 0; margin: 30px 0 0; border-top: 1.5px solid var(--line); }
.fact-strip div { padding: 14px 22px 0 0; margin-right: 22px; border-right: 1px solid var(--line-2); }
.fact-strip div:last-child { border-right: 0; }
.fact-strip dt { font-size: .82rem; font-weight: 600; color: var(--green-ink); }
.fact-strip dd { margin: 0; font-family: var(--serif); font-size: 1.15rem; color: var(--ink); }

/* ---------- about ---------- */
.mission-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.big-text { font-family: var(--serif); font-size: clamp(1.45rem, 1.15rem + 1.1vw, 2rem); line-height: 1.3; color: var(--ink); letter-spacing: -.01em; }
.services { padding: clamp(26px, 3vw, 40px); border-radius: var(--r-xl); background: var(--glass); border: 1px solid #fff; box-shadow: var(--shadow-sm); }
.services .ticks { margin-bottom: 26px; }
.story-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.story-head { position: sticky; top: calc(var(--header-h) + 28px); }
.story-ar { text-align: left; font-size: clamp(1.6rem, 1.2rem + 1vw, 2.2rem); color: var(--teal); margin: 18px 0 4px; }
.story-meta { color: var(--muted); font-size: .95rem; }
.prose { max-width: 68ch; }
.prose p, .prose li { font-family: var(--serif); font-size: 1.18rem; line-height: 1.75; color: #24323D; font-optical-sizing: auto; }
.prose h2, .prose h3 { font-family: var(--serif); font-size: 1.6rem; font-weight: 500; margin: 1.6em 0 .6em; letter-spacing: -.01em; }
.prose > h3:first-child, .prose > h2:first-child { margin-top: 0; }
.dropcap::first-letter { float: left; font-family: var(--serif); font-size: 4.1em; line-height: .82; padding: .06em .1em 0 0; color: var(--teal); font-weight: 400; }
.sayings { list-style: none; display: grid; gap: 18px; margin: 10px 0 28px; }
.sayings li { padding: 4px 0 4px 22px; border-left: 2px solid var(--mint); }
.credit { font-style: italic; color: var(--muted) !important; font-size: 1rem !important; }
.motivation { padding-block: clamp(80px, 8vw, 150px); text-align: center; background: radial-gradient(800px 400px at 50% 50%, rgba(131, 223, 210, .22), transparent 70%); }
.motivation-text { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(2rem, 1.3rem + 3vw, 3.8rem); line-height: 1.1; letter-spacing: -.025em; color: var(--teal-deep); max-width: 17em; margin: 0 auto 18px; text-wrap: balance; }
.motivation-label { color: var(--green-ink); font-weight: 600; font-size: .95rem; margin: 0; }

/* ---------- courses list ---------- */
.course-group + .course-group { padding-top: 0; }
.course-rows { border-top: 1.5px solid var(--ink); }
.course-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px 48px; padding: 30px 0; border-bottom: 1px solid var(--line); }
.course-row-title { font-family: var(--serif); font-size: clamp(1.6rem, 1.3rem + 1vw, 2.2rem); font-weight: 400; letter-spacing: -.02em; line-height: 1.1; margin-bottom: .35em; }
.course-row-title a { color: var(--ink); text-decoration: none; }
.course-row-title a:hover { color: var(--teal); }
.course-row-main p { margin: 0; max-width: 36em; }
.course-row-side { display: flex; flex-direction: column; gap: 18px; justify-content: space-between; align-items: flex-start; }
.ticks-sm { gap: 6px; margin: 0; font-size: .95rem; }
.ticks-sm .i { width: 18px; height: 18px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 5px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: .88rem; color: var(--ink-2); }
.chips .chip-more { background: transparent; border-style: dashed; color: var(--muted); }
.course-group-past .course-row-title { font-size: clamp(1.4rem, 1.2rem + .8vw, 1.8rem); }

/* ---------- course detail ---------- */
.course-detail { padding-top: clamp(24px, 3vw, 40px); }
.course-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.course-main .h3 { margin-top: 0; }
.course-main .body-l + .h3, .course-main .body-l + h2 { margin-top: 1.6em; }
.course-photo img { width: 100%; border-radius: var(--r-lg); margin-bottom: 32px; aspect-ratio: 16 / 10; object-fit: cover; }
.topic-list { list-style: none; display: grid; gap: 0; border-top: 1px solid var(--line); }
.topic-list li {
  display: grid; grid-template-columns: 28px 1fr; gap: 14px; align-items: start;
  padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 1.08rem; color: var(--ink);
}
.topic-list li::before {
  content: ""; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%;
  background: var(--mint-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2319785B' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.course-aside { position: sticky; top: calc(var(--header-h) + 24px); }
.aside-card .h3 { margin-bottom: .4em; }
.related { padding-top: 0; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.related-card {
  display: flex; flex-direction: column; gap: 6px; padding: 24px; border-radius: var(--r-lg);
  background: #fff; border: 1px solid var(--line-2); text-decoration: none; color: var(--ink-2);
  transition: border-color .2s, transform .2s var(--ease), box-shadow .2s;
}
.related-card:hover { border-color: rgba(31, 96, 119, .35); transform: translateY(-2px); box-shadow: var(--shadow-sm); color: var(--ink-2); }
.related-title { font-family: var(--serif); font-size: 1.4rem; color: var(--ink); line-height: 1.15; }
.related-text { font-size: .95rem; }
.related-card .programme-for { margin-bottom: 4px; }

/* ---------- register ---------- */
.reg-grid { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.reg-card { display: flex; flex-direction: column; align-items: flex-start; padding: 26px; border-radius: var(--r-lg); }
.reg-card h3 { font-family: var(--serif); font-size: 1.35rem; font-weight: 500; line-height: 1.2; }
.reg-card p { font-size: .96rem; flex: 1; }
.form-embed { padding-top: 0; }
.embed-frame, .video-frame, .map-frame { border-radius: var(--r-lg); overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.embed-frame iframe { display: block; width: 100%; height: 1400px; border: 0; }
.video-frame { margin: 28px 0; aspect-ratio: 16 / 9; }
.video-frame iframe, .map-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.map-frame { aspect-ratio: 16 / 7; }
.map-section { padding-top: 0; }

/* ---------- contact ---------- */
.contact { padding-top: clamp(16px, 2vw, 28px); }
.contact-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.contact-info .h3 { margin-bottom: .7em; }
.contact-info .h3 ~ .h3 { margin-top: 1.6em; }
.hours-table { width: 100%; max-width: 380px; margin: 0 0 8px; font-size: .98rem; }
.hours-caption { display: flex; align-items: center; gap: 10px; text-align: left; font-weight: 600; color: var(--ink); padding-bottom: 6px; }
.hours-caption .i { color: var(--green-ink); }
.hours-table th, .hours-table td { padding: 10px 0; border-bottom: 1px solid var(--line); text-align: left; }
.hours-table th { font-weight: 600; color: var(--ink); }
.hours-table td { text-align: right; font-variant-numeric: tabular-nums; }
.contact-info .btn { margin-top: 22px; }
.form { display: grid; gap: 18px; }
.form .btn { justify-self: start; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .95rem; color: var(--ink); }
.optional { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%; font: 400 1rem/1.5 var(--sans); color: var(--ink);
  padding: 12px 14px; border-radius: 14px; border: 1.5px solid rgba(31, 96, 119, .28); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 150px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(31, 96, 119, .16); }
.has-error input, .has-error textarea { border-color: #B42318; }
.field-error { margin: 0; color: #B42318; font-size: .9rem; font-weight: 500; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { display: flex; gap: 14px; padding: 18px 20px; border-radius: 16px; margin-bottom: 20px; }
.notice .i { flex: none; width: 24px; height: 24px; }
.notice ul { margin: 6px 0 0 18px; }
.notice p { margin: 0; }
.notice-ok { background: var(--mint-soft); color: var(--teal-deep); }
.notice-error { background: #FEF3F2; color: #912018; border: 1px solid #FECDCA; }
.notice-error a { color: #912018; }
.social { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.social a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: .92rem; }
.social .i { width: 20px; height: 20px; }
.social-lg a { background: #fff; border: 1px solid var(--line); color: var(--teal); }
.social-lg a:hover { border-color: var(--teal); }
.social-lg + .btn { display: inline-flex; }

/* ---------- donate page ---------- */
.donate-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.donate-card-lg { padding: clamp(30px, 4vw, 56px); }

/* ---------- posts ---------- */
.post-hero .display-post { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.8rem); margin-top: 18px; }
.post-meta { display: flex; align-items: center; gap: 12px; margin: clamp(20px, 3vw, 40px) 0 0; color: var(--muted); font-size: .92rem; }
.post-meta .tag { margin: 0; }
.post-body { padding-top: 0; }
.post-photo img { width: 100%; border-radius: var(--r-lg); margin-bottom: 30px; }
.post-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 24px 0; }
.post-photo-sm img { width: 100%; border-radius: var(--r-md); aspect-ratio: 4 / 3; object-fit: cover; }
.downloads { list-style: none !important; display: grid; gap: 12px; margin: 0 0 10px; padding: 0 !important; }
.download {
  display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: 16px;
  background: #fff; border: 1px solid var(--line); text-decoration: none; font-family: var(--sans); font-weight: 600; font-size: 1rem; color: var(--teal);
}
.download:hover { border-color: var(--teal); }
.download .i { width: 22px; height: 22px; flex: none; }
.post-back { margin-top: 40px; font-family: var(--sans) !important; }

/* ---------- 404 ---------- */
.notfound { padding-block: clamp(60px, 8vw, 120px); }
.notfound-mark { width: 110px; height: auto; margin: 0 auto 26px; }
.notfound .display { font-size: clamp(2.2rem, 1.5rem + 3vw, 3.8rem); margin-inline: auto; }
.notfound .lede { margin: 0 auto 30px; }

/* ---------- footer ---------- */
.site-footer {
  color: rgba(255, 255, 255, .74); font-size: .95rem; position: relative; overflow: hidden;
  background: linear-gradient(170deg, var(--teal-night) 0%, #0A2430 100%);
  padding-top: clamp(56px, 6vw, 90px);
}
.site-footer::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(700px 300px at 100% 0%, rgba(46, 163, 125, .22), transparent 70%);
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--mint); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 40px; position: relative; }
.footer-brand .brand img { height: 36px; filter: brightness(0) invert(1); }
.footer-motto { font-family: var(--serif); font-style: italic; font-size: 1.35rem; line-height: 1.3; color: #fff; margin: 22px 0 12px; max-width: 18em; }
.footer-brand p:last-child { max-width: 30em; }
.footer-h { font-family: var(--sans); font-size: .9rem; font-weight: 600; color: var(--mint); margin: 0 0 14px; }
.footer-col .footer-h ~ .footer-h { margin-top: 26px; }
.footer-col address { margin-bottom: 14px; line-height: 1.55; color: rgba(255, 255, 255, .86); }
.footer-hours { list-style: none; display: grid; gap: 4px; }
.footer-hours li { display: flex; justify-content: space-between; gap: 12px; max-width: 230px; }
.footer-links { list-style: none; display: grid; gap: 8px; }
.footer-links a { text-decoration: none; color: rgba(255, 255, 255, .86); }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.site-footer .btn-portal { --b-fg: #fff; --b-bd: rgba(255, 255, 255, .35); --b-bg: rgba(255, 255, 255, .06); }
.site-footer .btn-portal:hover { --b-bd: #fff; }
.site-footer .social a { color: #fff; background: rgba(255, 255, 255, .08); }
.site-footer .social a:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.footer-base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; position: relative;
  margin-top: clamp(40px, 5vw, 70px); padding-block: 22px calc(22px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, .12); font-size: .86rem; color: rgba(255, 255, 255, .6);
}
.footer-base p { margin: 0; }
.footer-base a { color: rgba(255, 255, 255, .8); }

/* ---------- reveal (only when JS runs and motion is welcome) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal-ready [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
  .reveal-ready [data-reveal].is-in { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1079px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero h1 { max-width: 11em; }
  .hero-side { max-width: 560px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .reg-grid { grid-template-columns: 1fr 1fr; }
  .news-list { grid-template-columns: 1fr 1fr; }
  .news-list .news-item:nth-child(3) { border-left: 0; padding-left: 0; }
  .news-list .news-item:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 899px) {
  .flagship-grid { grid-template-columns: 1fr; grid-template-areas: "a" "b" "c"; }
  .programme-maktab .programme-body { min-height: 380px; }
  .short-grid { grid-template-columns: 1fr; }
  .short { padding: 26px 0 24px; }
  .short + .short { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .legacy-grid, .mission-grid, .story-grid, .course-grid, .contact-grid, .visit-grid, .donate-grid { grid-template-columns: 1fr; }
  .story-head { position: static; }
  .course-aside { position: static; }
  .principles-grid { grid-template-columns: 1fr; gap: 32px; }
  .principle { display: grid; grid-template-columns: 56px 1fr; gap: 0 18px; }
  .principle h3 { margin-top: 2px; }
  .principle p { grid-column: 2; }
  .timeline { grid-template-columns: 1fr; gap: 0; }
  .timeline::before { left: 9px; right: auto; top: 8px; bottom: 8px; width: 1.5px; height: auto; background: linear-gradient(180deg, rgba(131, 223, 210, .7), rgba(237, 184, 54, .8)); }
  .timeline li { padding: 0 0 34px 46px; }
  .timeline li::before { top: 4px; }
  .course-row { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .map-frame { aspect-ratio: 4 / 3; }
  .page-hero-mark { width: 92px; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .hero-facts { grid-template-columns: 1fr; margin-top: 34px; }
  .hero-facts div, .hero-facts div + div { padding: 12px 0; border-left: 0; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-top: 1px solid var(--line); }
  .hero-facts dd { text-align: right; font-size: 1.02rem; }
  .hero .cta-row .btn { flex: 1 1 100%; }
  .cta-band .cta-row .btn { flex: 1 1 100%; }
  .prayer { padding: 20px 16px 16px; border-radius: var(--r-lg); }
  .prayer-list { gap: 2px 8px; }
  .prayer-list li { padding: 8px 10px; font-size: .92rem; }
  .news-list, .news-list-full { grid-template-columns: 1fr; }
  .news-list .news-item, .news-list .news-item + .news-item { padding: 20px 0; border-left: 0; border-top: 1px solid var(--line); }
  .news-list .news-item:first-child { border-top: 0; }
  .reg-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .page-hero-grid { grid-template-columns: 1fr; }
  .page-hero-mark { display: none; }
  .fact-strip { flex-direction: column; }
  .fact-strip div { margin-right: 0; padding: 10px 0; border-right: 0; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
  .fact-strip dd { text-align: right; }
  .embed-frame iframe { height: 1600px; }
  .prose p, .prose li { font-size: 1.1rem; }
  .post-gallery { grid-template-columns: 1fr; }
  .hero-ar { display: none; }
  .hero-mark { width: 300px; right: -120px; top: -30px; }
  .footer-links { grid-template-columns: 1fr 1fr; }
  .programme-art { width: 280px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .site-header, .site-footer, .hero-art, .cta-band, .map-section, .nav-toggle { display: none !important; }
  body { background: #fff; }
}
.wrap.prose { max-width: calc(780px + 2 * var(--gutter)); }

/* ---------- salaah timetable (home card) ---------- */
.prayer-table { width: 100%; border-collapse: separate; border-spacing: 0 3px; font-variant-numeric: tabular-nums; }
.prayer-table th, .prayer-table td { padding: 8px 10px; text-align: left; font-size: .95rem; }
.prayer-table thead th { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-block: 0 4px; }
.prayer-table thead th + th, .prayer-table td { text-align: right; }
.prayer-table tbody th { font-weight: 600; color: var(--ink-2); }
.prayer-table tbody td { color: var(--ink); font-weight: 600; }
.prayer-table td.jamaat { color: var(--teal-deep); }
.prayer-table tbody tr > * { background: rgba(255, 255, 255, .55); }
.prayer-table tbody tr > :first-child { border-radius: 10px 0 0 10px; }
.prayer-table tbody tr > :last-child { border-radius: 0 10px 10px 0; }
.prayer-table tr.is-sunrise > * { color: var(--muted); font-weight: 500; background: transparent; }
.prayer-table tr.is-next > * { background: var(--mint-soft); color: var(--teal-deep); }
.prayer-table tr.is-next th::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); margin-right: 8px; vertical-align: middle; box-shadow: 0 0 0 3px rgba(237, 184, 54, .25);
}
.prayer-hijri { color: var(--teal); font-style: italic; }
.prayer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 2px 0; font-size: .88rem; font-weight: 600; }
.prayer-links a { color: var(--teal-deep); }
.prayer-tt .prayer-next { margin: 14px 0 12px; padding: 14px 18px; }
.prayer-tt .prayer-next-name { font-size: 1.9rem; }

/* ---------- monthly timetable page ---------- */
.tt-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.tt-nav h2 { margin: 0; }
.tt-nav-links { display: flex; gap: 10px; flex-wrap: wrap; }
.tt-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line-2); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-sm); }
.tt-table { width: 100%; min-width: 760px; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .92rem; }
.tt-table th, .tt-table td { padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tt-table thead th { position: sticky; top: 0; background: var(--teal-deep); color: #fff; font-weight: 600; font-size: .8rem; }
.tt-table thead tr:first-child th { background: var(--teal-night); font-size: .85rem; }
.tt-table tbody th { text-align: left; font-weight: 600; color: var(--ink); }
.tt-table td.j { color: var(--teal-deep); font-weight: 700; background: rgba(131, 223, 210, .12); }
.tt-table tr.is-fri th { color: var(--green-ink); }
.tt-table tr.is-today > * { background: var(--mint-soft); font-weight: 700; }
.tt-table tr.is-ramadan th::after { content: " ☾"; color: var(--gold); }
.tt-note { margin-top: 14px; font-size: .9rem; color: var(--muted); }

/* ---------- full-screen salaah board (/mobile/) ---------- */
body.board-body { margin: 0; min-height: 100vh; min-height: 100dvh; background: #1f2326; color: #f2f2f2; font-family: var(--sans); display: flex; flex-direction: column; }
.board-top { background: #fff; color: #10202A; text-align: center; padding: clamp(10px, 2.5vw, 18px) 12px; display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 18px; }
.board-date { font-size: clamp(1.6rem, 7vw, 3rem); font-weight: 800; letter-spacing: -.01em; }
.board-hijri { font-size: clamp(1rem, 4.2vw, 1.8rem); font-style: italic; color: #1F6077; }
.board-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.board-table th, .board-table td { padding: clamp(10px, 3vw, 22px) clamp(8px, 3vw, 24px); border-bottom: 2px solid #6b5b57; font-size: clamp(1.5rem, 7.4vw, 3.6rem); font-weight: 800; line-height: 1.1; }
.board-table thead th { background: #212529; color: #f2f2f2; font-size: clamp(1.1rem, 5.2vw, 2.6rem); letter-spacing: .02em; border-bottom: 0; }
.board-table thead th:first-child, .board-table tbody th { text-align: left; padding-left: clamp(14px, 6vw, 48px); }
.board-table td, .board-table thead th + th { text-align: center; }
.board-table tbody th { background: #343434; color: #f2f2f2; }
.board-table td.b { background: #00a389; color: rgba(255, 255, 255, .62); }
.board-table td.j { background: #00563b; color: rgba(255, 255, 255, .62); }
.board-table tr.is-sunrise td { background: #343434; color: rgba(255, 255, 255, .55); }
.board-table tr.is-next > * { background: #006400; color: #fff; }
.board-table tr.is-next td { color: rgba(255, 255, 255, .7); }
.board-foot { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 18px 12px 22px; text-align: center; }
.board-clock { font-size: clamp(2.4rem, 12vw, 5rem); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.board-next { font-size: clamp(1rem, 4.4vw, 1.6rem); color: #cfe9e3; }
.board-next strong { color: #fff; }
.board-next .prayer-countdown { background: rgba(237, 184, 54, .2); color: #FFE7A6; padding: 2px 10px; border-radius: 999px; font-weight: 700; }
.board-note { font-size: .85rem; color: #9aa7ab; margin: 8px 0 0; }
.board-links { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; margin-top: 8px; font-size: .95rem; }
.board-links a { color: #83DFD2; }
.board-brand img { height: 26px; width: auto; filter: brightness(0) invert(1); opacity: .9; }

/* ---------- mobile: compact hero so courses show sooner ---------- */
@media (max-width: 640px) {
  .hero { padding-block: 20px 36px; }
  .hero .display { font-size: clamp(2rem, 9vw, 2.5rem); margin-bottom: .3em; }
  .hero .lede { font-size: 1.02rem; margin-bottom: 18px; }
  .hero-kicker { margin-bottom: 14px; }
  .hero-facts { display: none; }
  .hero .cta-row { gap: 8px; }
  .hero .cta-row .btn { flex: 1 1 100%; min-height: 0; padding-block: 12px; font-size: .95rem; }
  .hero-grid { gap: 22px; }
  .flagship .section-head { margin-bottom: 18px; }
  .programme-body { padding: 20px 18px; }
  .programme-title, .programme-maktab .programme-title { font-size: 1.6rem; }
  .programme p, .programme-maktab p { font-size: .98rem; }
  .programme-maktab .programme-body { min-height: 0; }
  .prayer-table th, .prayer-table td { padding: 7px 8px; font-size: .92rem; }
  .programme-photo img, .programme-maktab .programme-photo img { aspect-ratio: 4 / 3; }
}
/* course posters: always show the top of the poster (where the course name is) */
.programme-photo img { object-position: center top; }
.programme-weekend-maktab { grid-area: c; }
.short-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px; padding: clamp(22px, 3vw, 36px); border-radius: var(--r-lg); background: #fff; border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); }
.short-band .h2 { margin-bottom: .2em; }
.short-band p { margin: 0; max-width: 46em; color: var(--ink-2); }
.footer-legal a { color: inherit; }
.footer-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
/* Flagship courses: three equal cards on desktop, poster on top of each */
@media (min-width: 900px) {
  .flagship-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "a b c"; align-items: stretch; }
  .programme-maktab .programme-body { min-height: 0; justify-content: flex-start; }
  .programme-maktab .programme-title { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.2rem); }
  .programme-maktab p { font-size: 1rem; }
  .programme-art { width: 240px; }
}
.programme-photo img, .programme-maktab .programme-photo img { aspect-ratio: 4 / 3; object-position: center top; }
