/* ===========================================================================
   main.css — Irshad English School
   Mobile-first. All colors/fonts/radii/spacing come from tokens.css.
   Order: reset → primitives → buttons → section-header → header → sections → footer
   =========================================================================== */

/* --- reset / base --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-poppins);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--color-text-body);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

img, picture, svg { display: block; max-width: 100%; height: auto; }
/* Restore the [hidden] attribute over the display:block reset above (author `img`
   rule otherwise beats the UA rule, leaving hidden images visible). */
[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; }

ul { list-style: none; padding: 0; }

h1, h2, h3, h4 { line-height: var(--lh-tight); color: var(--color-heading); }

button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- layout primitives ---------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -100px;
  z-index: 2000;
  background: var(--color-primary);
  color: var(--color-white);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top var(--transition-fast);
}
.skip-link:focus { top: var(--space-3); }

/* --- buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.85em 1.9em;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--color-btn);
  color: var(--color-white);
  font-weight: 600;
  font-size: var(--fs-sm);
  line-height: 1.2;
  text-align: center;
  transition: background var(--transition-base), transform var(--transition-fast);
}
.btn:hover { background: var(--color-btn-hover); }
.btn:active { transform: translateY(1px); }
.btn--font-poppins { font-family: var(--font-poppins); }
.btn--font-roboto  { font-family: var(--font-roboto); }
.btn--badge { background: var(--color-badge); }
.btn--badge:hover { background: var(--color-badge-hover); }
.btn--lg { padding: 0.7em 2.4em; border-radius: var(--radius-lg); }
/* Outline button for dark bands (e.g. management) */
.btn--outline-light {
  background: transparent;
  border: 2px solid var(--color-white);
  padding: calc(0.85em - 2px) calc(1.9em - 2px);
}
.btn--outline-light:hover { background: var(--color-white); color: var(--color-heading); }

/* --- Gallery lightbox ----------------------------------------------------- */
.tour-tile--zoom { border: 0; padding: 0; background: none; cursor: zoom-in; font: inherit; display: block; width: 100%; }
body.has-lightbox { overflow: hidden; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 1000);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(0, 32, 32, 0.92);
}
.lightbox[hidden] { display: none; }
.lightbox__stage { margin: 0; max-width: min(1100px, 92vw); display: flex; flex-direction: column; align-items: center; }
.lightbox__img { max-width: 100%; max-height: 82vh; object-fit: contain; border-radius: var(--radius-md); background: #000; }
.lightbox__caption { color: var(--color-white); text-align: center; margin-top: var(--space-2); font-size: var(--fs-sm); }
.lightbox__close, .lightbox__nav {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 0;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  font-size: 1.7rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255, 255, 255, 0.32); }
.lightbox__nav[hidden] { display: none; }
.lightbox__close {
  position: absolute;
  top: clamp(0.75rem, 3vw, 1.5rem);
  right: clamp(0.75rem, 3vw, 1.5rem);
}
@media (max-width: 640px) {
  .lightbox__nav { position: absolute; bottom: 1rem; }
  .lightbox__nav--prev { left: 1rem; }
  .lightbox__nav--next { right: 1rem; }
}

/* --- section header ------------------------------------------------------- */
.section-header { margin-bottom: var(--space-5); }
.section-header--center { text-align: center; }
.section-header__title {
  font-family: var(--font-poppins);
  font-size: var(--fs-h2);
  font-weight: 800;
  color: var(--color-heading);
  letter-spacing: 0.2px;
}
.section-header__rule {
  display: block;
  width: 100%;
  height: 3px;
  margin-top: var(--space-3);
  background: var(--color-accent-red);
}
/* Centered variant: short rule centred under the heading */
.section-header--center .section-header__rule {
  width: 80px;
  margin-inline: auto;
}

/* ===========================================================================
   HEADER
   =========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  box-shadow: var(--shadow-header);
}

/* Top bar */
.topbar {
  background: var(--color-navy-topbar);
  color: var(--color-white);
  font-size: var(--fs-sm);
}
.topbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  min-height: 44px;
}
.topbar__contact {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
}
.topbar__contact a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.topbar__contact i { color: var(--color-icon-muted); }
.topbar__contact a:hover { color: var(--color-highlight); }

.topbar__actions {
  display: flex;
  align-items: stretch;
  gap: var(--space-4);
}
.topbar__disclosure {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
}
.topbar__disclosure:hover { color: var(--color-highlight); }
.btn.topbar__smart {
  border-radius: 0;
  padding-inline: var(--space-4);
  font-size: var(--fs-sm);
}

/* Nav bar — pure white (client) */
/* Left-to-right gradient: teal behind the white logo, fading to white behind the
   nav (so nav links are dark on the light side). Mobile falls back to solid teal.
   A thin white bottom border keeps the navbar visually separate from the hero. */
.navbar {
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary) 26%, var(--color-white) 58%);
  border-bottom: 2px solid var(--color-white);
}
.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 72px;
}
.navbar__logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.navbar__logo img {
  width: auto;
  height: clamp(40px, 6vw, 58px);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 0;
}
.nav-toggle__bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--color-white);
  transition: transform var(--transition-base), opacity var(--transition-fast);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Primary nav */
.primary-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(var(--space-1), 0.8vw, var(--space-3));
}
.primary-nav__item { position: relative; }
.primary-nav__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) 0.7rem;
  background: transparent;
  border: 0;
  color: var(--color-heading);
  font-family: var(--font-poppins);
  font-weight: 500;
  font-size: var(--fs-base);
  white-space: nowrap;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}
/* "Home" uses Inter per the design's font role map */
.primary-nav__item:first-child .primary-nav__link { font-family: var(--font-inter); }
.primary-nav__link:hover,
.primary-nav__toggle:hover { color: var(--color-primary); background: rgba(0, 0, 0, 0.05); }

/* Active item: teal pill with white text, standing out on the light (right) side */
.primary-nav__link.is-current,
.primary-nav__link.is-current:hover {
  color: var(--color-white);
  background: var(--color-primary);
}
.primary-nav__caret { font-size: 0.7em; transition: transform var(--transition-fast); }

/* Dropdowns (desktop): reveal on hover / focus-within / .is-open */
.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  padding: var(--space-2) 0;
  background: var(--color-white);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--transition-base), transform var(--transition-base), visibility var(--transition-base);
  z-index: var(--z-dropdown);
}
.has-dropdown:hover > .submenu,
.has-dropdown:focus-within > .submenu,
.primary-nav__toggle[aria-expanded="true"] + .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.primary-nav__toggle[aria-expanded="true"] .primary-nav__caret { transform: rotate(180deg); }
.submenu__link {
  display: block;
  padding: var(--space-2) var(--space-4);
  color: var(--color-heading);
  font-size: var(--fs-sm);
}
.submenu__link:hover { background: var(--color-bg-tab); color: var(--color-primary); }
/* Active child: white text on teal, mirroring the top-level is-current state */
.submenu__link.is-current,
.submenu__link.is-current:hover {
  color: var(--color-white);
  background: var(--color-primary);
}

/* ===========================================================================
   HERO
   =========================================================================== */
.hero {
  position: relative;
  min-height: clamp(420px, 78vh, 760px);
  overflow: hidden;
  background: var(--color-navy-hero);
}
.hero__slider,
.hero__viewport { position: absolute; inset: 0; }

/* Crossfade slides */
.hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 900ms ease;
}
.hero__slide.is-active { opacity: 1; }
.hero__slide img { width: 100%; height: 100%; object-fit: cover; }

/* Left scrim so the heading stays legible over any slide */
.hero__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;              /* vertically centred */
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg,
    var(--hero-panel) 0%,
    var(--hero-panel) 26%,
    var(--hero-panel-fade) 62%);
}
.hero__heading {
  max-width: 18ch;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-display);
  line-height: 1.12;
  color: var(--color-white);
  text-shadow: var(--shadow-text);
}

/* Arrows */
.hero__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--hero-nav-bg);
  color: var(--color-white);
  font-size: 1.2rem;
  transition: background var(--transition-base);
}
.hero__nav:hover { background: var(--hero-nav-bg-hover); }
.hero__nav--prev { left: clamp(0.5rem, 2vw, 1.5rem); }
.hero__nav--next { right: clamp(0.5rem, 2vw, 1.5rem); }

/* Dots */
.hero__dots {
  position: absolute;
  left: 0; right: 0; bottom: clamp(1rem, 3vh, 2rem);
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: var(--space-2);
}
.hero__dot {
  width: 12px; height: 12px;
  padding: 0;
  border: 2px solid var(--color-white);
  border-radius: var(--radius-full);
  background: transparent;
  transition: background var(--transition-base);
}
.hero__dot.is-active { background: var(--color-white); }

/* ===========================================================================
   ABOUT (tabs)
   =========================================================================== */
.about { background: var(--color-bg-light); padding-block: var(--section-pad); }
.about__inner {
  display: grid;
  gap: 0;                           /* image and tab panel sit adjacent, like Figma */
  align-items: stretch;             /* image column stretches to the panel height */
}
.about__media {
  aspect-ratio: 465 / 520;          /* height on mobile (single column) */
  border-radius: var(--radius-md);
  overflow: hidden;
}
.about__media img { width: 100%; height: 100%; object-fit: cover; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.tabs__tab {
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-tab);
  border: 0;
  font-family: var(--font-poppins);
  font-weight: 700;
  font-size: var(--fs-h4);
  color: var(--color-text-muted);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.tabs__tab[aria-selected="true"] {
  background: var(--color-white);
  color: var(--color-heading-alt);
}
.tabs__tab:hover { color: var(--color-heading-alt); }
.tabs__panel {
  background: var(--color-white);
  padding: clamp(1.5rem, 4vw, 2.75rem);
}
/* Stack every panel in ONE grid cell so the panel area is always the height of
   the TALLEST tab — switching tabs never changes the section height. Inactive
   panels keep their space (visibility:hidden) instead of collapsing. */
.js .tabs__panels { display: grid; }
.js .tabs__panel { grid-area: 1 / 1; }
.js .tabs__panel[hidden] { display: block; visibility: hidden; }
/* JS off: reveal all panels so they flow normally and stay readable */
html:not(.js) .tabs__panel[hidden] { display: block; }
.about__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-poppins);
  font-weight: 700;
  font-size: var(--fs-h3);
  color: var(--color-heading-alt);
  letter-spacing: 0.5px;
  margin-bottom: var(--space-3);
}
.about__title-icon { color: var(--color-primary); font-size: 0.9em; }
.about__text {
  font-size: var(--fs-lg);
  margin-bottom: var(--space-3);
  max-width: 65ch;
}
.about__text + .btn { margin-top: var(--space-2); }

/* ===========================================================================
   PRINCIPAL
   =========================================================================== */
/* Mobile-first: stack — portrait image on top, message below on teal */
.principal {
  position: relative;
  background: var(--color-navy-section);
  color: var(--color-white);
  overflow: hidden;
}
.principal__bg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: left center;
}
.principal__inner {
  position: relative;
  z-index: 2;
  width: 100%;
}
.principal__body { padding-block: var(--section-pad); }
.principal__heading {
  font-family: var(--font-poppins);
  font-weight: 700;
  font-size: var(--fs-h1);
  color: var(--color-white);
  margin-bottom: var(--space-3);
}
.principal__subheading {
  font-size: var(--fs-lg);
  color: var(--color-white);
  margin-bottom: var(--space-3);
}
.principal__text {
  font-size: var(--fs-lg);
  color: var(--color-text-lavender);
  margin-bottom: var(--space-3);
  max-width: 62ch;
}
.principal__signoff { margin-top: var(--space-4); font-weight: 700; color: var(--color-white); }
.principal__name { display: block; font-size: var(--fs-base); }
.principal__role { display: block; font-weight: 400; color: var(--color-text-lavender); }

/* ===========================================================================
   VIDEO TOUR + NEWS
   =========================================================================== */
.video-news { padding-block: var(--section-pad); }
.video-news__inner {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
}
.video-tour__frame {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.video-tour__poster { width: 100%; height: 100%; object-fit: cover; }
.video-tour__iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-tour__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 66px; height: 66px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--color-btn);
  color: var(--color-white);
  font-size: 1.4rem;
  transition: transform var(--transition-base), background var(--transition-base);
}
.video-tour__play:hover { background: var(--color-btn-hover); transform: scale(1.06); }
.video-tour__caption { margin-top: var(--space-3); font-size: var(--fs-base); max-width: 60ch; }

.news__grid {
  display: grid;
  gap: var(--space-4) var(--space-5);
  margin-bottom: var(--space-4);
}
.news-item { display: flex; gap: var(--space-3); align-items: flex-start; }
.news-item__thumb {
  position: relative;
  flex-shrink: 0;
  width: 80px; height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.news-item__thumb img { width: 80px; height: 80px; object-fit: cover; }
/* Play badge marks each news item as a video */
.news-item__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-size: 0.7rem;
  transition: background var(--transition-fast);
}
.news-item__play i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  padding-left: 2px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.55);
}
.news-item:hover .news-item__play { background: rgba(0, 0, 0, 0.2); }
.news-item__date {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-text-meta);
  margin-bottom: var(--space-1);
}
.news-item__title {
  font-family: var(--font-poppins);
  font-weight: 700;
  font-size: var(--fs-base);
  color: var(--color-title-blue);
}
.news-item__title a:hover { color: var(--color-primary); }

/* ===========================================================================
   STATS BAND
   =========================================================================== */
.stats {
  background:
    linear-gradient(var(--overlay-stats), var(--overlay-stats)),
    var(--color-navy-stats) url("../img/banner-1.jpg") center / cover no-repeat;
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
}
.stats__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}
.stat { text-align: center; color: var(--color-white); }
.stat__icon { width: 60px; height: 60px; margin: 0 auto var(--space-2); object-fit: contain; }
.stat__number {
  display: block;
  font-family: var(--font-inter);
  font-size: var(--fs-display);
  line-height: 1.1;
  color: var(--color-white);
}
.stat__label {
  display: block;
  margin-top: var(--space-1);
  font-family: var(--font-jost);
  font-size: var(--fs-lg);
  text-transform: uppercase;
  color: var(--color-highlight);
}

/* ===========================================================================
   FACILITIES
   =========================================================================== */
/* ===========================================================================
   CAROUSEL (shared: facilities, management)
   =========================================================================== */
.carousel { position: relative; }
.carousel__viewport { overflow: hidden; }
.carousel__track {
  display: flex;
  gap: var(--space-4);
  transition: transform 600ms ease;
  will-change: transform;
}
.carousel__slide { flex: 0 0 100%; min-width: 0; }

.carousel__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.carousel__arrow {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-full);
  background: var(--color-white);
  color: var(--color-heading);
  font-size: 1.05rem;
  transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}
.carousel__arrow:hover { background: var(--color-primary); color: var(--color-white); border-color: var(--color-primary); }
.carousel__dots { display: flex; gap: var(--space-2); }
.carousel__dot {
  width: 10px; height: 10px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--color-divider);
  transition: background var(--transition-base), transform var(--transition-base);
}
.carousel__dot.is-active { background: var(--color-primary); transform: scale(1.25); }

/* Without JS the track can't translate — let it scroll horizontally instead */
html:not(.js) .carousel__viewport { overflow-x: auto; }
html:not(.js) .carousel__controls { display: none; }

/* ===========================================================================
   FACILITIES
   =========================================================================== */
.facilities { padding-block: var(--section-pad); }
.facilities__carousel .carousel__slide { flex-basis: 100%; }
.facility-card {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.facility-card__media {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-3);
}
.facility-card__media img {
  width: 100%;
  aspect-ratio: 400 / 222;
  object-fit: cover;
  transition: transform var(--transition-base);
}
/* Hover: lift the card, zoom the image, tint the title teal */
.facility-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-soft);
}
.facility-card:hover .facility-card__media img { transform: scale(1.06); }
.facility-card__title { transition: color var(--transition-fast); }
.facility-card:hover .facility-card__title { color: var(--color-primary); }
.facility-card__title {
  font-family: var(--font-poppins);
  font-weight: 700;
  font-size: var(--fs-h4);
  color: var(--color-title-blue);
  margin-bottom: var(--space-2);
}
.facility-card__text { font-size: var(--fs-base); }

/* ===========================================================================
   MANAGEMENT
   =========================================================================== */
.management {
  position: relative;
  padding-block: var(--section-pad);
  background:
    linear-gradient(var(--overlay-management), var(--overlay-management)),
    var(--color-navy-section) url("../img/hero.jpg") center / cover no-repeat;
}
.management__head { text-align: center; margin-bottom: calc(var(--space-6) + var(--space-4)); }
.management__eyebrow {
  font-family: var(--font-roboto);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-white);
  margin-bottom: var(--space-2);
}
.management__heading {
  font-family: var(--font-roboto);
  font-weight: 700;
  font-size: var(--fs-display);
  color: var(--color-white);
}
.management__rule {
  display: block;
  width: 62px;
  height: 4px;
  margin: var(--space-3) auto 0;
  background: var(--color-primary);
}
.management__actions { text-align: center; margin-top: calc(var(--space-6) + var(--space-2)); }
/* Carousel on the navy band: give the viewport top room for the overlapping
   avatars and make the arrows readable on dark */
.management__carousel .carousel__viewport { padding-top: 40px; }
/* Mobile: one full-width, centred card (no left-shifted peek) */
.management__carousel .carousel__slide { flex-basis: 100%; display: flex; }
.management__slide { align-items: stretch; }
.management__carousel .leader-card { width: 100%; }
/* Arrows on the dark band */
.management__carousel .carousel__arrow {
  background: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}
.management__carousel .carousel__arrow:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.management__carousel .carousel__dot { background: var(--color-text-lavender); }
.management__carousel .carousel__dot.is-active { background: var(--color-primary); }
@media (min-width: 640px) {
  .management__carousel .carousel__slide { flex-basis: calc((100% - var(--space-4)) / 2); }
}
@media (min-width: 1024px) {
  .management__carousel .carousel__slide { flex-basis: calc((100% - 2 * var(--space-4)) / 3); }
}

.leader-card {
  position: relative;
  width: 100%;
  padding: 52px var(--space-4) var(--space-4);
  background: var(--color-white);
  border: 1px solid var(--color-border-card);
  border-radius: var(--radius-md);
  text-align: center;
}
.leader-card__avatar {
  position: absolute;
  top: -37px;
  left: 50%;
  transform: translateX(-50%);
  width: 74px; height: 74px;
  border-radius: var(--radius-full);
  border: 3px solid var(--color-white);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  background: var(--color-bg-light);
}
.leader-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.leader-card__name {
  font-family: var(--font-roboto);
  font-size: 1.25rem;
  color: var(--color-name-ink);
  margin-bottom: var(--space-1);
}
.leader-card__role {
  font-family: var(--font-roboto);
  font-size: var(--fs-sm);
  color: var(--color-text-card);
}
.leader-card__divider {
  display: block;
  width: 100px;
  height: 2px;
  margin: var(--space-3) auto;
  background: var(--color-primary);
  opacity: 0.7;
}
.leader-card__quote {
  font-family: var(--font-roboto);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--color-text-card);
  text-align: left;
}
.leader-card__more {
  display: inline-block;
  margin-top: var(--space-3);
  font-family: var(--font-roboto);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text-card);
}
.leader-card__more:hover { color: var(--color-primary); }

/* ===========================================================================
   GALLERY
   =========================================================================== */
.gallery { background: var(--color-bg-pale); padding-block: var(--section-pad); }
/* Pinterest-style masonry: images keep their natural width/height ratio and
   flow into balanced columns (2 → 3 → 4). */
.gallery__grid {
  column-count: 2;
  column-gap: var(--space-3);
}
.tour-tile {
  position: relative;
  display: block;
  break-inside: avoid;
  margin-bottom: var(--space-3);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.tour-tile img {
  width: 100%;
  height: auto;                 /* natural height → varied tile heights */
  display: block;
  transition: transform var(--transition-base);
}
/* Hover: zoom + a soft teal tint + a zoom-in cue */
.tour-tile::after {
  content: "\f00e";             /* fa magnifying-glass-plus */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  color: var(--color-white);
  background: var(--color-primary);
  opacity: 0;
  transition: opacity var(--transition-base);
}
.tour-tile:hover img { transform: scale(1.06); }
.tour-tile:hover::after { opacity: 0.55; }
.gallery__actions { text-align: center; margin-top: var(--space-5); }

/* ===========================================================================
   FOOTER
   =========================================================================== */
.site-footer { background: var(--color-footer); color: var(--color-footer-link); padding-block: var(--section-pad); }
.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}
.site-footer__logo { width: auto; height: 46px; margin-bottom: var(--space-3); }
.site-footer__address {
  font-style: normal;
  color: var(--color-text-footaddr);
  margin-bottom: var(--space-3);
}
.site-footer__contact { color: var(--color-white); margin-bottom: var(--space-4); }
.site-footer__contact a:hover { color: var(--color-primary); }
.site-footer__social { display: flex; gap: var(--space-3); }
.site-footer__social a {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  color: var(--color-social);
  font-size: 1.1rem;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.site-footer__social a:hover { color: var(--color-white); background: var(--color-btn); }

.site-footer__heading {
  font-family: var(--font-poppins);
  font-weight: 700;
  font-size: var(--fs-h4);
  color: var(--color-white);
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-primary);
}
.site-footer__links li { margin-bottom: var(--space-2); }
.site-footer__links a { transition: color var(--transition-fast); }
.site-footer__links a:hover { color: var(--color-primary); }

/* Copyright bar */
.copyright { background: var(--color-copyright); color: var(--color-text-copy); padding-block: var(--space-4); }
.copyright__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  font-size: var(--fs-sm);
}
.copyright__credit { color: var(--color-white); }
.copyright__heart { color: var(--color-accent-red); }
.copyright__brand { color: var(--color-white); font-weight: 600; }
.copyright__brand:hover { color: var(--color-primary); text-decoration: underline; }

/* ===========================================================================
   INNER PAGES (page.php)
   =========================================================================== */
.page-banner {
  background:
    linear-gradient(var(--overlay-management), var(--overlay-management)),
    var(--color-navy-section) url("../img/banner-1.jpg") center / cover no-repeat;
  color: var(--color-white);
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--color-text-lavender);
  margin-bottom: var(--space-2);
}
.breadcrumb a:hover { color: var(--color-white); text-decoration: underline; }
.breadcrumb__sep { opacity: 0.6; }
.page-banner__title {
  font-family: var(--font-poppins);
  font-weight: 800;
  font-size: var(--fs-display);
  color: var(--color-white);
}

.page-content { padding-block: var(--section-pad); }

/* --- About ("Our School") bespoke layout --------------------------------- */
.about-page__intro { display: grid; gap: var(--space-5); margin-bottom: var(--space-6); }
.about-page__media { border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 4 / 3; }
.about-page__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-page__cards { display: grid; gap: var(--space-4); margin-bottom: var(--space-4); }
.vm-card {
  background: var(--color-white);
  border: 1px solid var(--color-border-card);
  border-top: 4px solid var(--color-primary);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-soft);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}
.vm-card--wide { margin-bottom: var(--space-6); }
.vm-card__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-poppins);
  font-weight: 700;
  font-size: var(--fs-h3);
  color: var(--color-heading);
  margin-bottom: var(--space-3);
}
.vm-card__title i { color: var(--color-primary); }
.vm-card__text { font-size: var(--fs-lg); margin-bottom: var(--space-3); }
.vm-card__text:last-child { margin-bottom: 0; }
@media (min-width: 768px) {
  .about-page__intro { grid-template-columns: minmax(0, 420px) 1fr; align-items: center; }
  .about-page__media { aspect-ratio: auto; align-self: stretch; max-height: 480px; }
}
/* Inner pages fill the breadcrumb container; the message/about layouts and cards
   manage their own width below. */
.page-content__inner { max-width: none; }

/* Content fills the inner container full width (same as the About / Our School
   page), so every inner page shares one container width. */
.content-block { margin-bottom: var(--space-6); }
.content-block__title {
  font-family: var(--font-poppins);
  font-weight: 700;
  font-size: var(--fs-h2);
  color: var(--color-heading);
  margin-bottom: var(--space-3);
  position: relative;
  padding-bottom: var(--space-2);
}
.content-block__title::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 56px; height: 3px;
  background: var(--color-accent-red);
}
.content-block__text {
  font-size: var(--fs-lg);
  margin-bottom: var(--space-3);
}
/* Feature block (e.g. "Haven of Guidance") — teal panel, light text */
.content-block--feature {
  background:
    linear-gradient(0deg, var(--color-navy-section), var(--color-heading-alt));
  color: var(--color-white);
  border-radius: var(--radius-panel);
  padding: clamp(1.5rem, 4vw, 2.75rem);
}
.content-block--feature .content-block__title { color: var(--color-white); }
.content-block--feature .content-block__text { color: var(--color-text-lavender); }
/* Content tables & lists (e.g. Syllabus & Curriculum) */
.table-wrap { overflow-x: auto; margin-bottom: var(--space-4); }
.content-table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.content-table th, .content-table td {
  border: 1px solid var(--color-border-card);
  padding: var(--space-3);
  text-align: left;
}
.content-table th {
  background: var(--color-bg-tab);
  font-family: var(--font-poppins);
  font-weight: 700;
  color: var(--color-heading);
}
.content-table tbody tr:nth-child(even) { background: var(--color-bg-light); }
.content-list { margin: 0 0 var(--space-4) 1.5rem; }
.content-list li { font-size: var(--fs-lg); margin-bottom: var(--space-2); }

/* Leadership message pages — editorial card with decorative quote + author */
.msg {
  position: relative;
  max-width: none;                 /* fill the inner container (aligns with breadcrumb, less scrolling) */
  margin-inline: auto;
  background: var(--color-white);
  border: 1px solid var(--color-border-card);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-soft);
  padding: clamp(1.75rem, 5vw, 3.5rem);
  overflow: hidden;
}
/* variant: accent-left — teal edge bar */
.msg--accent-left::before {
  content: "";
  position: absolute;
  left: 0; top: clamp(1.75rem, 5vw, 3.5rem); bottom: clamp(1.75rem, 5vw, 3.5rem);
  width: 5px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
}
.msg__quote {
  display: block;
  font-family: var(--font-display);
  font-size: 5rem;
  line-height: 0.7;
  color: var(--color-primary);
  opacity: 0.25;
  margin-bottom: var(--space-2);
}
.msg__subheading {
  font-family: var(--font-poppins);
  font-weight: 700;
  font-size: var(--fs-h3);
  color: var(--color-heading-alt);
  margin-bottom: var(--space-4);
}
.msg__text { font-size: var(--fs-lg); margin-bottom: var(--space-3); }
.msg__author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-card);
}
.msg__avatar {
  flex-shrink: 0;
  width: 72px; height: 72px;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 3px solid var(--color-white);
  box-shadow: var(--shadow-card);
}
.msg__avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg__name {
  display: block;
  font-family: var(--font-poppins);
  font-weight: 700;
  font-size: var(--fs-h4);
  color: var(--color-heading);
}
.msg__role { display: block; color: var(--color-text-muted); }

/* variant: panel — dark teal, inverted colours */
.msg--panel {
  background: linear-gradient(160deg, var(--color-heading), var(--color-navy-section));
  border-color: transparent;
}
.msg--panel .msg__quote { color: var(--color-white); opacity: 0.3; }
.msg--panel .msg__subheading { color: var(--color-white); }
.msg--panel .msg__text { color: var(--color-text-lavender); }
.msg--panel .msg__author { border-top-color: var(--border-on-dark); }
.msg--panel .msg__name { color: var(--color-white); }
.msg--panel .msg__role { color: var(--color-text-lavender); }

/* variant: centered — author on top, centred */
.msg--centered { text-align: center; }
.msg--centered .msg__quote { margin-inline: auto; }
.msg--centered .msg__author {
  flex-direction: column;
  order: -1;
  margin: 0 0 var(--space-4);
  padding: 0;
  border-top: 0;
}
.msg--centered .msg__body { text-align: left; }

/* Portrait message: photo + message. Image on top by default (and always for
   --top, e.g. the Chairman); --side places it beside the text on wider screens. */
.msg-portrait {
  max-width: none;
  margin-inline: auto;
  display: grid;
  gap: 0;
  background: var(--color-white);
  border: 1px solid var(--color-border-card);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.msg-portrait__media { background: var(--color-bg-light); aspect-ratio: 4 / 3; }
.msg-portrait__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.msg-portrait__content { position: relative; padding: clamp(1.75rem, 5vw, 3.5rem); }
.msg-portrait__author {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-card);
}
.msg-portrait__author .msg__name {
  display: block;
  font-family: var(--font-poppins);
  font-weight: 700;
  font-size: var(--fs-h4);
  color: var(--color-heading);
}
.msg-portrait__author .msg__role { display: block; color: var(--color-text-muted); }
@media (min-width: 768px) {
  .msg-portrait--side { grid-template-columns: minmax(0, 440px) 1fr; align-items: stretch; }
  .msg-portrait--side .msg-portrait__media { aspect-ratio: auto; }
}

/* variant: split-left / split-right — teal author sidebar */
@media (min-width: 768px) {
  .msg--split-left,
  .msg--split-right {
    display: grid;
    gap: 0;
    padding: 0;
    align-items: stretch;
  }
  .msg--split-left  { grid-template-columns: 280px 1fr; }
  /* Author into the narrow (280px) left column; text fills the wide 1fr column.
     Without this the text was squeezed into 280px and the teal author panel
     ballooned to 1fr — a large empty band when there's no portrait photo. */
  .msg--split-left  .msg__author { order: -1; }
  .msg--split-right { grid-template-columns: 1fr 280px; }
  .msg--split-right .msg__author { order: 2; }
  .msg--split-left .msg__main,
  .msg--split-right .msg__main { padding: clamp(1.75rem, 5vw, 3.5rem); }
  .msg--split-left .msg__author,
  .msg--split-right .msg__author {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: var(--space-3);
    margin: 0;
    padding: var(--space-5);
    border-top: 0;
    background: linear-gradient(160deg, var(--color-heading), var(--color-navy-section));
    color: var(--color-white);
  }
  .msg--split-left .msg__avatar,
  .msg--split-right .msg__avatar { width: 96px; height: 96px; }
  .msg--split-left .msg__name,
  .msg--split-right .msg__name { color: var(--color-white); }
  .msg--split-left .msg__role,
  .msg--split-right .msg__role { color: var(--color-text-lavender); }
}

/* Emphasised lead paragraph on content pages */
.content-block__lead {
  font-size: var(--fs-h4);
  color: var(--color-heading-alt);
  line-height: var(--lh-base);
}

/* Placeholder / not-found notice */
.page-notice {
  background: var(--color-bg-pale);
  border: 1px solid var(--color-border-card);
  border-radius: var(--radius-md);
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
}
.page-notice p { font-size: var(--fs-lg); margin-bottom: var(--space-4); }
.page-notice p:last-child { margin-bottom: 0; }

/* Management page — leader cards grid */
.leader-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px var(--space-5);
  margin-top: 56px;
}

/* Contact page */
.contact-map { margin-top: var(--space-6); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-soft); }
.contact-map iframe { display: block; width: 100%; height: clamp(300px, 45vw, 460px); border: 0; }
.contact-list { display: grid; gap: var(--space-4); margin-top: var(--space-4); }
.contact-list li { display: flex; align-items: center; gap: var(--space-3); font-size: var(--fs-lg); }
.contact-list i { color: var(--color-primary); width: 24px; text-align: center; }

/* Long dropdown (About Us) — cap height on desktop */
@media (min-width: 1024px) {
  .submenu { max-height: 80vh; overflow-y: auto; }
  .leader-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 640px) and (max-width: 1023.98px) {
  .leader-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===========================================================================
   SCROLL REVEAL — only when JS is present AND motion is allowed (no FOUC:
   .js is set synchronously in <head> before the body paints).
   =========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .js .section-header,
  .js .about__panelwrap,
  .js .principal__body,
  .js .facility-card,
  .js .leader-card,
  .js .news-item,
  .js .stat,
  .js .tour-tile,
  .js .video-tour__frame,
  .js .reveal-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  .js .is-revealed {
    opacity: 1;
    transform: none;
  }

  /* Inner-page banner: fade-up on load (above the fold, not scroll-triggered) */
  .page-banner__title { animation: bannerRise 0.7s 0.05s ease both; }
  .breadcrumb { animation: bannerRise 0.7s ease both; }
  @keyframes bannerRise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
  }
}

/* ===========================================================================
   RESPONSIVE — mobile-first min-width breakpoints
   =========================================================================== */

/* sm 480 — stats 2-up */
@media (min-width: 480px) {
  .stats__inner { grid-template-columns: repeat(2, 1fr); }
  .news__grid { grid-template-columns: 1fr; }
}

/* md 768 — two-column blocks, facilities 3-up, footer columns */
@media (min-width: 768px) {
  .about__inner { grid-template-columns: minmax(0, 384px) 1fr; }
  /* Desktop: image matches the panel (content) height instead of a fixed ratio */
  .about__media { aspect-ratio: auto; }
  .video-news__inner { grid-template-columns: minmax(0, 34%) 1fr; }

  /* Principal (desktop): full-bleed image, message over the navy right side */
  .principal {
    min-height: clamp(440px, 44vw, 560px);
    display: flex;
    align-items: center;
  }
  .principal__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    z-index: 0;
  }
  .principal::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg, transparent 26%, var(--color-navy-section) 56%);
  }
  .principal__inner { display: grid; grid-template-columns: 1fr 1fr; }
  .principal__body { grid-column: 2; padding-inline-start: clamp(1rem, 3vw, 2.5rem); }
  .news__grid { grid-template-columns: repeat(2, 1fr); }
  .facilities__carousel .carousel__slide { flex-basis: calc((100% - var(--space-4)) / 2); }
  .gallery__grid { column-count: 3; }
  .site-footer__inner { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}

/* lg 1024 — stats 4-up, desktop nav */
@media (min-width: 1024px) {
  .stats__inner {
    grid-template-columns: repeat(4, 1fr);
  }
  .stat:not(:last-child) { border-right: 1px solid var(--color-divider); }
  .facilities__carousel .carousel__slide { flex-basis: calc((100% - 2 * var(--space-4)) / 3); }
  .gallery__grid { column-count: 4; }
}

/* ---- Mobile nav (below lg). No-JS: nav stays visible & stacked. --------- */
@media (max-width: 1023.98px) {
  .navbar__inner { flex-wrap: wrap; }
  /* Stacked mobile nav: solid teal so the white logo + white links stay readable */
  .navbar { background: var(--color-primary); }
  .primary-nav { width: 100%; }
  .primary-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-block: var(--space-2);
  }
  .primary-nav__item { width: 100%; }
  .primary-nav__link,
  .primary-nav__toggle {
    width: 100%;
    justify-content: space-between;
    padding: var(--space-3) var(--space-2);
    color: var(--color-white);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }
  .primary-nav__link:hover,
  .primary-nav__toggle:hover { color: var(--color-white); background: rgba(255, 255, 255, 0.14); }
  .primary-nav__link.is-current::after { display: none; }
  .primary-nav__link.is-current {
    color: var(--color-heading);
    background: var(--color-white);
    border-left: 3px solid var(--color-primary);
    padding-left: var(--space-3);
  }
  /* submenu becomes an inline expandable block */
  .submenu {
    position: static;
    min-width: 0;
    box-shadow: none;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.18);
    padding: 0;
    opacity: 1;
    visibility: hidden;
    height: 0;
    overflow: hidden;
    transform: none;
    transition: none;
  }
  .has-dropdown:focus-within > .submenu,
  .primary-nav__toggle[aria-expanded="true"] + .submenu {
    visibility: visible;
    height: auto;
  }
  .submenu__link { color: var(--color-white); padding-left: var(--space-5); }
  .submenu__link:hover { background: rgba(255, 255, 255, 0.12); }
  /* Active child on mobile: left rule + tinted background, matching the parent cue */
  .submenu__link.is-current,
  .submenu__link.is-current:hover {
    color: var(--color-white);
    background: var(--color-primary);
    border-left: 3px solid var(--color-white);
    padding-left: calc(var(--space-5) - 3px);
  }

  /* With JS: collapse behind the hamburger */
  .js .nav-toggle { display: flex; }
  .js .primary-nav {
    display: none;
    order: 3;
  }
  .js .primary-nav.is-open { display: block; }
}

/* ---- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .tour-tile:hover img,
  .video-tour__play:hover { transform: none; }
}
