/* ==========================================================================
   BASE — design tokens, reset, typography, buttons, utilities
   Bright Future International School
   Uses CSS logical properties throughout so an RTL (Arabic) version only
   needs <html dir="rtl" lang="ar">.
   ========================================================================== */

:root {
  /* Brand colours (light, airy palette) */
  --white: #FFFFFF;
  --ivory: #FBF8F3;
  --sky: #EAF1FB;
  --sky-deep: #D7E4F6;
  --blush: #F7ECEE;
  --champagne: #F3E6C3;
  --champagne-deep: #E9D49C;
  --navy: #0B1F5C;
  --maroon: #6B1230;
  --globe: #3B68AE;          /* logo globe blue, motifs only */

  /* Text */
  --text: #1E2E5E;           /* body copy, AA+ on all light backgrounds */
  --muted: #4A5782;          /* secondary copy, AA on white/ivory/sky */
  --line: #E2E8F2;
  --line-strong: #C9D3E4;

  /* Type */
  --font-head: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Lato", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-ar: "Tajawal", "Lato", system-ui, sans-serif;
  --fs-body: 1.0625rem;
  --fs-small: .9375rem;
  --fs-lead: clamp(1.125rem, 1rem + .5vw, 1.3rem);
  --fs-h1: clamp(2.35rem, 1.6rem + 3.4vw, 4.6rem);
  --fs-h2: clamp(1.95rem, 1.4rem + 2.3vw, 3.3rem);
  --fs-h3: clamp(1.25rem, 1.1rem + .6vw, 1.55rem);

  /* Shape & depth */
  --r-sm: 10px;
  --r: 18px;
  --r-lg: 28px;
  --r-xl: 40px;
  --r-pill: 999px;
  --shadow-sm: 0 2px 10px rgba(11, 31, 92, .06);
  --shadow: 0 16px 36px -16px rgba(11, 31, 92, .18);
  --shadow-lg: 0 34px 70px -28px rgba(11, 31, 92, .28);

  /* Layout */
  --container: 1320px;
  --gutter: 16px;
  --section-y: clamp(4.25rem, 3rem + 6vw, 8.5rem);
  --header-h: 72px;
  --header-h-sm: 62px;
  --dock-h: 0px;            /* updated by JS to the height of the bottom dock */
  --dir: 1;                 /* flips horizontal motion in RTL */

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}
[dir="rtl"] { --dir: -1; }

@media (min-width: 768px)  { :root { --gutter: 28px; --header-h: 84px; --header-h-sm: 66px; } }
@media (min-width: 1280px) { :root { --gutter: 40px; } }
@media (min-width: 1800px) { :root { --container: 1440px; } }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-block-start: calc(var(--header-h) + 16px);
  overflow-x: clip;
}
body {
  margin: 0;
  padding-block-start: var(--header-h);
  background: var(--white);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-height: 100vh;
}
:lang(ar), [lang="ar"] { font-family: var(--font-ar); }
img, svg, video, picture { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
:where(ul[class], ol[class]) { list-style: none; margin: 0; padding: 0; }
[hidden] { display: none !important; }
table { border-collapse: collapse; width: 100%; }

/* Lenis smooth scroll */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--navy);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .6em;
  letter-spacing: -.01em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); line-height: 1.06; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.3; }
h4 { font-size: 1.125rem; }
h1 em, h2 em, h3 em, .two-tone em { font-style: italic; color: var(--maroon); font-weight: 500; }
p { margin: 0 0 1.1em; }
.lead { font-size: var(--fs-lead); color: var(--muted); line-height: 1.65; }
strong { font-weight: 700; color: var(--navy); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .65em;
  margin: 0 0 1rem;
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--maroon);
}
.eyebrow::before {
  content: "";
  inline-size: 26px;
  block-size: 1.5px;
  background: currentColor;
  opacity: .7;
}
.eyebrow--center { justify-content: center; }

/* Visible placeholders: [Principal Name] etc. */
.ph {
  background: #FFF3D1;
  color: inherit;
  border-radius: 4px;
  padding: 0 .25em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  font-style: normal;
}

/* ---------- Layout helpers ---------- */
.container {
  inline-size: 100%;
  max-inline-size: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-inline-size: calc(900px + var(--gutter) * 2); }
.section { padding-block: var(--section-y); position: relative; }
.section--ivory { background: var(--ivory); }
.section--sky { background: var(--sky); }
.section--blush { background: var(--blush); }
.section-head { max-inline-size: 760px; margin-block-end: clamp(2.25rem, 4vw, 3.5rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }
.section-head--row {
  max-inline-size: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}
.section-head--row > div { max-inline-size: 720px; }
.section-head p:last-child { margin-block-end: 0; }

.visually-hidden {
  position: absolute !important;
  inline-size: 1px; block-size: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  z-index: 1000;
  padding: .8rem 1.2rem;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--r-pill);
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform .25s var(--ease);
}
.skip-link:focus { transform: none; }

/* ---------- Focus ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--maroon);
  outline-offset: 3px;
  border-radius: 6px;
}
.site-main:focus { outline: none; }

/* ---------- Icons ---------- */
.icon {
  inline-size: 1.25em;
  block-size: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
[dir="rtl"] .icon-flip, [dir="rtl"] .btn .icon, [dir="rtl"] .circle-btn .icon { transform: scaleX(-1); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--champagne);
  --btn-fg: var(--navy);
  --btn-bd: var(--champagne);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-block-size: 50px;
  padding: .7rem 1.6rem;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .975rem;
  letter-spacing: .02em;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), background-color .25s, color .25s, border-color .25s;
}
.btn .icon { transition: transform .35s var(--ease-out); }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:hover .icon { transform: translateX(calc(var(--dir) * 4px)); }
[dir="rtl"] .btn:hover .icon { transform: scaleX(-1) translateX(4px); }
.btn:active { transform: translateY(0); }

.btn--primary:hover { --btn-bg: var(--champagne-deep); --btn-bd: var(--champagne-deep); }
.btn--outline { --btn-bg: transparent; --btn-fg: var(--navy); --btn-bd: var(--navy); }
.btn--outline:hover { --btn-fg: var(--maroon); --btn-bd: var(--maroon); --btn-bg: var(--white); }
.btn--ghost { --btn-bg: var(--white); --btn-fg: var(--navy); --btn-bd: var(--line-strong); }
.btn--ghost:hover { --btn-bd: var(--maroon); --btn-fg: var(--maroon); }
.btn--glass { --btn-bg: rgba(255,255,255,.7); --btn-fg: var(--navy); --btn-bd: rgba(11,31,92,.18); backdrop-filter: blur(6px); }
.btn--glass:hover { --btn-bg: var(--white); --btn-bd: var(--maroon); --btn-fg: var(--maroon); }
.btn--sm { min-block-size: 44px; padding: .55rem 1.2rem; font-size: .9rem; }
.btn--lg { min-block-size: 56px; padding: .85rem 2rem; font-size: 1.02rem; }
.btn--block { inline-size: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .85rem; align-items: center; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-block-size: 44px;
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 85% / 0 1.5px;
  transition: color .25s, background-size .35s var(--ease-out);
}
[dir="rtl"] .text-link { background-position: 100% 85%; }
.text-link:hover { color: var(--maroon); background-size: calc(100% - 1.8em) 1.5px; }
.text-link .icon { transition: transform .35s var(--ease-out); }
.text-link:hover .icon { transform: translateX(calc(var(--dir) * 4px)); }

.link-btn { color: inherit; text-decoration: underline; text-underline-offset: .2em; min-block-size: 44px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  border-radius: 50%;
  color: var(--navy);
  transition: background-color .25s, color .25s;
}
.icon-btn:hover { background: var(--sky); color: var(--maroon); }
.icon-btn .icon { inline-size: 22px; block-size: 22px; }
.icon-btn--sm .icon { inline-size: 18px; block-size: 18px; }

.circle-btn {
  display: inline-grid;
  place-items: center;
  inline-size: 52px;
  block-size: 52px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--white);
  color: var(--navy);
  transition: border-color .25s, color .25s, transform .35s var(--ease-out), box-shadow .35s;
}
.circle-btn:hover { border-color: var(--maroon); color: var(--maroon); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.circle-btn.swiper-button-disabled { opacity: .4; pointer-events: none; }
.circle-btn .icon { inline-size: 20px; block-size: 20px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .3rem .8rem;
  border-radius: var(--r-pill);
  background: var(--sky);
  color: var(--navy);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.tag--blush { background: var(--blush); color: var(--maroon); }
.tag--champagne { background: var(--champagne); }

/* ---------- Motifs ---------- */
.motif-rays { fill: var(--champagne-deep); opacity: .35; }

/* ---------- Animation states (JS adds .js, GSAP reveals) ---------- */
.js .reveal, .js .reveal-stagger > * { opacity: 0; transform: translateY(28px); }
.js [data-split] { opacity: 0; }
.js [data-split].is-split { opacity: 1; }
.split-word { display: inline-block; overflow: hidden; vertical-align: top; padding-block-end: .08em; margin-block-end: -.08em; }
.split-word > span { display: inline-block; will-change: transform; }
.js [data-mask-reveal] { clip-path: inset(0 0 100% 0 round var(--r-lg)); }
.js [data-mask-reveal].is-revealed { clip-path: none; }

/* Fallback if animations cannot run */
.anim-fallback .reveal, .anim-fallback .reveal-stagger > *, .anim-fallback [data-split],
.reduced-motion .reveal, .reduced-motion .reveal-stagger > *, .reduced-motion [data-split] {
  opacity: 1 !important; transform: none !important;
}
.anim-fallback [data-mask-reveal], .reduced-motion [data-mask-reveal] { clip-path: none !important; }
.anim-fallback .split-word > span, .reduced-motion .split-word > span { transform: none !important; }

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