/* ==========================================================================
   Academy design system — "The Ottoman Madrasa"
   One stylesheet for the public site and every portal. Logical properties
   throughout so Urdu/Arabic (RTL) mirror without separate rules.
   ========================================================================== */

/* ---------- Fonts (self-hosted, SIL OFL) ---------- */
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-garamond-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Amiri"; src: url("../fonts/amiri-arabic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Amiri"; src: url("../fonts/amiri-arabic-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Aref Ruqaa"; src: url("../fonts/aref-ruqaa-arabic-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Amiri Quran"; src: url("../fonts/amiri-quran-arabic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Noto Naskh Arabic"; src: url("../fonts/noto-naskh-arabic-arabic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Noto Naskh Arabic"; src: url("../fonts/noto-naskh-arabic-arabic-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Noto Nastaliq Urdu"; src: url("../fonts/noto-nastaliq-urdu-arabic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Noto Nastaliq Urdu"; src: url("../fonts/noto-nastaliq-urdu-arabic-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }

/* ---------- Tokens ---------- */
:root {
  --emerald: #153D32;
  --emerald-deep: #0E2B23;
  --emerald-soft: #1F5244;
  --ivory: #EDE2C8;
  --gold: #B18A46;
  --gold-light: #CFB27A;
  --gold-dark: #8A6830;
  --walnut: #513A2B;
  --walnut-deep: #3A2A1F;
  --parchment: #F5F0E5;
  --parchment-deep: #EBE2CF;
  --ink: #282820;
  --muted: #6E675B;          /* warm grey, darkened from #777064 for AA contrast on parchment */
  --rule: rgba(177, 138, 70, .45);
  --rule-soft: rgba(81, 58, 43, .14);
  --paper: #FBF8F1;          /* cards, tables and tiles inside the portals */
  --field: #FDFBF6;
  --field-line: #CDBF9F;

  --ok: #3E6B4E;
  --warn: #9A7128;
  --danger: #8E3B2E;
  --info: #3D5A6C;

  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-arabic: "Noto Naskh Arabic", "Amiri", "Traditional Arabic", serif;
  --font-arabic-display: "Amiri", "Noto Naskh Arabic", serif;
  --font-quran: "Amiri Quran", "Amiri", serif;
  /* Urdu body: Jameel Noori Nastaleeq where installed (not licensed for embedding), else self-hosted Noto Nastaliq.
     Urdu headings: bold Naskh, so headings and body read as clearly different. Arabic headings: Aref Ruqaa. */
  --font-urdu: "Jameel Noori Nastaleeq", "Jameel Noori Nastaleeq Kasheeda", "Noto Nastaliq Urdu", "Noto Naskh Arabic", serif;
  --font-urdu-heading: "Noto Naskh Arabic", "Amiri", serif;
  --font-arabic-heading: "Aref Ruqaa", "Amiri", "Noto Naskh Arabic", serif;

  --radius: 2px;
  --container: 1200px;
  --gutter: 16px;
  --section-y: 72px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 10px 30px -18px rgba(40, 40, 32, .35);

  /* 8-point star lattice (girih-style), gold hairlines */
  --lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23B18A46' stroke-width='1'%3E%3Cpath d='M23 23H57V57H23Z'/%3E%3Cpath d='M40 16L64 40L40 64L16 40Z'/%3E%3Cpath d='M40 16V0M64 40H80M40 64V80M16 40H0M23 23L0 0M57 23L80 0M57 57L80 80M23 57L0 80'/%3E%3C/g%3E%3C/svg%3E");
}

@media (min-width: 768px) { :root { --gutter: 24px; --section-y: 96px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font-body);
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
:lang(ar) body, body:lang(ar) { font-family: var(--font-arabic); font-size: 1.125rem; line-height: 1.9; }
:lang(ur) body, body:lang(ur) { font-family: var(--font-urdu); font-size: 1rem; line-height: 2.2; }

img, svg { max-width: 100%; display: block; }
a { color: var(--emerald); text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { color: var(--gold-dark); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; color: var(--emerald-deep); letter-spacing: .005em; }
:lang(ar) :is(h1, h2, h3, h4) { font-family: var(--font-arabic-heading); font-weight: 700; line-height: 1.6; }
:lang(ur) :is(h1, h2, h3, h4) { font-family: var(--font-urdu-heading); font-weight: 600; line-height: 1.7; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.45rem; }
:lang(ur) h1 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
:lang(ur) h2 { font-size: clamp(1.35rem, 2.8vw, 1.85rem); }
:lang(ur) h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

/* Running text is justified (Business Owner, 31-Oct); headings, controls, tables and centred blocks are not. */
main p, main li, main dd, .site-footer p { text-align: justify; text-justify: inter-word; }
:lang(en) :is(main p, main li, main dd, .site-footer p) { hyphens: auto; }
:is(.section-head--center, .pillar, .cta-panel, .notice-page, .text-center) :is(p, li) { text-align: center; }
main :is(nav, .btn-row, .breadcrumb, .table-wrap) :is(p, li), main .breadcrumb { text-align: start; }
.text-center { text-align: center; }

.skip-link { position: absolute; inset-inline-start: 8px; inset-block-start: -60px; background: var(--emerald); color: var(--ivory); padding: 8px 14px; z-index: 100; }
.skip-link:focus { inset-block-start: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.ar { font-family: var(--font-arabic-display); direction: rtl; unicode-bidi: isolate; }
.quran { font-family: var(--font-quran); direction: rtl; unicode-bidi: isolate; line-height: 2.2; }

/* ---------- Ornament primitives ---------- */
.star-icon { width: 14px; height: 14px; flex: none; color: var(--gold); }
.ornament-rule { display: flex; align-items: center; gap: 14px; color: var(--gold); margin-block: 18px 28px; }
.ornament-rule::before, .ornament-rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--rule) 30%, var(--rule) 70%, transparent); }
.ornament-rule--start::before { display: none; }
.ornament-rule .star-icon { width: 16px; height: 16px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 .78rem/1.4 var(--font-body); letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold-dark); margin-block-end: 14px;
}
:lang(ar) .eyebrow, :lang(ur) .eyebrow { letter-spacing: 0; text-transform: none; font-size: .95rem; font-family: inherit; }

.frame { position: relative; border: 1px solid var(--rule); padding: 28px; background: var(--parchment); }
.frame::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--rule-soft); pointer-events: none; }

/* Welcome card: classroom photograph above three short facts */
.welcome-card { padding: 10px; }
.welcome-card__media { position: relative; margin: 0; aspect-ratio: 3 / 2; overflow: hidden; background: var(--emerald-deep); }
.welcome-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s ease; }
.welcome-card:hover .welcome-card__media img { transform: scale(1.04); }
.welcome-card__media figcaption {
  position: absolute; inset-inline: 0; bottom: 0; padding: 48px 16px 10px; text-align: center;
  font-size: 2.3rem; line-height: 1.6; color: var(--gold-light);
  background: linear-gradient(transparent, rgba(14, 43, 35, .88)); text-shadow: 0 2px 12px rgba(0, 0, 0, .45);
}
.welcome-card__facts { display: grid; gap: 4px 18px; margin: 0; padding: 18px 12px 8px; }
@media (min-width: 640px) { .welcome-card__facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.welcome-card__facts > div { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-content: start; padding-block: 8px; }
.welcome-card__facts .star-icon { grid-row: span 2; margin-block-start: 4px; }
.welcome-card__facts dt { font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-dark); font-weight: 600; }
:lang(ar) .welcome-card__facts dt, :lang(ur) .welcome-card__facts dt { letter-spacing: 0; text-transform: none; font-size: .92rem; }
.welcome-card__facts dd { margin: 2px 0 0; font-size: .95rem; text-align: start; }
.welcome-card__facts a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 4px; transition: color .2s, text-decoration-color .2s; }
.welcome-card__facts a:hover { color: var(--gold-dark); text-decoration-color: var(--gold); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 10px 22px; border-radius: var(--radius);
  font: 600 .98rem/1.2 var(--font-body); letter-spacing: .02em; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s;
}
:lang(ar) .btn { font-family: var(--font-arabic); font-weight: 600; }
:lang(ur) .btn { font-family: var(--font-urdu); font-weight: 400; line-height: 2; padding-block: 4px; }
.btn--gold { background: var(--gold); color: var(--emerald-deep); border-color: var(--gold-light); }
.btn--gold:hover { background: var(--gold-light); color: var(--emerald-deep); }
.btn--emerald { background: var(--emerald); color: var(--ivory); border-color: var(--emerald-deep); }
.btn--emerald:hover { background: var(--emerald-soft); color: #fff; }
.btn--outline { background: transparent; color: var(--emerald); border-color: var(--gold); }
.btn--outline:hover { background: var(--emerald); color: var(--ivory); }
.btn--outline-light { background: transparent; color: var(--ivory); border-color: rgba(207, 178, 122, .7); }
.btn--outline-light:hover { background: rgba(237, 226, 200, .08); color: #fff; border-color: var(--gold-light); }
.btn--sm { min-height: 36px; padding: 6px 14px; font-size: .9rem; }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }
[dir="rtl"] .btn .arrow { transform: scaleX(-1); }
[dir="rtl"] .btn:hover .arrow { transform: scaleX(-1) translateX(3px); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Header ---------- */
.topbar { background: var(--walnut-deep); color: var(--ivory); font-size: .88rem; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 38px; flex-wrap: wrap; }
.topbar a { color: var(--ivory); text-decoration: none; opacity: .88; }
.topbar a:hover, .topbar a[aria-current="true"] { opacity: 1; color: var(--gold-light); }
.topbar__langs, .topbar__portals { display: flex; gap: 16px; align-items: center; }
.topbar__langs a[lang="ur"] { font-family: var(--font-urdu); }
.topbar__langs a[lang="ar"] { font-family: var(--font-arabic); }
:lang(ur) .topbar { line-height: 2.2; }

.site-header { background: var(--parchment); border-block-end: 1px solid var(--rule); position: sticky; top: 0; z-index: 40; }
.site-header::after { content: ""; display: block; height: 3px; border-block-start: 1px solid var(--rule-soft); }
.site-header > .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--emerald-deep); min-width: 0; }
.brand__mark { height: 46px; width: auto; flex: none; object-fit: contain; }
.footer-logo { width: 150px; height: auto; margin-block-end: 6px; }
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__name { font: 700 1.28rem/1.1 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:lang(ar) .brand__name { font-family: var(--font-arabic-display); font-size: 1.25rem; line-height: 1.5; }
:lang(ur) .brand__name { font-family: var(--font-urdu); font-size: 1.05rem; line-height: 2; }
.brand__sub { font: 600 .7rem/1.5 var(--font-body); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-dark); }
:lang(ar) .brand__sub { font: 400 .92rem/1.5 var(--font-arabic); letter-spacing: 0; }
:lang(ur) .brand__sub { font: 400 .8rem/1.9 var(--font-urdu); letter-spacing: 0; }

.nav { display: none; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.nav a { display: block; padding: 8px 7px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap; border-block-end: 2px solid transparent; }
.nav a:hover { color: var(--emerald); border-block-end-color: var(--rule); }
.nav a[aria-current="page"] { color: var(--emerald); border-block-end-color: var(--gold); }
:lang(ur) .nav a { font-weight: 400; font-size: .92rem; padding-inline: 8px; }
.header-cta { display: none; }

.menu-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 12px;
  background: transparent; border: 1px solid var(--gold); color: var(--emerald); border-radius: var(--radius);
  font: 600 .95rem var(--font-body); cursor: pointer;
}
:lang(ur) .menu-toggle, :lang(ar) .menu-toggle { font-family: inherit; }
.menu-toggle__bars { width: 18px; height: 12px; position: relative; border-block: 2px solid currentColor; }
.menu-toggle__bars::after { content: ""; position: absolute; inset-inline: 0; top: 3px; height: 2px; background: currentColor; }

/* The drawer lives inside the sticky header: cap its height so it never hides the whole page. */
.drawer { display: none; background: var(--parchment); border-block-start: 1px solid var(--rule); max-height: calc(100vh - 116px); max-height: calc(100dvh - 116px); overflow-y: auto; overscroll-behavior: contain; }
.drawer.is-open { display: block; }
.drawer .container { padding-block: 8px 18px; }
.drawer ul { list-style: none; margin: 0; padding: 0; display: grid; column-gap: 28px; }
@media (min-width: 640px) { .drawer ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.drawer li a { display: block; padding: 11px 0; color: var(--ink); text-decoration: none; font-weight: 600; border-block-end: 1px solid var(--rule-soft); }
:lang(ur) .drawer li a { font-weight: 400; padding-block: 6px; }
.drawer li a[aria-current="page"] { color: var(--emerald); }
.drawer .btn { width: 100%; margin-block-start: 14px; }

@media (min-width: 1180px) {
  .nav { display: block; }
  .header-cta { display: inline-flex; }
  .site-header > .container > .brand { flex: none; }
  .menu-toggle, .drawer, .drawer.is-open { display: none; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--section-y); position: relative; }
.section--ivory { background: var(--ivory); }
.section--deep { background: var(--parchment-deep); }
.section--emerald { background: var(--emerald); color: var(--ivory); }
.section--emerald :is(h1, h2, h3, h4) { color: var(--ivory); }
.section--emerald .eyebrow { color: var(--gold-light); }
.section--emerald a { color: var(--gold-light); }
.section--walnut { background: var(--walnut); color: var(--ivory); }
.section--walnut :is(h2, h3) { color: var(--ivory); }
.section--walnut .eyebrow { color: var(--gold-light); }
.section--lattice::before { content: ""; position: absolute; inset: 0; background-image: var(--lattice); opacity: .07; pointer-events: none; }
.section > .container { position: relative; }

.section-head { max-width: 720px; margin-block-end: 44px; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }
.section-head p.lead { font-size: 1.15rem; color: var(--muted); }
.section--emerald .section-head p.lead, .section--walnut .section-head p.lead { color: rgba(237, 226, 200, .85); }
.lead { font-size: 1.15rem; }

.grid { display: grid; gap: 24px; }
@media (min-width: 640px) { .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 640px) { .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 640px) { .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Hero ---------- */
.hero {
  color: var(--ivory); position: relative; overflow: hidden;
  background: linear-gradient(90deg, rgba(14, 43, 35, .95) 0%, rgba(14, 43, 35, .86) 50%, rgba(14, 43, 35, .7) 100%), url("../images/classes/courtyard-1600.webp") center 30% / cover, var(--emerald-deep);
}
[dir="rtl"] .hero { background-image: linear-gradient(270deg, rgba(14, 43, 35, .95) 0%, rgba(14, 43, 35, .86) 50%, rgba(14, 43, 35, .7) 100%), url("../images/classes/courtyard-1600.webp"); }
@media (max-width: 767px) {
  .hero, [dir="rtl"] .hero { background-image: linear-gradient(rgba(14, 43, 35, .9), rgba(14, 43, 35, .84)), url("../images/classes/courtyard-900.webp"); }
}
.hero::before { content: ""; position: absolute; inset: 0; background-image: var(--lattice); background-size: 96px; opacity: .09; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 70% 40%, rgba(31, 82, 68, .9), transparent 60%); }
.hero .container { position: relative; z-index: 1; display: grid; gap: 40px; padding-block: 56px 64px; align-items: center; }
@media (min-width: 1024px) { .hero .container { grid-template-columns: 1.1fr .9fr; gap: 64px; padding-block: 88px 96px; } }
.hero h1 { color: var(--ivory); margin-block-end: 22px; }
.hero .eyebrow { color: var(--gold-light); }
.hero__lead { font-size: 1.15rem; color: rgba(237, 226, 200, .88); max-width: 560px; margin-block-end: 32px; }

.arch { position: relative; width: min(100%, 400px); margin-inline: auto; aspect-ratio: 420 / 560; container-type: inline-size; }
.arch > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.arch__content {
  position: absolute; inset: 27% 12% 10%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 14px;
}
/* Amiri draws U+FDFD as one ligature 11.44em wide: size it from the arch width, never the viewport. */
.arch__bismillah { font-family: var(--font-arabic-display); color: var(--gold-light); font-size: 1.6rem; font-size: calc(76cqi / 11.44); line-height: 1.4; direction: rtl; white-space: nowrap; }
.arch__verse { font-family: var(--font-quran); color: var(--ivory); font-size: clamp(1.45rem, 5vw, 1.95rem); line-height: 2; direction: rtl; }
.arch__translation { font-family: var(--font-display); font-style: italic; font-size: 1.05rem; color: rgba(237, 226, 200, .82); line-height: 1.4; }
:lang(ur) .arch__translation { font-family: var(--font-urdu); font-style: normal; font-size: .92rem; line-height: 2.1; }
.arch__ref { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-light); }
:lang(ar) .arch__ref, :lang(ur) .arch__ref { letter-spacing: 0; text-transform: none; font-size: .9rem; }

/* ---------- Program cards ---------- */
.program-card {
  position: relative; display: flex; flex-direction: column; background: var(--parchment); border: 1px solid var(--rule);
  text-decoration: none; color: inherit; transition: border-color .2s, transform .2s, box-shadow .2s; min-width: 0;
}
.program-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow); color: inherit; }
.program-card__arch { position: relative; height: 150px; background: var(--emerald); overflow: hidden; }
.program-card__arch::before { content: ""; position: absolute; inset: 0; background-image: var(--lattice); background-size: 60px; opacity: .14; }
.program-card__arch svg { position: absolute; inset-inline: 0; bottom: 0; width: 100%; height: 100%; }
.program-card__title-ar { position: absolute; inset-inline: 0; bottom: 22px; text-align: center; font-family: var(--font-arabic-display); font-size: 1.85rem; color: var(--ivory); direction: rtl; }
.program-card__num { position: absolute; top: 12px; inset-inline-start: 14px; font: 600 .75rem/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-light); }
:lang(ur) .program-card__num, :lang(ar) .program-card__num { font-family: inherit; letter-spacing: 0; font-size: .85rem; }
.program-card__body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.program-card__body h3 { margin-block-end: 6px; }
.program-card__body p { color: var(--muted); margin-block-end: 18px; }
.program-card__more { margin-block-start: auto; font-weight: 600; color: var(--emerald); display: inline-flex; gap: 8px; align-items: center; }
[dir="rtl"] .program-card__more .arrow { transform: scaleX(-1); }

/* ---------- Generic content blocks ---------- */
.feature { padding-block-start: 20px; border-block-start: 1px solid var(--rule); }
.feature h3 { display: flex; align-items: center; gap: 10px; margin-block-end: 8px; }
.feature p { color: var(--muted); margin: 0; }
.section--emerald .feature p, .section--walnut .feature p { color: rgba(237, 226, 200, .82); }
.section--emerald .feature, .section--walnut .feature { border-block-start-color: rgba(207, 178, 122, .35); }

.pillar { text-align: center; padding: 32px 24px; border: 1px solid var(--rule); background: var(--parchment); position: relative; }
.pillar::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--rule-soft); pointer-events: none; }
.pillar__ar { font-family: var(--font-arabic-display); font-size: 2.4rem; color: var(--gold-dark); line-height: 1.3; direction: rtl; }
.pillar h3 { margin-block: 4px 10px; }
.pillar p { color: var(--muted); margin: 0; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; counter-reset: step; }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.steps li { counter-increment: step; display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: start; padding: 18px; border: 1px solid var(--rule); background: var(--parchment); }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 52px; height: 52px;
  font: 600 1.5rem/1 var(--font-display); color: var(--emerald);
  background: var(--ivory); clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  box-shadow: inset 0 0 0 1px var(--gold);
}
:lang(ar) .steps li::before { content: counter(step, arabic-indic); font-family: var(--font-arabic); }
:lang(ur) .steps li::before { content: counter(step, persian); font-family: var(--font-arabic); }
.steps h3 { font-size: 1.2rem; margin-block-end: 4px; }
.steps p { margin: 0; color: var(--muted); font-size: .98rem; }

.mode { padding: 32px 28px; border: 1px solid var(--rule); background: var(--parchment); position: relative; }
.mode::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--rule-soft); pointer-events: none; }
.mode__ar { font-family: var(--font-arabic-display); color: var(--gold-dark); font-size: 1.3rem; direction: rtl; }

.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-inline-start: 26px; }
.ticks li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .62em; width: 9px; height: 9px; background: var(--gold); transform: rotate(45deg); }
:lang(ur) .ticks li::before { top: 1.05em; }

.seal-steps { display: grid; gap: 0; border: 1px solid rgba(207, 178, 122, .35); }
@media (min-width: 768px) { .seal-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.seal-steps > div { padding: 26px 22px; border-block-end: 1px solid rgba(207, 178, 122, .35); }
@media (min-width: 768px) { .seal-steps > div { border-block-end: 0; border-inline-end: 1px solid rgba(207, 178, 122, .35); } .seal-steps > div:last-child { border-inline-end: 0; } }
.seal { width: 46px; height: 46px; color: var(--gold-light); margin-block-end: 14px; }
.seal-steps h3 { font-size: 1.2rem; }
.seal-steps p { margin: 0; color: rgba(237, 226, 200, .82); font-size: .98rem; }
.note { margin-block-start: 26px; padding: 16px 18px; border-inline-start: 3px solid var(--gold); background: rgba(177, 138, 70, .08); font-size: .98rem; }
.section--emerald .note { background: rgba(237, 226, 200, .06); color: rgba(237, 226, 200, .9); }

.ledger { border-block-start: 2px solid var(--emerald); }
.ledger > div { display: grid; gap: 4px 24px; padding: 16px 4px; border-block-end: 1px solid var(--rule); }
@media (min-width: 640px) { .ledger > div { grid-template-columns: 200px 1fr; } }
.ledger dt { font: 600 1.25rem/1.3 var(--font-display); color: var(--emerald-deep); }
:lang(ar) .ledger dt { font-family: var(--font-arabic-display); }
:lang(ur) .ledger dt { font-family: var(--font-urdu); font-size: 1.05rem; line-height: 2; }
.ledger dd { margin: 0; color: var(--muted); }

.clocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: rgba(207, 178, 122, .3); border: 1px solid rgba(207, 178, 122, .3); }
@media (min-width: 768px) { .clocks { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.clock { background: var(--emerald); padding: 18px 16px; min-width: 0; }
.clock__city { font-size: .9rem; color: rgba(237, 226, 200, .78); }
.clock__time { font: 600 1.7rem/1.2 var(--font-display); color: var(--ivory); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.clock--home { background: var(--emerald-soft); }
.clock--home .clock__city { color: var(--gold-light); }

.faq details { border-block-end: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 36px 18px 0; position: relative; font: 600 1.25rem/1.35 var(--font-display); color: var(--emerald-deep); }
[dir="rtl"] .faq summary { padding: 18px 0 18px 36px; }
:lang(ar) .faq summary { font-family: var(--font-arabic-display); }
:lang(ur) .faq summary { font-family: var(--font-urdu); font-size: 1.05rem; line-height: 2; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; inset-inline-end: 4px; top: 50%; translate: 0 -50%; font: 400 1.6rem/1 var(--font-display); color: var(--gold-dark); }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); padding-block-end: 18px; margin: 0; max-width: 760px; }

.cta-panel { text-align: center; max-width: 760px; margin-inline: auto; padding: 48px 24px; border: 1px solid rgba(207, 178, 122, .5); position: relative; }
.cta-panel::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(207, 178, 122, .22); pointer-events: none; }
.cta-panel .btn-row { justify-content: center; }
.cta-panel p { color: rgba(237, 226, 200, .85); }

/* ---------- Page header (inner pages) ---------- */
.page-head {
  color: var(--ivory); position: relative; overflow: hidden;
  background: linear-gradient(90deg, rgba(14, 43, 35, .94) 0%, rgba(21, 61, 50, .86) 55%, rgba(21, 61, 50, .62) 100%), url("../images/classes/courtyard-1600.webp") center 35% / cover, var(--emerald);
}
[dir="rtl"] .page-head { background-image: linear-gradient(270deg, rgba(14, 43, 35, .94) 0%, rgba(21, 61, 50, .86) 55%, rgba(21, 61, 50, .62) 100%), url("../images/classes/courtyard-1600.webp"); }
@media (max-width: 767px) {
  .page-head, [dir="rtl"] .page-head { background-image: linear-gradient(rgba(14, 43, 35, .9), rgba(21, 61, 50, .82)), url("../images/classes/courtyard-900.webp"); }
}
.page-head::before { content: ""; position: absolute; inset: 0; background-image: var(--lattice); background-size: 80px; opacity: .08; }
.page-head .container { position: relative; padding-block: 56px 48px; }
.page-head h1 { color: var(--ivory); margin-block-end: 10px; }
.page-head p { color: rgba(237, 226, 200, .86); font-size: 1.15rem; max-width: 640px; margin: 0; }
.breadcrumb { font-size: .9rem; margin-block-end: 14px; color: var(--gold-light); }
.breadcrumb a { color: var(--gold-light); }

/* ---------- Program detail ---------- */
.program-layout { display: grid; gap: 40px; }
@media (min-width: 1024px) { .program-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; } }
.program-aside { align-self: start; }
/* Sticky only where the taller aside (photo + facts) still fits the screen */
@media (min-width: 1024px) and (min-height: 980px) { .program-aside { position: sticky; top: 100px; } }
/* Teaching method: heading beside a lesson photograph */
.method-head { display: grid; gap: 28px; margin-block-end: 44px; }
.method-head .section-head { margin-block-end: 0; }
@media (min-width: 1024px) { .method-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 56px; } }
.method-photo { margin: 0; border: 1px solid var(--rule); padding: 8px; background: var(--parchment); position: relative; }
.method-photo img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.program-photo { margin: 0 0 18px; border: 1px solid var(--rule); padding: 6px; background: var(--parchment); }
.program-photo img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.facts { margin: 0; }
.facts > div { padding-block: 14px; border-block-end: 1px solid var(--rule-soft); }
.facts dt { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-dark); font-weight: 600; }
:lang(ar) .facts dt, :lang(ur) .facts dt { letter-spacing: 0; text-transform: none; font-size: .95rem; }
.facts dd { margin: 4px 0 0; }
.topic-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; border-block-start: 1px solid var(--rule); }
@media (min-width: 640px) { .topic-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; } }
.topic-list li { padding: 12px 0 12px 26px; border-block-end: 1px solid var(--rule-soft); position: relative; }
[dir="rtl"] .topic-list li { padding: 12px 26px 12px 0; }
.topic-list li::before { content: ""; position: absolute; inset-inline-start: 4px; top: 1.2em; width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); }
:lang(ur) .topic-list li::before { top: 1.6em; }
.prose h2 { font-size: 1.9rem; margin-block: 40px 14px; }
.prose h2:first-child { margin-block-start: 0; }
:lang(ur) .prose h2 { font-size: 1.4rem; }

/* ---------- Notice / portal placeholder ---------- */
.notice-page { min-height: 52vh; display: grid; place-items: center; text-align: center; }
.notice-page .frame { max-width: 560px; padding: 44px 32px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--emerald-deep); color: rgba(237, 226, 200, .85); padding-block: 56px 28px; position: relative; }
.site-footer::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 6px; background: linear-gradient(var(--gold), var(--gold)) top / 100% 1px no-repeat, linear-gradient(var(--gold), var(--gold)) bottom / 100% 1px no-repeat; opacity: .6; }
.site-footer a { color: var(--ivory); text-decoration: none; }
.site-footer a:hover { color: var(--gold-light); }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-grid h4 { color: var(--gold-light); font: 600 .8rem/1.4 var(--font-body); letter-spacing: .14em; text-transform: uppercase; margin-block-end: 14px; }
:lang(ar) .footer-grid h4, :lang(ur) .footer-grid h4 { font-family: inherit; letter-spacing: 0; text-transform: none; font-size: 1rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-brand .brand { color: var(--ivory); margin-block-end: 14px; }
.footer-brand .brand__name { color: var(--ivory); }
.footer-brand .brand__sub { color: var(--gold-light); }
.contact-links { margin: 0 0 12px; }
.contact-links__email { margin: 0 0 14px; }
.contact-links__email span { display: block; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
:lang(ar) .contact-links__email span, :lang(ur) .contact-links__email span { letter-spacing: 0; text-transform: none; font-size: .9rem; }
.contact-links a { overflow-wrap: break-word; }
/* .contact-links prefix beats the footer's generic `.footer-grid ul { display: grid }` */
.contact-links .social { list-style: none; margin: 0; padding: 0; display: flex; flex-flow: row wrap; gap: 10px; }
.social__link {
  display: grid; place-items: center; width: 42px; height: 42px; color: var(--gold-light);
  border: 1px solid rgba(207, 178, 122, .55); border-radius: var(--radius); transition: background-color .2s, color .2s, border-color .2s;
}
.social__link svg { width: 20px; height: 20px; fill: currentColor; }
.social__link:hover, .social__link:focus-visible { background: var(--gold); border-color: var(--gold); color: var(--emerald-deep); }
.contact-links--large { font-size: 1.1rem; }
.contact-links--large .contact-links__email span { color: var(--gold-dark); opacity: 1; }
.contact-links--large .social__link { width: 52px; height: 52px; color: var(--emerald); border-color: var(--gold); }
.contact-links--large .social__link svg { width: 24px; height: 24px; }
.contact-links--large .social__link:hover, .contact-links--large .social__link:focus-visible { background: var(--emerald); border-color: var(--emerald); color: var(--ivory); }
.footer-base { margin-block-start: 40px; padding-block-start: 20px; border-block-start: 1px solid rgba(207, 178, 122, .25); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: .85rem; color: rgba(237, 226, 200, .65); }

/* ==========================================================================
   Workspace components (portals) — tables, forms, status, tiles, calendar
   ========================================================================== */
.ws { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 640px; border: 1px solid var(--rule); background: var(--parchment); }
/* Two panels side by side only when each has room for a form */
.split { display: grid; gap: 28px; align-items: start; }
@media (min-width: 1180px) { .split { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .ws { grid-template-columns: 250px minmax(0, 1fr); } }
.ws-side { background: var(--walnut); color: var(--ivory); padding: 22px 18px; position: relative; }
.ws-side::before { content: ""; position: absolute; inset: 0; background-image: var(--lattice); background-size: 70px; opacity: .06; pointer-events: none; }
.ws-side__title { font: 600 .78rem/1.4 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-light); margin: 18px 0 8px; position: relative; }
.ws-side ul { list-style: none; margin: 0; padding: 0; position: relative; }
.ws-side a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; color: rgba(237, 226, 200, .88); text-decoration: none; border-inline-start: 2px solid transparent; font-size: .97rem; }
.ws-side a:hover { background: rgba(237, 226, 200, .06); color: #fff; }
.ws-side a[aria-current="page"] { border-inline-start-color: var(--gold); background: rgba(237, 226, 200, .08); color: #fff; }
.ws-main { padding: 24px var(--gutter); min-width: 0; }
/* Full-page portal shell */
.portal-body { background: var(--parchment); }
.ws--page { min-height: 100vh; border: 0; }
.ws-brand { display: flex; gap: 10px; align-items: center; color: var(--ivory); text-decoration: none; position: relative; margin-block-end: 18px; }
.ws-brand span { display: flex; flex-direction: column; line-height: 1.2; }
.ws-brand strong { font: 600 1.2rem var(--font-display); }
.ws-brand small { color: var(--gold-light); font-size: .8rem; letter-spacing: .08em; }
.ws-user { position: relative; margin-block-start: 22px; padding-block-start: 16px; border-block-start: 1px solid rgba(207, 178, 122, .3); display: grid; gap: 6px; font-size: .92rem; }
.ws-user small { color: rgba(237, 226, 200, .7); }
.ws-langs { display: flex; gap: 12px; font-size: .9rem; }
.ws-langs a { color: rgba(237, 226, 200, .8); text-decoration: none; }
.ws-langs a[aria-current="true"] { color: var(--gold-light); text-decoration: underline; text-underline-offset: 4px; }
.ws-langs a[lang="ur"] { font-family: var(--font-urdu); }
:lang(ur) :is(.ws-side__title, .ws-brand small, .tile__label) { letter-spacing: 0; text-transform: none; font-family: inherit; }
:lang(ur) .ws-side a, :lang(ur) .ws-user { line-height: 2; }
@media (max-width: 1023px) {
  .ws-side ul { display: flex; flex-wrap: wrap; gap: 2px 6px; }
  .ws-side a { padding: 6px 8px; border-inline-start: 0; border-block-end: 2px solid transparent; }
  .ws-side a[aria-current="page"] { border-block-end-color: var(--gold); }
  .ws-user { grid-template-columns: 1fr auto; align-items: center; }
  .ws-user small { display: none; }
}
.ws-section { margin-block-end: 32px; }
.ws-section > h3 { font-size: 1.35rem; margin-block-end: 12px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form .input, .inline-form .select { min-height: 36px; width: auto; padding: 4px 8px; }
.empty { padding: 18px; border: 1px dashed var(--rule); color: var(--muted); background: var(--paper); }
.kv { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--muted); font-size: .92rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.copy-link { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; overflow-wrap: anywhere; background: var(--paper); border: 1px solid var(--rule); padding: 6px 8px; display: block; }
.ws-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; padding-block-end: 16px; margin-block-end: 24px; border-block-end: 1px solid var(--rule); }
.ws-head h2 { margin: 0; font-size: 2rem; }
.ws-head p { margin: 0; color: var(--muted); }

.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-block-end: 28px; }
.tile { padding: 18px; border: 1px solid var(--rule); background: var(--paper); position: relative; }
.tile::after { content: ""; position: absolute; inset-inline-start: 0; inset-block: 0; width: 3px; background: var(--gold); }
.tile__label { font-size: .85rem; color: var(--muted); }
.tile__value { font: 600 2.1rem/1.1 var(--font-display); color: var(--emerald-deep); font-variant-numeric: tabular-nums; }
.tile__meta { font-size: .85rem; color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--rule); background: var(--paper); }
.table { width: 100%; border-collapse: collapse; font-size: .97rem; min-width: 560px; }
.table caption { text-align: start; padding: 12px 14px; font: 600 1.2rem var(--font-display); color: var(--emerald-deep); border-block-end: 1px solid var(--rule); }
.table th { text-align: start; font: 600 .78rem/1.4 var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--walnut); background: var(--parchment-deep); padding: 10px 14px; border-block-end: 1px solid var(--rule); }
:lang(ar) .table th, :lang(ur) .table th { font-family: inherit; letter-spacing: 0; text-transform: none; font-size: .9rem; }
.table td { padding: 12px 14px; border-block-end: 1px solid var(--rule-soft); vertical-align: top; }
.table tbody tr:hover { background: rgba(177, 138, 70, .06); }
.table .num { text-align: end; font-variant-numeric: tabular-nums; }
/* Fee table: number columns centred under their headings, the same in LTR and RTL */
.fees-table .table :is(th, td).num { text-align: center; }
.fees-table .table tbody th { white-space: nowrap; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; font-size: .82rem; font-weight: 600; border: 1px solid currentColor; border-radius: var(--radius); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; background: currentColor; transform: rotate(45deg); }
.badge--ok { color: var(--ok); background: rgba(62, 107, 78, .08); }
.badge--warn { color: var(--warn); background: rgba(154, 113, 40, .1); }
.badge--danger { color: var(--danger); background: rgba(142, 59, 46, .08); }
.badge--info { color: var(--info); background: rgba(61, 90, 108, .08); }
.badge--muted { color: var(--muted); background: rgba(110, 103, 91, .08); }

.form-grid { display: grid; gap: 18px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field { display: grid; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .95rem; color: var(--walnut); }
.field .hint { font-size: .85rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; font: inherit; color: var(--ink);
  background: var(--field); border: 1px solid var(--field-line); border-block-end: 2px solid var(--gold); border-radius: var(--radius);
}
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(21, 61, 50, .12); }
.field--error .input { border-color: var(--danger); }
.field--error .hint { color: var(--danger); }
.choice { display: flex; gap: 10px; align-items: center; }
.choice input { accent-color: var(--emerald); width: 18px; height: 18px; }

.alert { padding: 14px 16px; border: 1px solid; border-inline-start-width: 4px; margin-block-end: 16px; }
.alert--info { border-color: var(--info); background: rgba(61, 90, 108, .06); }
.alert--warn { border-color: var(--warn); background: rgba(154, 113, 40, .08); }
.alert--ok { border-color: var(--ok); background: rgba(62, 107, 78, .07); }

.meter { height: 8px; background: var(--parchment-deep); border: 1px solid var(--rule-soft); }
.meter > span { display: block; height: 100%; background: linear-gradient(90deg, var(--emerald), var(--emerald-soft)); }

.week { display: grid; grid-template-columns: 64px repeat(7, minmax(84px, 1fr)); border: 1px solid var(--rule); background: var(--paper); font-size: .85rem; min-width: 700px; }
.week > div { border-inline-end: 1px solid var(--rule-soft); border-block-end: 1px solid var(--rule-soft); padding: 6px; min-height: 46px; }
.week .wk-head { background: var(--parchment-deep); font-weight: 600; color: var(--walnut); text-align: center; }
.week .wk-time { color: var(--muted); text-align: end; }
.slot { background: var(--emerald); color: var(--ivory); padding: 4px 6px; border-inline-start: 3px solid var(--gold); font-size: .8rem; line-height: 1.3; }
.slot--group { background: var(--walnut); }

.modal-demo { max-width: 460px; background: var(--parchment); border: 1px solid var(--gold); box-shadow: 0 30px 60px -30px rgba(14, 43, 35, .6); }
.modal-demo__head { background: var(--emerald); color: var(--ivory); padding: 14px 18px; font: 600 1.25rem var(--font-display); }
.modal-demo__body { padding: 18px; }
.modal-demo__foot { padding: 14px 18px; display: flex; justify-content: flex-end; gap: 10px; border-block-start: 1px solid var(--rule); }

.specimen-label { display: inline-block; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--danger); border: 1px dashed var(--danger); padding: 2px 8px; margin-block-end: 12px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.swatch { border: 1px solid var(--rule); background: var(--paper); }
.swatch span { display: block; height: 72px; }
.swatch p { margin: 0; padding: 8px 10px; font-size: .85rem; }

/* ---------- Theme toggle (sun / moon) ---------- */
.theme-toggle {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; flex: none;
  background: transparent; color: inherit; border: 1px solid rgba(207, 178, 122, .55); border-radius: var(--radius); cursor: pointer;
  transition: color .2s, border-color .2s, background-color .2s;
}
.theme-toggle:hover { color: var(--gold-light); border-color: var(--gold-light); background: rgba(237, 226, 200, .06); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .theme-toggle__sun, [data-theme="dark"] .theme-toggle .theme-toggle__moon { display: none; }
[data-theme="dark"] .theme-toggle .theme-toggle__sun { display: block; }
.ws-user__row { display: flex; align-items: center; gap: 12px; }

/* ---------- Dark theme ("lamplit madrasa"): chosen with the toggle, stored per browser ----------
   Light-surface tokens are redefined; rules below repeat the original selector behind
   :where(), so each keeps its original specificity and only wins over the light rule. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --parchment: #10201A;
  --parchment-deep: #182B24;
  --paper: #13251F;
  --field: #0D1B16;
  --field-line: #3F5249;
  --ink: #E9E0CA;
  --muted: #B4AA95;
  --gold-dark: #D4B87F;
  --rule: rgba(207, 178, 122, .38);
  --rule-soft: rgba(237, 226, 200, .13);
  --ok: #8CC29E;
  --warn: #E3BC6A;
  --danger: #EC9282;
  --info: #93B8CE;
  --shadow: 0 10px 30px -18px rgba(0, 0, 0, .8);
}
:where([data-theme="dark"]) a { color: var(--gold-light); }
:where([data-theme="dark"]) a:hover { color: var(--ivory); }
:where([data-theme="dark"]) :is(h1, h2, h3, h4),
:where([data-theme="dark"]) .brand, :where([data-theme="dark"]) .ledger dt, :where([data-theme="dark"]) .faq summary,
:where([data-theme="dark"]) .tile__value, :where([data-theme="dark"]) .table caption { color: var(--ivory); }
:where([data-theme="dark"]) :is(.nav a:hover, .nav a[aria-current="page"], .drawer li a[aria-current="page"]),
:where([data-theme="dark"]) .menu-toggle, :where([data-theme="dark"]) .btn--outline, :where([data-theme="dark"]) .program-card__more,
:where([data-theme="dark"]) .contact-links--large .social__link,
:where([data-theme="dark"]) :is(.table th, .field label, .week .wk-head) { color: var(--gold-light); }
:where([data-theme="dark"]) .btn--emerald { border-color: rgba(207, 178, 122, .55); }
:where([data-theme="dark"]) .section--ivory { background: #17302A; }
:where([data-theme="dark"]) .steps li::before { background: var(--parchment-deep); color: var(--gold-light); }
:where([data-theme="dark"]) .ledger { border-block-start-color: var(--gold); }
:where([data-theme="dark"]) .input:focus, :where([data-theme="dark"]) .select:focus, :where([data-theme="dark"]) .textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(207, 178, 122, .18); }
:where([data-theme="dark"]) .choice input { accent-color: var(--gold); }

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { transition: none !important; }
}
