/* --- Global Layout Variables --- */
:root {
    /* Updated Colors for a Modern Look */
    --header-bg: #ffffff;
    --header-text: #2c3e50; /* Darker text */
    --footer-bg: #eef1f5; /* Light grey/blue footer */
    --footer-text: #667788;
    --accent-color: #3498db; /* Bright blue for accents */
    --hover-color: #2980b9; /* Slightly darker blue for hover */
    --border-color: #e0e6ef;
    --font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --panel-bg: #ffffff;
}

/* Base Reset and Body Styling */
body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: var(--font-family);
    color: var(--header-text);
    background-color: #f9f9fb; /* Light background for the whole page */
}

/* --- Header & Navigation --- */
.site-header {
    background-color: var(--header-bg);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); /* Softer shadow */
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo a {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent-color);
    text-decoration: none;
    letter-spacing: -0.8px;
    transition: color 0.3s;
}

/* Mobile Menu Toggle Button (Hidden on Desktop) */
.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: none; /* Hide by default */
    color: var(--header-text);
    transition: transform 0.2s;
}
.menu-toggle:active {
    transform: scale(0.95);
}

/* Main Navigation List (Desktop Layout) */
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
}

.main-nav a {
    text-decoration: none;
    color: var(--header-text);
    font-weight: 500;
    font-size: 1rem;
    padding: 20px 0; /* Ensures click area is large */
    display: inline-block;
    position: relative;
    transition: color 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--hover-color);
}

/* Active Indicator Line */
.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 2px;
}


/* --- Dropdown Menu Styles (Desktop Only) --- */

.dropdown-menu-item {
    position: relative;
}

.dropdown-menu-item .dropdown-menu {
    /* Styling */
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%); /* Center the dropdown relative to parent link */
    list-style: none;
    margin: 0;
    padding: 10px 0;
    min-width: 250px;
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 999;
    border-radius: 8px;
    overflow: hidden; /* Contains the border radius properly */
}

.dropdown-menu-item:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--header-text);
    font-weight: 400;
    white-space: nowrap;
    transition: background-color 0.2s, color 0.2s;
    /* Resetting the active indicator line for submenus */
    position: static;
}

.dropdown-menu li a::after {
    display: none;
}

.dropdown-menu li a:hover {
    background-color: var(--footer-bg);
    color: var(--accent-color);
}


/* --- Main Content Area --- */
main {
    flex: 1;
    width: 100%;
}


/* --- Footer --- */
.site-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 50px 0 20px; /* Increased top padding */
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 5px rgba(0,0,0,0.03);
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Explicitly set 3 columns for desktop */
    gap: 40px;
}

.footer-section h3 {
    color: var(--header-text); /* Use darker text for section headers */
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.footer-section p,
.footer-section a {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--footer-text);
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    margin-top: 50px;
    padding-top: 25px;
    border-top: 1px solid #e1e4e8;
    font-size: 0.85rem;
    color: #99aab5; /* Lighter text for copyright */
}


/* --- Responsive Overrides (Tablet & Mobile) --- */
@media (max-width: 768px) {
    .nav-container {
        height: 60px; /* Shorter header on mobile */
        padding: 0 15px;
    }

    /* Show the mobile toggle button */
    .menu-toggle {
        display: block;
        z-index: 1010; /* Above the navigation */
    }

    /* Hide the main navigation by default (collapsed state) */
    .main-nav {
        display: none;
        position: absolute;
        top: 60px; /* Below the header height */
        left: 0;
        width: 100%;
        background-color: var(--header-bg);
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        z-index: 990;
        overflow-y: auto;
        max-height: calc(100vh - 60px); /* Fill remaining viewport */
        padding-bottom: 20px;
    }

    /* Show the navigation when the 'is-open' class is applied */
    .main-nav.is-open {
        display: block;
    }

    /* Vertical stacking for mobile menu links */
    .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 0;
        border-top: 1px solid var(--border-color);
    }

    .main-nav ul li {
        width: 100%;
    }

    .main-nav a {
        padding: 15px 20px;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
        display: block;
    }

    /* Remove active indicator on mobile to keep it cleaner */
    .main-nav a.active::after {
        display: none;
    }

    /* Dropdown menus are integrated directly into the list on mobile */
    .dropdown-menu-item .dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0 0 0 20px; /* Indent sub-links */
        min-width: auto;
        border-radius: 0;
        display: block; /* Always show sub-links on mobile for simplicity */
        background-color: #f7f9fa;
    }

    .dropdown-menu li a {
        padding: 10px 20px;
        font-size: 1rem;
        color: var(--footer-text);
        border-bottom: 1px solid var(--border-color);
    }

    /* --- Footer Responsiveness --- */
    .site-footer {
        padding: 40px 0 15px;
    }

    .footer-container {
        grid-template-columns: 1fr; /* Stack columns vertically on mobile */
        gap: 30px;
        text-align: center;
    }

    .footer-section h3 {
        margin-bottom: 10px;
    }

    .footer-section p, 
    .footer-section a {
        line-height: 1.5;
        margin-bottom: 5px;
    }

    .footer-bottom {
        margin-top: 30px;
        padding-top: 15px;
    }
}