:root {
    --cream: #fdf8f2;
    --ink: #2b2420;
    --ink-soft: #6b5f56;
    --terracotta: #d76a3c;
    --terracotta-dark: #b8532a;
    --teal: #1f5a58;
    --teal-dark: #163f3e;
    --gold: #e8b74b;
    --card-bg: #ffffff;
    --border: #ecdfd0;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(43, 36, 32, 0.08);
}

* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

section[id] { scroll-margin-top: var(--header-h, 66px); }

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background: var(--cream);
    color: var(--ink);
    line-height: 1.6;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Public pages only — offsets content for the fixed header below. Admin pages
   don't set --header-h and don't have .site-header, so they're unaffected. */
body.public-body {
    padding-top: var(--header-h, 66px);
}

h1, h2, h3 {
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.2;
    margin: 0 0 0.5em;
    color: var(--teal-dark);
}

p { margin: 0 0 1em; color: var(--ink-soft); }

a { color: var(--terracotta-dark); }

img { max-width: 100%; display: block; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- header / nav ---- */

/* The glass blur lives on this ::before layer rather than directly on
   .site-header. backdrop-filter on an element makes it the "containing
   block" for any position:fixed descendant (per spec) — that broke the
   mobile nav sidebar, which needs position:fixed relative to the real
   viewport, not this ~66px-tall header bar. A ::before pseudo-element
   isn't an ancestor of .main-nav, so it gives the same glass look without
   that side effect. */
.site-header {
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(232, 183, 75, 0.22);
    box-shadow: 0 12px 40px rgba(10, 25, 24, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(22, 63, 62, 0.62), rgba(14, 40, 39, 0.72));
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    padding-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-family: Georgia, serif;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.brand-text span {
    background: linear-gradient(120deg, #f3d88a, var(--gold) 55%, #c8912f);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.text-gold { color: var(--gold); }

.brand-logo {
    height: 48px;
    width: auto;
    display: block;
    object-fit: contain;
}

.main-nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.main-nav a {
    position: relative;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: background 0.2s ease, color 0.2s ease;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 4px;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease;
}

.main-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.main-nav a.active {
    color: #fff;
    background: rgba(232, 183, 75, 0.12);
}

.main-nav a:hover::after, .main-nav a.active::after {
    transform: scaleX(1);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    margin: 0;
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
    /* Pinned to the header's own top-right corner via position:absolute
       (resolved against .site-header, the nearest positioned ancestor) —
       deliberately pulled out of the brand/back-button flex row so it can
       never get crowded or wrapped onto a second line by their text. */
    .mobile-menu-btn {
        display: block;
        position: absolute;
        top: 50%;
        right: 16px;
        transform: translateY(-50%);
        z-index: 56;
    }

    .site-header .container { padding-right: 56px; }

    .main-nav-backdrop {
        position: fixed;
        top: var(--header-h, 66px);
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 39;
        background: rgba(10, 20, 20, 0.45);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .main-nav-backdrop.open {
        opacity: 1;
        pointer-events: auto;
    }

    .main-nav {
        position: fixed;
        top: var(--header-h, 66px);
        right: 0;
        left: auto;
        bottom: 0;
        width: min(78%, 300px);
        z-index: 40;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 22px;
        background: linear-gradient(180deg, rgba(22, 63, 62, 0.7), rgba(14, 40, 39, 0.82));
        backdrop-filter: blur(24px) saturate(160%);
        -webkit-backdrop-filter: blur(24px) saturate(160%);
        border-left: 1px solid rgba(232, 183, 75, 0.18);
        box-shadow: -18px 0 40px rgba(10, 20, 20, 0.3);
        transform: translateX(100%);
        pointer-events: none;
        transition: transform 0.28s ease;
        overflow-y: auto;
    }

    .main-nav.open {
        transform: translateX(0);
        pointer-events: auto;
    }

    .main-nav a {
        font-size: 1rem;
        letter-spacing: 0.06em;
        padding: 15px 18px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.06);
    }

    .main-nav a::after { display: none; }

    .main-nav a.active {
        background: rgba(232, 183, 75, 0.14);
        border-color: rgba(232, 183, 75, 0.3);
    }

    /* The nav itself becomes a fixed side panel below, so its (now-empty)
       second header row shouldn't take up space on mobile. */
    .site-header-split .header-bottom {
        padding: 0;
        border-top: none;
    }
}

/* ---- "split" header: brand + a button back to the other site share the
   top line; that section's own nav sits on its own line underneath, so a
   longer nav never crowds the brand/back-button line. ---- */

.site-header-split .header-bottom {
    padding-top: 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.header-top-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-to-foundation {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    color: #fff;
    text-decoration: none;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: rgba(232, 183, 75, 0.16);
    border: 1px solid rgba(232, 183, 75, 0.45);
    transition: background 0.2s ease, transform 0.15s ease;
}

.back-to-foundation:hover {
    background: rgba(232, 183, 75, 0.3);
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .back-to-foundation { padding: 7px 12px; font-size: 0.78rem; }
}

/* ---- hero / slideshow ---- */

.hero {
    position: relative;
    width: 100%;
    height: 420px;
    overflow: hidden;
    background: var(--teal-dark);
}

@media (min-width: 640px) {
    .hero { height: 520px; }
}

@media (min-width: 1024px) {
    .hero { height: 700px; }
}

/* School hero — desktop/laptop only. A 700px-tall, full-bleed box is much
   wider than most source photos, so a dead-center crop was cutting off
   heads. Scoped to .school-hero (not .hero) so the homepage hero and the
   school hero's own mobile/tablet layout are completely unaffected. */
@media (min-width: 1024px) {
    .school-hero {
        height: clamp(480px, 42vw, 640px);
    }

    .school-hero .hero-slide img,
    .school-hero .hero-slide video {
        object-position: 50% 25%;
    }
}

.hero-slides { position: absolute; inset: 0; }

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.hero-slide.active { opacity: 1; z-index: 1; }

.hero-slide img, .hero-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    background: #000;
}

/* Slow zoom on the active photo for a premium, editorial feel — synced to the 6s autoplay interval */
.hero-slide.active img, .hero-slide.active video { animation: heroKenBurns 6s ease-out forwards; }

@keyframes heroKenBurns {
    from { transform: scale(1); }
    to { transform: scale(1.06); }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: rgba(8, 20, 20, 0.45);
}

.hero-content {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
    color: #fff;
}

.hero-content h1 {
    color: #fff;
    font-size: clamp(2rem, 5vw, 3.4rem);
    margin-bottom: 0.45em;
}

.hero-content p {
    color: #f1ede6;
    font-size: 1.15rem;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions { display: flex; justify-content: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.hero-arrow:hover { background: rgba(255,255,255,0.3); }
.hero-arrow-prev { left: 20px; }
.hero-arrow-next { right: 20px; }

@media (max-width: 640px) {
    .hero-arrow { width: 34px; height: 34px; font-size: 1.2rem; }
    .hero-arrow-prev { left: 10px; }
    .hero-arrow-next { right: 10px; }
}

.hero-empty {
    height: 420px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--teal-dark), var(--teal));
}

@media (min-width: 640px) { .hero-empty { height: 520px; } }
@media (min-width: 1024px) { .hero-empty { height: 700px; } }

/* ---- buttons ---- */

.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s;
}

.btn-primary { background: var(--terracotta); color: #fff; }
.btn-primary:hover { background: var(--terracotta-dark); }
.btn-outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.8); }
.btn-outline:hover { background: rgba(255,255,255,0.15); }
.btn-dark { background: var(--teal-dark); color: #fff; }
.btn-dark:hover { background: var(--teal); }
.btn-small { padding: 7px 14px; font-size: 0.85rem; }
.btn-danger { background: #b23b3b; color: #fff; }

/* ---- about page: fixed banner. Hardcoded static asset, no admin route/control
   exists to remove or replace it — it is not part of the editable slides system. ---- */

.fixed-banner {
    width: 100%;
    line-height: 0;
    background: #c9a877;
}

.fixed-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* ---- page hero (per-page photo slideshow) ---- */

.page-hero {
    position: relative;
    height: min(38vh, 320px);
    min-height: 200px;
    overflow: hidden;
    background: var(--teal-dark);
}

.page-hero-slide {
    position: absolute;
    inset: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transition: opacity 1.4s ease-in-out;
}

.page-hero-slide.active { opacity: 1; }

.page-hero-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--teal-dark);
}

.page-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(22,63,62,0) 55%, rgba(22,63,62,0.55) 100%);
}

.page-hero-dots {
    position: absolute;
    bottom: 14px;
    left: 0; right: 0;
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.page-hero-dots button {
    width: 8px; height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 0;
}

.page-hero-dots button.active { background: var(--gold); width: 20px; border-radius: 5px; }

/* ---- school page: quick nav + extended sections ---- */

.school-quicknav {
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.school-quicknav-inner {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-top: 14px;
    padding-bottom: 14px;
    -webkit-overflow-scrolling: touch;
}

.school-quicknav-inner a {
    flex: 0 0 auto;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--cream);
    color: var(--teal-dark);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.school-quicknav-inner a:hover { background: var(--terracotta); color: #fff; }

.school-highlight-card {
    background: linear-gradient(135deg, var(--teal-dark), var(--teal));
    border-radius: var(--radius);
    padding: 40px;
    color: #fff;
    box-shadow: var(--shadow);
}

.school-highlight-card h2 { color: #fff; }
.school-highlight-card p { color: #e3efee; margin-bottom: 0; }

@media (max-width: 700px) {
    .school-highlight-card { padding: 28px 22px; }
}

/* ---- "coverflow" slideshow: multiple photos visible at once, center one
   large and bright, neighbors peeking at reduced scale/opacity to the sides.
   Deliberately a different visual style from the hero (fade + zoom) and the
   side-slideshow (single box sliding in from the edge). ---- */

.coverflow {
    position: relative;
    height: 440px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--cream);
}

.coverflow-track { position: relative; width: 100%; height: 100%; }

.coverflow-slide {
    position: absolute;
    top: 8%;
    bottom: 8%;
    left: 50%;
    width: 58%;
    margin-left: -29%;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(0,0,0,0.35);
    transition: transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.65s ease;
}

.coverflow-slide img, .coverflow-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    background: #000;
}

.coverflow-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.coverflow-arrow:hover { background: rgba(255,255,255,0.32); }
.coverflow-prev { left: 10px; }
.coverflow-next { right: 10px; }

.coverflow-caption {
    position: absolute;
    left: 0; right: 0;
    bottom: 10px;
    z-index: 20;
    text-align: center;
    color: #fff;
    font-size: 0.95rem;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
    pointer-events: none;
}

@media (max-width: 700px) {
    .coverflow { height: 300px; }
    .coverflow-slide { width: 78%; margin-left: -39%; }
}

/* ---- sections ---- */

section.block { padding: 64px 0; }
section.block.alt { background: #fff; }

.section-head { max-width: 640px; margin-bottom: 32px; }
.section-head p { font-size: 1.05rem; }

.gallery-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.gallery-tab {
    display: inline-block;
    padding: 9px 20px;
    border-radius: 999px;
    background: #fff;
    border: 1.5px solid var(--border);
    color: var(--ink-soft);
    font-weight: 600;
    text-decoration: none;
}
.gallery-tab:hover { border-color: var(--terracotta); color: var(--terracotta-dark); }
.gallery-tab.active { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.gallery-subtabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.gallery-subtab {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--ink-soft);
    font-size: 0.9rem;
    text-decoration: none;
}
.gallery-subtab:hover { border-color: var(--terracotta); color: var(--terracotta-dark); }
.gallery-subtab.active { background: var(--terracotta); border-color: var(--terracotta); color: #fff; }

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

@media (max-width: 800px) {
    .two-col { grid-template-columns: 1fr; }
}

/* ---- shared "side slideshow" component: a box beside a column of text,
   used on the About page (Mission) and the School page (Staff) ---- */

.split-align-start { align-items: start; }

.side-copy h2 { margin-bottom: 0.5em; }
.side-copy p { font-size: 1.05rem; }

.side-slideshow-viewport {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--teal-dark);
}

.side-slide {
    position: absolute;
    inset: 0;
    transform: translateX(100%);
    transition: transform 0.8s cubic-bezier(0.65, 0.05, 0.36, 1);
}

.side-slide.side-slide-current { transform: translateX(0%); z-index: 2; }
.side-slide.side-slide-exit { transform: translateX(-100%); z-index: 1; }
.side-slide.no-transition { transition: none !important; }

.side-slide img, .side-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    background: #000;
}

.side-slide-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: 1.3rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.side-slide-arrow:hover { background: rgba(255,255,255,0.35); }
.side-slide-prev { left: 14px; }
.side-slide-next { right: 14px; }

.side-slideshow-empty {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--teal-dark), var(--teal));
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.75);
    font-size: 0.95rem;
}

@media (max-width: 800px) {
    .side-slideshow-viewport, .side-slideshow-empty { aspect-ratio: 16 / 10; }
}

/* ---- small linked photo grid, used on the Sports page to tease each sport's
   gallery category ---- */
.teaser-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.teaser-grid-item {
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.teaser-grid-item img, .teaser-grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.teaser-grid-item:hover img, .teaser-grid-item:hover video { transform: scale(1.08); }

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.draft-tag {
    display: inline-block;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: #fff3d6;
    color: #8a6512;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
}

/* ---- gallery: featured highlights carousel ---- */

.gallery-feature {
    position: relative;
    height: 420px;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
    background: var(--teal-dark);
}

.gallery-feature-slides { position: absolute; inset: 0; }

.gallery-feature-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.9s ease-in-out;
}

.gallery-feature-slide.active { opacity: 1; z-index: 1; }

.gallery-feature-slide img, .gallery-feature-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    background: #000;
}

.gallery-feature-slide.active img, .gallery-feature-slide.active video { animation: heroKenBurns 5.5s ease-out forwards; }

.gallery-feature-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(8,20,20,0) 45%, rgba(8,20,20,0.78) 100%);
}

.gallery-feature-caption {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 20px;
    z-index: 3;
    color: #fff;
    font-family: Georgia, serif;
    font-size: 1.15rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.gallery-feature-arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.gallery-feature-arrow:hover { background: rgba(255,255,255,0.32); }
.gallery-feature-arrow-prev { left: 16px; }
.gallery-feature-arrow-next { right: 16px; }

@media (max-width: 640px) {
    .gallery-feature { height: 280px; border-radius: 12px; margin-bottom: 28px; }
    .gallery-feature-arrow { width: 34px; height: 34px; font-size: 1.15rem; }
    .gallery-feature-caption { font-size: 1rem; left: 16px; right: 16px; bottom: 14px; }
}

/* ---- gallery: masonry grid ---- */

.gallery-masonry {
    column-count: 4;
    column-gap: 18px;
}

@media (max-width: 1024px) { .gallery-masonry { column-count: 3; } }
@media (max-width: 700px) { .gallery-masonry { column-count: 2; column-gap: 12px; } }
@media (max-width: 420px) {
    .gallery-masonry { column-count: 2; column-gap: 8px; }
    .gallery-masonry figure { margin-bottom: 8px; border-radius: 10px; }
}

.gallery-masonry figure {
    position: relative;
    margin: 0 0 18px;
    break-inside: avoid;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.25s ease;
}

.gallery-masonry figure.reveal-pending { opacity: 0; transform: translateY(24px); }
.gallery-masonry figure.visible { opacity: 1; transform: translateY(0); }

.gallery-masonry figure:hover { box-shadow: 0 16px 34px rgba(43, 36, 32, 0.18); }

.gallery-masonry img, .gallery-masonry video {
    width: 100%;
    display: block;
    background: #000;
    transition: transform 0.6s ease;
}

.gallery-masonry figure:hover img, .gallery-masonry figure:hover video { transform: scale(1.08); }

.gallery-masonry figure::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(8,20,20,0) 55%, rgba(8,20,20,0.75) 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.gallery-masonry figure:hover::before { opacity: 1; }

.gallery-masonry figcaption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 2;
    padding: 16px 16px 14px;
    color: #fff;
    font-size: 0.9rem;
    transform: translateY(10px);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.gallery-masonry figure:hover figcaption { opacity: 1; transform: translateY(0); }

.gallery-masonry .zoom-hint {
    position: absolute;
    top: 50%; left: 50%;
    z-index: 2;
    transform: translate(-50%, -50%) scale(0.7);
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
}

.gallery-masonry figure:hover .zoom-hint { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---- gallery: lightbox ---- */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 14, 14, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.lightbox.open { opacity: 1; pointer-events: auto; }

.lightbox-body {
    max-width: min(90vw, 1100px);
    max-height: 88vh;
    text-align: center;
}

.lightbox-body img, .lightbox-body video {
    max-width: 100%;
    max-height: 76vh;
    width: auto;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    display: block;
    background: #000;
}

.lightbox-caption {
    color: #fff;
    margin-top: 16px;
    font-size: 1rem;
}

.lightbox-counter {
    color: rgba(255,255,255,0.6);
    margin-top: 6px;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
}

.lightbox-close {
    position: absolute;
    top: 18px; right: 22px;
    z-index: 201;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 8px;
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    z-index: 201;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lightbox-arrow:hover { background: rgba(255,255,255,0.22); }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }

@media (max-width: 640px) {
    .lightbox-arrow { width: 40px; height: 40px; font-size: 1.4rem; }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
    .lightbox-close { top: 10px; right: 12px; font-size: 1.9rem; }
}

.empty-state {
    padding: 40px;
    text-align: center;
    color: var(--ink-soft);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

/* ---- footer ---- */

.site-footer {
    background: var(--teal-dark);
    color: #cfe0df;
    margin-top: 40px;
    font-size: 0.92rem;
}

.site-footer a { color: #cfe0df; text-decoration: none; }

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 40px;
    padding-top: 48px;
    padding-bottom: 36px;
}

.footer-brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.footer-logo { height: 40px; width: auto; display: block; }

.footer-brand-text {
    font-family: Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.footer-brand-text span { color: var(--gold); }

.footer-tagline { color: #cfe0df; margin-bottom: 20px; max-width: 320px; }

.footer-social { display: flex; gap: 10px; }

.footer-social a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.footer-social a:hover { background: var(--terracotta); transform: translateY(-2px); }

.footer-col h4 {
    color: #fff;
    font-family: Georgia, serif;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 16px;
}

.footer-col a, .footer-col p {
    display: block;
    color: #cfe0df;
    margin: 0 0 10px;
}

.footer-col a {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-col a svg { flex-shrink: 0; opacity: 0.85; }

.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-col a:hover svg { opacity: 1; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); }

.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 18px;
    padding-bottom: 18px;
    font-size: 0.85rem;
    color: #a9c2c0;
}

.footer-bottom-inner a { color: #a9c2c0; }
.footer-bottom-inner a:hover { color: #fff; }

@media (max-width: 700px) {
    .footer-grid { grid-template-columns: 1fr; gap: 30px; padding-top: 36px; }
    .footer-tagline { max-width: none; }
}

/* ---- flash messages ---- */

.flash {
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 0.92rem;
}

.flash-success { background: #e3f3e1; color: #2b6b2b; }
.flash-error { background: #fbe3e3; color: #a12f2f; }

/* ---- admin ---- */

.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: 220px;
    background: var(--teal-dark);
    color: #fff;
    padding: 24px 16px;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 50;
}

.admin-sidebar a {
    display: block;
    color: #e6f0ef;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 0.92rem;
}

.admin-sidebar a:hover, .admin-sidebar a.active { background: var(--terracotta); color: #fff; }

.admin-sidebar .brand-mini {
    color: #fff;
    font-family: Georgia, serif;
    font-weight: 700;
    margin-bottom: 20px;
    display: block;
}

.admin-sidebar-group {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 18px 0 6px;
    padding: 0 12px;
}

.admin-main { flex: 1; padding: 32px; max-width: 900px; margin-left: 220px; }

/* ---- admin mobile nav (desktop layout above is untouched) ---- */

.admin-topbar {
    display: none;
    align-items: center;
    gap: 14px;
    background: var(--teal-dark);
    color: #fff;
    padding: 12px 16px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 55;
}

.admin-topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: Georgia, serif;
    font-weight: 700;
    font-size: 1.05rem;
}

.admin-topbar-brand img { height: 30px; width: auto; display: block; }

.admin-menu-btn {
    background: none;
    border: none;
    padding: 10px;
    margin: -10px;
    cursor: pointer;
}

.admin-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
    border-radius: 2px;
}

.admin-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 58;
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease;
}

.admin-sidebar-backdrop.open { opacity: 1; pointer-events: auto; }

.admin-sidebar-close { display: none; }

@media (max-width: 767px) {
    .admin-topbar { display: flex; }

    .admin-shell { padding-top: var(--admin-topbar-h, 60px); }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: min(80%, 300px);
        transform: translateX(-100%);
        transition: transform 300ms ease;
        z-index: 60;
        overflow-y: auto;
    }

    .admin-sidebar.open { transform: translateX(0); }

    .admin-sidebar-close {
        display: block;
        position: absolute;
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        background: none;
        border: none;
        color: #fff;
        font-size: 1.8rem;
        line-height: 1;
        cursor: pointer;
    }

    .admin-main {
        max-width: none;
        padding: 20px 16px;
        margin-left: 0;
    }
}

.admin-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--teal-dark), var(--teal));
}

.admin-login-card {
    background: #fff;
    padding: 40px;
    border-radius: var(--radius);
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow);
}

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }

.form-control {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.95rem;
    font-family: inherit;
}

textarea.form-control { min-height: 100px; resize: vertical; }

.password-field { position: relative; }
.password-field input { padding-right: 44px; }

.password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px;
    margin: 0;
    cursor: pointer;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
}

.password-toggle:hover { color: var(--ink); }

.content-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.content-continuation {
    background: var(--cream);
    border: 1px dashed var(--teal);
    border-radius: 8px;
    padding: 14px 16px 4px;
}

.content-continuation .form-hint {
    margin: -4px 0 10px;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.admin-thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.admin-thumb {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: grab;
}

.admin-thumb.dragging { opacity: 0.4; }

.admin-thumb img, .admin-thumb video { width: 100%; height: 140px; object-fit: cover; background: #000; pointer-events: none; }

.admin-thumb-body { padding: 10px 12px; }

.admin-thumb-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

.admin-thumb-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    padding: 4px;
    line-height: 0;
}

.admin-thumb-checkbox input { width: 18px; height: 18px; margin: 0; cursor: pointer; }

.shown-on-page-badge { display: none; }

.admin-thumb-grid.photo-mode .admin-thumb:first-child .shown-on-page-badge {
    display: inline-block;
    margin-bottom: 4px;
}

.admin-thumb-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.admin-thumb-toolbar .admin-thumb-hint { color: var(--ink-soft); font-size: 0.85rem; }

.upload-box {
    background: #fff;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 10px;
}

.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.admin-tab {
    display: inline-block;
    padding: 7px 16px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--ink-soft);
    font-size: 0.92rem;
    text-decoration: none;
}
.admin-tab:hover { border-color: var(--terracotta); color: var(--terracotta-dark); }
.admin-tab.active { background: var(--terracotta); border-color: var(--terracotta); color: #fff; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin: 20px 0; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card .n { font-size: 2rem; font-weight: 700; color: var(--terracotta-dark); }
