/* Custom Properties / Design System Setup */
:root {
    --primary-color: #f15a24;
    --secondary-color: #333333;
    --text-color: #555555;
    --light-bg: #f9f9f9;
    --white: #ffffff;
    --font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* Base Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-family); color: var(--text-color); line-height: 1.6; }
h1, h2, h3 { color: var(--secondary-color); margin-bottom: var(--spacing-sm); }
.container { width: 90%; max-width: 1200px; margin: 0 auto; }
.section { padding: var(--spacing-lg) 0; }
.section-title { text-align: center; font-size: 2.5rem; margin-bottom: var(--spacing-md); color: var(--primary-color); }

.bg-light { background-color: var(--light-bg); }
.bg-dark { background-color: var(--secondary-color); color: var(--white); }
.bg-dark h3, .bg-dark p { color: var(--white); }

/* Buttons */
.btn { display: inline-block; padding: 12px 24px; border-radius: var(--border-radius); text-decoration: none; font-weight: bold; transition: var(--transition); }
.btn-primary { background-color: var(--primary-color); color: var(--white); }
.btn-primary:hover { background-color: #d94b1a; }

/* Navigation */
.navbar { position: fixed; top: 0; width: 100%; background-color: var(--white); box-shadow: 0 2px 10px rgba(0,0,0,0.1); z-index: 1000; }
.nav-container { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; }

/* Enlarged Logo via Transform */
.logo img {
    height: 60px; 
    width: auto;
    transform: scale(1.6); 
    transform-origin: left center; 
}

.nav-links { list-style: none; display: flex; gap: var(--spacing-md); }
.nav-links a {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 1.2rem; /* <-- Add this line to increase the text size */
    transition: var(--transition);
}
.nav-links a:hover { color: var(--primary-color); }

.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

/* Hero Section */
.hero { margin-top: 70px; padding: 120px 0 100px 0; text-align: center; background: linear-gradient(rgba(249, 249, 249, 0.9), rgba(249, 249, 249, 0.9)), url('MSE-logo-02.png') no-repeat center center; background-size: contain; }
.hero h1 { font-size: 2.5rem; color: var(--primary-color); }
.hero .subtitle { font-size: 1.2rem; font-weight: bold; }

/* Layout Cards */
.card { background: var(--white); padding: var(--spacing-md); border-radius: var(--border-radius); box-shadow: 0 4px 6px rgba(0,0,0,0.05); }

/* About Grid */
.vision-mission { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--spacing-md); margin-top: var(--spacing-md); }

/* Services Grid */
.grid-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--spacing-md); }
.grid-item { background: var(--white); padding: var(--spacing-sm); border-left: 4px solid var(--primary-color); box-shadow: 0 2px 4px rgba(0,0,0,0.05); font-weight: 500; }

/* Benefits List */
.benefit-list { list-style: none; display: grid; grid-template-columns: 1fr; gap: var(--spacing-sm); }
.benefit-list li { background: var(--white); padding: var(--spacing-sm); border-radius: var(--border-radius); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

/* Team Grid & Photos */
.team-grid { display: grid; gap: var(--spacing-md); }
.team-member { text-align: center; }
.team-member ul { margin-top: var(--spacing-sm); padding-left: 20px; text-align: left; }
.role { color: var(--primary-color); font-weight: bold; margin-bottom: 10px; }

.team-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem auto;
    display: block;
    border: 3px solid var(--primary-color);
}

/* Footer / Contact */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--spacing-md); margin-bottom: var(--spacing-md); }
.footer-logo {
    height: 100px; /* <-- Increased from 60px */
    background: white;
    padding: 2px;  /* <-- Slightly increased padding to frame the bigger logo */
    border-radius: 4px;
    margin-bottom: var(--spacing-sm);
}
.contact-links ul { list-style: none; }
.contact-links li { margin-bottom: 5px; }
.footer-bottom { text-align: center; border-top: 1px solid rgba(255,255,255,0.1); padding-top: var(--spacing-sm); margin-top: var(--spacing-sm); }

/* Responsive Media Queries */
@media (max-width: 768px) {
    /* Shrink the massive logo slightly on mobile so it doesn't push the button off-screen */
    .logo img {
        height: 60px;
        transform: scale(1.3); 
    }

    /* Changed 'top: 70px' to 'top: 100%' so the menu never overlaps the button */
    .nav-links { 
        display: none; 
        flex-direction: column; 
        width: 100%; 
        position: absolute; 
        top: 100%; /* <-- This is the magic fix for the disappearing button */
        left: 0; 
        background: var(--white); 
        padding: var(--spacing-md) 0; 
        text-align: center; 
        box-shadow: 0 4px 6px rgba(0,0,0,0.1); 
    }
    
    .nav-links.active { display: flex; }
    
    .mobile-menu-btn { 
        display: block; 
        z-index: 1001; /* Keeps the button on top */
        flex-shrink: 0; /* Prevents the logo from squishing it */
        padding: 5px;
    }
    
    .hero {
        padding-top: 150px; /* Give the hero text more room since the header is taller */
    }

    .hero h1 { font-size: 1.8rem; }
}

/* --- VERSION 2 ANIMATION CLASSES --- */
.animate-on-scroll {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out, visibility 0.8s;
    will-change: opacity, transform, visibility;
}

.slide-up { transform: translateY(50px); }
.slide-left { transform: translateX(-50px); }
.slide-right { transform: translateX(50px); }

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }
.delay-3 { transition-delay: 0.6s; }

.animate-on-scroll.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(0); 
}

/* --- GALLERY & LIGHTBOX STYLES --- */

/* The Thumbnail Grid */
.gallery-grid {
    display: grid;
    /* This creates responsive columns that are at least 250px wide */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    padding-top: 1rem;
}

/* Individual Thumbnails */
.gallery-item {
    width: 100%;
    height: 250px; /* Fixed height forces uniform boxes */
    object-fit: cover; /* Magic property: crops the center of portrait/landscape images to fit the box without stretching */
    border-radius: var(--border-radius);
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

/* The Full-Screen Lightbox Overlay */
.lightbox {
    position: fixed;
    inset: 0; /* Shorthand for top 0, left 0, right 0, bottom 0 */
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Toggled by JavaScript */
.lightbox.active {
    display: flex;
    opacity: 1;
}

/* The Full-Size Image */
.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain; /* Ensures the whole image is visible, preserving aspect ratio */
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* The Close Button (X) */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 2001;
}

.lightbox-close:hover {
    color: var(--primary-color);
}

/* --- Lightbox Navigation Arrows --- */
.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    padding: 16px;
    transition: color 0.3s ease, background-color 0.3s ease;
    z-index: 2001;
    user-select: none; /* Prevents accidental text highlighting when clicking fast */
    border-radius: 4px;
}

.lightbox-prev:hover, .lightbox-next:hover {
    color: var(--primary-color);
    background-color: rgba(0,0,0,0.5); /* Adds a slight dark background on hover for visibility */
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Adjust mobile sizing for arrows */
@media (max-width: 768px) {
    .lightbox-prev, .lightbox-next {
        font-size: 30px;
        padding: 10px;
    }
    .lightbox-prev { left: 5px; }
    .lightbox-next { right: 5px; }
}