/* ==========================================================================
   BSA School front design: "crest and shield".
   Brand colors come ONLY from --primary, --secondary, --accent, --on-primary,
   --on-secondary. They can be any combination, so:
     - text on --primary uses --on-primary, text on --secondary uses --on-secondary;
     - --accent is decoration only (lines, markers), never behind text;
     - body text and headings on white stay neutral.
   Mobile first: base styles are for phones, min-width queries add to them.
   ========================================================================== */

@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/poppins-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/poppins-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/poppins-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Noto Sans Devanagari"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/noto-sans-devanagari.woff2") format("woff2"); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; }

:root {
    --ink: #1a2133;
    --ink-soft: #525a6e;
    --line: #e2e4ea;
    --paper: #ffffff;
    --dark: #121826;
    --radius: 10px;
    --shadow: 0 10px 30px rgba(14, 22, 44, .12);
    --tint: #f5f6f9;
    --tint: color-mix(in srgb, var(--primary) 5%, #ffffff);
    --footer-bg: #121826;
    --footer-bg: color-mix(in srgb, var(--primary) 45%, #070a12);
    /* The shield outline taken from the school crest. */
    --shield: polygon(50% 0, 100% 12%, 100% 62%, 80% 86%, 50% 100%, 20% 86%, 0 62%, 0 12%);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    font-family: "Poppins", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--ink);
    background: var(--paper);
    overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }
picture { display: block; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .6rem; font-weight: 700; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; }
a { color: inherit; text-decoration-color: var(--primary); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 5px #fff; }
[id] { scroll-margin-top: 76px; }

.container { width: min(1160px, 100% - 32px); margin-inline: auto; }
.container.narrow, .narrow { max-width: 820px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 200; background: var(--paper); color: var(--ink); padding: .6rem 1rem; }
.skip-link:focus { left: 8px; top: 8px; }
.muted { color: var(--ink-soft); font-size: .9rem; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    min-height: 46px; padding: .6rem 1.35rem; border: 2px solid transparent; border-radius: 6px;
    font: inherit; font-size: .95rem; font-weight: 600; line-height: 1.3; text-align: center; text-decoration: none; cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary { background: var(--primary); color: var(--on-primary); border-color: rgba(0, 0, 0, .12); }
.btn-gold { background: var(--secondary); color: var(--on-secondary); border-color: rgba(255, 255, 255, .55); box-shadow: 0 0 0 1px rgba(0, 0, 0, .14); }
.btn-outline { background: var(--paper); color: var(--ink); border-color: var(--primary); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }

.shield-icon { display: grid; place-items: center; width: 58px; height: 64px; flex: none; background: var(--primary); color: var(--on-primary); font-size: 1.6rem; clip-path: var(--shield); }

/* ---------- Masthead: crest, school name, admission button ---------- */
.masthead { background: var(--primary); color: var(--on-primary); }
.masthead-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.5rem; padding-block: .7rem; }
.brand { display: flex; align-items: center; gap: .75rem; min-width: 0; flex: 1 1 220px; text-decoration: none; }
.brand-logo { width: auto; max-width: 96px; max-height: 66px; object-fit: contain; flex: none; }
.brand-mark { display: grid; place-items: center; width: 52px; height: 58px; flex: none; background: var(--secondary); color: var(--on-secondary); font-size: 1.5rem; clip-path: var(--shield); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-size: clamp(1.2rem, 5.4vw, 1.9rem); font-weight: 700; line-height: 1.2; letter-spacing: .01em; }
.brand-sub { font-size: .8rem; line-height: 1.4; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }
.masthead-contact { display: none; list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.masthead-contact a { display: flex; align-items: center; gap: .5rem; min-height: 30px; text-decoration: none; }
.masthead-contact a:hover span { text-decoration: underline; text-decoration-color: currentColor; }
/* Phones: the admission button has its own full-width row, always visible. */
.header-admission { width: 100%; }
@media (min-width: 600px) { .header-admission { width: auto; flex: none; } }
@media (min-width: 900px) {
    .masthead-inner { padding-block: .9rem; }
    .brand-logo { max-height: 86px; max-width: 150px; }
    .masthead-contact { display: block; }
}

/* Long email addresses and other unbroken words must wrap, never widen the page. */
.masthead-contact, .footer-contact span, .footer-contact a, .contact-list a { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
@media (min-width: 900px) { .masthead-contact { max-width: 290px; } }

/* ---------- Menu bar (sticky) ---------- */
.navbar { position: sticky; top: 0; z-index: 60; background: var(--paper); border-top: 4px solid var(--secondary); border-bottom: 1px solid var(--line); box-shadow: 0 4px 14px rgba(14, 22, 44, .08); }
.navbar-inner { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 52px; }
.nav-toggle, .navbar-call { display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; padding: 0 .9rem; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s ease; }
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }
.navbar-call { margin-left: auto; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a, .sub-toggle {
    display: flex; align-items: center; justify-content: center; gap: .3rem; width: 100%; height: 100%; min-height: 48px; padding: .55rem .6rem;
    border: 0; background: none; border-radius: 6px; font: inherit; font-size: .95rem; font-weight: 600; line-height: 1.35; text-align: center; color: var(--ink); text-decoration: none; cursor: pointer;
}
.sub-menu { display: none; }
.has-sub.is-open > .sub-menu { display: block; }

/* Phone menu: a two-column grid of tiles. Without JavaScript it stays visible. */
.site-nav { position: absolute; top: 100%; left: 0; right: 0; max-height: var(--nav-space, 70vh); overflow-y: auto; overscroll-behavior: contain; background: var(--paper); border-bottom: 4px solid var(--secondary); box-shadow: var(--shadow); padding: .75rem 16px 1rem; }
.js .site-nav { display: none; }
.js .site-nav.is-open { display: block; }
.site-nav > ul { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.site-nav > ul > li > a, .sub-toggle { border: 1px solid var(--line); background: var(--tint); }
.site-nav a.is-active, .sub-toggle.is-active { box-shadow: inset 0 -3px 0 var(--accent); }
.has-sub.is-open { grid-column: 1 / -1; }
.has-sub > .sub-toggle { height: auto; }
/* Phones: "More" comes after Contact, so opening it does not push Contact far down. */
@media (max-width: 899px) { .site-nav > ul > li.has-sub { order: 1; } }
.sub-menu { padding-top: .5rem; }
.has-sub.is-open > .sub-menu { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem .5rem; }
.sub-menu a { justify-content: flex-start; text-align: left; font-weight: 400; border-bottom: 1px solid var(--line); border-radius: 0; }
html:not(.js) .site-nav { position: static; max-height: none; width: 100%; }
html:not(.js) .sub-menu { display: grid; }
html:not(.js) .has-sub { grid-column: 1 / -1; }
html:not(.js) .nav-toggle { display: none; }
html:not(.js) .navbar { position: static; }
html:not(.js) .navbar-inner { flex-wrap: wrap; }

@media (min-width: 900px) {
    .nav-toggle, .navbar-call { display: none; }
    .site-nav, .js .site-nav, html:not(.js) .site-nav { display: block; position: static; width: 100%; max-height: none; overflow: visible; padding: 0; border: 0; box-shadow: none; }
    .site-nav > ul { display: flex; justify-content: space-between; align-items: stretch; gap: .25rem; }
    .site-nav > ul > li { flex: 1 1 auto; }
    .site-nav > ul > li > a, .sub-toggle { border: 0; background: none; border-radius: 0; white-space: nowrap; }
    .site-nav a:hover, .sub-toggle:hover { background: var(--tint); }
    .site-nav a.is-active, .sub-toggle.is-active { background: var(--tint); }
    .has-sub { position: relative; }
    .has-sub > .sub-toggle { height: 100%; }
    .has-sub.is-open { grid-column: auto; }
    .site-nav .sub-menu { position: absolute; right: 0; top: 100%; width: max-content; min-width: 230px; max-width: 320px; max-height: calc(100vh - 80px); overflow-y: auto; padding: .4rem; background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--secondary); box-shadow: var(--shadow); }
    .site-nav .has-sub.is-open > .sub-menu { display: block; }
    html:not(.js) .site-nav .sub-menu { display: none; }
    html:not(.js) .has-sub:focus-within > .sub-menu, html:not(.js) .has-sub:hover > .sub-menu { display: block; }
    .sub-menu a { min-height: 44px; white-space: normal; }
}

/* ---------- Alert bar ---------- */
.ticker { display: flex; align-items: stretch; background: var(--paper); border-bottom: 2px solid var(--accent); font-size: .92rem; }
.ticker-label { display: flex; align-items: center; padding: .4rem .8rem; background: var(--secondary); color: var(--on-secondary); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.ticker-window { flex: 1; overflow: hidden; display: flex; align-items: center; min-width: 0; }
.ticker-track { display: flex; width: max-content; animation: ticker 36s linear infinite; }
.ticker-track ul { display: flex; list-style: none; margin: 0; padding: 0; }
.ticker-track li { display: flex; align-items: center; white-space: nowrap; padding: 0 1.6rem; position: relative; min-height: 44px; }
.ticker-track li::before { content: ""; position: absolute; left: 0; top: 50%; width: 8px; height: 8px; margin-top: -4px; background: var(--accent); transform: rotate(45deg); }
.ticker-track a { display: flex; align-items: center; min-height: 44px; font-weight: 600; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track, .ticker.is-paused .ticker-track { animation-play-state: paused; }
.ticker-pause { min-width: 44px; border: 0; border-left: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; }
.ticker-pause[aria-pressed="true"] { background: var(--line); }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
    .ticker-track { animation: none; }
    .ticker-window { overflow-x: auto; }
    .ticker-track ul[aria-hidden="true"], .ticker-pause { display: none; }
}

/* ---------- Hero: framed photo beside the text, never text over faces ---------- */
.hero { background: var(--primary); color: var(--on-primary); padding: 1.1rem 0 .6rem; border-bottom: 5px solid var(--secondary); }
.slides { display: grid; }
.slide { grid-area: 1 / 1; display: grid; gap: 1.1rem; align-content: start; min-width: 0; visibility: hidden; opacity: 0; transition: opacity .6s ease, visibility .6s; }
.slide.is-active { visibility: visible; opacity: 1; }
.slide-photo { padding: 5px; background: var(--paper); border: 2px solid var(--secondary); border-radius: var(--radius); box-shadow: 0 14px 34px rgba(0, 0, 0, .3); }
.slide-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 70%; border-radius: 5px; }
.slide-caption { text-align: center; }
.slide-caption h2 { font-size: clamp(1.5rem, 6vw, 2.7rem); line-height: 1.22; }
.slide-caption h2::after { content: ""; display: block; width: 74px; height: 5px; margin: .7rem auto 0; background: var(--secondary); }
.slide-caption p { font-size: 1rem; opacity: .95; }
.hero-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; }
.slider-controls { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: .7rem; }
.slider-arrow { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid currentColor; border-radius: 50%; background: transparent; color: inherit; font-size: 1.2rem; cursor: pointer; }
.slider-dots { display: flex; flex-wrap: wrap; justify-content: center; }
.slider-dots button { width: 32px; height: 44px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; display: grid; place-items: center; }
.slider-dots button::before { content: ""; width: 10px; height: 10px; border-radius: 99px; background: currentColor; opacity: .45; transition: width .2s ease; }
.slider-dots button.is-active::before { width: 22px; opacity: 1; }
@media (min-width: 600px) and (max-width: 899px) { .slide-photo img { aspect-ratio: 16 / 10; } }
@media (min-width: 640px) and (max-width: 899px) and (orientation: landscape), (min-width: 900px) {
    .slide { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 1.5rem; align-items: center; align-content: stretch; }
    .slide-caption { grid-column: 1; grid-row: 1; text-align: left; }
    .slide-photo { grid-column: 2; grid-row: 1; }
    .slide-caption h2::after { margin-inline: 0; }
    .hero-buttons { justify-content: flex-start; }
}
@media (min-width: 900px) {
    .hero { padding-top: 2.25rem; }
    .slide { gap: 3rem; }
    .slide-photo img { aspect-ratio: 3 / 2; max-height: max(300px, 100vh - 330px); }
}

.hero-plain { background: var(--primary); color: var(--on-primary); text-align: center; padding: clamp(3rem, 10vw, 6rem) 0; border-bottom: 5px solid var(--secondary); }
.hero-plain h1 { font-size: clamp(2rem, 6vw, 3.2rem); }

/* ---------- Quick action boxes ---------- */
.quick { padding: 1.75rem 0; background: var(--tint); border-bottom: 1px solid var(--line); }
.quick-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.quick-box { display: flex; align-items: center; gap: 1rem; height: 100%; padding: 1.1rem; background: var(--paper); border: 1px solid var(--line); border-bottom: 4px solid var(--secondary); border-radius: var(--radius); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.quick-box:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.quick-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.45; }
.quick-text strong { font-size: 1.05rem; }
.quick-text span { font-size: .88rem; color: var(--ink-soft); }
.chip-list { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.chip-list a { display: inline-flex; align-items: center; min-height: 44px; padding: .35rem 1.1rem; background: var(--paper); border: 1px solid var(--primary); border-radius: 99px; font-size: .9rem; font-weight: 600; text-decoration: none; }

/* ---------- Sections ---------- */
.section { padding: clamp(2.75rem, 7vw, 4.75rem) 0; }
.section-tinted { background: var(--tint); }
.section-title { font-size: clamp(1.45rem, 4vw, 2.05rem); margin-bottom: 1.5rem; }
.section-title::after { content: ""; display: block; width: 90px; height: 8px; margin-top: .6rem; border-top: 3px solid var(--secondary); border-bottom: 2px solid var(--accent); }
.section-title.is-centered { text-align: center; }
.section-title.is-centered::after { margin-inline: auto; }
.section-intro { max-width: 680px; margin: -.6rem auto 2rem; text-align: center; color: var(--ink-soft); }
.section-more { text-align: center; margin: 2rem 0 0; }
.empty-note { text-align: center; color: var(--ink-soft); padding: 2rem 0; }

/* Director's desk */
.desk-grid { display: grid; gap: 2rem; align-items: center; }
.desk-photo { width: min(300px, 100%); margin-inline: auto; padding: 6px; border: 3px solid var(--secondary); border-radius: 999px 999px var(--radius) var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.desk-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border-radius: 999px 999px 6px 6px; background: var(--tint); }
.desk-quote { margin: 0 0 1.25rem; padding-left: 1.1rem; border-left: 5px solid var(--primary); font-size: clamp(1.1rem, 2.6vw, 1.4rem); }
.desk-quote p { margin: 0; }
.desk-name { display: flex; flex-direction: column; line-height: 1.5; }
.desk-name span { color: var(--ink-soft); font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; }
@media (min-width: 760px) { .desk-grid { grid-template-columns: 300px 1fr; gap: 3.5rem; } }

/* Key features on the brand band */
.section-band { background: var(--primary); color: var(--on-primary); }
.honour-grid { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.honour-grid .card { flex: 1 1 100%; background: var(--paper); color: var(--ink); border-radius: var(--radius); border-top: 4px solid var(--secondary); overflow: hidden; }
.honour-grid .card-body { display: flex; align-items: flex-start; gap: 1rem; padding: 1.2rem; }
@media (min-width: 640px) { .honour-grid .card { flex: 0 1 calc(50% - .5rem); } }
@media (min-width: 980px) { .honour-grid .card { flex-basis: calc(33.333% - .7rem); } }

/* Wings and facilities: numbered steps */
.step-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); counter-reset: step; }
.step-grid .card { counter-increment: step; position: relative; }
.step-grid .card::after { content: counter(step, decimal-leading-zero); display: block; order: -1; padding: .5rem 1.2rem; background: var(--secondary); color: var(--on-secondary); font-weight: 700; letter-spacing: .1em; }
.step-grid .card-body { display: flex; flex-direction: column; gap: .9rem; }

/* Cards */
.card-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); }
.card { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card-image { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card-body { display: block; padding: 1.25rem 1.3rem 1.35rem; min-width: 0; }
.card-body h3, .card-title { display: block; font-size: 1.1rem; font-weight: 700; margin-bottom: .35rem; }
.card-body p:last-child { margin-bottom: 0; color: var(--ink-soft); font-size: .94rem; }
.card-body .shield-icon + div { min-width: 0; }
.card-grid .card-body > .shield-icon { margin-bottom: .9rem; }
.card-link { border-bottom: 4px solid var(--secondary); transition: transform .18s ease, box-shadow .18s ease; }
.card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-link a { text-decoration: none; display: flex; flex-direction: column; height: 100%; }

/* About */
.about-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 880px) { .about-grid { grid-template-columns: 1.1fr 1fr; gap: 3.5rem; } .about-media { order: 2; } }
.about-media { position: relative; }
.about-image { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 6px solid var(--paper); outline: 2px solid var(--secondary); border-radius: var(--radius); box-shadow: var(--shadow); }
.about-badge { position: absolute; right: 0; bottom: -14px; background: var(--primary); color: var(--on-primary); padding: .7rem 1.2rem; border-radius: var(--radius); border: 4px solid var(--paper); font-size: .85rem; text-align: center; }
.about-badge strong { display: block; font-size: 1.4rem; line-height: 1.1; }

/* Counters */
.stats { background: var(--secondary); color: var(--on-secondary); padding: 3rem 0; }
.stats-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 2rem 1rem; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); text-align: center; }
.stats-grid li { display: flex; flex-direction: column; align-items: center; gap: .25rem; min-width: 0; }
.stats-grid .icon { width: 2.2rem; height: 2.2rem; }
.stats-grid strong { font-size: clamp(1.9rem, 5vw, 2.7rem); line-height: 1.15; font-variant-numeric: tabular-nums; }

/* Testimonials */
.quote-row { list-style: none; margin: 0; padding: .25rem .25rem 1rem; display: grid; grid-auto-flow: column; grid-auto-columns: min(360px, 86%); gap: 1.25rem; overflow-x: auto; scroll-snap-type: x mandatory; }
.quote-row > li:first-child { margin-left: auto; }
.quote-row > li:last-child { margin-right: auto; }
.quote-card { scroll-snap-align: start; background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--secondary); border-radius: var(--radius); padding: 1.5rem; display: flex; flex-direction: column; }
.quote-mark { color: var(--primary); font-size: 1.9rem; line-height: 1; }
.rating { color: #e2a100; margin: .5rem 0 0; display: flex; gap: .1rem; }
.quote-card blockquote { margin: .75rem 0 1.25rem; flex: 1; }
.quote-person { display: flex; align-items: center; gap: .75rem; }
.quote-person small { display: block; color: var(--ink-soft); }
.avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-letter { display: grid; place-items: center; background: var(--secondary); color: var(--on-secondary); font-weight: 700; font-size: 1.2rem; }

/* ---------- Gallery: BSA's own design (photo stage, album stacks, print wall) ---------- */
.gallery-wall { background: var(--footer-bg); color: #fff; }
.gallery-wall .section-title { color: #fff; }
.gallery-wall :focus-visible { outline-color: #fff; box-shadow: none; }
.wall-intro { max-width: 680px; margin: 0 auto 2rem; text-align: center; }

/* Home: one large photo, with thumbnails that change it. */
.stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: .8rem; }
.stage-main { display: flex; flex-direction: column; min-width: 0; margin: 0; padding: 6px; background: var(--paper); border-bottom: 6px solid var(--secondary); border-radius: var(--radius); box-shadow: 0 18px 40px rgba(0, 0, 0, .4); }
.stage-open { display: block; width: 100%; padding: 0; border: 0; border-radius: 5px; overflow: hidden; background: var(--dark); cursor: zoom-in; }
.gallery-wall .stage-open:focus-visible { outline: 4px solid var(--ink); outline-offset: -4px; box-shadow: inset 0 0 0 8px #fff; }
/* The whole photo is shown, whatever its shape. */
.stage-open img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.stage-main figcaption { padding: .55rem .5rem .25rem; color: var(--ink); font-size: .92rem; font-weight: 600; line-height: 1.45; text-align: center; }
.stage-reel { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; align-content: start; }
.stage-reel a { display: block; border: 3px solid rgba(255, 255, 255, .22); border-radius: 6px; overflow: hidden; }
.stage-reel a.is-current { border-color: var(--paper); box-shadow: 0 5px 0 var(--secondary); }
.stage-reel img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; opacity: .75; transition: opacity .2s ease; }
.stage-reel a:hover img, .stage-reel a:focus-visible img, .stage-reel a.is-current img { opacity: 1; }
.stage.is-single .stage-reel { display: none; }
@media (min-width: 900px) {
    .stage { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.4rem; align-items: center; }
    .stage.is-single { grid-template-columns: minmax(0, 760px); justify-content: center; }
    .stage-reel img { aspect-ratio: 1; }
}
/* The large photo and its caption must fit on a short screen. */
@media (min-width: 600px) { .stage-open img { max-height: max(220px, 100vh - 180px); } }

/* Gallery page: every album is a stack of photo prints. The first one is featured. */
.album-shelf { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 2.75rem 2.25rem; }
.album-shelf > li { flex: 0 1 340px; min-width: 0; padding: .5rem .5rem 0; }
.album-stack { display: flex; flex-direction: column; height: 100%; text-align: center; text-decoration: none; }
.album-print { position: relative; display: block; isolation: isolate; }
.album-print::before, .album-print::after { content: ""; position: absolute; inset: 0; z-index: -1; border: 5px solid var(--paper); border-radius: 6px; box-shadow: 0 6px 18px rgba(14, 22, 44, .22); transition: transform .2s ease; }
.album-print::before { background: var(--primary); transform: rotate(-3deg); }
.album-print::after { background: var(--secondary); transform: rotate(2.5deg); }
.album-stack:hover .album-print::before { transform: rotate(-4.5deg); }
.album-stack:hover .album-print::after { transform: rotate(4deg); }
.album-print picture { padding: 6px; background: var(--paper); border-radius: 6px; box-shadow: 0 6px 18px rgba(14, 22, 44, .18); }
.album-print img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; }
.album-count { position: absolute; top: -14px; right: -6px; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 62px; height: 70px; padding-bottom: 6px; background: var(--primary); color: var(--on-primary); line-height: 1.1; clip-path: var(--shield); }
.album-count strong { font-size: 1.3rem; }
.album-count small { font-size: .62rem; text-transform: uppercase; letter-spacing: .04em; }
.album-label { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; min-width: 0; padding: 1.4rem .25rem 0; }
.album-title { max-width: 100%; font-size: 1.2rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.album-open { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .3rem 1.2rem; background: var(--paper); border: 2px solid var(--primary); border-radius: 99px; font-size: .9rem; font-weight: 600; }
@media (min-width: 800px) {
    .album-shelf > li:first-child { flex-basis: 100%; }
    .album-shelf > li:first-child .album-stack { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; max-width: 960px; margin-inline: auto; }
    .album-shelf > li:first-child .album-label { padding-top: 0; }
    .album-shelf > li:first-child .album-title { font-size: 1.8rem; }
}

/* Album page: framed prints in columns, so no photo is cropped. */
.print-wall { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: .7rem; }
.print-wall li { break-inside: avoid; padding-bottom: .7rem; }
.print-wall a { display: block; padding: 5px; background: var(--paper); color: var(--ink); border-radius: 6px; text-decoration: none; box-shadow: 0 8px 20px rgba(0, 0, 0, .35); }
.print-wall a:hover { box-shadow: 0 0 0 3px var(--secondary), 0 8px 20px rgba(0, 0, 0, .35); }
.gallery-wall .print-wall a:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 8px var(--secondary); }
.print-wall img { width: 100%; min-height: 60px; border-radius: 3px; background: var(--line); }
.print-caption { display: block; padding: .45rem .25rem .2rem; font-size: .78rem; line-height: 1.45; text-align: center; overflow-wrap: anywhere; }
/* One to three photos: centred, not spread over empty columns. */
.print-wall.is-few { columns: auto; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: .7rem; }
.print-wall.is-few li { flex: 0 1 360px; min-width: 0; padding: 0; }
@media (min-width: 640px) {
    .print-wall { columns: 3; column-gap: 1.1rem; }
    .print-wall li { padding-bottom: 1.1rem; }
    .print-wall a { padding: 8px; }
    .print-caption { font-size: .86rem; }
}
@media (min-width: 1080px) { .print-wall { columns: 4; } }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8, 10, 14, .95); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4rem .75rem; }
.lightbox[hidden] { display: none; }
.lightbox > img { max-width: 100%; max-height: calc(100vh - 11rem); max-height: calc(100dvh - 11rem); min-height: 0; border-radius: 6px; }
.lightbox p { color: #fff; margin: .6rem 0 0; text-align: center; font-size: .9rem; }
.lightbox button { position: absolute; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #161a22; font-size: 1.3rem; cursor: pointer; }
.lightbox .lightbox-close { top: .6rem; right: .6rem; }
.lightbox .lightbox-prev { left: .75rem; bottom: .6rem; }
.lightbox .lightbox-next { right: .75rem; bottom: .6rem; }
.lightbox button[hidden] { display: none; }
.lightbox .lightbox-count:not([hidden]) { position: absolute; top: .6rem; left: .75rem; display: flex; align-items: center; min-height: 46px; margin: 0; font-weight: 600; }
.lightbox-reel { display: none; flex: none; gap: .4rem; max-width: 100%; margin-top: .7rem; padding: 3px; overflow-x: auto; scrollbar-width: none; }
.lightbox-reel::-webkit-scrollbar { display: none; }
.lightbox-reel > :first-child { margin-left: auto; }
.lightbox-reel > :last-child { margin-right: auto; }
.lightbox .lightbox-reel button { position: static; flex: none; width: 56px; height: 46px; padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; background: none; opacity: .55; }
.lightbox .lightbox-reel button.is-current { border-color: #fff; opacity: 1; }
.lightbox-reel img { width: 100%; height: 100%; object-fit: cover; }
/* The thumbnail row needs height; short landscape screens use the arrows only. */
@media (min-height: 560px) {
    .lightbox-reel:not([hidden]) { display: flex; }
    .lightbox > img { max-height: calc(100vh - 15.5rem); max-height: calc(100dvh - 15.5rem); }
}
@media (min-width: 900px) {
    .lightbox { padding-inline: 5rem; }
    .lightbox .lightbox-prev, .lightbox .lightbox-next { top: calc(50% - 23px); bottom: auto; }
}

/* Student corner, notices, events */
.corner-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); align-items: start; }
.corner-panel { min-width: 0; padding: 1.2rem; background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--primary); border-radius: var(--radius); }
.corner-panel > h3 { font-size: 1.15rem; margin-bottom: .9rem; }
.corner-panel > :last-child { margin-bottom: 0; }
.notice-list, .event-list { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .75rem; }
.notice-list li, .event-list li { display: flex; gap: .9rem; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem .9rem; }
.notice-list li > div, .event-list li > div { min-width: 0; }
.notice-list li.is-pinned { border-left: 5px solid var(--accent); }
.notice-list h3, .event-list h3 { font-size: 1rem; margin-bottom: .2rem; }
.notice-list h3 a { display: block; padding-block: .1rem; }
.notice-list p, .event-list p { margin: 0; }
.date-chip { display: flex; flex-direction: column; align-items: center; min-width: 54px; padding: .35rem .4rem; border-radius: 6px; background: var(--secondary); color: var(--on-secondary); font-size: .74rem; text-transform: uppercase; line-height: 1.3; flex: none; }
.date-chip strong { font-size: 1.3rem; line-height: 1.1; }
.tag { display: inline-block; border: 1px solid var(--primary); border-radius: 99px; padding: 0 .55rem; margin-right: .35rem; font-size: .72rem; font-weight: 600; color: var(--ink); }

.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { border-bottom: 1px solid var(--line); }
.link-list li:last-child { border-bottom: 0; }
.link-list a { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 48px; padding: .5rem 0; font-weight: 600; text-decoration: none; }
.link-list a:hover span { text-decoration: underline; }

/* Call to action */
.cta { background: var(--primary); color: var(--on-primary); padding: clamp(2.75rem, 7vw, 4.5rem) 0; border-top: 5px solid var(--secondary); }
.cta h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
.cta-single { text-align: center; max-width: 720px; }
.cta-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) { .cta-grid { grid-template-columns: 1fr 1.1fr; gap: 3.5rem; } }
.cta .enquiry-box { background: var(--paper); color: var(--ink); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); }

/* Forms: one column on phones, 16px text so phones do not zoom in. */
.form-layout { display: grid; gap: 2.5rem; align-items: start; }
.form-layout > * { min-width: 0; }
@media (min-width: 920px) { .form-layout { grid-template-columns: 1fr 1.3fr; gap: 3.5rem; } }
.section .enquiry-box { background: var(--paper); border: 1px solid var(--line); border-top: 5px solid var(--primary); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); }
.enquiry-form { display: grid; gap: .9rem; }
@media (min-width: 620px) {
    .enquiry-form { grid-template-columns: 1fr 1fr; }
    .enquiry-form .field-wide { grid-column: 1 / -1; }
}
.field { min-width: 0; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
.field input, .field textarea { width: 100%; min-height: 46px; padding: .6rem .8rem; border: 1px solid #b5bbc8; border-radius: 6px; font: inherit; font-size: 1rem; color: var(--ink); background: #fff; }
.field input:focus, .field textarea:focus { border-color: var(--ink); }
.field [aria-invalid="true"] { border-color: #b3261e; box-shadow: 0 0 0 2px rgba(179, 38, 30, .18); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.privacy-note { margin: 0; font-size: .83rem; color: var(--ink-soft); flex: 1 1 200px; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.alert { border-radius: 8px; padding: .8rem 1rem; margin-bottom: 1rem; }
.alert ul { margin: 0; padding-left: 1.1rem; }
.alert-success { background: #e7f6ec; color: #14532d; border: 1px solid #a7dbb7; }
.alert-error { background: #fdecea; color: #7f1d1d; border: 1px solid #f3b9b3; }

.contact-list { list-style: none; padding: 0; }
.contact-list li { display: flex; gap: 1rem; margin-bottom: 1.25rem; }
.contact-list li > div { min-width: 0; }
.contact-list .icon { width: 46px; height: 50px; padding: 11px; background: var(--primary); color: var(--on-primary); clip-path: var(--shield); }
.contact-list strong, .contact-list span, .contact-list a { display: block; }
.contact-list a { min-height: 32px; }

.map iframe { display: block; width: 100%; height: clamp(260px, 50vh, 400px); border: 0; }

/* ---------- Inner pages ---------- */
.page-banner { position: relative; background: var(--primary); color: var(--on-primary); padding: clamp(1.5rem, 5vw, 2.75rem) 0; border-bottom: 5px solid var(--secondary); overflow: hidden; }
.page-banner-inner { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.page-banner-text { min-width: 0; }
.page-banner h1 { font-size: clamp(1.55rem, 5vw, 2.5rem); margin: 0; }
.page-banner-note { margin: .35rem 0 0; }
.page-banner .breadcrumb { margin: 0 0 .35rem; font-size: .85rem; }
.page-banner .breadcrumb a { display: inline-block; padding-block: .25rem; text-decoration-color: currentColor; }
.page-banner-crest { display: none; width: auto; max-height: 120px; flex: none; }
@media (min-width: 760px) { .page-banner-crest { display: block; } }
.page-banner.has-image { color: #fff; background: var(--dark); }
.page-banner-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.page-banner.has-image::after { content: ""; position: absolute; inset: 0; background: rgba(8, 10, 15, .66); }

.prose { min-width: 0; }
.prose h2 { font-size: 1.35rem; margin-top: 2rem; }
.prose h3 { font-size: 1.12rem; margin-top: 1.5rem; }
.prose > :first-child { margin-top: 0; }
.prose li { margin-bottom: .35rem; }
.prose img, .prose iframe, .prose video { max-width: 100%; }
.prose table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.prose td, .prose th { border: 1px solid var(--line); padding: .5rem .75rem; text-align: left; }
.prose blockquote { margin-inline: 0; padding-left: 1rem; border-left: 4px solid var(--accent); }

.toc { background: var(--tint); border: 1px solid var(--line); border-left: 5px solid var(--primary); border-radius: var(--radius); padding: 1.1rem 1.3rem; margin-bottom: 2rem; }
.toc h2 { font-size: 1.05rem; }
.toc ol { margin: 0; padding-left: 1.25rem; }
.toc a { display: inline-block; padding-block: .3rem; }
@media (min-width: 640px) { .toc ol { columns: 2; column-gap: 2.5rem; } }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; }
.data-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.data-table th, .data-table td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
.data-table thead th { background: var(--primary); color: var(--on-primary); white-space: nowrap; }
.data-table tbody tr:nth-child(even) { background: var(--tint); }

.people-grid { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem; text-align: center; }
.people-grid li { flex: 0 1 260px; min-width: 0; border: 1px solid var(--line); border-bottom: 4px solid var(--secondary); border-radius: var(--radius); padding: 1.5rem 1rem; }
.people-grid h2 { font-size: 1.05rem; margin-bottom: .2rem; }
.people-grid p { margin: 0; }
.person-photo { width: 130px; height: 130px; margin: 0 auto 1rem; border-radius: 50%; object-fit: cover; object-position: top; border: 4px solid var(--secondary); background: var(--tint); }
.person-placeholder { display: grid; place-items: center; color: var(--ink-soft); font-size: 3rem; }

.download-list { list-style: none; padding: 0; margin: 0 0 2.5rem; display: grid; gap: .6rem; }
.download-list a { display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; border: 1px solid var(--line); border-left: 5px solid var(--primary); border-radius: var(--radius); text-decoration: none; }
.download-list span { flex: 1; font-weight: 600; }
.download-list small { color: var(--ink-soft); }

.pager { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.pager a { display: grid; place-items: center; min-width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; }
.pager a.is-active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

.not-found { text-align: center; }
.not-found-code { font-size: clamp(4rem, 18vw, 8rem); font-weight: 700; line-height: 1; margin: 0; text-shadow: 4px 4px 0 var(--secondary); }

/* ---------- Footer: centred crest, contact strip ---------- */
.site-footer { background: var(--footer-bg); color: #e8eaf1; border-top: 5px solid var(--secondary); font-size: .93rem; text-align: center; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-decoration-color: currentColor; }
.site-footer :focus-visible { outline-color: #fff; box-shadow: none; }
.footer-head { padding-top: 2.5rem; }
.footer-logo { width: auto; max-width: 170px; max-height: 110px; margin: 0 auto .75rem; }
.footer-name { margin: 0; font-size: 1.35rem; font-weight: 700; color: #fff; }
.footer-tagline { margin: .2rem 0 0; opacity: .85; }
.footer-contact { list-style: none; padding: 1.25rem 0; margin: 1.5rem 0 1.25rem; display: grid; gap: 1rem; border-block: 1px solid rgba(255, 255, 255, .18); }
.footer-contact li { display: flex; flex-direction: column; align-items: center; gap: .35rem; min-width: 0; }
.footer-contact li > span { min-width: 0; max-width: 100%; }
.footer-contact .icon { width: 1.5rem; height: 1.5rem; }
.footer-contact a { display: inline-block; padding: .35rem .25rem; }
@media (min-width: 760px) {
    .footer-contact { display: flex; justify-content: center; gap: 0; }
    .footer-contact li { flex: 1 1 0; padding-inline: 1rem; }
    .footer-contact li + li { border-left: 1px solid rgba(255, 255, 255, .18); }
}
.footer-social, .footer-links, .footer-portal, .footer-legal { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; }
.footer-social { gap: .6rem; margin-bottom: 1rem; }
.footer-social a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .1); font-size: 1.15rem; }
.footer-links { gap: 0 .25rem; margin-bottom: 1.25rem; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .75rem; }
.footer-portal { gap: .7rem; padding-bottom: 1.75rem; }
.site-footer .footer-portal a { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .4rem 1.2rem; border: 1px solid rgba(255, 255, 255, .45); border-radius: 6px; font-weight: 600; }
.site-footer .footer-portal a:hover { background: rgba(255, 255, 255, .14); text-decoration: none; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .18); font-size: .84rem; }
.footer-bottom-inner { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding-block: 1rem 5.5rem; } /* room for the WhatsApp button */
.footer-bottom p { margin: 0; }
.footer-legal { gap: 0 1.25rem; }
.footer-legal a { display: inline-flex; align-items: center; min-height: 44px; }
@media (min-width: 1320px) {
    .footer-bottom-inner { flex-direction: row; justify-content: space-between; padding-bottom: 1rem; }
}

/* Floating WhatsApp button (WhatsApp's own green, not a brand color of the school) */
.whatsapp-float { position: fixed; right: 14px; bottom: 14px; z-index: 55; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #1faa53; color: #fff; font-size: 1.8rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.whatsapp-float:hover { filter: brightness(1.07); }

@media print {
    .navbar, .site-footer, .whatsapp-float, .cta, .map { display: none !important; }
}
