﻿/* ============================================================================
   pathwaysindex.css - styles for Views/Home/pathwaysindex.cshtml (the proposed
   new homepage, built from new-index-page/pathwaysindex.html).
   Layout: full-screen brand film, then K-12 cards (with photos) above Early
   Years cards, an accreditation logo strip and a one-line footer.
   Palette is limited to black, grey, white and blue; every colour is a token on
   :root so the automatic dark scheme below only has to swap the tokens.
   ============================================================================ */
:root {
    --bg: #FFFFFF;
    --soft: #F4F5F6;
    --ink: #15191E;
    --muted: #5E6670;
    --line: #E4E7EA;
    --accent: #1B2F52;
    --film: #0F1115;
    --on-film: #FFFFFF;
    --f: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
    --ease: cubic-bezier(.2,.75,.2,1);
    color-scheme: light;
}
/* Dark scheme follows the visitor's OS setting (the mockup ships this); an explicit
   data-theme attribute on <html> can force either scheme. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #111417;
        --soft: #181C20;
        --ink: #ECEFF1;
        --muted: #9AA3AC;
        --line: #272C31;
        --accent: #A9BCDB;
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #111417;
    --soft: #181C20;
    --ink: #ECEFF1;
    --muted: #9AA3AC;
    --line: #272C31;
    --accent: #A9BCDB;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font-family: var(--f); font-size: 16px; line-height: 1.6; margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
/* Page gutter: 16px on phones growing to 40px on desktop, content capped at 1180px. */
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); }

/* ---------- Hero: the brand film ----------
   Desktop: fills the whole viewport like the old homepage (100vh; 100svh where supported so the bottom
   controls are not hidden behind a browser toolbar). Tablet (below 881px): fixed 450px like the old page's
   .heightpsg rule. Phones (below 767px): full width, natural 16:9 height, nothing cropped - see the bottom. */
.hero { position: relative; overflow: hidden; background: var(--film); color: var(--on-film); height: 100vh; height: 100svh; min-height: 540px; }
.hero video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); animation: settle 2.6s var(--ease) .1s forwards; }
@keyframes settle { to { transform: scale(1); } }
/* Shown only when the video fails to load (the .noplay class is added by script). */
.hero .fallback { position: absolute; inset: 0; display: none; place-items: center; text-align: center; background: linear-gradient(135deg, #1B2333, #0F1115 60%, #22262D); color: rgba(255,255,255,.7); font-size: 15px; }
.hero.noplay .fallback { display: grid; }
/* Top and bottom shading so the white logo, button and cue stay legible over any frame. */
.hero::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.5) 0%, rgba(0,0,0,0) 26%, rgba(0,0,0,0) 46%, rgba(0,0,0,.72) 100%); }

/* Top bar: Pathways logo (left) and the "Choose a campus" pill (right). */
.bar { position: absolute; top: 0; left: 0; right: 0; z-index: 3; }
.bar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 18px; }
.logo { display: inline-block; line-height: 0; }
/* Same logo widths as the current homepage's .corporate_logo img (175 / 140 / 85px). */
.logo img { width: 175px; height: auto; display: block; }
.bar .enq { font-size: 15px; font-weight: 600; text-decoration: none; border: 1px solid rgba(255,255,255,.6); padding: 10px 18px; border-radius: 999px; transition: background .25s, color .25s; }
.bar .enq:hover { background: #FFFFFF; color: #15191E; }
.bar__actions { display: flex; align-items: center; gap: 12px; }
/* Light/dark toggle: same round glass button as the sound control. Stays visible on phones. */
.theme { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,.55); background: rgba(0,0,0,.3); color: #FFFFFF; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(6px); transition: background .25s, transform .25s; }
.theme:hover { background: rgba(0,0,0,.55); transform: scale(1.06); }
.theme svg { width: 18px; height: 18px; }

/* Bottom-right of the hero: the sound toggle (the h1 beside it is screen-reader only). */
.copy { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; }
.copy .wrap { display: flex; justify-content: flex-end; align-items: flex-end; gap: 24px; padding-block: 0 64px; }
.sound { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,.55); background: rgba(0,0,0,.3); color: #FFFFFF; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(6px); transition: background .25s, transform .25s; }
.sound:hover { background: rgba(0,0,0,.55); transform: scale(1.06); }
.sound svg { width: 18px; height: 18px; }

/* Animated "scroll down" mouse cue, centred at the bottom of the hero. */
.cue { position: absolute; left: 50%; bottom: 20px; z-index: 3; transform: translateX(-50%); width: 26px; height: 40px; border: 1.5px solid rgba(255,255,255,.6); border-radius: 14px; display: flex; justify-content: center; padding-top: 7px; }
.cue::before { content: ""; width: 3px; height: 8px; border-radius: 2px; background: #FFFFFF; animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

/* Screen-reader-only text. */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Simple fade-in used by the hero chrome on load. */
.in { opacity: 0; animation: fadeIn .9s ease forwards; }
@keyframes fadeIn { to { opacity: 1; } }

/* ---------- Campus cards ---------- */
.campuses { padding-block: clamp(56px, 8vw, 104px); }
.group + .group { margin-top: clamp(44px, 6vw, 72px); }
/* Group heading with a hairline that draws itself in when scrolled into view (.seen). */
.group h2 { position: relative; font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 22px; padding-bottom: 12px; }
.group h2::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%; background: var(--line); transform-origin: left; }
.js .group h2::after { transform: scaleX(0); transition: transform 1.1s var(--ease); }
.js .group.seen h2::after { transform: scaleX(1); }
/* Two cards per row; one per row on phones. */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }

.card { display: flex; flex-direction: column; gap: 14px; padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); overflow: hidden; min-width: 0; transition: border-color .3s, transform .35s var(--ease), box-shadow .35s; }
.card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 18px 40px -26px rgba(27,47,82,.4); }
/* Scroll reveal: cards start hidden only when the script has confirmed IntersectionObserver
   support (html.js), so nothing is ever hidden without JavaScript. */
.js .card { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s var(--ease), border-color .3s, box-shadow .35s; }
.js .card.seen { opacity: 1; transform: none; }
.js .card.seen:hover { transform: translateY(-4px); }
/* Cards with a campus photo: the photo bleeds to the card edges above the text. */
.card.has-img { padding-top: 0; }
.photo { position: relative; margin: 0 -28px 6px; aspect-ratio: 16 / 9; max-width: none; background: var(--soft); border-bottom: 1px solid var(--line); overflow: hidden; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s var(--ease); }
.js .card .photo img { transform: scale(1.12); }
.js .card.seen .photo img { transform: scale(1); }
.js .card.seen:hover .photo img { transform: scale(1.05); }
.type { font-size: 13px; color: var(--accent); font-weight: 600; }
.card h3 { font-size: clamp(22px, 2.4vw, 26px); font-weight: 600; letter-spacing: -.015em; line-height: 1.2; margin: 0; }
.card p { margin: 0; color: var(--muted); }
.addr { font-size: 14px; color: var(--muted); }
/* Card footer links: website (accent), WhatsApp, directions. margin-top:auto pins them to the bottom. */
.links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: auto; padding-top: 8px; font-size: 15px; font-weight: 600; }
.links a { text-decoration: none; }
.links a.primary { color: var(--accent); }
.links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ext { display: inline-block; transition: transform .25s; }
.links a:hover .ext { transform: translateX(4px); }

/* ---------- Accreditation strip ----------
   Label on the left, logo tiles on the right (wrapping underneath on narrow screens).
   Each logo sits on a white tile so the coloured marks stay readable in the dark scheme. */
.accr { margin-top: 56px; background: var(--soft); border-radius: 16px; padding: 22px 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; font-size: 14px; color: var(--muted); }
.accr strong { color: var(--ink); font-weight: 600; }
/* flex-basis 320px: the logo row drops below the label when the strip is narrower than label + 320px (phones). */
.accr__logos { flex: 1 1 320px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; list-style: none; margin: 0; padding: 0; }
.accr__logos li { width: 104px; height: 104px; display: grid; place-items: center; padding: 10px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; }
.accr__logos img { display: block; width: auto; height: auto; max-width: 84px; max-height: 84px; }
.js .accr { opacity: 0; transform: translateY(16px); transition: opacity .8s ease, transform .8s var(--ease); }
.js .accr.seen { opacity: 1; transform: none; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 22px 36px; font-size: 14px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .logo img { width: 140px; }
}
/* Film heights below desktop: same breakpoints and values as the old homepage. */
@media (max-width: 881px) {
    .hero { height: 450px; min-height: 0; }
    .copy .wrap { padding-block: 0 32px; }
}
/* Phones: the film is shown whole - full width, natural 16:9 height, no cropping and no gradient -
   so the text inside the film is never cut off. The logo, theme and sound controls overlay it as before. */
@media (max-width: 767px) {
    .hero { height: auto; min-height: 0; }
    .hero video { position: relative; inset: auto; height: auto; aspect-ratio: 16 / 9; display: block; transform: none; animation: none; }
    .hero::after { display: none; }
    .bar .wrap { padding-block: 14px; }
    .copy .wrap { padding-block: 0 16px; }
}
@media (max-width: 760px) {
    .grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .cue { display: none; }
    .bar .enq { display: none; }
    .accr { padding: 18px 20px; justify-content: center; text-align: center; }
    .accr__logos li { width: 88px; height: 88px; }
    .accr__logos img { max-width: 70px; max-height: 70px; }
}
@media (max-width: 480px) {
    .logo img { width: 85px; }
}

/* Respect the visitor's reduced-motion preference: no animations, everything visible. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .hero video { transform: none; }
    .in { opacity: 1; }
    .js .card, .js .accr { opacity: 1; transform: none; }
    .js .card .photo img { transform: none; }
    .js .group h2::after { transform: none; }
}
