/* Public school home page. Builds on school.css tokens. */

html { scroll-behavior: smooth; }
body.home { background: var(--surface); }
.section-inner { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ---------- top bar ---------- */
.home-bar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: .75rem 1.25rem; flex-wrap: wrap;
    min-height: 64px; padding: .6rem 16px; color: var(--text);
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid var(--border);
}
.home-bar .brand { margin-right: auto; }
.home-nav { display: flex; gap: .25rem; }
.home-nav a { color: inherit; text-decoration: none; padding: .35rem .7rem; border-radius: 999px; font-size: .95rem; font-weight: 500; }
.home-nav a:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); }
@media (max-width: 720px) { .home-nav { display: none; } }

/* ---------- hero ---------- */
.hero {
    position: relative; min-height: min(72vh, 600px); display: flex; align-items: flex-end;
    color: #fff; isolation: isolate; overflow: hidden;
    background:
        radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--brand) 55%, #fff) 0%, transparent 60%),
        linear-gradient(135deg, color-mix(in srgb, var(--brand) 85%, #000) 0%, var(--brand) 100%);
}
.hero.has-photo { background: #111 var(--hero-image) center / cover no-repeat; }
.hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(180deg, rgb(0 0 0 / .05) 0%, rgb(0 0 0 / .25) 45%, rgb(0 0 0 / .72) 100%);
}
.hero-inner { width: 100%; max-width: 1120px; margin: 0 auto; padding: 4rem 16px 5.5rem; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.6rem); font-weight: 800; letter-spacing: -.02em; margin: 0 0 .5rem; text-wrap: balance; text-shadow: 0 2px 18px rgb(0 0 0 / .35); }
.hero-eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; opacity: .9; margin: 0 0 .75rem; }
.hero-tagline { font-size: clamp(1.05rem, 2.4vw, 1.35rem); max-width: 40rem; opacity: .95; margin: 0 0 1.5rem; }
.hero-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.hero .btn-primary { background: #fff; border-color: #fff; color: #161816; }
.hero .btn-primary:hover { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.hero-eyebrow::before { content: ""; display: inline-block; width: 22px; height: 2px; margin-right: .6rem; vertical-align: middle; background: var(--brand); }
.btn-ghost { background: rgb(255 255 255 / .12); color: #fff; border-color: rgb(255 255 255 / .45); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgb(255 255 255 / .2); border-color: #fff; }

/* ---------- stats ---------- */
.stats-strip {
    position: relative; z-index: 2; max-width: 880px; margin: -3rem auto 0; padding: 0 16px;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
}
.stats-strip .stat {
    background: var(--surface); padding: 1.25rem 1rem; text-align: center;
    border: 1px solid var(--border); display: flex; flex-direction: column; gap: .15rem;
    box-shadow: 0 10px 30px rgb(0 0 0 / .08);
}
.stats-strip .stat:first-child { border-radius: 18px 0 0 18px; }
.stats-strip .stat:last-child { border-radius: 0 18px 18px 0; }
.stats-strip .stat + .stat { border-left: 0; }
.stat-value { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; line-height: 1.1; color: var(--link); }
.stat-label { color: var(--muted); font-size: .9rem; }

/* ---------- sections ---------- */
.section { padding: 4.5rem 0; }
.section-alt { background: var(--bg); border-block: 1px solid var(--border); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 700; color: var(--link); margin: 0 0 .5rem; }
.section h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); letter-spacing: -.01em; margin-bottom: 1.25rem; }
.prose { font-size: 1.05rem; line-height: 1.7; max-width: 42rem; }
.prose p { margin: 0 0 1rem; }

.about { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 860px) { .about { grid-template-columns: 1.6fr 1fr; align-items: start; } }
.about-side { display: flex; flex-direction: column; gap: .75rem; padding: 1.25rem; border: 1px solid var(--border); border-radius: 18px; background: var(--bg); }
.session-time { display: flex; gap: .75rem; align-items: flex-start; }
.session-dot { width: 10px; height: 10px; margin-top: .45rem; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 20%, transparent); flex: none; }

.session-columns { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.session-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.session-card-head { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem;
    background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 10%, var(--surface)), var(--surface)); }
.session-card-head h3 { margin: 0; font-size: 1.1rem; }
.class-list { list-style: none; margin: 0; padding: 0; }
.class-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1.25rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.class-list li:first-child { border-top: 0; }
.class-name { font-weight: 700; }
.class-teacher { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); }
.teacher-initial { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: .8rem;
    background: color-mix(in srgb, var(--brand) 15%, var(--surface)); color: var(--text); }

/* ---------- find us ---------- */
.find-us { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 960px) { .find-us { grid-template-columns: 1.7fr 1fr; } }
.address { font-size: 1.05rem; line-height: 1.6; }
.phone { font-size: 1.15rem; font-weight: 700; text-decoration: none; }

/* ---------- framed map ---------- */
.map-frame {
    margin: 0; padding: 10px; border-radius: 16px; background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgb(0 0 0 / .06), 0 18px 40px -18px rgb(0 0 0 / .35);
}
.map-head {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap;
    padding: .35rem .5rem .6rem;
}
.map-title { text-transform: uppercase; letter-spacing: .22em; font-size: .78rem; font-weight: 800; color: var(--text); }
.map-coords { font-variant-numeric: tabular-nums; font-size: .8rem; color: var(--muted); letter-spacing: .02em; }
.map-canvas {
    position: relative; border-radius: 10px; overflow: hidden; line-height: 0;
    outline: 1px solid color-mix(in srgb, var(--text) 30%, transparent); outline-offset: 3px;
    box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15);
}
.map-canvas > img { width: 100%; height: auto; display: block; user-select: none; }
@media (prefers-color-scheme: dark) { .map-canvas > img { filter: brightness(.88) contrast(1.05); } }
.map-compass { position: absolute; left: 1.2%; top: 4%; width: 5.5%; min-width: 22px; max-width: 34px; opacity: .85; }
.map-compass .compass-n { fill: #1f2a27; }
.map-compass .compass-s { fill: #fff; stroke: #1f2a27; stroke-width: 1; }
.map-compass text { font: 700 9px system-ui, sans-serif; fill: #1f2a27; }

.map-pin { position: absolute; transform: translate(-50%, -100%); line-height: 1.2; z-index: 2; pointer-events: none; }
.pin-head {
    position: relative; display: grid; place-items: center;
    width: clamp(30px, 6vw, 46px); height: clamp(30px, 6vw, 46px);
    border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
    background: var(--brand); border: 3px solid #fff;
    box-shadow: 0 6px 14px rgb(0 0 0 / .35);
    margin: 0 auto 6px;
}
.pin-head img, .pin-head svg { transform: rotate(45deg); width: 72%; height: 72%; object-fit: contain; border-radius: 50%; background: #fff; }
.pin-head svg { background: transparent; fill: var(--brand-ink); width: 60%; height: 60%; }
.pin-pulse {
    position: absolute; left: 50%; bottom: 0; width: 14px; height: 14px; margin-left: -7px; margin-bottom: -7px;
    border-radius: 50%; background: color-mix(in srgb, var(--brand) 60%, transparent);
    animation: pin-pulse 2.2s ease-out infinite;
}
@keyframes pin-pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(3.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pin-pulse { animation: none; } }
.pin-label {
    position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
    white-space: nowrap; font: 700 .78rem/1.2 system-ui, sans-serif; letter-spacing: .02em;
    padding: .3rem .55rem; border-radius: 6px; background: var(--surface); color: var(--text);
    box-shadow: 0 4px 12px rgb(0 0 0 / .2); border: 1px solid var(--border);
}
.map-editable .map-canvas { cursor: crosshair; }

/* ---------- gallery ---------- */
.gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.gallery-item { all: unset; cursor: zoom-in; display: block; position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface-2); }
.gallery-item:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.gallery-item:hover img { transform: scale(1.04); }
.gallery-caption { position: absolute; inset: auto 0 0; padding: 1.5rem .75rem .6rem; color: #fff; font-size: .88rem; background: linear-gradient(transparent, rgb(0 0 0 / .65)); }
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(1100px, 94vw); }
.lightbox::backdrop { background: rgb(0 0 0 / .85); }
.lightbox img { max-width: 100%; max-height: 80vh; display: block; border-radius: 8px; }
.lightbox-caption { color: #fff; text-align: center; margin: .6rem 0 0; }
.lightbox-close { position: fixed; top: 12px; right: 16px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgb(255 255 255 / .15); color: #fff; font-size: 1.6rem; cursor: pointer; }

/* ---------- footer ---------- */
.home-footer { padding: 2.5rem 0 2rem; border-top: 1px solid var(--border); background: var(--bg); display: grid; gap: 1.25rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
