/* La Cité Nationale · shared styles for the English (ltr) and Arabic (rtl) pages.
   Layout uses logical properties (inline-start/end) so both directions work from one file. */

/* ============ Tokens ============ */
:root {
  --navy: #0E2440;        /* deep bands, footer, headings */
  --navy-2: #0A1B31;      /* footer base */
  --navy-3: #13294A;      /* raised panels on navy */
  --blue: #3A6EA8;        /* logo blue, sampled from logo.png */
  --blue-deep: #2D5F9E;   /* hover / pressed */
  --sky: #9DBCE6;         /* highlight on navy (logo ring tint) */
  --mist: #EAF1F9;        /* tinted panels */
  --paper: #F6F8FB;       /* page background */
  --white: #FFFFFF;
  --ink: #1B2A3D;         /* body text */
  --muted: #4A5B70;       /* secondary text */
  --line: rgba(14, 36, 64, .13);
  --line-dark: rgba(255, 255, 255, .16);

  --f-sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --f-ar: "Amiri", "Noto Naskh Arabic", "Geeza Pro", serif;
  --body-weight: 300;
  --italic: italic;
  --track: .16em;          /* small-caps label tracking (0 in Arabic) */
  --start: left;           /* transform-origin for lines that draw from the reading start */
  --nudge: 3px;            /* arrow hover nudge, flipped in rtl */
  --hero-side: 90deg;      /* hero shading falls on the text side */

  --ease: cubic-bezier(.22, .7, .18, 1);
  --wrap: 1240px;
  --gut: clamp(20px, 5vw, 64px);
  --header-h: 78px;
}
html[dir="rtl"] {
  --f-sans: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-serif: "Noto Naskh Arabic", "Source Serif 4", serif;
  --body-weight: 400;
  --italic: normal;
  --track: 0;
  --start: right;
  --nudge: -3px;
  --hero-side: 270deg;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--f-serif); font-weight: var(--body-weight); font-size: 17px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
  -webkit-tap-highlight-color: rgba(58, 110, 168, .15);
}
html[dir="rtl"] body { font-size: 18px; line-height: 1.85; }
html[dir="rtl"] * { letter-spacing: 0 !important; }  /* tracking breaks Arabic letter joins */
img, video, svg, iframe { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--f-sans); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -0.01em; color: var(--navy); text-wrap: balance; }
html[dir="rtl"] :is(h1, h2, h3, h4) { line-height: 1.4; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure, blockquote { margin: 0; }
.sprite { position: absolute; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gut)); margin-inline: auto; padding-inline: var(--gut); }
.ar { font-family: var(--f-ar); direction: rtl; unicode-bidi: isolate; font-weight: 400; font-style: normal; }
/* On the English page, Arabic motto lines align with the left-hand column */
html[dir="ltr"] .motto-line { text-align: left; }
.flip { transform: scaleX(1); }
html[dir="rtl"] .flip { transform: scaleX(-1); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 2px; }
.on-dark :focus-visible { outline-color: var(--sky); }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 300; background: var(--navy); color: #fff; padding: 10px 16px; font-family: var(--f-sans); font-size: 14px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ============ Shared pieces ============ */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-serif); font-style: var(--italic); font-weight: 400; font-size: 16px; line-height: 1.4;
  color: var(--blue); margin-bottom: 18px;
}
html[dir="rtl"] .eyebrow { font-family: var(--f-ar); font-size: 19px; }
.eyebrow svg { width: 17px; height: 10px; flex: none; }
.eyebrow::after { content: ""; width: 34px; height: 1px; background: currentColor; opacity: .5; transform-origin: var(--start); }
.on-dark .eyebrow { color: var(--sky); }

.h2 { font-size: clamp(2rem, 3.6vw, 3.1rem); }
.hl { color: var(--blue); }
.on-dark .h2 { color: var(--white); }
.on-dark .hl { color: var(--sky); }
.lead { font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--muted); max-width: 40em; margin-top: 22px; }
.on-dark .lead { color: rgba(255, 255, 255, .8); }

.arrow-link {
  display: inline-flex; align-items: center; gap: 14px; min-height: 44px;
  font-family: var(--f-sans); font-weight: 600; font-size: 15px;
  color: var(--navy); text-decoration: none;
}
.arrow-link .circle {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  border: 1.5px solid currentColor; display: grid; place-items: center;
  transition: background .3s, color .3s, border-color .3s, translate .3s var(--ease);
}
.arrow-link .circle svg { width: 15px; height: 15px; }
.arrow-link:hover .circle { background: var(--blue); border-color: var(--blue); color: var(--white); translate: var(--nudge) 0; }
.on-dark .arrow-link { color: var(--white); }
.on-dark .arrow-link:hover .circle { background: var(--white); border-color: var(--white); color: var(--navy); }
.arrow-link.big { font-size: clamp(1.25rem, 2vw, 1.6rem); gap: 16px; }
.arrow-link.big .circle { width: 50px; height: 50px; }

.text-link { font-family: var(--f-sans); font-weight: 600; font-size: 14px; color: var(--blue); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.text-link:hover { color: var(--blue-deep); }

/* logo.png is a square with a patterned blue border: zoom so only the white roundel shows */
.seal { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; background: #fff; flex: none; box-shadow: 0 0 0 1px var(--line); }
.seal img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.27); }

.section { padding-block: clamp(80px, 10vw, 140px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px;
  font: 600 14px var(--f-sans); text-decoration: none; border-radius: 999px; transition: background .25s, color .25s, border-color .25s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-solid { background: var(--blue); color: var(--white); border: 1.5px solid var(--blue); }
.btn-solid:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn-line { color: var(--navy); border: 1.5px solid rgba(14, 36, 64, .3); background: var(--white); }
.btn-line:hover { border-color: var(--blue); color: var(--blue); }

/* ============ Language switch ============ */
.lang-switch {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px 0 12px;
  border: 1.5px solid rgba(58, 110, 168, .45); border-radius: 999px; background: var(--white);
  color: var(--blue); text-decoration: none; font: 600 14px/1 var(--f-sans); white-space: nowrap;
  transition: background .25s, color .25s, border-color .25s;
}
.lang-switch svg { width: 16px; height: 16px; flex: none; }
.lang-switch[lang="ar"] span { font-family: "IBM Plex Sans Arabic", var(--f-ar); font-size: 15px; font-weight: 600; letter-spacing: 0; }
.lang-switch[lang="en"] span { font-family: "Montserrat", "IBM Plex Sans Arabic", sans-serif; }
.lang-switch:hover { background: var(--blue); border-color: var(--blue); color: var(--white); }
.on-dark-pill { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, .4); }
.on-dark-pill:hover { background: var(--white); border-color: var(--white); color: var(--navy); }

/* ============ Header ============ */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  background: rgba(255, 255, 255, .97); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px rgba(14, 36, 64, .06); }
.header-inner { height: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.header-side { display: flex; align-items: center; gap: 22px; font-family: var(--f-sans); font-weight: 600; font-size: 14px; }
.header-side.end { justify-content: flex-end; }
.header-side > a:not(.lang-switch) { text-decoration: none; color: var(--navy); }
.header-side > a:not(.lang-switch):hover { color: var(--blue); }
.dot-link { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; }
.dot-link::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand-name { font-family: var(--f-sans); font-weight: 700; font-size: 14px; letter-spacing: var(--track); text-transform: uppercase; color: var(--navy); white-space: nowrap; }
html[dir="rtl"] .brand-name { font-size: 17px; font-weight: 700; }
.menu-btn {
  display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 8px 0; min-height: 44px; cursor: pointer;
  font: 600 14px var(--f-sans); color: var(--navy);
}
.menu-btn .bars { width: 22px; height: 10px; position: relative; }
.menu-btn .bars::before, .menu-btn .bars::after { content: ""; position: absolute; inset-inline: 0; height: 2px; background: var(--blue); border-radius: 2px; }
.menu-btn .bars::before { top: 0; } .menu-btn .bars::after { bottom: 0; }
.menu-btn:hover { color: var(--blue); }

/* ============ Full-screen menu ============ */
.menu {
  position: fixed; inset: 0; z-index: 200; background: var(--navy); color: var(--white);
  display: grid; grid-template-rows: auto 1fr; overflow-y: auto; overscroll-behavior: contain;
  opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility 0s .35s;
}
.menu[hidden] { display: none; }
.menu.open { opacity: 1; visibility: visible; transition: opacity .35s var(--ease); }
.menu-topbar { border-bottom: 1px solid var(--line-dark); }
.menu-top { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.menu-top .brand-name { color: var(--white); }
.menu-top .seal { box-shadow: none; }
.menu-top-end { display: flex; align-items: center; gap: 18px; }
.close-btn { background: none; border: 0; color: var(--white); font: 600 14px var(--f-sans); display: inline-flex; align-items: center; gap: 10px; cursor: pointer; padding: 8px 0; min-height: 44px; }
.close-btn svg { width: 18px; height: 18px; }
.menu-body { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; padding-top: clamp(28px, 6vh, 72px); padding-bottom: 56px; }
.menu-links li + li { border-top: 1px solid var(--line-dark); }
.menu-links a {
  display: flex; align-items: baseline; gap: 18px; padding: 14px 0; text-decoration: none;
  font-family: var(--f-sans); font-weight: 500; font-size: clamp(1.5rem, 3.2vw, 2.4rem); letter-spacing: -0.01em;
  transition: color .25s;
}
.menu-links a span { font: var(--italic) 400 15px var(--f-serif); color: var(--sky); min-width: 26px; }
.menu-links a:hover { color: var(--sky); }
.menu-aside { align-self: end; font-size: 16px; color: rgba(255, 255, 255, .8); }
.menu-aside .ar { font-size: 1.9rem; color: var(--white); margin-bottom: 6px; line-height: 1.6; }
.menu-aside dl { margin: 28px 0 0; display: grid; gap: 14px; }
.menu-aside dt { font: 600 11px var(--f-sans); letter-spacing: var(--track); text-transform: uppercase; color: var(--sky); }
html[dir="rtl"] .menu-aside dt { font-size: 14px; }
.menu-aside dd { margin: 2px 0 0; }
.menu-aside a { text-decoration: none; }
.menu-aside a:hover { color: var(--white); text-decoration: underline; }

/* ============ Hero ============ */
.hero { position: relative; margin-top: var(--header-h); min-height: min(calc(100svh - var(--header-h)), 880px); display: flex; align-items: flex-end; color: var(--white); overflow: hidden; background: var(--navy); }
.hero-media { position: absolute; inset: 0; will-change: transform; }
.hero-img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(180deg, rgba(14, 36, 64, .18) 0%, rgba(14, 36, 64, .05) 30%, rgba(14, 36, 64, .62) 64%, rgba(14, 36, 64, .94) 100%),
    linear-gradient(var(--hero-side), rgba(14, 36, 64, .55) 0%, rgba(14, 36, 64, 0) 62%);
}
.hero-rays { position: absolute; z-index: 1; inset-inline-end: -4vw; bottom: -2px; width: min(62vw, 820px); color: var(--white); opacity: .2; pointer-events: none; }
.hero-content { position: relative; z-index: 2; padding-top: 120px; padding-bottom: clamp(48px, 8vh, 96px); }
.hero .eyebrow { color: var(--sky); }
.hero h1 { color: var(--white); font-size: clamp(2.5rem, 6.2vw, 5.4rem); font-weight: 600; line-height: 1.04; letter-spacing: -0.02em; max-width: 11.5em; }
html[dir="rtl"] .hero h1 { font-size: clamp(2.5rem, 6vw, 5.2rem); line-height: 1.3; max-width: 10em; }
.hero-motto { font-size: clamp(1.45rem, 2.4vw, 2rem); margin-top: 18px; color: rgba(255, 255, 255, .94); line-height: 1.6; }
.hero-sub { margin-top: 10px; font-style: var(--italic); font-weight: 400; font-size: 16px; color: rgba(255, 255, 255, .8); }
html[dir="rtl"] .hero-sub { margin-top: 18px; font-size: 17px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px 36px; margin-top: 32px; }

/* ============ About ============ */
.about-grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(40px, 7vw, 110px); align-items: center; }
.motto-card { border: 1px solid rgba(58, 110, 168, .35); padding: clamp(32px, 4vw, 52px); background: var(--white); }
.motto-card .mark { width: 54px; height: 30px; color: var(--blue); margin-bottom: 26px; }
.motto-card .ar { font-size: clamp(2rem, 3.4vw, 2.7rem); color: var(--navy); line-height: 1.55; font-weight: 700; }
.motto-card .en { margin-top: 14px; font-style: var(--italic); font-weight: 400; font-size: 1.12rem; color: var(--ink); }
.motto-card .who { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font: 600 11px var(--f-sans); letter-spacing: var(--track); text-transform: uppercase; color: var(--blue); }
html[dir="rtl"] .motto-card .who { font-size: 14px; }
.about-copy .text-link { display: inline-block; margin-top: 30px; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: clamp(64px, 8vw, 110px); }
.fact { position: relative; padding-top: 24px; }
.fact::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 2px; background: var(--blue); transform-origin: var(--start); }
.fact b { display: block; font: 600 clamp(2.4rem, 4.4vw, 3.6rem)/1.05 var(--f-sans); color: var(--navy); letter-spacing: -0.02em; }
.fact span { display: block; margin-top: 12px; color: var(--muted); font-size: 1rem; }
.fact span strong { font-weight: 400; color: var(--ink); }
html[dir="rtl"] .fact span strong { font-weight: 600; }

/* ============ KG to Grade 12 (scroll-driven stages) ============ */
.school { background: var(--navy); color: var(--white); position: relative; }
.school-head { max-width: 760px; }
.stage-track { position: relative; margin-top: clamp(40px, 5vw, 72px); }
.stage-track.is-pinned .stage-sticky { position: sticky; }
.school-grid { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(40px, 6vw, 96px); align-items: start; }

.stages-top { display: none; align-items: center; gap: 16px; margin-bottom: 14px; }
.is-pinned .stages-top { display: flex; }
.stage-count { font: var(--italic) 400 15px var(--f-serif); color: rgba(255, 255, 255, .75); white-space: nowrap; }
.stage-count b { font-weight: 400; color: var(--sky); }
.stage-bar { flex: 1; height: 2px; background: var(--line-dark); position: relative; overflow: hidden; }
.stage-bar i { position: absolute; inset: 0; background: var(--sky); transform: scaleX(var(--p, 0)); transform-origin: var(--start); }

.stages { border-top: 1px solid var(--line-dark); }
.stage { border-bottom: 1px solid var(--line-dark); }
.stage summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 16px;
  padding: 24px 0; font-family: var(--f-sans); -webkit-user-select: none; user-select: none;
}
.stage summary::-webkit-details-marker { display: none; }
.stage .num { font: var(--italic) 400 16px var(--f-serif); color: var(--sky); }
.stage .name { font-weight: 500; font-size: clamp(1.35rem, 2.3vw, 1.85rem); letter-spacing: -0.01em; color: var(--white); line-height: 1.2; transition: color .4s; }
.stage .grades { display: block; margin-top: 4px; font: var(--italic) 400 14px var(--f-serif); letter-spacing: 0; color: rgba(255, 255, 255, .72); }
html[dir="rtl"] .stage .grades { font-size: 15px; }
.stage .toggle { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .45); position: relative; transition: background .35s, border-color .35s; }
.stage .toggle::before, .stage .toggle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 1.5px; background: var(--white); transform: translate(-50%, -50%); transition: transform .35s var(--ease), background .35s; }
.stage .toggle::after { transform: translate(-50%, -50%) rotate(90deg); }
.stage-body > p { padding: 0 0 28px; padding-inline-start: 60px; color: rgba(255, 255, 255, .84); max-width: 38em; }
.stage summary:hover .name { color: var(--sky); }

/* Open state (no-JS uses [open]; enhanced mode uses .is-active) */
.stage[open]:not(.js-stage) .toggle,
.stage.js-stage.is-active .toggle { background: var(--white); border-color: var(--white); }
.stage[open]:not(.js-stage) .toggle::before, .stage[open]:not(.js-stage) .toggle::after,
.stage.js-stage.is-active .toggle::before, .stage.js-stage.is-active .toggle::after { background: var(--navy); }
.stage[open]:not(.js-stage) .toggle::after,
.stage.js-stage.is-active .toggle::after { transform: translate(-50%, -50%) rotate(0deg); }

/* Enhanced (JS) accordion: every <details> stays open for screen readers; height animates */
.js-stage .stage-body { height: 0; overflow: hidden; opacity: 0; transition: height .6s var(--ease), opacity .45s ease; }
.js-stage.is-active .stage-body { height: var(--body-h, auto); opacity: 1; transition: height .6s var(--ease), opacity .6s ease .12s; }
.is-pinned .js-stage:not(.is-active) .name { color: rgba(255, 255, 255, .62); }
.stage-track:not(.is-pinned) .js-stage .stage-body { height: auto; opacity: 1; }
.stage-track:not(.is-pinned) .js-stage .toggle { display: none; }
.measuring *, .measuring *::before, .measuring *::after { transition: none !important; }
.js-stage .grades { max-height: 4em; overflow: hidden; transition: max-height .6s var(--ease), opacity .45s ease, margin .6s var(--ease); }

.school-photo { position: relative; }
.school-photo::before { content: ""; position: absolute; inset-inline-start: -18px; top: 28px; bottom: 60px; width: 3px; background: var(--blue); }
.school-photo .frame { position: relative; height: min(600px, calc(100svh - var(--header-h) - 150px)); min-height: 360px; overflow: hidden; background: var(--navy-3); }
.school-photo .frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .9s ease, transform 1.6s var(--ease); transform: scale(1.04); }
.school-photo .frame img:first-child { object-position: 50% 50%; }
.school-photo .frame img:last-child { object-position: 62% 50%; }
.school-photo .frame img.on { opacity: 1; transform: none; }
.school-photo figcaption { display: grid; margin-top: 14px; font-style: var(--italic); font-weight: 400; font-size: 15px; color: rgba(255, 255, 255, .72); }
.school-photo figcaption span { grid-area: 1 / 1; opacity: 0; transition: opacity .6s ease; }
.school-photo figcaption span.on { opacity: 1; }
.school-photo-m { display: none; margin-top: 40px; }
.school-photo-m img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 62% 50%; background: var(--navy-3); }
.school-photo-m figcaption { margin-top: 12px; font-style: var(--italic); font-weight: 400; font-size: 15px; color: rgba(255, 255, 255, .72); }

/* ============ Values ============ */
.values { background: var(--white); }
.values-head { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: end; }
.values-head .lead { margin-top: 0; }
.value-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; margin-top: clamp(48px, 6vw, 80px); }
.value { border-top: 1px solid var(--line); padding-top: 26px; }
.value .vnum { font: var(--italic) 400 16px var(--f-serif); color: var(--blue); }
.value h3 { font-size: 1.4rem; margin: 12px 0 14px; }
.value p { color: var(--muted); font-size: 16px; }
html[dir="rtl"] .value p { font-size: 17px; }

/* ============ Life at La Cité ============ */
.life-head { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: end; }
.year-chip { font: 600 12px var(--f-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--blue); border: 1px solid rgba(58, 110, 168, .4); padding: 9px 16px; border-radius: 999px; white-space: nowrap; }
html[dir="rtl"] .year-chip { font-size: 14px; }
.stories { margin-top: clamp(40px, 5vw, 64px); border-top: 1px solid var(--line); }
.story { display: grid; grid-template-columns: 220px 1fr auto; gap: 14px 48px; padding: 34px 0; border-bottom: 1px solid var(--line); align-items: start; }
.story .tag { font-style: var(--italic); font-weight: 400; color: var(--blue); font-size: 16px; padding-top: 4px; }
html[dir="rtl"] .story .tag { font-family: var(--f-ar); font-size: 19px; padding-top: 0; }
.story h3 { font-size: clamp(1.25rem, 1.9vw, 1.55rem); }
.story p { margin-top: 10px; color: var(--muted); font-size: 16px; max-width: 42em; }
html[dir="rtl"] .story p { font-size: 17px; }
.clip-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding-inline-end: 4px; white-space: nowrap;
  font: 600 13px var(--f-sans); color: var(--muted); text-decoration: none; transition: color .25s;
}
html[dir="rtl"] .clip-link { font-size: 15px; }
.clip-link svg { width: 22px; height: 22px; flex: none; }
.clip-link:hover { color: var(--blue); }

.fb-block { margin-top: clamp(56px, 7vw, 96px); background: var(--mist); padding: clamp(28px, 4vw, 56px); display: grid; grid-template-columns: 5fr 6fr; gap: 32px clamp(32px, 5vw, 72px); align-items: start; }
.fb-intro { position: sticky; top: calc(var(--header-h) + 32px); }
.fb-h { font-size: clamp(1.5rem, 2.4vw, 2.1rem); }
.fb-intro > p:not(.eyebrow) { margin-top: 14px; color: var(--muted); font-size: 16px; max-width: 30em; }
html[dir="rtl"] .fb-intro > p:not(.eyebrow) { font-size: 17px; }
.fb-intro .social-btns { margin-top: 26px; }
.fb-frame { position: relative; width: 100%; max-width: 500px; justify-self: end; height: 640px; background: var(--white); border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(14, 36, 64, .07); overflow: hidden; }
.fb-frame iframe { position: relative; z-index: 1; display: block; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity .6s ease; }
.fb-frame.loaded iframe { opacity: 1; }
.fb-frame iframe { background: var(--white); }
.fb-frame.loaded .fb-fallback { display: none; }
.fb-fallback { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 32px; text-align: center; color: var(--muted); font-size: 15px; }
.fb-fallback svg { width: 34px; height: 34px; color: var(--blue); }
.fb-noscript { position: absolute; inset: auto 0 24px; text-align: center; }
.social-btns { display: flex; flex-wrap: wrap; gap: 12px; }

/* Video dialog: small, opened only on request */
.clip-dialog { border: 0; padding: 0; background: transparent; width: min(92vw, 420px); max-width: none; max-height: 90svh; overflow: visible; color: var(--white); }
.clip-dialog.wide { width: min(92vw, 880px); }
.clip-dialog::backdrop { background: rgba(10, 27, 49, .9); }
.clip-dialog video { width: 100%; max-height: 80svh; background: #000; }
.clip-dialog .close-btn { position: absolute; top: -50px; inset-inline-end: 0; }

/* ============ Admissions band ============ */
.admissions { background: var(--navy); color: var(--white); position: relative; overflow: hidden; text-align: center; padding-bottom: calc(min(96vw, 460px) / 2 + 48px); }
.admissions-rays { position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%); width: min(96vw, 460px); color: var(--sky); opacity: .24; pointer-events: none; }
.admissions .wrap { position: relative; z-index: 1; }
.admissions .lead { margin-inline: auto; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: clamp(48px, 6vw, 72px) auto 0; max-width: 1040px; text-align: start; }
.step { border: 1px solid var(--line-dark); padding: 28px 28px 30px; background: var(--navy-3); }
.step .snum { width: 38px; height: 38px; border-radius: 50%; background: var(--blue); color: var(--white); display: grid; place-items: center; font: 600 15px var(--f-sans); }
.step h3 { color: var(--white); font-size: 1.2rem; margin: 20px 0 8px; }
.step p { color: rgba(255, 255, 255, .8); font-size: 16px; }
html[dir="rtl"] .step p { font-size: 17px; }
.admissions-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px 56px; margin-top: clamp(48px, 6vw, 72px); }

/* ============ Contact ============ */
.contact-grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(40px, 6vw, 96px); align-items: stretch; }
.contact-list { margin-top: 36px; border-top: 1px solid var(--line); }
.contact-list li { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.contact-list .k { font: 600 11px/1.9 var(--f-sans); letter-spacing: var(--track); text-transform: uppercase; color: var(--blue); padding-top: 3px; }
html[dir="rtl"] .contact-list .k { font-size: 14px; padding-top: 2px; }
.contact-list .v { font-size: 17px; color: var(--ink); overflow-wrap: anywhere; }
.contact-list .v a { text-decoration: none; border-bottom: 1px solid rgba(58, 110, 168, .45); }
.contact-list .v a:hover { color: var(--blue); border-bottom-color: var(--blue); }
.contact-list .v small { display: block; color: var(--muted); font-size: 15px; }
.contact .btn { margin-top: 32px; }
.map { min-height: 420px; background: var(--mist); border: 1px solid var(--line); overflow: hidden; }
.map iframe { width: 100%; height: 100%; min-height: 420px; border: 0; }

/* ============ Footer ============ */
.site-footer { background: var(--navy-2); color: rgba(255, 255, 255, .74); font-size: 16px; padding: clamp(64px, 8vw, 96px) 0 0; }
.footer-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 48px; padding-bottom: 56px; }
.footer-brand .brand { margin-bottom: 22px; }
.footer-brand .seal { width: 58px; height: 58px; box-shadow: none; }
.footer-brand .brand-name { color: var(--white); }
.footer-brand .ar { font-size: 1.5rem; color: var(--white); line-height: 1.6; }
.footer-brand p { margin-top: 10px; max-width: 26em; }
.footer-lang { margin-top: 24px; }
.footer-col .fh { font: 600 11px var(--f-sans); letter-spacing: var(--track); text-transform: uppercase; color: var(--sky); margin-bottom: 14px; }
html[dir="rtl"] .footer-col .fh { font-size: 14px; }
.footer-col li { padding-block: 5px; }
.footer-col a { text-decoration: none; }
.footer-col a:hover { color: var(--white); text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--line-dark); padding: 22px 0 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font: 500 13px var(--f-sans); color: rgba(255, 255, 255, .62); }
.footer-bottom a { text-decoration: none; }
.footer-bottom a:hover { color: var(--white); }

/* ============ Phone quick actions ============ */
.callbar { display: none; }

/* ============ Motion (only when html.motion is set: JS on, no reduced-motion preference) ============ */
html.motion .rv { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0ms); }
html.motion .rv.in { opacity: 1; transform: none; }
html.motion .rv .eyebrow::after, html.motion .hero .eyebrow::after { transform: scaleX(0); transition: transform 1s var(--ease) .35s; }
html.motion .rv.in .eyebrow::after, html.motion .hero.is-in .eyebrow::after { transform: none; }
html.motion .fact::before { transform: scaleX(0); transition: transform 1.2s var(--ease); transition-delay: calc(var(--d, 0ms) + 150ms); }
html.motion .fact.in::before { transform: none; }

html.motion .hero-content > * { opacity: 0; transform: translateY(18px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
html.motion .hero.is-in .hero-content > * { opacity: 1; transform: none; }
html.motion .hero.is-in .hero-content > :nth-child(2) { transition-delay: .1s; }
html.motion .hero.is-in .hero-content > :nth-child(3) { transition-delay: .2s; }
html.motion .hero.is-in .hero-content > :nth-child(4) { transition-delay: .3s; }
html.motion .hero.is-in .hero-content > :nth-child(5) { transition-delay: .4s; }
html.motion .hero-img { transform: scale(1.07); transition: transform 2.4s var(--ease); }
html.motion .hero.is-in .hero-img { transform: none; }
html.motion .hero-rays { opacity: 0; transform: translateY(30px); transition: opacity 1.6s ease .5s, transform 1.8s var(--ease) .5s; }
html.motion .hero.is-in .hero-rays { opacity: .2; transform: none; }

html.motion .admissions-rays { opacity: 0; transform: translateX(-50%) translateY(28%); transition: opacity 1.4s ease .2s, transform 1.8s var(--ease) .2s; }
html.motion .admissions.in .admissions-rays { opacity: .24; transform: translateX(-50%); }

html.motion .menu-links li, html.motion .menu-aside { opacity: 0; transform: translateY(12px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
html.motion .menu.open .menu-links li, html.motion .menu.open .menu-aside { opacity: 1; transform: none; }
html.motion .menu.open .menu-links li:nth-child(1) { transition-delay: .08s; }
html.motion .menu.open .menu-links li:nth-child(2) { transition-delay: .12s; }
html.motion .menu.open .menu-links li:nth-child(3) { transition-delay: .16s; }
html.motion .menu.open .menu-links li:nth-child(4) { transition-delay: .2s; }
html.motion .menu.open .menu-links li:nth-child(5) { transition-delay: .24s; }
html.motion .menu.open .menu-links li:nth-child(6) { transition-delay: .28s; }
html.motion .menu.open .menu-aside { transition-delay: .3s; }

/* ============ Responsive ============ */
@media (min-width: 761px) and (max-height: 800px) {
  .stage summary { padding: 15px 0; }
  .stage .name { font-size: 1.4rem; }
  .stage-body > p { padding-bottom: 20px; font-size: 16px; }
  .stages-top { margin-bottom: 8px; }
}
@media (max-width: 1080px) {
  .value-grid { grid-template-columns: repeat(2, 1fr); gap: 40px 32px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .story { grid-template-columns: 170px 1fr; }
  .story .clip-link { grid-column: 2; }
  .hide-md { display: none; }
}
@media (max-width: 900px) {
  .fb-block { grid-template-columns: 1fr; }
  .fb-intro { position: static; }
  .fb-frame { justify-self: start; }
  .about-grid, .values-head, .contact-grid { grid-template-columns: 1fr; }
  .about-copy { order: -1; }
  .school-grid { grid-template-columns: 1fr; }
  .school-photo { display: none; }
  .school-photo-m { display: block; }
  .menu-body { grid-template-columns: 1fr; gap: 40px; }
  .menu-aside { align-self: start; }
  .steps { grid-template-columns: 1fr; max-width: 560px; }
  .header-side.start { display: none; }
  .header-inner { grid-template-columns: 1fr auto; }
  .header-inner .brand { order: -1; }
}
@media (max-width: 760px) {
  :root { --header-h: 64px; }
  body { font-size: 16px; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  html[dir="rtl"] body { font-size: 17px; }
  .header-side { gap: 10px; }
  .menu-btn .menu-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .menu-btn { padding-inline: 8px; margin-inline-end: -8px; }
  .menu-btn .bars { width: 24px; }
  .brand { gap: 9px; }
  .brand-name { font-size: 12px; letter-spacing: .12em; }
  html[dir="rtl"] .brand-name { font-size: 16px; }
  .seal { width: 40px; height: 40px; }
  .lang-switch { min-height: 40px; padding: 0 12px 0 10px; font-size: 13px; }
  .lang-switch svg { width: 15px; height: 15px; }
  .menu-top-end .close-btn .menu-word { display: none; }

  .section { padding-block: 72px; }
  .hero { min-height: calc(100svh - var(--header-h) - 68px); }
  .hero-content { padding-top: 96px; padding-bottom: 40px; }
  .hero h1 { font-size: clamp(2.3rem, 10.5vw, 3rem); }
  html[dir="rtl"] .hero h1 { font-size: clamp(2.2rem, 10vw, 2.9rem); }
  .hero-rays { width: 125vw; inset-inline-end: -40vw; }
  .hero-img { object-position: 46% 40%; }
  .hero-actions { flex-direction: column; align-items: flex-start; gap: 6px; }

  .facts { grid-template-columns: 1fr; gap: 26px; margin-top: 56px; }
  .fact { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: baseline; }
  .fact b { font-size: 2.2rem; }
  .fact span { margin-top: 0; }
  .value-grid { grid-template-columns: 1fr; gap: 30px; }
  .life-head { grid-template-columns: 1fr; }
  .year-chip { justify-self: start; }
  .story { grid-template-columns: 1fr; gap: 6px; padding: 26px 0; }
  .story .clip-link { grid-column: 1; margin-top: 2px; }
  .fb-block { grid-template-columns: 1fr; padding: 28px 20px 20px; margin-inline: calc(var(--gut) * -1); }
  .fb-intro { position: static; }
  .fb-frame { justify-self: stretch; max-width: none; height: 560px; }
  .social-btns .btn { flex: 1 1 140px; }
  .contact-list li { grid-template-columns: 1fr; gap: 2px; }
  .map, .map iframe { min-height: 300px; }
  .footer-top { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; }
  .admissions { padding-bottom: calc(min(96vw, 460px) / 2 + 40px); }
  .admissions-actions { gap: 14px 36px; }

  /* compact stages so the pinned stepper fits a phone screen */
  .stage summary { grid-template-columns: 30px 1fr auto; gap: 12px; padding: 15px 0; }
  .stage .name { font-size: 1.22rem; }
  .stage .grades { font-size: 13px; margin-top: 2px; }
  html[dir="rtl"] .stage .grades { font-size: 14px; }
  .stage .toggle { width: 32px; height: 32px; }
  .stage-body > p { padding-inline-start: 42px; padding-bottom: 20px; font-size: 15.5px; line-height: 1.65; }
  .is-pinned .js-stage:not(.is-active) .grades { max-height: 0; opacity: 0; margin-top: 0; }
  html[dir="rtl"] .stage-body > p { font-size: 16.5px; line-height: 1.8; }

  .callbar {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: fixed; inset: auto 0 0 0; z-index: 90;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .97);
    border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(14, 36, 64, .08);
    transition: transform .4s var(--ease);
  }
  .callbar .btn { min-height: 46px; padding: 0 10px; }
  .callbar.away { transform: translateY(110%); }
}
@media (max-width: 760px) and (max-height: 620px) {
  /* short phone screens (iPhone SE with browser bars): tighter stepper so it still pins */
  .stage summary { padding: 11px 0; }
  .stage .name { font-size: 1.15rem; }
  .stage-body > p { font-size: 15px; line-height: 1.58; padding-bottom: 14px; }
  html[dir="rtl"] .stage-body > p { font-size: 15.5px; line-height: 1.7; }
  .stages-top { margin-bottom: 8px; }
}
@media (max-width: 380px) {
  .brand-name { font-size: 11px; letter-spacing: .08em; }
  html[dir="rtl"] .brand-name { font-size: 15px; }
  .seal { width: 36px; height: 36px; }
  .lang-switch svg { display: none; }
  .lang-switch { padding: 0 11px; }
  .fact { grid-template-columns: 96px 1fr; }
}
/* ============ Phone breathing room (more air between blocks, longer lines of text read easier) ============ */
@media (max-width: 760px) {
  :root { --gut: 24px; }
  body { line-height: 1.75; }
  .section { padding-block: 104px; }
  .h2 { font-size: 2.05rem; line-height: 1.15; }
  html[dir="rtl"] .h2 { font-size: 1.95rem; line-height: 1.45; }
  .eyebrow { margin-bottom: 16px; }
  .lead { margin-top: 20px; line-height: 1.75; }
  html[dir="rtl"] .lead { line-height: 1.95; }

  .hero-actions { gap: 12px; margin-top: 30px; }
  .hero-sub { margin-top: 14px; line-height: 1.6; }

  .about-grid { gap: 56px; }
  .about-copy .text-link { margin-top: 26px; }
  .facts { gap: 0; margin-top: 72px; }
  .fact { padding-block: 26px; }
  .fact + .fact { margin-top: 8px; }

  .stage-track { margin-top: 48px; }
  .school-photo-m { margin-top: 56px; }

  .values-head { gap: 22px; }
  .value-grid { gap: 0; margin-top: 56px; }
  .value { padding-block: 28px 34px; }
  .value h3 { margin: 10px 0 12px; }

  .life-head { gap: 26px; }
  .stories { margin-top: 48px; }
  .story { gap: 10px; padding-block: 34px 30px; }
  .story p { margin-top: 12px; line-height: 1.75; }
  html[dir="rtl"] .story p { line-height: 1.9; }
  .fb-block { margin-top: 80px; padding: 40px 24px 24px; gap: 32px; }
  .fb-intro .social-btns { margin-top: 24px; }

  .steps { gap: 16px; margin-top: 52px; }
  .step { padding: 28px 24px 30px; }
  .step h3 { margin: 18px 0 10px; }
  .admissions-actions { margin-top: 56px; flex-direction: column; align-items: center; gap: 14px; }
  .admissions-actions .arrow-link { min-width: 9.5em; justify-content: space-between; }

  .contact-grid { gap: 56px; }
  .contact-list { margin-top: 40px; }
  .contact-list li { padding-block: 20px; gap: 4px; }
  .contact .btn { margin-top: 36px; }

  .site-footer { padding-top: 80px; }
  .footer-top { gap: 44px; padding-bottom: 64px; }
  .footer-brand p { margin-top: 12px; }
  .footer-col .fh { margin-bottom: 12px; }
  .footer-col li { padding-block: 7px; }
}
@media (max-width: 760px) and (max-height: 620px) {
  .section { padding-block: 88px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; animation: none !important; }
}
