/* ==================================================
   1. VARIABLES & THEMING
   ================================================== */
:root {
    --primary: #002366;
    --secondary: #004aad;
    --accent: #ffde59;
    --accent-hover: #e6c545;
    
    --bg-main: #fcfcfc;
    --bg-section: #ffffff;
    --bg-card: #ffffff;
    --bg-nav: #ffffff;
    
    --text-main: #333333;
    --text-muted: #6b7280;
    --text-light: #ffffff;
    
    --font-heading: 'Merriweather', serif;
    --font-body: 'Inter', sans-serif;
    
    --transition: all 0.3s ease;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --primary: #013999;
    --secondary: #4084fa;
    --bg-main: #0f172a;
    --bg-section: #1e293b;
    --bg-card: #1e293b;
    --bg-nav: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

/* ==================================================
   2. GLOBAL RESETS & TYPOGRAPHY
   ================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color var(--transition), color var(--transition);
    overflow-x: hidden; 
    position: relative;
}

/* Prevents horizontal scrolling/wobbling on narrow mobile devices */
.site-wrapper {
    /* overflow-x: hidden; */
    width: 100%;
}

h1, h2, h3, h4, .logo-text {
    font-family: var(--font-heading);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent);
}

.info-links {
    color: var(--text-light);
}

.info-links:hover {
    color: var(--accent);
}

/* ==================================================
   3. BUTTONS
   ================================================== */
.btn-enroll-yellow, .btn-yellow-outline, .btn-theme {
    background-color: var(--accent);
    color: #111;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-enroll-yellow:hover, .btn-yellow-outline:hover, .btn-theme:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-yellow-outline {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--text-main);
    display: inline-block;
    margin-top: 15px;
}

.btn-yellow-outline:hover {
    background: var(--accent);
    color: #111;
}

/* ==================================================
   4. HEADER & NAVIGATION
   ================================================== */
.top-bar {
    background-color: var(--primary);
    color: var(--text-light);
    padding: 10px 0;
    font-size: 0.9rem;
}

.top-bar-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 15px;
}


.main-header {
    background-color: var(--bg-nav);
    padding: 15px 0;
    box-shadow: var(--shadow);
    position: sticky;
    position: -webkit-sticky; /* Support for Safari */
    top: 0;
    z-index: 1000;
}

.header-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 30px;
}

.logo-area {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    gap: 15px;
}

.header-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.logo-text {
    color: var(--secondary);
    font-size: 1.8rem;
    margin: 0;
}

.logo-subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.nav-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 20px;
    list-style: none;
}

.nav-grid a {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Desktop Hidden Hamburger */
.mobile-toggle {
    display: none;
}

/* Dropdown Animation & Layout */
.dropdown {
    position: relative;
    cursor: pointer;
    color: var(--text-main);
    font-weight: bold;
}

.drop-label:hover {
    color: var(--accent);
}

.caret {
    display: inline-block;
    transition: transform 0.3s ease;
}

.dropdown.active .caret {
    transform: rotate(180deg);
}

/* Dropdown container relies on max-height for smooth opening/closing */
.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    box-shadow: var(--shadow);
    min-width: 220px;
    border-radius: 4px;
    z-index: 101;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0;
}

.dropdown-content a {
    display: block;
    padding: 12px 20px;
    border-bottom: 1px solid var(--bg-main);
}

/* Expands the dropdown on hover (desktop) or click (JS toggle active) */
.dropdown:hover .dropdown-content,
.dropdown.active .dropdown-content {
    max-height: 400px;
}

/* ==================================================
   5. PAGE SECTIONS & LAYOUTS
   ================================================== */
.hero-mural {
    width: 100%;
}

.hero-img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

.enrollment-banner {
    padding: 40px 0;
}

.banner-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    background: var(--bg-card);
    box-shadow: var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}

.banner-image {
    background: var(--secondary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
}

.banner-text {
    padding: 40px;
}

.banner-text h3 {
    margin-bottom: 15px;
    color: var(--primary);
}

/* UP-Style Asymmetrical Grid Base */
.news-section, .events-section {
    padding: 60px 0;
}

.news-section {
    background-color: var(--bg-main);
}

.events-section {
    background-color: var(--bg-section);
}

.section-title {
    margin-bottom: 30px;
    font-size: 2rem;
    color: var(--primary);
    border-bottom: 3px solid var(--accent);
    display: inline-block;
    padding-bottom: 10px;
}

.up-layout-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 30px;
}

/* Featured Large Card (Left) */
.featured-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.featured-card:hover {
    transform: translateY(-5px);
}

.featured-card img {
    width: 100%;
    height: 350px;
    object-fit: cover;
}

.featured-card .card-content {
    padding: 30px;
}

.featured-card h4 {
    font-size: 1.6rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.featured-card p {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Small Cards Grid (Right) */
.side-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.small-card {
    display: grid;
    grid-template-columns: 1fr 2fr;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.small-card:hover {
    transform: translateX(5px);
}

.small-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.small-card .card-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.small-card h4 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--primary);
}

.small-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.read-more {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary);
    background: #f1f5f9;
    padding: 5px 10px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

/* Events Formatting */
.event-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.event-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.event-details {
    padding: 25px;
}

.event-date {
    color: #b91c1c;
    font-weight: bold;
    font-size: 1.2rem;
    display: block;
    margin-bottom: 10px;
}

.event-list-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 15px;
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    align-items: center;
}

.event-date-box {
    background: var(--bg-main);
    color: #b91c1c;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    width: 80px;
}

/* ==================================================
   6. FOOTER & UI COMPONENTS
   ================================================== */
.site-footer {
    background-color: var(--primary);
    color: var(--text-light);
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-logo {
    width: 80px;
    border-radius: 50%;
    margin-bottom: 15px;
}

.site-footer h4 {
    margin-bottom: 20px;
    color: var(--accent);
}

.footer-links a {
    display: block;
    color: var(--text-light);
    margin-bottom: 10px;
}

#scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--secondary);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none; /* Disables clicking while hidden */
    transition: var(--transition);
    z-index: 999;
}

#scroll-top.show {
    opacity: 1;
    pointer-events: auto;
}

/* ==================================================
   7. MOBILE OVERRIDES (Max-width 768px)
   ================================================== */
@media (max-width: 768px) {
    /* Collapse all complex grids into single columns */
    .top-bar-grid, 
    .banner-grid, 
    .up-layout-grid,
    .small-card {
        grid-template-columns: 1fr;
    }
    
    /* Header layout for Hamburger Menu */
    .header-grid {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }

    .logo-area {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    /* Style and show the Hamburger button */
    .mobile-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 5px;
        z-index: 1000;
    }

    .mobile-toggle .bar {
        width: 25px;
        height: 3px;
        background-color: var(--primary);
        transition: 0.3s;
        border-radius: 2px;
    }

    /* Hide the Nav behind max-height for slide animation */
    .nav-grid {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-nav);
        flex-direction: column;
        justify-content: flex-start;
        gap: 10px;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
        box-shadow: var(--shadow);
    }

    /* JS adds this class to expand the menu */
    .nav-grid.show-menu {
        max-height: 500px;
        padding: 20px 0;
    }

    /* Make dropdowns push content down instead of overlapping */
    .dropdown-content {
        position: static;
        box-shadow: none;
        background-color: var(--bg-section);
        min-width: 100%;
        text-align: center;
    }

    /* Adjust image heights for mobile viewport */
    .small-card img {
        height: 200px;
    }

    .featured-card img {
        height: 250px;
    }

    /* Ensure scroll up button doesn't clip off small screens */
    #scroll-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
        z-index: 9999;
    }
}