/* Core Variables & Reset */
:root {
    --bg-main: #f8f9fa;
    --oxford-blue: #002147;
    --cambridge-gold: #C5A059;
    --text-dark: #1a1a1a;
    --glass-bg: rgba(255, 255, 255, 0.95);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--bg-main); color: var(--text-dark); overflow-x: hidden; }
h1, h2, h3, h4 { font-family: 'Cinzel', serif; color: var(--oxford-blue); }

.container { max-width: 1200px; margin: 0 auto; padding: 5rem 2rem; }
.bg-light { background-color: #ffffff; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 { font-size: 2.5rem; }

/* Academic Divider */
.academic-divider { height: 2px; width: 80px; background: var(--cambridge-gold); margin: 1rem auto; position: relative; }
.academic-divider::after { content: "♦"; color: var(--cambridge-gold); position: absolute; top: -10px; left: 50%; transform: translateX(-50%); font-size: 1.2rem; background: inherit; padding: 0 10px; }
.bg-light .academic-divider::after { background: #ffffff; }

/* Header & Navigation */
header { position: fixed; width: 100%; top: 0; z-index: 1000; background: var(--glass-bg); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(0,0,0,0.05); transition: 0.4s; }
.nav-container { display: flex; justify-content: space-between; padding: 1.2rem 5%; align-items: center; }
.logo a { font-family: 'Cinzel', serif; font-size: 1.8rem; color: var(--oxford-blue); text-decoration: none; font-weight: bold; }
.nav-list { display: flex; gap: 2rem; list-style: none; align-items: center; }
.nav-link { color: var(--oxford-blue); text-decoration: none; font-weight: 600; text-transform: uppercase; font-size: 0.9rem; letter-spacing: 1px; transition: color 0.3s; }
.nav-link:hover { color: var(--cambridge-gold); }

/* Buttons */
.btn-gold { background: var(--cambridge-gold); color: white; padding: 15px 35px; text-decoration: none; text-transform: uppercase; font-weight: bold; letter-spacing: 2px; border-radius: 3px; display: inline-block; transition: 0.3s; }
.btn-gold:hover { background: #a88849; transform: translateY(-3px); }
.btn-gold-outline { border: 2px solid var(--cambridge-gold); padding: 8px 20px; border-radius: 3px; color: var(--oxford-blue); }
.btn-gold-outline:hover { background: var(--cambridge-gold); color: white; }
.gold-text { color: var(--cambridge-gold); }

/* Mobile Hamburger Menu */
.hamburger { display: none; cursor: pointer; z-index: 1001; }
.hamburger span { display: block; width: 25px; height: 3px; background-color: var(--oxford-blue); margin: 5px 0; transition: 0.4s; }

/* Hero */
.hero { height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; background: linear-gradient(rgba(0, 33, 71, 0.85), rgba(0, 33, 71, 0.95)), url('https://images.unsplash.com/photo-1532012197267-da84d127e765?auto=format&fit=crop&q=80') center/cover; }
.hero-content { color: white; padding: 0 20px; width: 100%; }
.hero-content p { font-size: 1.2rem; color: #e0e0e0; margin-bottom: 2.5rem; max-width: 600px; margin-inline: auto; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; text-align: center; }
.stat-box { background: white; padding: 2.5rem; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); border-top: 4px solid var(--cambridge-gold); }
.stat-box span { font-size: 3rem; font-family: 'Cinzel', serif; color: var(--oxford-blue); font-weight: bold; }

/* Faculty */
.filter-controls { display: flex; justify-content: center; gap: 1rem; margin-bottom: 3rem; flex-wrap: wrap; }
.filter-btn { background: transparent; border: 1px solid var(--oxford-blue); color: var(--oxford-blue); padding: 8px 20px; border-radius: 30px; cursor: pointer; transition: 0.3s; font-weight: 600; }
.filter-btn.active, .filter-btn:hover { background: var(--oxford-blue); color: white; }
.faculty-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.faculty-card { background: white; border-radius: 8px; padding: 2rem; box-shadow: 0 10px 30px rgba(0,0,0,0.04); transition: 0.4s; border-left: 4px solid transparent; }
.faculty-card:hover { transform: translateY(-5px); border-left-color: var(--cambridge-gold); }
.subject { display: inline-block; padding: 5px 12px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; margin: 10px 0; }
.tag-science { background: #e3f2fd; color: #1565c0; } .tag-commerce { background: #fff3e0; color: #e65100; } .tag-language { background: #e4fcef; color: #26b54d; }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; }
.gallery-grid img { width: 100%; height: 250px; object-fit: cover; border-radius: 8px; transition: 0.3s; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.gallery-grid img:hover { transform: scale(1.02); }

/* Admission Form & Rules */
.admission-layout { display: grid; grid-template-columns: 1fr 1.5fr; gap: 4rem; }
.rules-container h3, .form-container h3 { margin-bottom: 1.5rem; font-size: 1.8rem; }
.formal-list { list-style: none; }
.formal-list li { margin-bottom: 15px; padding-left: 30px; position: relative; color: var(--text-dark); line-height: 1.6; }
.formal-list li::before { content: "✓"; color: var(--cambridge-gold); position: absolute; left: 0; font-weight: bold; font-size: 1.2rem; }
.google-form-wrapper { background: #ffffff; padding: 10px; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }

/* Footer */
footer { background: var(--oxford-blue); color: white; text-align: center; padding: 2rem; font-size: 0.9rem; }

/* Animations */
.reveal { opacity: 0; transform: translateY(40px); transition: all 0.8s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }

/* =========================================
   Logo Styling
   ========================================= */
.nav-logo { height: 35px; width: auto; margin-right: 10px; vertical-align: middle; }
.logo { display: flex; align-items: center; }
.hero-logo { height: 180px; width: auto; margin-bottom: 20px; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3)); }

/* =========================================
   Typewriter Layout Shift Fix (Hard Lock)
   ========================================= */
/* Wrapping container explicitly locks the vertical space */
.typewriter-container {
    height: 140px; 
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    width: 100%;
}
.hero-content h1 { 
    color: white; 
    font-size: 4rem; 
    line-height: 1.2;
    margin: 0;
}
#typewriter {
    display: inline-block;
    min-height: 1.2em;
}

/* =========================================
   Infinite Sliding Gallery (With Edge Fading)
   ========================================= */
.gallery-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    background: var(--bg-light);
    /* Eye-pleasing fade on left and right edges */
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.gallery-track {
    display: flex;
    gap: 15px;
    width: max-content; 
    padding: 0 7.5px; /* Helps smooth the gap during infinite loop */
}

.gallery-track img {
    width: 280px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

@keyframes slideLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } 
}
@keyframes slideRight {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

.track-left { animation: slideLeft 35s linear infinite; }
.track-right { animation: slideRight 35s linear infinite; }

.gallery-track:hover { animation-play-state: paused; }

/* Expand Admisson Form*/
.toggle-icon { display: none; }
.accordion-content { display: block !important; } /* Always open on Desktop */
.accordion-header { cursor: default; }


/* =======================================================
   MOBILE OPTIMIZATION (MEDIA QUERIES)
   ======================================================= */
@media (max-width: 768px) {
    .container { padding: 3rem 1.5rem; overflow: hidden; }
    .section-header h2 { font-size: 2rem; }
    
    .hamburger { display: block; }
    #nav-menu {
        position: fixed; top: 0; right: -100%; width: 70%; height: 100vh;
        background: var(--oxford-blue); display: flex; align-items: center; justify-content: center;
        transition: 0.4s ease-in-out; box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    }
    #nav-menu.active { right: 0; }
    .nav-list { flex-direction: column; text-align: center; gap: 2.5rem; }
    .nav-link { color: white; font-size: 1.2rem; }
    .btn-gold-outline { color: var(--cambridge-gold); border-color: var(--cambridge-gold); }
    .hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* Typewriter Mobile Jump Fix */
    .typewriter-container {
        height: 120px; /* Accounts for words wrapping on small screens */
    }
    .hero-content h1 { 
        font-size: 2.4rem; 
    }
    
    .stats-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .hero-logo { height: 100px; }
    .hero-content p { font-size: 1rem; }
    
    .filter-controls { 
        display: flex; flex-direction: row; flex-wrap: nowrap; 
        overflow-x: auto; justify-content: flex-start;
        padding-bottom: 15px;
        width: 100%; 
        max-width: 100vw;
        -webkit-overflow-scrolling: touch; 
        scrollbar-width: none; 
    }
    .filter-controls::-webkit-scrollbar { display: none; } 
    .filter-btn { flex: 0 0 auto; width: auto; white-space: nowrap; }

    .gallery-track img { width: 220px; height: 160px; }

    .admission-layout { grid-template-columns: 1fr; gap: 1rem; }
    
    .accordion-header { 
        display: flex; justify-content: space-between; align-items: center; 
        cursor: pointer; background: white; padding: 15px 20px; 
        border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); 
        border-left: 4px solid var(--cambridge-gold);
    }
    .accordion-header h3 { margin-bottom: 0; font-size: 1.4rem; }
    
    .toggle-icon { display: block; font-size: 1.8rem; color: var(--oxford-blue); font-weight: bold; }
    
    /* Hides content by default on mobile */
    .accordion-content { display: none !important; padding: 15px 5px; }
    
    /* Shown when toggled by JS */
    .accordion-content.active { display: block !important; animation: fadeIn 0.3s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

}