/* =========================================
   1. GLOBAL VARIABLES & UTILITIES
   ========================================= */
:root {
    --rotary-blue: #00246c;
    --rotary-gold: #F7A81B;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --text-main: #1a1a1a;
    --text-muted: #64748b;
    --nav-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container { 
    width: 90%; 
    max-width: 1200px; 
    margin: 0 auto; 
}
.section-padding { padding: 6rem 0; }
.bg-light { background-color: var(--bg-light); }
.text-center { text-align: center; }

/* =========================================
   2. PREMIUM TOP MENU (NAVBAR)
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(4, 15, 35, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    z-index: 1001; /* Stays above mobile menu */
}

.brand-wheel {
    height: 45px;
    width: auto;
    object-fit: contain;
}

.brand-text h2 {
    margin: 0;
    line-height: 1;
    color: var(--bg-white);
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--bg-white);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--rotary-gold);
}

/* Navbar Premium Button */
.navbar .btn-primary {
    background: var(--rotary-gold);
    color: var(--rotary-blue);
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.navbar .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(247, 168, 27, 0.4);
    color: var(--rotary-blue);
}

.navbar .btn-primary::after {
    content: '';
    position: absolute;
    top: 0; left: -150%;
    width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.5), transparent);
    transform: skewX(-25deg);
    animation: premiumShine 4s infinite;
}

/* Mobile Menu Toggle (Hamburger) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--bg-white);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
}

/* =========================================
   3. CINEMATIC HERO & SLIDER (FIXED)
   ========================================= */
.hero {
    /* Modern viewport units prevent jumping on mobile */
    min-height: 100vh; 
    min-height: 100svh; 
    width: 100%;
    background-color: var(--rotary-blue);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Left align for desktop */
    padding-top: var(--nav-height); /* Prevent nav from covering text */
    color: var(--bg-white);
    overflow: hidden;
}

.hero-slideshow {
    position: absolute;
    inset: 0; /* Shorthand for top, right, bottom, left 0 */
    width: 100%; 
    height: 100%;
    z-index: 0;
}

.hero-slideshow .slide {
    position: absolute;
    inset: 0;
    width: 100%; 
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1);
    /* Smoother crossfade */
    transition: opacity 2s cubic-bezier(0.4, 0, 0.2, 1); 
}

.hero-slideshow .slide.active {
    opacity: 1;
    transform: scale(1.08); /* Slow pan effect */
    transition: opacity 2s cubic-bezier(0.4, 0, 0.2, 1), transform 12s linear; 
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0, 15, 45, 0.9) 0%, rgba(0, 15, 45, 0.5) 45%, transparent 100%);
    z-index: 1;
}

/* Glass Box Wrapper */
.hero .container {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: flex-start; /* Pushes glass box to the left on desktop */
}

.hero-content {
    max-width: 650px; 
    text-align: left; 
    background: rgba(4, 15, 35, 0.5); 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px); 
    padding: 4rem; 
    border-radius: 24px; 
    border: 1px solid rgba(255, 255, 255, 0.15); 
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6); 
}

.hero .badge {
    display: inline-block;
    color: var(--rotary-gold);
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--rotary-gold);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.hero h1 { 
    font-family: 'Playfair Display', serif;
    font-size: 4rem; /* Slightly reduced for better desktop wrap */
    line-height: 1.1; 
    color: #ffffff; 
    margin-bottom: 1.2rem; 
    font-weight: 700;
}

.hero p { 
    font-size: 1.15rem; 
    margin-bottom: 2.5rem; 
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
}

.hero-actions { 
    display: flex; 
    gap: 1.2rem; 
}

/* =========================================
   4. CONTENT GRIDS & CARDS
   ========================================= */
.legacy-grid, .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }

.section-header h2, .legacy-text h2 { font-size: 3rem; margin-bottom: 1rem; color: var(--rotary-blue); }
.section-subtitle { color: var(--rotary-gold); font-weight: 800; text-transform: uppercase; letter-spacing: 3px; font-size: 0.9rem; display: block; margin-bottom: 0.5rem; }

/* Stats */
.legacy-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.stat-box { background: var(--bg-white); padding: 2.5rem 2rem; border-radius: 12px; border-left: 4px solid var(--rotary-gold); transition: transform 0.4s ease, box-shadow 0.4s ease; box-shadow: 0 4px 15px rgba(0,0,0,0.03); }
.stat-box:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0, 36, 108, 0.08); border-color: var(--rotary-blue); }
.stat-box h3 { font-size: 3rem; margin-bottom: 0.5rem; color: var(--rotary-blue); }
.stat-box p { color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 1px; font-size: 0.9rem; }

/* Initiatives Cards */
.card { background: var(--bg-white); border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.04); transition: transform 0.5s ease; border: 1px solid #f1f5f9; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-15px); box-shadow: 0 25px 50px rgba(0, 36, 108, 0.12); }
.card-img { height: 240px; overflow: hidden; background-color: var(--bg-light); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s cubic-bezier(0.25, 1, 0.5, 1); }
.card:hover .card-img img { transform: scale(1.15); }
.card-content { padding: 2.5rem 2rem; flex: 1; }
.card-content h3 { font-size: 1.6rem; margin-bottom: 1rem; color: var(--rotary-blue); }

/* Vision & Mission 3D Glass */
.vision-mission { background-color: var(--bg-white); position: relative; overflow: hidden; }
.vm-box { background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(0, 36, 108, 0.08); padding: 4rem 3rem; border-radius: 20px; height: 100%; box-shadow: 0 20px 50px rgba(0,0,0,0.05); backdrop-filter: blur(25px); transition: transform 0.6s ease, border-color 0.4s ease; }
.vm-box:hover { border-color: rgba(247, 168, 27, 0.5); transform: translateY(-10px); }
.vm-icon { margin-bottom: 2rem; display: inline-block; padding: 18px; background: rgba(247, 168, 27, 0.15); border-radius: 14px; border: 1px solid rgba(247, 168, 27, 0.3); }

/* =========================================
   5. EVENTS & FOOTER
   ========================================= */
.mini-event { display: flex; align-items: center; background: var(--bg-white); padding: 1.5rem; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.04); border-left: 4px solid var(--rotary-gold); transition: transform 0.4s ease; margin-bottom: 1.5rem;}
.mini-event:hover { transform: translateX(15px); border-left-color: var(--rotary-blue);}
.mini-date { background: var(--bg-light); padding: 12px 20px; border-radius: 8px; text-align: center; margin-right: 1.5rem; }
.mini-date span { display: block; font-size: 0.85rem; color: var(--rotary-gold); font-weight: 700; }
.mini-date strong { display: block; font-size: 2rem; color: var(--rotary-blue); font-family: 'Playfair Display', serif; line-height: 1;}

.premium-footer { background-color: #051429; color: rgba(255, 255, 255, 0.8); padding-top: 5rem; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 4rem; margin-bottom: 4rem; }
.footer-brand h3 { color: var(--bg-white); font-size: 2rem; margin-bottom: 1rem; }
.footer-links h4, .footer-contact h4 { color: var(--bg-white); font-size: 1.2rem; margin-bottom: 1.5rem; border-bottom: 2px solid var(--rotary-gold); padding-bottom: 0.5rem; display: inline-block; }
.footer-links ul { list-style: none; }
.footer-links ul li { margin-bottom: 0.8rem; }
.footer-links ul li a { color: rgba(255, 255, 255, 0.8); text-decoration: none; transition: color 0.3s ease;}
.footer-links ul li a:hover { color: var(--rotary-gold); }

/* =========================================
   6. RESPONSIVE MOBILE FIXES (THE MAGIC)
   ========================================= */

@media screen and (max-width: 1024px) {
    .hero h1 { font-size: 3rem; }
    .grid-2, .grid-3, .legacy-grid { gap: 2rem; }
}

@media screen and (max-width: 768px) {
    /* Top Menu Mobile Optimization */
    .menu-toggle { display: block; }
    
    .nav-links {
        position: absolute;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        background: rgba(4, 15, 35, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 2rem 0;
        gap: 1.5rem;
        transform: translateY(-150%);
        opacity: 0;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    /* Add a class via JavaScript (e.g. .active) to show the menu */
    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
    }

    /* Hero & Slider Mobile Optimization */
    .hero {
        justify-content: center; /* Center horizontally */
        text-align: center;
        padding-top: var(--nav-height); /* Clear the navbar */
    }

    .hero-overlay {
        /* Bottom gradient makes text pop even if center of image is bright */
        background: linear-gradient(to bottom, rgba(0, 15, 45, 0.8) 0%, rgba(0, 15, 45, 0.7) 100%);
    }

    .hero .container {
        justify-content: center;
    }

    .hero-content {
        padding: 2.5rem 1.5rem;
        text-align: center;
        width: 100%;
        max-width: 100%;
        margin: 0 1rem;
        backdrop-filter: blur(15px); /* Slightly lighter blur for mobile performance */
    }

    .hero h1 { font-size: 2.5rem; line-height: 1.2; }
    .hero p { font-size: 1rem; margin-bottom: 2rem; }
    
    .hero-actions { 
        flex-direction: column; 
        gap: 1rem; 
        width: 100%; 
    }
    
    .hero-actions .btn { 
        width: 100%; 
        justify-content: center; 
        text-align: center;
    }

    /* Grid Stacking */
    .legacy-grid, .grid-3, .grid-2, .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .section-header h2, .legacy-text h2 { font-size: 2.2rem; }

    /* Stats & Events */
    .legacy-stats { grid-template-columns: 1fr; }
    .stat-box { padding: 2rem; }
    
    .mini-event { flex-direction: column; text-align: center; }
    .mini-date { margin-right: 0; margin-bottom: 1rem; width: 100%; }
    .mini-event:hover { transform: translateY(-5px); } /* Up instead of right */

    /* Footer */
    .footer-links h4::after, .footer-contact h4::after {
        content: ''; display: block; margin: 5px auto; width: 50px;
    }
}

/* =========================================
   7. KEYFRAMES
   ========================================= */
@keyframes premiumShine {
    0% { left: -150%; }
    20% { left: 250%; }
    100% { left: 250%; }
}