/* =========================================================
   SHARED NAVIGATION STYLES (Match index.html / style.css)
========================================================= */

/* --- BASE NAV STYLES --- */
nav {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    background: rgba(0,52,116,0.95);
    /* ensure nav sits above content and remains visible while scrolling */
}

/* --- HAMBURGER MENU ICON (Hidden on Desktop) --- */
.menu-toggle {
    display: none;
    /* Flex on mobile */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 2000;
}

.menu-toggle .bar {
    height: 3px;
    width: 100%;
    background-color: #ffffff;
    /* Default white (overridden if needed) */
    border-radius: 3px;
    transition: 0.3s;
}

/* Animate Hamburger to Cross */
.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* --- BASE DROPDOWN STYLES (Desktop) --- */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    min-width: 180px;
    z-index: 1000;
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu li a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
}

.dropdown-menu li a:hover {
    background-color: #f4f4f4;
}

/* Desktop Hover */
@media (min-width: 901px) {
    .dropdown:hover .dropdown-menu {
        display: block;
    }
}

/* ================= MEDIA QUERIES (Mobile Menu) ================= */

@media (max-width: 900px) {

    /* Top Bar adjustments (optional, but good for consistency) */
    .top-bar {
        height: auto;
        flex-direction: column;
        padding: 10px 20px;
        gap: 10px;
        text-align: center;
    }

    .top-bar .info {
        display: none;
    }

    /* Nav adjustments */
    nav {
        justify-content: space-between;
        padding: 15px 20px;
        align-items: center;
    }

    .menu-toggle {
        display: flex;
    }

    /* Mobile Menu List - MATCHING STYLE.CSS */
    .nav-list,
    nav ul {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background-color: #003474;
        /* Default Brand Blue */
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);

        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding-top: 120px;
        /* KEEPING 120px FIX */
        transition: 0.3s ease;
        z-index: 1500;
        box-sizing: border-box;

        /* Reset inherited styles */
        max-height: none;
        opacity: 1;
        overflow-y: auto;
    }

    .nav-list.active,
    nav ul.active {
        left: 0;
    }

    .nav-list li,
    nav ul li {
        width: 100%;
        text-align: left;
        margin: 0;
    }

    .nav-list li a,
    nav ul li a {
        display: block;
        padding: 15px 25px;
        width: 100%;
        font-size: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Mobile Dropdown - shrink-to-content instead of full width */
    .dropdown-menu {
        position: static;
        display: none;
        background: #ffffff;
        box-shadow: none;
        width: auto; /* let it size to its contents */
        max-width: 260px; /* don't exceed the mobile menu width */
        padding: 6px 0; /* small vertical padding for items */
        border-radius: 8px;
        box-sizing: border-box;
        margin: 6px 0 6px 18px; /* slight inset from left edge */
        overflow: visible;
        height: auto; /* ensure it only takes content height */
        white-space: normal;
    }

    .dropdown-menu li a {
        padding-left: 40px;
        /* Reset to style.css values */
        font-size: 15px;
        color: #1a1a1a !important;
        background: #f8f9fa;
        border-bottom: 1px solid #e9ecef;
    }

    .dropdown-menu li a:hover {
        color: #c4d600 !important;
        background: #ffffff;
        padding-left: 45px;
    }

    /* Show Dropdown on click/active in mobile */
    .dropdown:hover .dropdown-menu,
    .dropdown.active .dropdown-menu {
        display: block;
    }
}

@media (max-width: 600px) {

    /* Full width menu on small screens - FROM STYLE.CSS */
    .nav-list,
    nav ul {
        width: 100%;
    }
}