/**
 * Tabora Boys Secondary School - Main Theme Styles
 * Color palette: Khaki + Gold (official school colors)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800;900&display=swap');

:root {
    /* Primary Palette — Khaki */
    --khaki-primary: #5C4B2C;
    --khaki-soft: #8B7355;
    --khaki-dark: #3D2E18;
    --khaki-light: #A89070;
    --khaki-glass: rgba(92, 75, 44, 0.75);
    --khaki-muted: #C3B091;

    /* Gold Accents */
    --gold-primary: #d4a017;
    --gold-soft: #f3c94d;
    --gold-deep: #b8860b;

    /* Legacy variable aliases for backward compat */
    --navy-primary: var(--khaki-primary);
    --navy-soft: var(--khaki-soft);
    --navy-glass: var(--khaki-glass);
    --maroon-accent: #751f24;

    /* Neutrals */
    --white: #ffffff;
    --white-glass: rgba(255, 255, 255, 0.1);
    --light-bg: #f8f5f0;
    --text-main: #2a1f0e;
    --text-muted: #7a6e5d;

    /* Design Tokens */
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-premium: 0 15px 45px rgba(60, 46, 24, 0.18);
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Typography Sizes */
    --h1-size: clamp(2.8rem, 5vw, 4.5rem);
    --h2-size: clamp(2rem, 3.5vw, 3rem);
    --h3-size: clamp(1.4rem, 2.5vw, 1.8rem);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

img, canvas, video, svg {
    max-width: 100%;
    height: auto;
}

body {
    font-family: 'Inter', 'Outfit', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    background-color: var(--light-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: 1320px;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

/* --- Loader Styles --- */
.site-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--khaki-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1), 
                visibility 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.site-loader.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    max-width: 90%;
    width: 450px;
}

.loader-logo-container {
    position: relative;
    width: clamp(100px, 20vw, 140px);
    height: clamp(100px, 20vw, 140px);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-logo {
    width: 85%;
    height: 85%;
    object-fit: contain;
    z-index: 2;
    animation: logoPulse 2s infinite ease-in-out;
}

.loader-fallback-logo {
    width: 85%;
    height: 85%;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-soft));
    color: var(--khaki-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    z-index: 2;
    box-shadow: 0 0 20px rgba(212, 160, 23, 0.4);
}

.loader-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid rgba(255, 255, 255, 0.05);
    border-top: 4px solid var(--gold-primary);
    border-right: 4px solid var(--gold-soft);
    border-radius: 50%;
    animation: ringRotate 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    z-index: 1;
}

.loader-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle, rgba(212, 160, 23, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(5px);
    z-index: 0;
}

.loader-text-wrapper {
    text-align: center;
    width: 100%;
}

.loader-progress {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.loader-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--gold-primary), var(--gold-soft));
    box-shadow: 0 0 10px var(--gold-primary);
    border-radius: 10px;
    animation: fillProgress 4s cubic-bezier(0.1, 0.8, 0.1, 1) forwards;
}

@keyframes fillProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes dots {
    0%, 100% { opacity: 0; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-3px); }
}

/* --- Helper Classes --- */
.section-title-premium {
    font-size: var(--h2-size);
    font-weight: 800;
    color: var(--khaki-primary);
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 3rem;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background: var(--gold-primary);
    color: var(--khaki-dark);
}

/* --- Sub-Page Hero Header --- */
/* Reusable class for all sub-page banners (gallery, news, results, about, etc.) */
.page-hero-header {
    position: relative;
    padding: 160px 0 80px;
    text-align: center;
    overflow: hidden;
    z-index: 2;
}

.page-hero-header .hero-bg-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.page-hero-header .hero-bg-slideshow .slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.page-hero-header .hero-bg-slideshow .slide-bg.active {
    opacity: 1;
}

.page-hero-header .hero-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(42, 31, 14, 0.88) 0%, rgba(61, 46, 24, 0.82) 50%, rgba(92, 75, 44, 0.78) 100%);
    z-index: 1;
}

.page-hero-header .hero-content {
    position: relative;
    z-index: 2;
}

.page-hero-header h1 {
    font-size: var(--h2-size);
    font-weight: 900;
    color: var(--white);
    text-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
    margin-bottom: 15px;
}

.page-hero-header h1 i {
    color: var(--gold-primary);
    margin-right: 12px;
    filter: drop-shadow(0 0 8px rgba(212, 160, 23, 0.4));
}

.page-hero-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.15rem;
    max-width: 650px;
    margin: 0 auto;
    font-weight: 400;
}

.page-hero-header .breadcrumb-nav {
    margin-top: 25px;
}

.page-hero-header .breadcrumb-nav a {
    color: var(--gold-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.page-hero-header .breadcrumb-nav a:hover {
    color: var(--gold-soft);
}

.page-hero-header .breadcrumb-nav span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin: 0 10px;
}

/* --- Footer --- */
#wrapper {
    position: relative;
    z-index: 2;
}

.content-wrapper {
    position: relative;
    z-index: 2;
    background: var(--light-bg);
}

.site-footer {
    background: var(--khaki-dark);
    color: var(--white);
    padding: 100px 0 35px;
    border-top: 3px solid var(--gold-primary);
    position: relative;
    z-index: 2;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr 1fr 1.5fr;
    gap: 50px;
    margin-bottom: 60px;
}

.footer-col h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--gold-primary);
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 35px;
    height: 2px;
    background: var(--gold-primary);
    box-shadow: 0 0 5px var(--gold-primary);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--white);
    font-size: 1.7rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.footer-logo img {
    height: 55px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

.footer-logo span {
    letter-spacing: 1px;
}

.footer-desc {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.footer-socials {
    display: flex;
    gap: 15px;
}

.footer-socials a {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--white);
    text-decoration: none;
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.footer-socials a:hover {
    background: var(--gold-primary);
    color: var(--khaki-dark);
    transform: translateY(-4px);
    box-shadow: 0 5px 15px rgba(212, 160, 23, 0.4);
    border-color: var(--gold-primary);
}

.footer-links {
    list-style: none;
    padding-left: 0;
}

.footer-links li {
    margin-bottom: 14px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    display: inline-block;
}

.footer-links a:hover {
    color: var(--gold-soft);
    transform: translateX(6px);
}

.footer-contact {
    list-style: none;
    padding-left: 0;
}

.footer-contact li {
    display: flex;
    gap: 15px;
    margin-bottom: 22px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
    line-height: 1.4;
}

.footer-contact i {
    color: var(--gold-primary);
    font-size: 1.1rem;
    margin-top: 3px;
    filter: drop-shadow(0 0 3px rgba(212, 160, 23, 0.3));
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.88rem;
}

.footer-bottom p {
    margin-bottom: 0;
}
