/* ============================================================
   Namanga Secondary School Digital Resource Centre
   Stylesheet
   ============================================================ */

:root {
    /* Bright, friendly school palette: deep indigo + sunflower yellow on a
       warm cream background, with green / sky-blue / orange for cards. */
    --navy: #2A1F5E;
    --navy-light: #3B2D80;
    --gold: #FFC82E;
    --gold-dark: #F2A900;
    --cream: #FFF3D9;
    --green: #8CC63F;
    --sky: #1FB0E6;
    --orange: #F05A28;
    --pink: #F06EAA;
    --white: #FFFFFF;
    --light-grey: #FFF8E8;
    --dark-text: #1E1A3A;
    --border-color: #EADFC6;
    --danger: #C62828;
    --success: #2E7D32;
    --radius: 18px;
    --shadow: 0 3px 12px rgba(42, 31, 94, 0.08);
    --shadow-hover: 0 10px 24px rgba(42, 31, 94, 0.18);
    /* Fonts: set here ONCE and used everywhere. Loaded from Google Fonts in
       includes/header.php and includes/admin-header.php. */
    --font-heading: 'Poppins', 'Segoe UI', Roboto, Arial, sans-serif;
    --font-body: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;

    /* Fluid type sizes: grow smoothly from phone to large screen */
    --fs-h1: clamp(1.8rem, 4vw + 0.5rem, 3.2rem);
    --fs-h2: clamp(1.5rem, 2.5vw + 0.5rem, 2.25rem);
    --fs-h3: clamp(1.1rem, 0.6vw + 0.95rem, 1.35rem);
    --fs-body: clamp(0.95rem, 0.3vw + 0.9rem, 1.05rem);

    /* Soft card shadows for the clean card style */
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 12px 30px rgba(42, 31, 94, 0.12);

    /* Vertical space around page sections (smaller on phones, see below) */
    --section-space: 60px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--fs-body);
    color: var(--dark-text);
    background: var(--cream);
    line-height: 1.65;
    /* Never let a too-wide element cause sideways scrolling. "clip" (not
       "hidden") keeps the sticky header working. */
    overflow-x: clip;
}

h1, h2, h3, h4, h5, h6,
.brand-name, .btn, .main-nav a {
    font-family: var(--font-heading);
}
/* Strong but elegant headings: 600, never the heavy 800-900 */
h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.25; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
/* Photos scale down with the screen and keep their shape */
img { max-width: 100%; height: auto; display: block; }

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}
.container.narrow { max-width: 760px; }

/* ---------------- Header / Navbar ---------------- */

.site-header {
    background: var(--navy);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    max-width: 1180px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
}

.brand-logo { height: 58px; width: auto; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 600; font-size: 1.05rem; letter-spacing: 0.3px; color: var(--gold); }
.brand-tagline { font-size: 0.78rem; color: #E6E0FF; white-space: nowrap; }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.nav-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--white);
    border-radius: 2px;
}

.main-nav ul {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.main-nav a {
    color: var(--white);
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 500;
    display: inline-block;
    transition: background 0.15s ease, color 0.15s ease;
}
.main-nav a:hover,
.main-nav a.active {
    background: rgba(255, 200, 46, 0.15);
    color: var(--gold);
}

.nav-search-form {
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: 20px;
    padding: 2px 4px 2px 10px;
    margin-left: 6px;
}
.nav-search-icon {
    display: flex;
    align-items: center;
    color: var(--navy);
    opacity: 0.4;
    margin-right: 4px;
}
.nav-search-form input {
    border: none;
    outline: none;
    font-size: 0.85rem;
    padding: 6px 4px;
    width: 150px;
    background: transparent;
}
.nav-search-form button {
    background: var(--gold);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--navy);
}
.icon-svg-small { width: 16px; height: 16px; }

.nav-auth {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
}
.nav-auth-link {
    color: #cfd8e8;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
}
.nav-auth-link:hover { background: rgba(255, 255, 255, 0.08); color: var(--white); }
.main-nav .nav-auth-register {
    background: var(--gold);
    color: var(--navy);
    font-weight: 700;
    border-radius: 10px;
}
.main-nav .nav-auth-register:hover { background: var(--white); color: var(--navy); }

/* ---------------- Buttons ---------------- */

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    text-align: center;
    transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-light); }
.btn-gold { background: var(--gold); color: var(--navy); box-shadow: 0 3px 0 var(--gold-dark); }
.btn-gold:hover { background: #FFD457; color: var(--navy); }
.btn-outline { background: transparent; color: var(--navy); border: 2px solid var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }
/* Double-chevron "»" after a button label, as in "Learn more »" */
.btn-gold::after,
.category-card .btn::after {
    content: '\00BB';
    color: var(--sky);
    font-weight: 700;
    font-size: 1.25em;
    line-height: 0;
    margin-left: 8px;
    position: relative;
    top: 1px;
}
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #a52d20; }
.btn-large { padding: 14px 32px; font-size: 1rem; }
.btn-small { padding: 6px 12px; font-size: 0.8rem; }

/* ---------------- Hero (homepage) ----------------
   The slideshow photos fill the whole hero. A navy shade on the left fades
   smoothly into the photo so the text in front is always easy to read.
   Layers, back to front: .hero-slideshow -> .hero-shade -> .hero-inner. */

.hero {
    --hero-navy: 27, 21, 80; /* #1B1550, deep brand navy, as R,G,B for rgba() */
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: clamp(540px, 80vh, 700px);
    padding: 80px 20px 120px;
    color: var(--white);
    /* Shown when no slideshow photos have been uploaded yet */
    background:
        radial-gradient(circle at 85% 20%, rgba(31, 176, 230, 0.25) 0, transparent 45%),
        linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
}
/* Wavy cream edge at the bottom of the hero */
.hero::after {
    content: '';
    position: absolute;
    z-index: 3;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 48px;
    background: var(--cream);
    clip-path: ellipse(60% 100% at 50% 100%);
}

.hero-slideshow { position: absolute; inset: 0; z-index: 0; }
.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
}
/* Slow zoom on the visible photo for a gentle, video-like motion */
.hero-slide.active { opacity: 1; animation: heroKenBurns 14s ease-in-out infinite alternate; }
@keyframes heroKenBurns {
    from { transform: scale(1); }
    to   { transform: scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
    .hero-slide.active { animation: none; }
}

/* The navy shade: solid behind the text, fading out into the photo */
.hero-shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(90deg,
            rgba(var(--hero-navy), 0.97) 0%,
            rgba(var(--hero-navy), 0.92) 30%,
            rgba(var(--hero-navy), 0.6) 48%,
            rgba(var(--hero-navy), 0.15) 66%,
            rgba(var(--hero-navy), 0) 80%),
        linear-gradient(to top, rgba(var(--hero-navy), 0.45) 0%, transparent 35%);
}

.hero-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 40px;
}
.hero-content { max-width: 620px; }

.hero-badge {
    display: inline-block;
    margin-bottom: 18px;
    padding: 6px 16px;
    border-radius: 999px;
    background: var(--gold);
    color: var(--navy);
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.hero-title {
    margin: 0 0 16px;
    font-size: clamp(2.2rem, 4.5vw + 0.5rem, 4rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
}
.hero-title span { display: block; }
.hero-title-white { color: var(--white); }
.hero-title-gold { color: var(--gold); }
.hero-motto {
    margin: 0 0 12px;
    font-family: var(--font-heading);
    font-size: clamp(1.05rem, 0.6vw + 0.9rem, 1.35rem);
    font-weight: 500;
    color: var(--white);
}
.hero-text {
    max-width: 470px;
    margin: 0 0 30px;
    color: #E6E0FF;
    line-height: 1.6;
}

.hero-buttons { display: flex; flex-wrap: wrap; gap: 14px; }
.btn-hero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 26px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
}
.btn-hero-gold { background: var(--gold); color: var(--navy); border: 2px solid var(--gold); }
.btn-hero-gold:hover { background: #FFD457; border-color: #FFD457; }
.btn-hero-outline { background: transparent; color: var(--white); border: 2px solid rgba(255, 255, 255, 0.75); }
.btn-hero-outline:hover { background: var(--white); border-color: var(--white); color: var(--navy); }

/* Glass-style navy card at the bottom right of the hero */
.hero-card {
    min-width: 310px;
    padding: 8px 22px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(var(--hero-navy), 0.82);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}
.hero-card li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
}
.hero-card li + li { border-top: 1px solid rgba(255, 255, 255, 0.1); }
.hero-card-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 200, 46, 0.15);
    color: var(--gold);
}
.hero-card-icon .icon-svg { width: 22px; height: 22px; }
.hero-card strong { display: block; font-family: var(--font-heading); font-size: 0.98rem; font-weight: 600; }
.hero-card small { display: block; color: #C9C2EE; font-size: 0.8rem; }

/* Tablets: the text sits over more of the photo, so the shade is stronger,
   and the card becomes a row of three under the buttons. */
@media (max-width: 1023px) {
    .hero { min-height: 0; padding: 64px 20px 100px; }
    .hero-shade {
        background: linear-gradient(90deg,
            rgba(var(--hero-navy), 0.95) 0%,
            rgba(var(--hero-navy), 0.85) 55%,
            rgba(var(--hero-navy), 0.55) 100%);
    }
    .hero-inner { grid-template-columns: 1fr; gap: 32px; }
    .hero-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; min-width: 0; padding: 4px 18px; }
    .hero-card li + li { border-top: 0; }
}
/* Phones: shade from top to bottom, everything stacked */
@media (max-width: 760px) {
    .hero { padding: 48px 16px 84px; }
    .hero-shade {
        background: linear-gradient(180deg,
            rgba(var(--hero-navy), 0.78) 0%,
            rgba(var(--hero-navy), 0.9) 100%);
    }
    .hero-badge { margin-bottom: 14px; }
    .hero-text { margin-bottom: 24px; }
    .hero-buttons { gap: 10px; }
    .hero-buttons .btn-hero { flex: 1 1 auto; padding: 13px 18px; }
    .hero-card { grid-template-columns: 1fr; gap: 0; padding: 4px 18px; }
    .hero-card li { padding: 12px 0; }
    .hero-card li + li { border-top: 1px solid rgba(255, 255, 255, 0.1); }
}
@media (max-width: 420px) {
    .hero-buttons { flex-direction: column; }
    .hero-buttons .btn-hero { width: 100%; }
}

/* ---------------- Resource / category cards ---------------- */

.resource-cards { padding: var(--section-space) 0; }
.section-title {
    text-align: center;
    font-size: var(--fs-h2);
    font-weight: 600;
    color: var(--navy);
    margin: 0 0 36px;
}
/* Short orange accent line under every centred section title */
.section-title::after {
    content: '';
    display: block;
    width: 56px;
    height: 3px;
    margin: 12px auto 0;
    border-radius: 3px;
    background: var(--orange);
}

/* ---------------- "Who are we?" (homepage) ----------------
   One intro card with the text about the school, then three small
   feature cards: 3 columns on computers and tablets, 1 on phones. */
.home-intro { padding: 0 0 var(--section-space); }
.intro-card {
    background: var(--white);
    border-radius: 16px;
    border-left: 4px solid var(--orange);
    padding: clamp(22px, 3vw, 36px);
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
}
.intro-card p { margin: 0 0 14px; line-height: 1.75; }
.intro-card p:last-child { margin-bottom: 0; }
.intro-card a { color: var(--orange); font-weight: 600; }
.intro-card a:hover { text-decoration: underline; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.feature-card {
    --accent: var(--orange);
    background: var(--white);
    border-radius: 14px;
    padding: 24px 22px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature-card:nth-child(2) { --accent: var(--navy-light); }
.feature-card:nth-child(3) { --accent: var(--gold-dark); }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--card-shadow-hover); }
.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 14px;
    border-radius: 12px;
    color: var(--accent);
    /* A light tint of the card's accent colour behind the icon
       (plain cream first, for older phone browsers) */
    background: var(--light-grey);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.feature-icon .icon-svg { width: 24px; height: 24px; }
.feature-title { margin: 0 0 6px; font-size: 1.05rem; font-weight: 600; color: var(--navy); }
.feature-card p { margin: 0; font-size: 0.95rem; line-height: 1.6; color: #4A4566; }
@media (max-width: 700px) { .feature-grid { grid-template-columns: 1fr; gap: 14px; } }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

/* Colourful cards — each card in a grid gets the next colour in turn
   (green, yellow, blue, orange, pink, purple), so every page that uses
   .cards-grid picks this up automatically. */
.category-card {
    --card-bg: var(--green);
    --card-text: var(--navy);
    background: var(--card-bg);
    color: var(--card-text);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 30px 24px 26px;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cards-grid > .category-card:nth-child(6n+2) { --card-bg: var(--gold); }
.cards-grid > .category-card:nth-child(6n+3) { --card-bg: var(--sky); --card-text: var(--white); }
.cards-grid > .category-card:nth-child(6n+4) { --card-bg: var(--orange); --card-text: var(--white); }
.cards-grid > .category-card:nth-child(6n+5) { --card-bg: var(--pink); --card-text: var(--white); }
.cards-grid > .category-card:nth-child(6n+6) { --card-bg: var(--navy-light); --card-text: var(--white); }
.category-card:hover { transform: translateY(-6px) rotate(-0.5deg); box-shadow: var(--shadow-hover); }
.category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    margin: 0 0 8px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.85);
    color: var(--navy);
}
.category-card:hover .category-icon { background: var(--navy); color: var(--gold); }
.category-card .btn {
    margin-top: auto;
    background: var(--gold);
    color: var(--navy);
    border: none;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
}
.cards-grid > .category-card:nth-child(6n+2) .btn { background: var(--white); }
.category-card:hover .btn { background: var(--white); color: var(--navy); }
.icon-svg { width: 28px; height: 28px; }

.form-big-label {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--navy);
    margin: 4px 0;
}

.back-link { color: var(--navy); font-weight: 600; font-size: 0.9rem; }
.back-link:hover { color: var(--orange); }
.section-title-left { color: var(--navy); margin: 16px 0 18px; font-size: 1.3rem; border-bottom: 3px solid var(--gold); padding-bottom: 8px; }

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.section-title-row .section-title-left { margin: 16px 0 0; border-bottom: none; padding-bottom: 0; flex: 1 1 auto; }
.section-title-row::after {
    content: '';
    display: block;
    width: 100%;
    height: 3px;
    background: var(--gold);
    margin-bottom: 18px;
    order: 3;
}

.download-all-btn { display: inline-block; margin-top: 18px; }

.resource-link-list { display: flex; flex-direction: column; gap: 6px; }
.resource-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--white);
    border-radius: 6px;
    box-shadow: var(--shadow);
    padding: 9px 14px;
    transition: box-shadow 0.15s ease, transform 0.1s ease;
}
.resource-link-item:hover { box-shadow: var(--shadow-hover); transform: translateX(2px); }
.resource-link-main { display: flex; flex-direction: column; gap: 2px; }
.resource-link-title { font-weight: 600; color: var(--navy); font-size: 0.88rem; }
.resource-link-meta { display: flex; align-items: center; gap: 6px; }
.resource-link-meta .badge,
.resource-link-meta .file-size { font-size: 0.72rem; }
.resource-link-arrow { font-size: 1.1rem; color: var(--orange); flex-shrink: 0; }

/* ---------------- National exams (theory / practical) ---------------- */

.exam-section { margin-bottom: 44px; }
.exam-subject-group { margin-bottom: 28px; }
.exam-group-title { color: var(--navy); font-size: 1.1rem; margin: 0 0 12px; }
.exam-subject-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
}
.exam-subject-list a {
    display: block;
    background: var(--white);
    border-radius: 6px;
    box-shadow: var(--shadow);
    border-left: 3px solid var(--gold);
    padding: 10px 14px;
    color: var(--navy);
    font-weight: 600;
    font-size: 0.92rem;
    transition: box-shadow 0.15s ease, transform 0.1s ease;
}
.exam-subject-list a:hover { box-shadow: var(--shadow-hover); transform: translateX(2px); color: var(--orange); }

.exam-block {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    margin-bottom: 18px;
}
.exam-block-title { color: var(--navy); font-size: 1.05rem; margin: 0 0 12px; }
.exam-year-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.exam-year {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    background: var(--light-grey);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.9rem;
}
.exam-year-link { color: var(--navy); font-weight: 700; }
.exam-solution-link { color: var(--orange); font-size: 0.82rem; font-weight: 600; }
.exam-year-link:hover,
.exam-solution-link:hover { text-decoration: underline; }

/* ---------------- Pagination ---------------- */

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}
.pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 6px;
    background: var(--white);
    color: var(--navy);
    box-shadow: var(--shadow);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}
.pagination .page-link:hover { background: var(--light-grey); }
.pagination .page-link.active {
    background: var(--navy);
    color: var(--white);
    box-shadow: none;
}
.pagination .page-ellipsis { color: #888; padding: 0 4px; }
.category-card h3 { margin: 0; color: inherit; font-size: 1.4rem; font-weight: 600; }
.category-card p { margin: 0 0 6px; font-size: 0.98rem; color: inherit; opacity: 0.92; }
.card-count { font-size: 0.78rem; font-weight: 700; color: var(--navy); background: rgba(255, 255, 255, 0.75); padding: 3px 12px; border-radius: 12px; margin-bottom: 12px; }
.category-card .form-big-label { color: inherit; }

/* ---------------- Page header / content ---------------- */

.page-header {
    background:
        radial-gradient(circle at 90% 20%, rgba(31, 176, 230, 0.22) 0, transparent 40%),
        linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: var(--white);
    padding: 50px 0 64px;
    text-align: center;
    position: relative;
}
.page-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 30px;
    background: var(--cream);
    clip-path: ellipse(60% 100% at 50% 100%);
}
.page-header h1 { margin: 0 0 8px; color: var(--gold); font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; }
.page-header p { margin: 0; color: #E6E0FF; font-size: 1.05rem; }

.page-search-form {
    display: flex;
    max-width: 500px;
    margin: 20px auto 0;
    gap: 8px;
}
.page-search-form input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 6px;
    border: none;
    font-size: 0.95rem;
}

.page-content { padding: 40px 0 60px; }

.form-section { margin-bottom: 40px; }
.form-section h2 {
    color: var(--navy);
    font-weight: 600;
    border-bottom: 3px solid var(--gold);
    padding-bottom: 8px;
    margin-bottom: 18px;
    font-size: 1.3rem;
}

.empty-state {
    background: var(--white);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    color: #666;
}

/* ---------------- Resource list / item ---------------- */

.resource-list { display: flex; flex-direction: column; gap: 14px; }

.resource-item {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.resource-info h3 { margin: 0 0 4px; color: var(--navy); font-size: 1.05rem; }
.resource-description { margin: 0 0 8px; color: #555; font-size: 0.9rem; }
.resource-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.badge {
    background: var(--navy);
    color: var(--white);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}
.badge-outline { background: var(--light-grey); color: var(--navy); }
.file-size { font-size: 0.78rem; color: #777; }

.resource-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------------- Auth / forms ---------------- */

.auth-card, .upload-form {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    max-width: 520px;
    margin: 0 auto;
}
.auth-card h1, .upload-form + h1 { color: var(--navy); margin-top: 0; }
.muted { color: #666; }

label { display: block; margin: 16px 0 6px; font-weight: 600; font-size: 0.9rem; color: var(--navy); }
input[type="text"], input[type="password"], input[type="number"],
input[type="file"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); }
input:disabled { background: var(--light-grey); color: #888; }

.field-hint { font-size: 0.8rem; color: #777; margin: 4px 0 0; }

/* Password field with a show/hide "eye" toggle button */
.password-field { position: relative; }
.password-field input[type="password"],
.password-field input[type="text"] { padding-right: 42px; }
.password-toggle-btn {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 0;
}
.password-toggle-btn:hover { color: var(--navy); }
.password-toggle-btn .icon-eye-off { display: none; }
.password-toggle-btn.is-visible .icon-eye { display: none; }
.password-toggle-btn.is-visible .icon-eye-off { display: block; }
.password-toggle-btn svg { width: 20px; height: 20px; }

.upload-form button, .auth-card button, .upload-form a { margin-top: 22px; }

/* "Just Uploaded" results — shown after an upload so a Staff account (which
   cannot open Manage Resources) still has a direct way to view/download
   what it just uploaded. */
.uploaded-results {
    max-width: 520px;
    margin: 0 auto 24px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 24px;
}
.uploaded-results h2 { margin: 0 0 12px; font-size: 1.1rem; color: var(--navy); }
.uploaded-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.uploaded-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 12px;
    background: var(--light-grey);
    border-radius: 6px;
}
.uploaded-title { font-weight: 600; font-size: 0.88rem; color: var(--dark-text); flex: 1 1 auto; min-width: 140px; }
.uploaded-actions { display: flex; gap: 6px; flex-shrink: 0; }
.uploaded-actions .btn { margin-top: 0; }

.auth-alt-action {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: #555;
    text-align: center;
}
.auth-alt-action a { color: var(--navy); font-weight: 600; }

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.alert-error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6cb; }
.alert-success { background: #eaf6ec; color: var(--success); border: 1px solid #c3e6cb; }

.error-box { text-align: center; padding: 40px 20px; }
.error-box h2 { color: var(--danger); }

.resource-detail-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
}
.resource-detail-card h1 { color: var(--navy); margin: 12px 0; }
.resource-detail-card .resource-description { color: #555; margin-bottom: 14px; }
.resource-detail-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }

.contact-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-top: 20px;
}
.contact-card .note { color: #888; font-size: 0.85rem; }

/* ---------------- Admin layout (AdminLTE / NECTA PREMS style) ----------------
   Dark fixed sidebar on the left, green top bar, light grey page with white
   cards. The sidebar slides away with the menu button (see admin-footer.php). */

.admin-body {
    --adm-sidebar: #343A40;
    --adm-sidebar-text: #C2C7D0;
    --adm-green: #28A745;
    --adm-green-dark: #218838;
    --adm-blue: #007BFF;
    --adm-card-shadow: 0 0 1px rgba(0, 0, 0, 0.13), 0 1px 3px rgba(0, 0, 0, 0.2);
    background: #F4F6F9;
    margin: 0;
}

.adm-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 250px;
    background: var(--adm-sidebar);
    color: var(--adm-sidebar-text);
    overflow-y: auto;
    z-index: 1040;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s ease;
}
.adm-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 57px;
    padding: 0 16px;
    border-bottom: 1px solid #4B545C;
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.adm-brand-logo { height: 38px; width: auto; }
.adm-menu { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px 30px; }
.adm-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 4px;
    color: var(--adm-sidebar-text);
    font-size: 0.97rem;
    cursor: pointer;
    list-style: none;
}
summary.adm-link::-webkit-details-marker { display: none; }
.adm-link:hover { background: rgba(255, 255, 255, 0.1); color: var(--white); }
.adm-link.active { background: var(--adm-green); color: var(--white); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.adm-link-open { color: var(--white); }
.adm-icon { width: 20px; height: 20px; flex-shrink: 0; }
.adm-caret { width: 16px; height: 16px; margin-left: auto; transition: transform 0.2s ease; }
.adm-group[open] > summary .adm-caret { transform: rotate(-90deg); }
.adm-sublink {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 22px;
    border-radius: 4px;
    color: var(--adm-sidebar-text);
    font-size: 0.92rem;
}
.adm-sublink::before {
    content: '';
    width: 9px;
    height: 9px;
    margin-right: 11px;
    border: 2px solid currentColor;
    border-radius: 50%;
    flex-shrink: 0;
}
.adm-sublink:hover { background: rgba(255, 255, 255, 0.1); color: var(--white); }
.adm-sublink.active { background: rgba(255, 255, 255, 0.9); color: #343A40; }

.adm-main {
    margin-left: 250px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease;
}
.adm-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 57px;
    padding: 0 20px 0 12px;
    background: var(--adm-green);
    color: var(--white);
}
.adm-toggle { display: flex; padding: 6px; background: none; border: 0; color: var(--white); cursor: pointer; border-radius: 4px; }
.adm-toggle:hover { background: rgba(255, 255, 255, 0.15); }
.adm-topbar-school { font-weight: 600; font-size: 0.9rem; letter-spacing: 0.3px; }
.adm-topbar-brand { color: var(--white); font-weight: 700; padding-left: 8px; }
.adm-user { position: relative; margin-left: auto; }
.adm-user summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.adm-user summary::-webkit-details-marker { display: none; }
.adm-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--white);
    color: var(--adm-green);
    font-weight: 700;
}
.adm-user-caret { width: 16px; height: 16px; }
.adm-user-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 14px);
    min-width: 190px;
    padding: 6px 0;
    background: var(--white);
    border-radius: 6px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}
.adm-user-menu a { display: block; padding: 8px 16px; color: #333; }
.adm-user-menu a:hover { background: #F4F6F9; color: var(--adm-blue); }
.adm-user-role { margin: 0 0 4px; padding: 4px 16px 8px; font-size: 0.8rem; color: #888; border-bottom: 1px solid #EEE; }

.admin-content { flex: 1; padding: 22px 26px 40px; }
.admin-content > h1 { margin: 0 0 6px; font-size: 1.8rem; font-weight: 500; color: #343A40; }
.adm-breadcrumb { float: right; margin-top: 10px; font-size: 0.95rem; color: #6C757D; }
.adm-breadcrumb a { color: var(--adm-blue); }
.adm-breadcrumb span { margin: 0 6px; color: #6C757D; }

.adm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 26px;
    background: var(--white);
    border-top: 1px solid #DEE2E6;
    color: #6C757D;
    font-size: 0.9rem;
}
.adm-footer strong { color: #495057; }
.adm-footer-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 4px; background: #6C757D; color: var(--white); }
.adm-footer-btn:hover { background: #5A6268; color: var(--white); }

/* Menu button: hide the sidebar on computers... */
body.adm-sidebar-hidden .adm-sidebar { transform: translateX(-100%); }
body.adm-sidebar-hidden .adm-main { margin-left: 0; }
.adm-overlay { display: none; }
.adm-guest .adm-main { margin-left: 0; }
/* ...and slide it in over the page on phones */
@media (max-width: 900px) {
    .adm-sidebar { transform: translateX(-100%); }
    .adm-main { margin-left: 0; }
    body.adm-sidebar-open .adm-sidebar { transform: none; }
    body.adm-sidebar-open .adm-overlay { display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(0, 0, 0, 0.4); }
    .adm-topbar-school, .adm-user-name { display: none; }
    .admin-content { padding: 18px 16px 30px; }
    .adm-breadcrumb { float: none; display: block; margin: 0 0 8px; }
}

/* Cards, forms and tables inside the admin */
.adm-card { margin-bottom: 22px; background: var(--white); border-radius: 4px; border-top: 3px solid #6C757D; box-shadow: var(--adm-card-shadow); }
.adm-card-head { padding: 12px 20px; border-bottom: 1px solid rgba(0, 0, 0, 0.125); font-weight: 700; color: #343A40; }
.adm-card-body { padding: 20px; }
.admin-body .upload-form,
.admin-body .uploaded-results { max-width: 760px; margin-left: 0; border-radius: 4px; border-top: 3px solid #6C757D; box-shadow: var(--adm-card-shadow); }
.admin-body .table-responsive { border-radius: 4px; border-top: 3px solid #6C757D; box-shadow: var(--adm-card-shadow); }
.admin-body .data-table th { background: #F4F6F9; color: #343A40; border-bottom: 2px solid #DEE2E6; }
.admin-body .data-table td { border-bottom-color: #DEE2E6; }
.admin-body .data-table th, .admin-body .data-table td:not(:first-child) { white-space: nowrap; }
.admin-body .filter-tabs a.active { background: var(--adm-green); }
.admin-body label { color: #343A40; font-weight: 700; }
.admin-body input[type="text"], .admin-body input[type="password"], .admin-body input[type="number"],
.admin-body input[type="file"], .admin-body select, .admin-body textarea { border: 1px solid #CED4DA; border-radius: 4px; }
.admin-body input:focus, .admin-body select:focus, .admin-body textarea:focus { border-color: #80BDFF; box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2); }
.admin-body .btn { border-radius: 4px; }
.admin-body .btn-primary { background: var(--adm-green); }
.admin-body .btn-primary:hover { background: var(--adm-green-dark); }
.admin-body .alert { border-radius: 4px; }

/* Dashboard: coloured stat boxes with a big faded icon and "More info" */
.adm-boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; margin: 18px 0 26px; }
.adm-box { position: relative; overflow: hidden; border-radius: 4px; color: var(--white); box-shadow: var(--adm-card-shadow); }
.adm-box-inner { position: relative; z-index: 1; padding: 16px 18px 22px; }
.adm-box-number { display: block; font-size: 2.3rem; font-weight: 700; line-height: 1.1; }
.adm-box-label { font-size: 1rem; }
.adm-box-icon { position: absolute; top: 12px; right: 14px; width: 72px; height: 72px; opacity: 0.3; transition: transform 0.3s ease; }
.adm-box:hover .adm-box-icon { transform: scale(1.1); }
.adm-box-more { display: block; position: relative; z-index: 1; padding: 5px 0; text-align: center; background: rgba(0, 0, 0, 0.12); color: rgba(255, 255, 255, 0.9); font-size: 0.9rem; }
.adm-box-more:hover { background: rgba(0, 0, 0, 0.2); color: var(--white); }
.adm-box-sky   { background: #17A2B8; }
.adm-box-green { background: #28A745; }
.adm-box-gold  { background: #FFC107; color: #1F2D3D; }
.adm-box-gold .adm-box-more { color: rgba(31, 45, 61, 0.85); }
.adm-box-red   { background: #DC3545; }
.adm-box-navy  { background: var(--navy); }
.adm-box-pink  { background: #E83E8C; }
.adm-box-teal  { background: #20C997; }

.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.filter-tabs-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.filter-tabs-row .filter-tabs { margin-bottom: 0; }

.filter-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filter-tabs a {
    padding: 6px 14px;
    border-radius: 16px;
    background: var(--white);
    box-shadow: var(--shadow);
    font-size: 0.85rem;
    color: var(--navy);
}
.filter-tabs a.active { background: var(--navy); color: var(--white); }

.slides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    margin-top: 16px;
}
.slide-item {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.slide-item img,
.slide-item video { width: 100%; height: 130px; object-fit: cover; display: block; background: #0b1f3a; }
.slide-item-body { padding: 12px 14px; }
.slide-caption { margin: 0 0 6px; font-size: 0.88rem; color: var(--dark-text); min-height: 1.2em; }
.slide-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------- Public Gallery ---------------- */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.gallery-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.gallery-media {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #0b1f3a;
    overflow: hidden;
}
.gallery-media img,
.gallery-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gallery-caption {
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--navy);
}

.table-responsive { overflow-x: auto; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
}
.data-table th { background: var(--navy); color: var(--white); }
.actions-cell { display: flex; gap: 6px; }
.inline-form { display: inline; }

/* ---------------- Footer ---------------- */

.site-footer {
    background: var(--navy);
    color: #E6E0FF;
    margin-top: 40px;
    border-top: 8px solid;
    border-image: linear-gradient(90deg, var(--green) 0 25%, var(--gold) 25% 50%, var(--sky) 50% 75%, var(--orange) 75% 100%) 1;
}
.footer-content {
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
}
.footer-brand strong { color: var(--gold); font-family: var(--font-heading); font-size: 1.15rem; font-weight: 600; }
.site-footer h4 { color: var(--gold); margin: 0 0 12px; font-size: 1.1rem; font-weight: 600; }
.site-footer li { margin-bottom: 6px; }
.site-footer a:hover { color: var(--gold); }
.footer-bottom {
    text-align: center;
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.82rem;
    color: #B9B0E0;
}

/* ---------------- Responsive ---------------- */


@media (max-width: 1100px) {
    .nav-toggle { display: flex; }
    .main-nav {
        display: none;
        width: 100%;
        order: 3;
    }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; align-items: stretch; padding: 10px 0; }
    .nav-search-form { margin: 8px 0 0; }
    .nav-search-form input { width: 100%; }
}

@media (max-width: 768px) {
    .resource-item { flex-direction: column; align-items: flex-start; }
    .resource-actions { width: 100%; }

    .data-table thead { display: none; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table tr { margin-bottom: 12px; border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid var(--border-color);
    }
    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--navy);
        margin-right: 10px;
    }
}

/* ---------------- AI Assistant (floating chat widget) ---------------- */

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.assistant-widget {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 999;
    font-family: var(--font-body);
}
.assistant-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    background: var(--navy);
    color: var(--white);
    border: none;
    border-radius: 999px;
    padding: 12px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(42, 31, 94, 0.35);
    transition: transform 0.15s ease, background 0.15s ease;
}
.assistant-toggle:hover { background: var(--navy-light); transform: translateY(-1px); }
.assistant-toggle:focus-visible,
.assistant-widget button:focus-visible,
.assistant-widget a:focus-visible,
.assistant-messages:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}
.assistant-toggle-icon-open { width: 20px; height: 20px; }
.assistant-toggle-icon-close { width: 20px; height: 20px; display: none; }
.assistant-widget.assistant-open .assistant-toggle-icon-open { display: none; }
.assistant-widget.assistant-open .assistant-toggle-icon-close { display: block; }
.assistant-toggle-label { line-height: 1; }

.assistant-panel[hidden] {
    /* An author-stylesheet class rule normally beats the browser's own
       [hidden] { display:none } default, which would otherwise keep this
       panel visible even after JS sets hidden = true. This rule makes the
       hidden attribute win again. */
    display: none;
}
.assistant-panel {
    position: absolute;
    right: 0;
    bottom: 62px;
    width: 380px;
    max-width: calc(100vw - 36px);
    height: 560px;
    max-height: calc(100vh - 110px);
    max-height: calc(100dvh - 110px);
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(42, 31, 94, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.assistant-panel-header {
    background: var(--navy);
    color: var(--white);
    padding: 12px 12px 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.assistant-panel-heading { min-width: 0; }
.assistant-panel-header strong { display: block; font-family: var(--font-heading); font-size: 0.98rem; }
.assistant-panel-subtitle { display: block; font-size: 0.72rem; color: #d6d0f0; }
.assistant-header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.assistant-lang {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 2px;
}
.assistant-lang-btn {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 0.74rem;
    font-weight: 600;
    padding: 5px 9px;
    border-radius: 999px;
    cursor: pointer;
    min-width: 34px;
}
.assistant-lang-btn[aria-pressed="true"] { background: var(--gold); color: var(--navy); }
.assistant-panel-close {
    background: transparent;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 6px;
    line-height: 0;
    border-radius: 8px;
}
.assistant-panel-close:hover { background: rgba(255, 255, 255, 0.12); }
.assistant-panel-close .icon-svg { width: 18px; height: 18px; }

.assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--light-grey);
    overscroll-behavior: contain;
    position: relative; /* offsetTop of messages is measured from here */
}
.assistant-message {
    max-width: 90%;
    padding: 9px 12px;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.assistant-message p { margin: 0 0 6px; }
.assistant-message p:last-child { margin-bottom: 0; }
.assistant-message ul,
.assistant-message ol { margin: 4px 0 6px; padding-left: 20px; }
.assistant-message ul { list-style: disc; }
.assistant-message ol { list-style: decimal; }
.assistant-message li { margin: 2px 0; }
.assistant-message-bot {
    background: var(--white);
    border: 1px solid var(--border-color);
    color: var(--dark-text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.assistant-message-user {
    background: var(--navy);
    color: var(--white);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    white-space: pre-wrap;
}
.assistant-message-error { border-color: #f1b7b7; background: #fff3f3; color: #8a1f1f; }

.assistant-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    font-size: 0.8rem;
    color: #5b5578;
    background: var(--light-grey);
}
.assistant-typing[hidden] { display: none; }
.assistant-typing-dots { display: inline-flex; gap: 3px; }
.assistant-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--navy);
    opacity: 0.4;
    animation: assistant-bounce 1s infinite ease-in-out;
}
.assistant-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.assistant-typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes assistant-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-4px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .assistant-typing-dots span { animation: none; opacity: 0.8; }
}

.assistant-results {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-self: flex-start;
    width: 92%;
}
.assistant-results-title {
    margin: 2px 0 0;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b6488;
}
.assistant-result-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--gold);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.84rem;
}
.assistant-result-title { font-weight: 600; color: var(--navy); overflow-wrap: anywhere; }
.assistant-result-meta { color: #6B7280; font-size: 0.76rem; }
.assistant-result-desc { color: var(--dark-text); font-size: 0.78rem; }
.assistant-result-actions { display: flex; gap: 14px; margin-top: 3px; }
.assistant-result-actions a,
.assistant-web-link {
    color: var(--orange);
    font-weight: 600;
    font-size: 0.82rem;
    text-decoration: none;
}
.assistant-result-actions a:hover,
.assistant-web-link:hover { text-decoration: underline; }
.assistant-web-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 10px;
    overflow-wrap: anywhere;
}

.assistant-form {
    border-top: 1px solid var(--border-color);
    background: var(--white);
    padding: 8px 10px 6px;
}
.assistant-input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.assistant-input-row textarea {
    flex: 1;
    min-width: 0;
    resize: none;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    font-size: 16px; /* 16px stops iPhones zooming in on focus */
    line-height: 1.35;
    max-height: 120px;
    color: var(--dark-text);
    background: var(--white);
}
.assistant-input-row textarea:focus { outline: none; border-color: var(--navy-light); box-shadow: 0 0 0 3px rgba(59, 45, 128, 0.15); }
.assistant-send-btn {
    background: var(--gold);
    border: none;
    color: var(--navy);
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.assistant-send-btn:hover { background: var(--gold-dark); }
.assistant-send-btn:disabled { opacity: 0.5; cursor: wait; }
.assistant-send-btn .icon-svg { width: 18px; height: 18px; }
.assistant-form-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    font-size: 0.76rem;
    color: #6b6488;
}
.assistant-web-toggle { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.assistant-counter { margin-left: auto; }
.assistant-counter:empty { display: none; }
.assistant-clear-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--navy);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
}
.assistant-counter:not(:empty) + .assistant-clear-btn { margin-left: 0; }
.assistant-clear-btn:hover { background: var(--cream); }
.assistant-disclaimer { margin: 4px 0 0; font-size: 0.68rem; color: #8a84a3; text-align: center; }

@media (max-width: 480px) {
    .assistant-widget { right: 12px; bottom: 12px; }
    .assistant-toggle-label { display: none; }
    .assistant-toggle { padding: 14px; }
    .assistant-widget.assistant-open .assistant-toggle { display: none; }
    .assistant-panel {
        position: fixed;
        inset: 0;
        width: 100%;
        max-width: none;
        height: 100%;
        max-height: none;
        border-radius: 0;
        border: none;
    }
    .assistant-message { max-width: 94%; }
    .assistant-results { width: 100%; }
}

.exam-subject-list .card-count { margin: 0 0 0 8px; font-weight: 500; }

/* ---------------- Navbar dropdown (Our School) ---------------- */

.has-dropdown { position: relative; }
.main-nav .dropdown-trigger { display: inline-flex; align-items: center; gap: 4px; }
.dropdown-caret { width: 16px; height: 16px; stroke-width: 2.5; color: var(--orange); transition: transform 0.15s ease; }
.main-nav .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;
    padding: 8px;
    margin-top: 6px;
    background: var(--white);
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(20, 12, 60, 0.28);
    border-top: 4px solid var(--gold);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    z-index: 200;
}
/* Invisible bridge so the menu doesn't close while the mouse crosses the gap */
.dropdown-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.main-nav .has-dropdown:hover .dropdown-menu,
.main-nav .has-dropdown:focus-within .dropdown-menu { display: flex; }
.has-dropdown:hover .dropdown-caret { transform: rotate(180deg); }
.main-nav .dropdown-menu a {
    display: block;
    color: var(--navy);
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 0.95rem;
}
.main-nav .dropdown-menu a:hover,
.main-nav .dropdown-menu a.active { background: var(--cream); color: var(--orange); }

@media (max-width: 1100px) {
    /* On phones the sub-links simply show indented under "Our School" */
    .main-nav .dropdown-menu {
        position: static;
        display: flex;
        background: transparent;
        box-shadow: none;
        border-top: none;
        border-left: 3px solid var(--gold);
        border-radius: 0;
        margin: 2px 0 6px 14px;
        padding: 0 0 0 6px;
        min-width: 0;
    }
    .dropdown-caret { display: none; }
    .main-nav .dropdown-menu a { color: #E6E0FF; padding: 6px 12px; font-size: 0.9rem; }
    .main-nav .dropdown-menu a:hover,
    .main-nav .dropdown-menu a.active { background: rgba(255, 200, 46, 0.15); color: var(--gold); }
}

/* ---------------- Our School pages ---------------- */

.school-subnav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: -8px 0 44px;
}
.school-subnav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--white);
    color: var(--navy);
    font-family: var(--font-heading);
    font-weight: 500;
    box-shadow: var(--shadow);
    transition: background 0.15s ease, transform 0.12s ease;
}
.school-subnav a:hover { transform: translateY(-2px); }
.school-subnav a.active { background: var(--navy); color: var(--gold); }
.school-subnav .icon-svg { width: 20px; height: 20px; }

.school-section { margin-bottom: 64px; }
.eyebrow {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--orange);
    margin-bottom: 6px;
}
.eyebrow::before { content: '\00BB\00A0'; }
.school-h2 {
    font-size: var(--fs-h2);
    font-weight: 600;
    color: var(--navy);
    line-height: 1.2;
    margin: 0 0 18px;
}
.lead { font-size: 1.12rem; line-height: 1.8; }
.school-section p { line-height: 1.8; }

/* Text beside a framed photo */
.split {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 48px;
    align-items: center;
}
.split.reverse .split-media { order: -1; }
.photo-frame {
    position: relative;
    border-radius: 26px;
    border: 10px solid var(--gold);
    overflow: hidden;
    box-shadow: 0 14px 30px rgba(42, 31, 94, 0.18);
    background: var(--navy);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.photo-frame.tall img { aspect-ratio: 1 / 1; }
.photo-frame.frame-green { border-color: var(--green); }
.photo-frame.frame-sky { border-color: var(--sky); }
.photo-caption {
    position: absolute;
    left: 14px;
    bottom: 14px;
    background: rgba(42, 31, 94, 0.88);
    color: var(--white);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
}

/* Row of big facts on an indigo band */
.facts-band {
    background:
        radial-gradient(circle at 90% 10%, rgba(31, 176, 230, 0.25) 0, transparent 40%),
        var(--navy);
    border-radius: 28px;
    padding: 34px 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
    margin-bottom: 64px;
}
.fact { color: #E6E0FF; text-align: center; }
.fact-value {
    display: block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    color: var(--gold);
    line-height: 1.1;
    margin-bottom: 4px;
}
.fact-label { font-size: 0.92rem; }

/* Mission / vision statement cards */
.statement-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.statement-card {
    border-radius: 26px;
    padding: 34px 32px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.statement-card .icon-svg { width: 46px; height: 46px; margin-bottom: 14px; }
.statement-card h2 { margin: 0 0 12px; font-size: 1.9rem; font-weight: 700; }
.statement-card p { margin: 0; font-size: 1.15rem; line-height: 1.75; position: relative; z-index: 1; }
.statement-mission { background: var(--gold); color: var(--navy); }
.statement-vision { background: var(--sky); color: var(--white); }
.statement-card::after {
    content: '';
    position: absolute;
    right: -40px;
    bottom: -40px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
}

/* Core values */
.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
}
.values-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .values-grid-3 { grid-template-columns: 1fr; } }
.value-card {
    background: var(--white);
    border-radius: 22px;
    padding: 26px 24px;
    box-shadow: var(--shadow);
    border-top: 6px solid var(--green);
}
.value-card:nth-child(6n+2) { border-top-color: var(--gold); }
.value-card:nth-child(6n+3) { border-top-color: var(--sky); }
.value-card:nth-child(6n+4) { border-top-color: var(--orange); }
.value-card:nth-child(6n+5) { border-top-color: var(--pink); }
.value-card:nth-child(6n+6) { border-top-color: var(--navy-light); }
.value-card h3 { margin: 0 0 8px; color: var(--navy); font-size: 1.3rem; font-weight: 600; }
.value-card p { margin: 0; color: #4A4566; line-height: 1.65; }

/* History timeline */
.timeline { position: relative; margin: 0; padding: 0 0 0 34px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 6px;
    bottom: 6px;
    width: 4px;
    border-radius: 4px;
    background: linear-gradient(var(--green), var(--gold), var(--sky), var(--orange));
}
.timeline-item {
    position: relative;
    background: var(--white);
    border-radius: 20px;
    padding: 22px 26px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -32px;
    top: 26px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gold);
    border: 4px solid var(--navy);
}
.timeline-year {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 700;
    background: var(--navy);
    color: var(--gold);
    padding: 3px 14px;
    border-radius: 999px;
    font-size: 0.92rem;
    margin-bottom: 8px;
}
.timeline-item h3 { margin: 0 0 6px; color: var(--navy); font-size: 1.3rem; font-weight: 600; }
.timeline-item p { margin: 0; line-height: 1.7; }

/* Call-to-action band */
.cta-band {
    background: var(--gold);
    border-radius: 28px;
    padding: 36px 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: var(--shadow);
}
.cta-band h2 { margin: 0 0 4px; color: var(--navy); font-size: 1.8rem; font-weight: 700; }
.cta-band p { margin: 0; color: var(--navy); }
.cta-band .btn-primary::after { content: '\00BB'; color: var(--gold); margin-left: 8px; font-weight: 700; }

/* Two photos side by side */
.photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

@media (max-width: 860px) {
    .split, .statement-grid, .photo-pair { grid-template-columns: 1fr; gap: 28px; }
    .split.reverse .split-media { order: 0; }
    .photo-frame.tall img { aspect-ratio: 4 / 3; }
}

/* ---------------- School crest & motto ---------------- */

.footer-logo { height: 72px; width: auto; margin-bottom: 12px; }
.footer-brand strong { display: block; }
.footer-motto { display: block; margin-top: 6px; color: var(--gold); font-size: 0.9rem; }
.about-crest { height: 90px; width: auto; margin-bottom: 14px; }
.motto-band {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
    background: var(--white);
    border-radius: 28px;
    padding: 28px 32px;
    margin-bottom: 28px;
    box-shadow: var(--shadow);
    border: 3px dashed var(--gold);
    text-align: left;
}
.motto-logo { height: 110px; width: auto; }
.motto-text {
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 3vw, 2.1rem);
    font-weight: 700;
    color: var(--navy);
    margin: 0;
    line-height: 1.2;
}
@media (max-width: 480px) {
    .brand-logo { height: 44px; }
    .brand-name { font-size: 0.9rem; }
}

/* ---------------- Full-screen mobile menu ---------------- */

.mobile-nav-head { display: none; }

/* Phones, tablets and small laptops: the menu slides in from the right as a
   compact navy panel; the rest of the page is dimmed behind it (tapping
   the dimmed part closes the menu, see script.js). */
@media (max-width: 1100px) {
    /* Hamburger button: a neat 44px square with three thin bars */
    .nav-toggle {
        width: 44px;
        height: 44px;
        padding: 12px 10px;
        border-radius: 10px;
    }
    .nav-toggle:hover { background: var(--light-grey); }
    .nav-toggle span { height: 3px; border-radius: 3px; }

    .main-nav {
        --panel-width: min(360px, 100%);
        position: fixed;
        inset: 0;
        z-index: 1000;
        display: block;
        overflow-y: auto;
        overscroll-behavior: contain;
        /* Left part = dim backdrop, right part = the navy panel. The panel's
           contents are pushed to the right with padding-left below. */
        background: linear-gradient(to right,
            rgba(15, 10, 40, 0.55) calc(100% - var(--panel-width)),
            #1B1550 calc(100% - var(--panel-width)));
        padding: 0 0 32px calc(100% - var(--panel-width));
        /* Hidden until opened; fades in/out smoothly */
        visibility: hidden;
        opacity: 0;
        transition: opacity 0.25s ease, visibility 0.25s;
    }
    .main-nav.open { visibility: visible; opacity: 1; }
    .main-nav > * { transform: translateX(30px); transition: transform 0.25s ease; }
    .main-nav.open > * { transform: none; }
    body.nav-open { overflow: hidden; }

    /* Panel header: school name + close button */
    .mobile-nav-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 14px 16px 14px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }
    .mobile-nav-head .brand-name { color: var(--gold); font-size: 0.9rem; line-height: 1.3; }
    .nav-close {
        flex-shrink: 0;
        width: 42px;
        height: 42px;
        border: none;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.1);
        color: var(--white);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background 0.15s ease;
    }
    .nav-close:hover { background: var(--gold); color: var(--navy); }
    .nav-close .icon-svg { width: 20px; height: 20px; stroke-width: 2.5; }

    /* Menu items: 16px text, 44px tall rows, thin divider lines */
    .main-nav > ul { gap: 0; padding: 6px 20px 0; }
    .main-nav > ul > li { border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
    .main-nav > ul > li.nav-search,
    .main-nav > ul > li.nav-auth { border-bottom: none; }
    .main-nav > ul > li:not(.nav-auth) > a {
        display: flex;
        align-items: center;
        min-height: 44px;
        font-size: 1rem;
        font-weight: 500;
        padding: 10px 4px;
        border-radius: 0;
        background: none !important; /* beats the pill hover background from the desktop rules */
        color: var(--white);
    }
    .main-nav > ul > li > a:hover { color: var(--gold); }
    .main-nav > ul > li > a.active { color: var(--gold); font-weight: 600; }

    /* Dropdowns open on tap; the small arrow sits at the right edge */
    .main-nav .dropdown-trigger { justify-content: space-between; }
    .dropdown-caret { display: inline-block; width: 18px; height: 18px; margin-left: 8px; }
    .main-nav .has-dropdown .dropdown-menu { display: none !important; }
    .main-nav .has-dropdown.open .dropdown-menu { display: flex !important; }
    .has-dropdown.open .dropdown-caret { transform: rotate(180deg); }
    .main-nav .dropdown-menu { margin: 0 0 8px 4px; }
    .main-nav .dropdown-menu a {
        display: flex;
        align-items: center;
        min-height: 44px;
        font-size: 0.95rem;
        padding: 8px 12px;
    }

    /* Compact search box */
    .nav-search { margin-top: 16px; }
    .nav-search-form { margin: 0; height: 44px; padding: 4px 4px 4px 12px; border-radius: 10px; }
    .nav-search-form input { font-size: 0.95rem; }
    .nav-search-form button { width: 34px; height: 34px; border-radius: 8px; }

    .nav-auth {
        margin: 16px 0 0;
        padding: 16px 0 0;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        gap: 10px;
    }
    .nav-auth-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 0.95rem; padding: 0 16px; }
}
@media (max-width: 1100px) and (prefers-reduced-motion: reduce) {
    .main-nav, .main-nav > * { transition: none; }
}

/* ---------------- Photo lightbox (The Latest) ---------------- */

.gallery-photo-link { cursor: zoom-in; }
.gallery-card { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.gallery-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.gallery-media img { transition: transform 0.4s ease; }
.gallery-card:hover .gallery-media img { transform: scale(1.04); }
.gallery-card .gallery-type {
    display: inline-block;
    margin: 0 14px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--cream);
    color: var(--navy);
    align-self: flex-start;
}

.lightbox[hidden] { display: none; }
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 10, 40, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 70px 16px 60px;
}
.lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 18px;
    text-align: center;
    color: var(--white);
    font-weight: 600;
}
.lightbox-btn {
    position: absolute;
    border: none;
    border-radius: 14px;
    background: var(--gold);
    color: var(--navy);
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}
.lightbox-btn .icon-svg { width: 28px; height: 28px; stroke-width: 3; }
.lightbox-close { top: 14px; right: 14px; }
.lightbox-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 14px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) {
    .lightbox-prev, .lightbox-next { top: auto; bottom: 50px; transform: none; width: 46px; height: 46px; }
}
.lightbox-btn[hidden] { display: none; }

/* Phones and tablets: logo + school name centred in the bar, hamburger on
   the right. The empty first column balances the hamburger so the logo
   sits in the true centre. */
@media (max-width: 1100px) {
    .navbar {
        display: grid;
        grid-template-columns: 44px 1fr 44px;
        align-items: center;
        gap: 8px;
        padding: 10px 16px;
    }
    .brand { grid-column: 2; justify-self: center; min-width: 0; }
    .nav-toggle { grid-column: 3; }
    .brand-logo { height: 50px; }
    .brand-name { font-size: 1rem; }
}
@media (max-width: 480px) {
    /* Small phones: drop the balancing column so the school name gets
       enough room; the logo block stays (almost) centred. */
    .navbar { grid-template-columns: 1fr 44px; }
    .brand { grid-column: 1; gap: 8px; }
    .nav-toggle { grid-column: 2; }
    .brand-logo { height: 36px; }
    .brand-name { font-size: 0.8rem; }
    .brand-tagline { font-size: 0.68rem; }
}
/* Hide the chat button while the menu or a photo is open */
body.nav-open .assistant-widget { display: none; }

/* =====================================================================
   Template-style homepage (white header, open hero photo, photo cards,
   faculty), modelled on the "EduCampus" layout the school chose.
   ===================================================================== */

/* ---- Header: white bar, navy logo and text ---- */
.site-header { background: var(--white); box-shadow: 0 2px 14px rgba(0, 0, 0, 0.08); }
.brand-name { color: var(--navy); }
.brand-tagline { color: var(--orange); }
.nav-toggle span { background: var(--navy); }
@media (max-width: 1100px) {
    .nav-toggle span { background: var(--navy); }
}

/* Laptops and desktops: two rows. Top row = the logo and school name,
   centred, with Staff Login / Register on the right. Bottom row = the menu,
   centred, with full-height items, the current page in an orange block,
   and a square search button that opens a search box under it. */
@media (min-width: 1100.02px) {
    .site-header { border-top: 4px solid var(--navy); }
    .navbar { flex-direction: column; align-items: stretch; max-width: none; padding: 0; }
    .brand { align-self: center; height: 76px; padding: 0 20px; }
    .brand-logo { height: 54px; }
    .brand-name { font-size: 1.15rem; }
    .main-nav { display: flex; justify-content: center; border-top: 1px solid #EEEAF6; }
    .main-nav > ul { min-height: 54px; }
    .main-nav > ul { flex-wrap: nowrap; align-items: stretch; gap: 0; }
    .main-nav > ul > li { display: flex; align-items: stretch; }
    .main-nav > ul > li:not(.nav-auth) > a {
        display: flex;
        align-items: center;
        padding: 0 11px;
        border-radius: 0;
        color: #2B2B2B;
        font-size: 0.88rem;
        font-weight: 600;
        white-space: nowrap;
    }
    .main-nav > ul > li > a:hover { background: transparent; color: var(--orange); }
    .main-nav > ul > li > a.active,
    .main-nav > ul > li > a.active:hover { background: var(--orange); color: var(--white); }
    .main-nav > ul > li > a.active .dropdown-caret { color: var(--white); }
    .main-nav .dropdown-menu { margin-top: 0; border-radius: 0 0 10px 10px; border-top-color: var(--orange); }

    /* Staff Login / Register sit at the right of the logo row, so the
       menu row below has the full width and fits on one line. */
    .nav-auth {
        position: absolute;
        top: 0;
        right: 20px;
        height: 76px;
        margin: 0;
        padding: 0;
        border-left: 0;
        gap: 6px;
    }
    .main-nav > ul > li.nav-auth { align-items: center; }
    .main-nav > ul > li.nav-auth > a { display: inline-block; color: var(--navy); font-size: 0.82rem; font-weight: 600; padding: 7px 12px; border-radius: 8px; }
    .main-nav > ul > li.nav-auth > a:hover { background: var(--light-grey); color: var(--orange); }
    .main-nav > ul > li.nav-auth > a.nav-auth-register { background: var(--orange); color: var(--white); padding: 7px 14px; }
    .main-nav > ul > li.nav-auth > a.nav-auth-register:hover { background: var(--gold); color: var(--navy); }

    .nav-search { position: relative; }
    .nav-search-form { align-self: stretch; height: auto; margin: 0; padding: 0; border-radius: 0; background: transparent; align-items: stretch; }
    .nav-search-icon { display: none; }
    .nav-search-toggle {
        align-items: center;
        justify-content: center;
        width: 70px;
        margin: 0;
        background: var(--gold);
        color: var(--navy);
        cursor: pointer;
    }
    .nav-search-toggle:hover { background: var(--gold-dark); }
    /* The box itself, hidden until the square button is clicked */
    .nav-search-form input,
    .nav-search-form button {
        position: absolute;
        visibility: hidden;
        opacity: 0;
        transition: opacity 0.15s ease;
        z-index: 210;
    }
    .nav-search-form input {
        top: 100%;
        right: 0;
        width: 320px;
        height: 54px;
        padding: 0 56px 0 16px;
        background: var(--white);
        border: 1px solid #E6E6E6;
        border-top: 3px solid var(--gold);
        box-shadow: 0 14px 30px rgba(0, 0, 0, 0.15);
        font-size: 0.95rem;
    }
    .nav-search-form button { top: calc(100% + 11px); right: 10px; border-radius: 4px; }
    .nav-search-form:focus-within input,
    .nav-search-form:focus-within button { visibility: visible; opacity: 1; }
}
.nav-search-toggle { display: none; }
@media (min-width: 1100.02px) { .nav-search-toggle { display: flex; } }
/* Narrower laptops: tighten the menu so it still fits on one line */
@media (min-width: 1100.02px) and (max-width: 1380px) {
    .main-nav > ul > li:not(.nav-auth) > a { padding: 0 9px; font-size: 0.84rem; }
    .nav-search-toggle { width: 58px; }
}
/* Smallest computer screens: a little tighter so "Home" is not cut off */
@media (min-width: 1100.02px) and (max-width: 1240px) {
    .main-nav > ul > li:not(.nav-auth) > a { padding: 0 6px; font-size: 0.82rem; }
}
/* Computer: keep each dropdown item on one line ("Student Result System") */
@media (min-width: 1100.02px) {
    .main-nav .dropdown-menu a { white-space: nowrap; }
}

/* ---- Section subtitle under a centred title ---- */
.section-subtitle {
    text-align: center;
    color: #B49A5E;
    font-size: 1.05rem;
    margin: -26px 0 36px;
}

/* ---- Colour cards (homepage categories, About Us, every "choose a Form" page) ----
   Bright card + big navy title + blue button + a drawing (no photos).
   Colours go in order: orange, yellow, green, sky blue, then again. */
.photo-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 28px;
}
.photo-card {
    --card-bg: #F47920;
    --card-btn: #00AEEF;
    --card-btn-hover: #0093CB;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    padding: 28px 24px 24px;
    background: var(--card-bg);
    border-radius: 20px;
    color: #1E1A4D;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(30, 26, 77, 0.10);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.photo-cards-grid > .photo-card:nth-child(4n+2) { --card-bg: #FFC933; }
.photo-cards-grid > .photo-card:nth-child(4n+3) { --card-bg: #8DC63F; }
.photo-cards-grid > .photo-card:nth-child(4n+4) { --card-bg: #5BC8F5; --card-btn: #1E1A4D; --card-btn-hover: #3B2D80; }
.photo-card:hover { transform: translateY(-5px); box-shadow: 0 14px 28px rgba(30, 26, 77, 0.22); color: #1E1A4D; }
.photo-card:focus-visible { outline: 4px solid #1E1A4D; outline-offset: 3px; }
.photo-card-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.5px;
    color: #1E1A4D;
}
.photo-card-text {
    font-family: var(--font-heading);
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.4;
    color: #1E1A4D;
}
.photo-card-count {
    align-self: flex-start;
    padding: 3px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
    font-size: 0.82rem;
    font-weight: 700;
    color: #1E1A4D;
}
.photo-card-foot {
    margin-top: auto;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 4px;
    padding-top: 4px;
}
.photo-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 9px;
    background: var(--card-btn);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 3px 0 rgba(30, 26, 77, 0.25);
    transition: background 0.15s ease;
}
.photo-card:hover .photo-card-link { background: var(--card-btn-hover); color: #fff; }
.photo-card-chevrons { flex: 0 0 auto; width: 18px; height: 15px; color: #FFC933; }
.photo-card-art {
    flex: 0 0 auto;
    align-self: flex-end;
    width: 100px;
    height: 100px;
    margin: -6px 0 -2px 0;
    transition: transform 0.25s ease;
}
.photo-card:hover .photo-card-art { transform: rotate(-6deg) scale(1.07); }
.photo-credits { text-align: center; font-size: 0.75rem; color: #8A8A8A; margin: 22px 0 0; }
.photo-credits a { color: inherit; text-decoration: underline; }

/* ---- Our Great Faculties ---- */
.faculty-section { background: var(--white); padding: 60px 0 70px; }
.faculty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 260px));
    justify-content: center;
    gap: 30px;
}
.faculty-card { background: var(--white); border: 1px solid #E6E6E6; border-bottom: 3px solid var(--orange); text-align: center; }
.faculty-card img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; }
.faculty-initials {
    display: flex; align-items: center; justify-content: center;
    aspect-ratio: 4 / 5; background: var(--navy); color: var(--gold);
    font-family: var(--font-heading); font-size: 4rem; font-weight: 700; letter-spacing: 2px;
}
.faculty-name { margin: 16px 0 4px; font-size: 1rem; font-weight: 700; text-transform: uppercase; color: #2B2B2B; }
.faculty-role { margin: 0 0 16px; color: var(--orange); font-size: 0.9rem; }

/* =====================================================================
   Responsive polish: phones (320-767px), tablets (768-1023px)
   ===================================================================== */

/* Less empty space around sections on smaller screens */
@media (max-width: 1023px) {
    :root { --section-space: 48px; }
    .faculty-section { padding: 48px 0 56px; }
    .school-section { margin-bottom: 48px; }
    .facts-band, .cta-band { border-radius: 20px; }
}
@media (max-width: 767px) {
    :root { --section-space: 36px; }
    .container { padding: 0 16px; }
    .section-title { margin-bottom: 28px; }
    .section-subtitle { margin: -18px 0 28px; }
    .faculty-section { padding: 36px 0 44px; }
    .school-section { margin-bottom: 36px; }
    .facts-band { padding: 26px 20px; margin-bottom: 40px; }
    .cta-band { padding: 26px 22px; }
    .statement-card { padding: 26px 22px; }
    .split { gap: 24px; }
    .photo-cards-grid { gap: 20px; }
    .photo-card { min-height: 0; padding: 24px 20px 20px; }
    .photo-card-title { font-size: 1.55rem; }
    .photo-card-art { width: 84px; height: 84px; }
    .motto-band { padding: 22px 18px; }
    .page-header { padding: 34px 0 48px; }
}


/* ============================================================
   Download the App page (download-app.php)
   ============================================================ */
.app-download { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: center; }
.app-step-number {
    flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%;
    background: var(--navy); color: var(--gold); font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.app-download-qr {
    display: flex; flex-wrap: wrap; gap: 24px; align-items: center;
    background: var(--white); border: 1px solid var(--border-color);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
.app-qr-frame { position: relative; width: 220px; height: 220px; flex: 0 0 auto; }
.app-qr-frame img:first-child { width: 220px; height: 220px; display: block; }
.app-qr-logo {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 52px; height: 52px; background: var(--white); border-radius: 10px; padding: 3px;
}
.app-qr-caption { margin: 0 0 12px; font-weight: 700; color: var(--navy); font-size: 1.1rem; }
.app-qr-text .note { margin: 12px 0 0; }
.app-phone-frame {
    border: 10px solid #1E1A3A; border-radius: 36px; overflow: hidden;
    box-shadow: var(--shadow-hover); background: #1E1A3A;
}
.app-phone-frame img { display: block; width: 100%; height: auto; }

@media (max-width: 1023px) {
    .app-download { grid-template-columns: 1fr; gap: 32px; }
    .app-download-phone { max-width: 260px; margin: 0 auto; }
}
@media (max-width: 480px) {
    .app-download-qr { justify-content: center; text-align: center; }
}

/* Download the App page: bilingual install guide */
.app-en { color: #6B6588; font-size: 0.92em; }
.app-trust {
    margin-top: 24px; padding: 18px 20px; border-radius: var(--radius);
    background: var(--cream); border-left: 5px solid var(--green);
}
.app-trust h3 { margin: 0 0 8px; color: var(--navy); font-size: 1.05rem; }
.app-trust p { margin: 0; }
.app-install-steps {
    list-style: none; margin: 24px 0 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px;
}
.app-install-step {
    position: relative; background: var(--white); border: 1px solid var(--border-color);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px 16px;
}
.app-install-step .app-step-number { position: absolute; top: -14px; left: 14px; }
.app-install-step img { display: block; width: 100%; height: auto; border-radius: 12px; margin: 6px 0 12px; background: #1E1A3A; }
.app-install-step h3 { margin: 0 0 6px; color: var(--navy); font-size: 1.02rem; }
.app-install-step p { margin: 0 0 6px; }

/* ---- The Latest: photo albums by event, album photos, videos (owner 2026-11-07) ----
   Like the reference: rounded photo cards, the event date and a big bold
   name written ON the photo, first album big on the left. */
.album-wall,
.photo-wall {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 260px;
    grid-auto-flow: dense;
    gap: 22px;
}
.album-card,
.photo-tile,
.video-tile {
    position: relative;
    display: block;
    overflow: hidden;
    margin: 0;
    border-radius: 22px;
    border: 3px solid var(--white);
    background: #1E1A3A;
    box-shadow: 0 10px 28px rgba(42, 31, 94, 0.16);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.album-card:hover,
.photo-tile:hover { transform: translateY(-4px) rotate(-0.4deg); box-shadow: 0 16px 36px rgba(42, 31, 94, 0.24); }
.album-card img,
.photo-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}
.album-card:hover img,
.photo-tile:hover img { transform: scale(1.05); }
.album-card:first-child,
.photo-tile:first-child { grid-column: span 2; grid-row: span 2; }
.photo-tile:nth-child(7n + 5) { grid-column: span 2; }
.photo-tile { cursor: zoom-in; }

/* Event name (with its year) written at the TOP of the photo in an elegant
   serif, the date under it, over a soft dark shade (owner 2026-11-07). */
.media-label {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px 24px 70px;
    background: linear-gradient(to bottom, rgba(10, 8, 30, 0.8) 0%, rgba(10, 8, 30, 0.42) 55%, rgba(10, 8, 30, 0) 100%);
    color: var(--white);
    pointer-events: none;
}
.media-title {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0.005em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
/* Short gold line under the name, then the date. */
.media-title::after {
    content: "";
    display: block;
    width: 46px;
    height: 3px;
    margin-top: 10px;
    border-radius: 2px;
    background: var(--gold, #F5B700);
}
.media-date {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.92;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
.album-card:first-child .media-title,
.photo-tile:first-child .media-title { font-size: 2.2rem; }
.photo-tile .media-label { padding: 16px 18px 50px; }
.photo-tile:not(:first-child) .media-title { font-size: 1.1rem; }
.photo-tile:not(:first-child) .media-title::after { width: 32px; margin-top: 7px; }

/* Year drop-down above the albums, on the right like the reference. */
.year-picker {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin: 0 0 26px;
}
.year-picker label { font-family: var(--font-heading); font-weight: 600; color: var(--navy); }
.year-picker select {
    width: 220px;
    max-width: 60vw;
    margin: 0;
    padding: 10px 40px 10px 14px;
    border: 2px solid var(--navy);
    border-radius: 10px;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%232A1F5E' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
    color: var(--navy);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}
.year-picker select:focus { outline: 3px solid rgba(245, 183, 0, 0.5); outline-offset: 2px; }

.album-back { margin: 0 0 18px; }
.album-back a { font-family: var(--font-heading); font-weight: 600; color: var(--navy); text-decoration: none; }
.album-back a:hover { color: var(--orange); }

/* Videos: the name sits on top of the video so the controls stay free at the bottom. */
.video-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
}
.video-tile video { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #000; }
.video-tile .media-label {
    top: 0;
    bottom: auto;
    padding: 18px 20px 46px;
    background: linear-gradient(to bottom, rgba(10, 8, 30, 0.8) 0%, rgba(10, 8, 30, 0) 100%);
}
.video-tile .media-title { font-size: 1.2rem; }

@media (max-width: 1000px) {
    .album-wall, .photo-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 230px; gap: 16px; }
}
@media (max-width: 600px) {
    .album-wall { grid-template-columns: 1fr; grid-auto-rows: 300px; }
    .album-card:first-child { grid-column: auto; grid-row: span 1; }
    .photo-wall { grid-auto-rows: 160px; gap: 10px; }
    .photo-tile { border-radius: 16px; }
    .photo-tile:nth-child(7n + 5) { grid-column: span 2; }
    .photo-tile:not(:first-child) .media-label { display: none; }
    .media-title, .album-card:first-child .media-title, .photo-tile:first-child .media-title { font-size: 1.4rem; }
    .year-picker { justify-content: stretch; }
    .year-picker select { flex: 1; width: auto; max-width: none; }
    .video-wall { grid-template-columns: 1fr; }
}

/* ---- Top bar: social buttons (yellow squares) + Staff Login, above the header ----
   Buttons are listed in includes/navbar.php ($socialLinks). */
.top-bar { background: var(--navy); }
.top-bar-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 6px 20px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}
.top-social { display: flex; align-items: center; gap: 10px; margin: 0; padding: 0; list-style: none; }
.top-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--gold);
    color: var(--navy);
    transition: transform 0.15s ease, background 0.15s ease;
}
.top-social a:hover { background: var(--white); transform: translateY(-2px); }
.top-social svg { width: 20px; height: 20px; fill: currentColor; }
.top-login {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 9px;
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}
.top-login:hover { background: var(--gold); border-color: var(--gold); color: var(--navy); }
/* Computer: login now lives in the top bar, so hide the old one on the right of the logo row */
@media (min-width: 1100.02px) {
    .main-nav > ul > li.nav-auth { display: none; }
    .site-header { border-top: 0; }
}
/* Phones: centre the bar, slightly smaller buttons */
@media (max-width: 480px) {
    .top-bar-inner { justify-content: center; padding: 6px 12px; gap: 10px; }
    .top-social { gap: 8px; }
    .top-social a { width: 30px; height: 30px; }
    .top-social svg { width: 18px; height: 18px; }
    .top-login { height: 30px; padding: 0 10px; font-size: 0.8rem; }
}

/* ---------------- Footer layout (owner 2026-11-08: like the reference picture) ---------------- */
.site-footer { background: #1565C0; color: #fff; }
.site-footer a { color: #fff; }
.footer-content { grid-template-columns: 1fr 1.35fr 1.6fr .9fr; gap: 32px; padding: 48px 20px 40px; }
.site-footer h4 { color: #fff; font-family: inherit; font-size: 1.05rem; font-weight: 700; letter-spacing: .02em; margin-bottom: 18px; }
.footer-brand .footer-logo { height: 100px; }
.footer-brand .footer-motto { color: #fff; font-style: normal; font-size: .95rem; }
.footer-contact p { margin: 0 0 12px; line-height: 1.9; }
.footer-contact a[href^="mailto"] { white-space: nowrap; }
.footer-links ul { list-style: none; margin: 0; padding: 0; }
.footer-links li { position: relative; padding-left: 16px; margin-bottom: 10px; line-height: 1.35; }
.footer-links li::before { content: ""; position: absolute; left: 0; top: .5em; width: 6px; height: 6px; border-top: 2px solid #fff; border-right: 2px solid #fff; transform: rotate(45deg); }
.footer-social-icons { list-style: none; display: flex; gap: 10px; margin: 16px 0 0; padding: 0; }
.footer-social-icons li { margin: 0; }
.footer-social-icons a { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; transition: background .2s; }
.footer-social-icons a:hover { background: var(--gold); }
.footer-social-icons svg { width: 17px; height: 17px; fill: #fff; }
.footer-bottom { background: var(--navy); color: #fff; border-top: 0; padding: 22px 20px; font-size: .95rem; }
.footer-bottom p { margin: 4px 0; }
.footer-bottom strong { color: var(--gold); }
@media (max-width: 900px) { .footer-content { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-content { grid-template-columns: 1fr; } .footer-contact a[href^="mailto"] { white-space: normal; word-break: break-all; } }

/* ---------------- Big header + blue menu + photo slider (owner 2026-11-08, like atc.ac.tz) ----------------
   Order on the page: top bar -> .gov-header (coat of arms | names + motto | school logo)
   -> .site-header (blue menu, sticks to the top) -> .slider (homepage photos only). */
:root { --menu-blue: #15157D; }
.gov-header { background: var(--white); }
.gov-header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    color: inherit;
    text-decoration: none;
}
.gov-arms { height: 118px; width: auto; flex-shrink: 0; }
.gov-logo { height: 104px; width: auto; flex-shrink: 0; }
.gov-text { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.gov-country {
    font-family: var(--font-heading);
    font-size: clamp(0.85rem, 1.6vw + 0.3rem, 1.95rem);
    font-weight: 700;
    letter-spacing: 0.14em;
    color: #1565C0;
    line-height: 1.25;
}
.gov-school {
    font-family: var(--font-heading);
    font-size: clamp(0.95rem, 1.4vw + 0.35rem, 1.75rem);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #333;
    line-height: 1.35;
    margin-top: 4px;
}
.gov-motto {
    font-size: clamp(0.75rem, 0.8vw + 0.4rem, 1.2rem);
    font-style: italic;
    letter-spacing: 0.12em;
    color: #555;
    margin-top: 4px;
}
@media (max-width: 760px) {
    .gov-header-inner { gap: 10px; padding: 10px 12px; }
    .gov-arms { height: 62px; }
    .gov-logo { height: 52px; }
    .gov-country, .gov-school, .gov-motto { letter-spacing: 0.04em; }
}
@media (max-width: 400px) {
    .gov-header-inner { gap: 6px; padding: 8px; }
    .gov-arms { height: 50px; }
    .gov-logo { height: 40px; }
    .gov-country { font-size: 0.74rem; }
    .gov-school { font-size: 0.82rem; }
    .gov-motto { font-size: 0.68rem; }
}

/* The school name is now in the big header, so the menu bar holds only the menu */
.site-header { background: var(--menu-blue); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18); border-top: 0; }
.site-header .brand { display: none; }
@media (max-width: 1100px) {
    .navbar { display: flex; justify-content: flex-end; padding: 6px 16px; }
    .nav-toggle span { background: var(--white); }
    .nav-toggle:hover { background: rgba(255, 255, 255, 0.12); }
}
@media (min-width: 1100.02px) {
    .main-nav { border-top: 0; }
    .main-nav > ul > li:not(.nav-auth) > a { color: var(--white); }
    .main-nav > ul > li > a .dropdown-caret { color: inherit; }
    .main-nav > ul > li > a:hover { background: transparent; color: var(--gold); }
    .main-nav > ul > li > a.active,
    .main-nav > ul > li > a.active:hover {
        background: transparent;
        color: var(--white);
        text-decoration: underline;
        text-decoration-thickness: 2px;
        text-underline-offset: 8px;
    }
}

/* Homepage slider: photos only, arrows, dots */
.slider {
    position: relative;
    overflow: hidden;
    height: clamp(230px, 42vw, 600px);
    background: #10103F;
    border-bottom: 4px solid var(--gold);
}
.slider-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.9s ease-in-out;
}
.slider-slide.active { opacity: 1; }
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    color: var(--white);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
}
.slider-btn:hover, .slider-btn:focus-visible { background: rgba(0, 0, 0, 0.65); }
.slider-prev { left: 14px; }
.slider-next { right: 14px; }
.slider-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12px;
    z-index: 2;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.slider-dot {
    width: 11px;
    height: 11px;
    padding: 0;
    border: 2px solid var(--white);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}
.slider-dot.active { background: var(--white); }
@media (max-width: 600px) {
    .slider-btn { width: 36px; height: 36px; font-size: 1rem; }
    .slider-prev { left: 8px; }
    .slider-next { right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    .slider-slide { transition: none; }
}

/* ---------------- Message from the Head of School (owner 2026-11-08, like atc.ac.tz) ---------------- */
.head-message { padding: 48px 0 24px; }
.head-message-box { background: #F3F7FB; padding: 28px 28px 32px; }
.head-message-title { display: inline-block; margin: 0 0 24px; padding-top: 14px; border-top: 2px solid var(--navy); font-family: var(--font-heading); font-size: 1.3rem; font-weight: 600; color: var(--navy); letter-spacing: .01em; }
.head-message-grid { display: grid; grid-template-columns: 200px 1fr; gap: 36px; align-items: start; }
.head-message-person img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border-radius: 10px; margin-bottom: 14px; }
.head-message-name { display: block; color: var(--navy); font-family: var(--font-heading); font-size: 1rem; }
.head-message-role { display: inline-block; margin-top: 4px; padding-bottom: 10px; border-bottom: 2px solid var(--gold); color: #444; }
.head-message-text p { margin: 0 0 12px; text-align: justify; line-height: 1.7; color: #333; }
.head-message-more { display: none; }
.head-message-text.is-open .head-message-more { display: block; }
.head-message-sign { text-align: center; margin: 22px 0 8px; }
.head-message-sign em { display: block; font-weight: 600; color: #333; margin-bottom: 8px; }
.head-message-sign strong { display: block; color: var(--navy); }
.head-message-sign span { display: block; color: #333; }
.head-message-toggle { margin-top: 6px; padding: 0; border: 0; background: none; color: var(--navy); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.head-message-toggle:hover { color: var(--orange); }
@media (max-width: 700px) {
    .head-message { padding: 32px 0 16px; }
    .head-message-box { padding: 20px 16px 24px; }
    .head-message-grid { grid-template-columns: 1fr; gap: 20px; }
    .head-message-person { max-width: 220px; }
    .head-message-text p { text-align: left; }
}

/* Top bar (owner 2026-11-17): phone number + social buttons + login, all in the CENTRE */
.top-bar-inner { justify-content: center; flex-wrap: wrap; }
.top-phone { display: inline-flex; align-items: center; gap: 8px; color: var(--white); font-weight: 700; font-size: 0.95rem; white-space: nowrap; text-decoration: none; }
.top-phone-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9px; background: var(--gold); color: var(--navy); }
.top-phone-icon svg { width: 18px; height: 18px; fill: currentColor; }
.top-phone:hover .top-phone-icon { background: var(--white); }
@media (max-width: 480px) {
    .top-phone { font-size: 0.85rem; gap: 6px; }
    .top-phone-icon { width: 30px; height: 30px; }
}

/* =====================================================================
   Two websites (2026-11-25): school website + Student Portal (masomo.)
   ===================================================================== */
.nav-site-switch { display: flex; align-items: center; margin-left: 6px; }
.site-switch-btn {
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
    padding: 7px 12px; border: 1.5px solid var(--gold); border-radius: 999px;
    color: var(--gold); font-weight: 600; font-size: 0.82rem;
}
.site-switch-btn:hover { background: var(--gold); color: var(--navy); }
.site-switch-btn .icon-svg { width: 16px; height: 16px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.center-link { text-align: center; margin-top: 24px; }

/* Quick links under the slideshow */
.quick-links { padding: 36px 0 8px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.quick-tile {
    display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--radius);
    background: var(--white); border: 1.5px solid var(--border-color); box-shadow: var(--card-shadow);
    color: var(--dark-text); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.quick-tile:hover { transform: translateY(-3px); box-shadow: var(--card-shadow-hover); border-color: var(--gold); }
.quick-icon {
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
    background: var(--navy); color: var(--gold);
}
.quick-icon .icon-svg { width: 24px; height: 24px; }
.quick-title { font-family: var(--font-heading); font-weight: 700; color: var(--navy); font-size: 1.05rem; }
.quick-text { font-size: 0.9rem; color: #4A4566; line-height: 1.5; }
@media (max-width: 900px) { .quick-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .quick-grid { grid-template-columns: 1fr; } }

.school-glance { padding: 28px 0 8px; }

/* News & announcements */
.home-news, .home-photos, .home-location, .home-about { padding: 40px 0 8px; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.news-card {
    display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: var(--radius);
    background: var(--white); border-top: 4px solid var(--gold); box-shadow: var(--card-shadow);
}
.news-card p { margin: 0; color: #4A4566; font-size: 0.93rem; line-height: 1.6; flex: 1; }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 0.82rem; color: #6b6585; }
.news-cat {
    background: var(--navy); color: var(--gold); padding: 2px 10px; border-radius: 999px;
    font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em;
}
.news-title { margin: 0; font-size: 1.08rem; line-height: 1.35; }
.news-title a { color: var(--navy); }
.news-title a:hover { color: var(--orange); }
.news-more { color: var(--orange); font-weight: 600; font-size: 0.9rem; }
.news-list { display: flex; flex-direction: column; gap: 10px; }
.news-row {
    display: grid; grid-template-columns: 110px 1fr auto; gap: 14px; align-items: center;
    padding: 14px 16px; border-radius: 12px; background: var(--white); border: 1.5px solid var(--border-color);
    color: var(--dark-text);
}
.news-row:hover { border-color: var(--gold); }
.news-row time { font-size: 0.85rem; color: #6b6585; font-weight: 600; }
.news-row-title { font-weight: 600; color: var(--navy); }
.news-row-title small { display: block; font-weight: 400; color: #6b6585; margin-top: 3px; }
.news-row-cat, .news-row-file { font-size: 0.78rem; font-weight: 600; color: var(--orange); white-space: nowrap; }
@media (max-width: 600px) { .news-row { grid-template-columns: 1fr; gap: 4px; } }
.news-article {
    background: var(--white); border-radius: var(--radius); padding: 28px; box-shadow: var(--card-shadow); margin-bottom: 20px;
}
.news-article-title { color: var(--navy); margin: 10px 0 16px; font-size: var(--fs-h3); }
.news-article-body p { line-height: 1.8; margin: 0 0 14px; }
.news-article-body a { color: var(--orange); word-break: break-word; }

/* Latest photos */
.home-photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.home-photo { display: block; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--light-grey); }
.home-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.home-photo:hover img { transform: scale(1.05); }
@media (max-width: 700px) { .home-photo-grid { grid-template-columns: repeat(2, 1fr); } }

/* Location / map */
.location-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; align-items: stretch; }
.location-info { background: var(--navy); color: #E6E0FF; border-radius: var(--radius); padding: 26px; }
.location-info h3 { color: var(--gold); margin: 0 0 10px; }
.location-info a:not(.btn) { color: var(--gold); }
.location-info p { line-height: 1.7; }
.map-frame { border-radius: var(--radius); overflow: hidden; min-height: 320px; box-shadow: var(--card-shadow); }
.map-frame iframe { width: 100%; height: 100%; min-height: 320px; border: 0; display: block; }
@media (max-width: 800px) { .location-grid { grid-template-columns: 1fr; } }

/* Contact page */
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 28px; }
.contact-grid .contact-card h3 { display: flex; align-items: center; gap: 8px; color: var(--navy); margin-top: 0; }
.contact-social { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.contact-social a { display: inline-block; padding: 6px 12px; border: 1.5px solid var(--gold); border-radius: 999px; color: var(--gold); }
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }

/* Academics: subjects */
.subject-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 18px; }
.subject-group {
    background: var(--white); border-radius: var(--radius); padding: 20px; border-left: 5px solid var(--gold);
    box-shadow: var(--card-shadow);
}
.subject-group h3 { margin: 0 0 10px; color: var(--navy); font-size: 1.02rem; }
.subject-group ul { margin: 0; padding-left: 18px; }
.subject-group li { margin: 4px 0; line-height: 1.5; }

/* Admissions: steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 18px auto 0; max-width: 820px; }
.steps li {
    counter-increment: step; position: relative; padding: 16px 18px 16px 64px; margin-bottom: 12px;
    background: var(--white); border-radius: 14px; box-shadow: var(--card-shadow); line-height: 1.6;
}
.steps li::before {
    content: counter(step); position: absolute; left: 16px; top: 14px; width: 34px; height: 34px; border-radius: 50%;
    background: var(--gold); color: var(--navy); font-weight: 700; display: grid; place-items: center;
}
.steps a { color: var(--orange); font-weight: 600; }

/* Student Portal home */
.portal-hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: var(--white); padding: 56px 0 48px; text-align: center;
}
.portal-hero h1 { color: var(--gold); margin: 10px 0; font-size: var(--fs-h1); }
.portal-hero p { color: #E6E0FF; max-width: 640px; margin: 0 auto 24px; font-size: 1.05rem; line-height: 1.6; }
.portal-hero-tag {
    display: inline-block; padding: 5px 14px; border: 1.5px solid var(--gold); border-radius: 999px;
    color: var(--gold); font-size: 0.8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.portal-search { display: flex; gap: 10px; max-width: 640px; margin: 0 auto; }
.portal-search input { flex: 1; padding: 14px 18px; border-radius: 12px; border: 2px solid transparent; font-size: 1rem; min-width: 0; }
.portal-search input:focus { outline: none; border-color: var(--gold); }
.portal-search .btn { display: inline-flex; align-items: center; gap: 6px; }
.portal-search .btn::after { content: none; }
@media (max-width: 520px) { .portal-search { flex-direction: column; } }
.portal-forms { padding: 32px 0 8px; }
.portal-form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.portal-form-tile {
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 12px; border-radius: var(--radius);
    background: var(--white); border: 2px solid var(--border-color); color: var(--navy); text-align: center;
}
.portal-form-tile:hover { border-color: var(--gold); transform: translateY(-2px); }
.portal-form-num { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 700; color: var(--orange); }
.portal-form-label { font-weight: 600; }
@media (max-width: 700px) { .portal-form-grid { grid-template-columns: repeat(2, 1fr); } }

/* Admin: announcements */
.checkbox-line { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 500; }
.checkbox-line input { width: auto; }
.announce-admin-list { display: flex; flex-direction: column; gap: 10px; }
.announce-admin-item {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center;
    padding: 14px 16px; background: var(--white); border: 1.5px solid var(--border-color); border-radius: 12px;
}
.announce-admin-title { display: block; margin: 6px 0 2px; color: var(--navy); }

/* Home page: News & Announcements block before the footer (2026-11-26, like atc.ac.tz) */
.home-newsroom { padding: 48px 0 56px; background: var(--light-grey); margin-top: 40px; }
.newsroom-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; align-items: start; }
.newsroom-head {
    margin: 0 0 16px; padding-bottom: 10px; color: var(--navy); font-size: 1.15rem;
    border-bottom: 3px solid var(--gold); display: inline-block;
}
.newsroom-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.newsroom-card {
    background: var(--white); border-radius: 14px; overflow: hidden; box-shadow: var(--card-shadow);
    display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease;
}
.newsroom-card:hover { transform: translateY(-3px); box-shadow: var(--card-shadow-hover); }
.newsroom-card-img { display: block; aspect-ratio: 16 / 10; background: var(--cream); overflow: hidden; }
.newsroom-card-img img { width: 100%; height: 100%; object-fit: cover; }
.newsroom-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.newsroom-card-body time { font-size: 0.8rem; color: var(--orange); font-weight: 600; }
.newsroom-card-body h4 { margin: 0; font-size: 1rem; line-height: 1.35; }
.newsroom-card-body h4 a { color: var(--navy); }
.newsroom-card-body h4 a:hover { color: var(--orange); }
.newsroom-card-body p { margin: 0; font-size: 0.88rem; color: #4A4566; line-height: 1.55; flex: 1; }
.newsroom-empty { color: #6b6585; }
.newsroom-all { margin-top: 18px; }
.newsroom-notices {
    background: var(--white); border-radius: 14px; padding: 20px; box-shadow: var(--card-shadow);
    border-top: 4px solid var(--navy);
}
.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-list li + li { border-top: 1px solid var(--border-color); }
.notice-list a { display: flex; gap: 12px; align-items: center; padding: 12px 0; color: var(--dark-text); }
.notice-list a:hover .notice-text { color: var(--orange); }
.notice-date {
    flex: 0 0 52px; height: 52px; border-radius: 10px; background: var(--navy); color: var(--gold);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700; letter-spacing: .05em; line-height: 1.1;
}
.notice-date b { font-size: 1.25rem; color: var(--white); }
.notice-date-icon .icon-svg { width: 24px; height: 24px; }
.notice-text { font-size: 0.92rem; line-height: 1.45; }
.notice-text em { color: var(--orange); font-style: normal; font-weight: 600; }
@media (max-width: 860px) { .newsroom-grid { grid-template-columns: 1fr; } }

/* Red strip for staff while maintenance mode is ON */
.maintenance-strip { background: #C62828; color: #fff; text-align: center; font-weight: 700; font-size: 0.85rem; padding: 8px 12px; position: relative; z-index: 1000; }

/* Home page: one big school photo instead of a slideshow (2026-11-26, like ilboru.ac.tz) */
.hero-single {
    position: relative; min-height: clamp(280px, 48vw, 560px);
    background-size: cover; background-position: center 35%; background-color: var(--navy);
    display: flex; align-items: flex-end;
}
.hero-single-overlay {
    width: 100%; padding: 80px 0 28px;
    background: linear-gradient(to top, rgba(20, 14, 50, 0.85), rgba(20, 14, 50, 0));
}
.hero-single-title { margin: 0; color: var(--white); font-size: var(--fs-h1); text-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
.hero-single-motto { margin: 6px 0 0; color: var(--gold); font-style: italic; font-size: 1.1rem; }

/* Highlights under the photo */
.highlights { padding: 28px 0 8px; }
.highlights-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.highlight { display: flex; align-items: center; gap: 16px; }
.highlight-img {
    flex: 0 0 120px; width: 120px; height: 120px; border-radius: 12px; object-fit: cover; box-shadow: var(--card-shadow);
}
.highlight-icon { display: grid; place-items: center; background: var(--navy); color: var(--gold); }
.highlight-icon .icon-svg { width: 52px; height: 52px; }
.highlight-title { margin: 0 0 4px; font-size: 1.2rem; color: var(--navy); }
.highlight-text { margin: 0; color: #4A4566; font-size: 0.93rem; line-height: 1.5; }
@media (max-width: 860px) { .highlights-grid { grid-template-columns: 1fr; } .highlight-img { flex-basis: 96px; width: 96px; height: 96px; } }

/* What We Learn: department tiles that turn over to show the Head of Department */
.home-departments, .home-services { padding: 40px 0 8px; }
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.dept-tile { position: relative; height: 120px; perspective: 900px; outline: none; }
.dept-face {
    position: absolute; inset: 0; border-radius: 14px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center; padding: 12px;
    backface-visibility: hidden; transition: transform .5s ease;
}
.dept-front { background: var(--white); border: 2px solid var(--navy); color: var(--navy); font-family: var(--font-heading); font-weight: 700; font-size: 1.02rem; text-transform: uppercase; letter-spacing: .02em; }
.dept-back { background: var(--navy); color: var(--white); transform: rotateY(180deg); gap: 2px; }
.dept-back strong { color: var(--gold); font-size: 1rem; }
.dept-back small { color: #cfd8e6; font-size: 0.78rem; }
.dept-back a { margin-top: 8px; padding: 4px 14px; border: 1.5px solid var(--gold); border-radius: 999px; color: var(--gold); font-size: 0.8rem; font-weight: 600; }
.dept-tile.has-head:hover .dept-front, .dept-tile.has-head:focus .dept-front, .dept-tile.has-head:focus-within .dept-front { transform: rotateY(-180deg); }
.dept-tile.has-head:hover .dept-back, .dept-tile.has-head:focus .dept-back, .dept-tile.has-head:focus-within .dept-back { transform: rotateY(0deg); }
.dept-tile.has-head .dept-front { cursor: pointer; }

/* Services */
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.service { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--card-shadow); border-top: 4px solid var(--gold); }
.service h3 { margin: 10px 0 6px; color: var(--navy); font-size: 1.05rem; }
.service p { margin: 0; font-size: 0.92rem; line-height: 1.55; color: #4A4566; }
.service a { color: var(--orange); font-weight: 600; word-break: break-word; }
.service-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--navy); color: var(--gold); }
.service-icon .icon-svg { width: 24px; height: 24px; }
@media (max-width: 1000px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .services-grid { grid-template-columns: 1fr; } }

/* Alumni form */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .form-row-2 { grid-template-columns: 1fr; } }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
