/* =========================================
   GLOBAL RESET & BASICS
   ========================================= */
html, body {
    width: 100%;
    overflow-x: hidden !important; /* Critical: Cuts off anything sticking out the side */
    position: relative; /* Helps stabilize the container */
    margin: 0;
    padding: 0;
}

:root {
    --earthy-bg: #3a2a22; 
    --harvard-crimson: #A51C30;
    --accent-gold: #d4a373;
    --text-main: #f4f1ee;
    --nav-footer-dark: #1a1816; 
}

* { box-sizing: border-box; scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--earthy-bg);
    color: var(--text-main);
    line-height: 1.6;
}

/* =========================================
   HEADER & NAVIGATION
   ========================================= */
nav {
    position: fixed;
    top: 0; width: 100%; z-index: 1000;
    padding: 25px 5%;
    display: flex; justify-content: space-between;
    align-items: center; 
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent; 
}

nav.scrolled {
    padding: 15px 5%;
    background: var(--nav-footer-dark); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(212, 163, 115, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.logo { 
    font-family: 'Playfair Display', serif; 
    font-size: 1.5rem; 
    color: var(--accent-gold); 
    text-decoration: none; 
    font-weight: 700;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.8s ease forwards;
}

.nav-menu { display: flex; gap: 30px; align-items: center; }

.header-link {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    color: var(--accent-gold);
    text-decoration: none;
    cursor: pointer;
    position: relative;
    opacity: 0;
    transform: translateY(-15px);
    transition: all 0.4s ease;
}

.header-link:hover {
    color: #fff;
    transform: translateY(-2px);
    text-shadow: 0 0 10px rgba(212, 163, 115, 0.5);
}

.reveal-active {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* =========================================
   MOBILE SIDE DRAWER
   ========================================= */
.menu-icon { 
    display: none; 
    font-size: 1.5rem; 
    color: var(--accent-gold); 
    cursor: pointer; 
    z-index: 1001; 
}

.side-drawer {
    position: fixed; top: 0; left: -100%;
    width: 280px; height: 100%;
    background: var(--nav-footer-dark);
    backdrop-filter: blur(15px); 
    z-index: 2000;
    padding: 80px 30px; display: flex; flex-direction: column; gap: 25px;
    transition: 0.5s; border-right: 1px solid var(--accent-gold);
}

.header-title { 
    color: var(--accent-gold); 
    cursor: pointer; 
    font-weight: 600; 
    text-decoration: none; 
    display: block;        
    transition: color 0.3s ease;
}

.header-title:hover { color: #fff; }

.side-drawer.open { left: 0; }
.menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 1999; display: none; }
.menu-overlay.active { display: block; }

@media (max-width: 992px) {
    .menu-icon { display: block; }
    .nav-menu { display: none; }
    nav { padding: 20px 5%; }
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    position: relative; height: 75vh;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    overflow: hidden !important; text-align: center; padding: 0 5%;
}
.hero-bg-fixed {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('./img/HeaderOfHpair.jpg'); 
    background-size: cover; background-position: center;
    z-index: -2; animation: singleImageMove 20s infinite alternate ease-in-out;
}
@keyframes singleImageMove { 0% { transform: scale(1); } 100% { transform: scale(1.1); } }
.hero::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to bottom, rgba(0,0,0,0.4), var(--earthy-bg)); z-index: -1; }
.hero h1 { font-family: 'Playfair Display', serif; font-size: clamp(1.5rem, 6vw, 3.5rem); margin-bottom: 20px; color: var(--accent-gold); }
.hero-subtitle { font-size: 1.1rem; max-width: 600px; color: #ddd; }

/* =========================================
   CONTAINER & CONTENT
   ========================================= */
.container { max-width: 1200px; margin: -40px auto 60px auto; padding: 0 20px; position: relative; z-index: 10; }

.section-glass {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px; padding: 40px 20px; margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    text-align: center;
    overflow: hidden; 
}
h2 { color: var(--accent-gold); text-transform: uppercase; font-size: clamp(1.2rem, 4vw, 1.8rem); border-bottom: 2px solid rgba(212, 163, 115, 0.2); padding-bottom: 8px; margin-bottom: 30px; }

/* =========================================
   ANIMATIONS (FIXED FOR MOBILE)
   ========================================= */
.reveal-left, .reveal-right {
    opacity: 0;
    transition: all 1s cubic-bezier(0.2, 1, 0.3, 1);
    will-change: transform, opacity;
}

/* Desktop Default: Slide from sides */
.reveal-left { transform: translateX(-100px); }
.reveal-right { transform: translateX(100px); }

.reveal-left.active, .reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* Mobile Override: Slide UP to prevent horizontal scroll/white bar */
@media screen and (max-width: 768px) {
    .reveal-left, .reveal-right {
        transition: all 0.6s ease-out; 
        transform: translateY(50px); /* Start slightly below */
    }
    
    .reveal-left.active, .reveal-right.active {
        transform: translateY(0);    /* Move to normal position */
        opacity: 1;
    }

    /* Footer mobile adjustments */
    footer { padding: 15px 10px 10px; }
    .footer-grid { flex-direction: column; align-items: center; gap: 15px; }
}

/* =========================================
   CARDS & SLIDER
   ========================================= */
.format-track {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px; width: 100%; margin-top: 20px;
}
.format-card {
    background: rgba(255,255,255,0.05); border-radius: 15px; padding: 15px; border: 1px solid rgba(255,255,255,0.1);
}
.format-card img { width: 100%; height: 160px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }
.format-card h3 { font-size: 1.1rem; color: var(--accent-gold); margin: 5px 0; }

/* Highlight Slider */
.highlight-container {
    position: relative;
    width: 100%; max-width: 900px;
    margin: 20px auto 0 auto;
    overflow: hidden;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.1);
    aspect-ratio: 16/9; 
}

.highlight-track { width: 100%; height: 100%; position: relative; }

.highlight-slide {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0; 
    transform: scale(1);
    transition: opacity 1s ease-in-out, transform 6s linear; 
    z-index: 1;
}

.highlight-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

.highlight-slide.active {
    opacity: 1; z-index: 2; transform: scale(1.1);
}

@media (max-width: 600px) {
    .highlight-container { aspect-ratio: 4/3; }
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    background-color: #1a1816;
    padding: 60px 5% 48px; 
    border-top: 1px solid rgba(212, 163, 115, 0.15);
    width: 100%; position: relative; z-index: 100;
}

.footer-grid {
    display: flex; justify-content: space-between;
    max-width: 1200px; margin: 0 auto; width: 100%;
}

.footer-reveal {
    opacity: 0; transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.2, 1, 0.3, 1);
}
.footer-reveal.active { opacity: 1; transform: translateY(0); }

.footer-col {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; text-align: center;
}

.footer-col h3 {
    font-size: 1rem; text-transform: uppercase;
    letter-spacing: 1.5px; color: var(--accent-gold); margin-bottom: 8px;
}

.footer-col p { font-size: 0.85rem; color: #999; margin: 0; }

.footer-links { display: flex; flex-direction: column; gap: 5px; }
.footer-links a { text-decoration: none; color: #ffffff; font-size: 1rem; font-family: 'Playfair Display', serif; }

.social-icons { display: flex; gap: 10px; margin-top: 5px; justify-content: center; }
.social-icons a {
    text-decoration: none !important; color: #fff;
    width: 32px; height: 32px; border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    transition: 0.3s ease;
}
.social-icons a:hover { border-color: var(--accent-gold); }

.footer-bottom {
    text-align: center; margin-top: 15px; padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.65rem; color: #444;
}

/* Active Page Indicator (Desktop Only) */
@media (min-width: 993px) {
    .header-link.active {
        color: #fff !important;       
        opacity: 1 !important;        
        transform: translateY(0) !important; 
        text-shadow: 0 0 15px rgba(212, 163, 115, 0.8); 
    }
}

/* =========================================
   FINAL MOBILE FIXES (No Lines, No Tilt)
   ========================================= */

/* --- MOBILE FIX FOR HOME PAGE --- */
@media screen and (max-width: 992px) {
    
    /* 1. Reset Global Styles to prevent horizontal scrolling */
    html, body {
        width: 100%;
        overflow-x: hidden !important;
        position: relative;
    }

    /* 2. Fix the Hero Section 
       - Removes the fixed 85vh/75vh height
       - Uses 'auto' so it only takes up as much space as the text needs
       - Adds padding to ensure the text isn't squashed
    */
    .hero {
        height: auto !important;        
        min-height: unset !important;   
        display: flex !important;
        flex-direction: column;
        justify-content: flex-end; /* Aligns content towards bottom of hero area */
        padding-top: 140px !important;  /* Space for Navbar */
        padding-bottom: 80px !important; /* Space for the overlap */
        box-sizing: border-box;
    }

    /* 3. Pull the "Mission" Container Up 
       - We use a larger negative margin here to ensure it overlaps 
         the hero background, closing the gap completely.
    */
    .container {
        margin-top: -60px !important; 
        padding: 0 20px;
        position: relative;
        z-index: 20;
        width: 100%;
    }

    /* 4. Ensure Text is Visible
       - Sometimes animations hide the text if JS doesn't trigger on mobile.
       - This forces the text to be visible immediately.
    */
    .reveal-left, .reveal-right, .section-glass {
        opacity: 1 !important;
        transform: none !important;
    }

    /* 5. Adjust Hero Text Size for Mobile */
    .hero h1 {
        font-size: 2.2rem;
        line-height: 1.2;
    }
}

/* --- MEDIA QUERIES --- */
@media (max-width: 768px) {
    footer { padding: 15px 10px 10px; }
    .footer-grid { flex-direction: column; align-items: center; gap: 15px; }
    .section-glass { padding: 30px 15px; }
    
    .card-reveal:nth-child(odd) { transform: translateX(-30px); }
    .card-reveal:nth-child(even) { transform: translateX(30px); }
    .card-reveal.active { transform: translateX(0); }
}

@media screen and (min-width: 768px) and (max-width: 1180px) {
    .hero { height: 60vh; }
    .container { margin-top: -20px; }
}