﻿body {
    margin: 0;
    padding: 0;
}

/* Layout container */
/* ==========================================================================
   1. NAVBAR & MAIN STRUCTURAL BASE
   ========================================================================== */
.navbar {
    position: relative;
    background-color: #ffffff;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: flex-start; /* Pushes the burger button to the TOP LEFT */
}

/* Burger Button styling */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 9999; /* Keeps button on top of everything */
}

    .hamburger .bar {
        width: 100%;
        height: 4px;
        background-color: #333;
        border-radius: 2px;
        transition: all 0.3s ease-in-out;
    }

    /* Burger to 'X' animation lines */
    .hamburger.is-active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .hamburger.is-active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.is-active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

/* ==========================================================================
   2. PRIMARY DROPDOWN NAVIGATION MENU
   ========================================================================== */
.nav-menu {
    list-style: none;
    position: absolute;
    top: 100%; /* Drops straight down below the navbar */
    left: 0; /* Aligns perfectly to the left wall */
    width: 250px; /* Constrains width so it is a neat vertical list */
    background-color: #f9f9f9;
    margin: 0;
    padding: 0;
    box-shadow: 2px 4px 5px rgba(0,0,0,0.1);
    z-index: 998;
    display: none; /* Hidden by default */
}

    /* Toggle state: Forces it to display on click */
    .nav-menu.is-active {
        display: block !important;
    }

    /* Target ONLY the main top-level list items */
    .nav-menu > li {
        position: relative;
        width: 100%;
    }

        /* Force ONLY top-level links to match height/width */
        .nav-menu > li > a {
            display: flex; /* Uses flexbox to perfectly center content */
            align-items: center; /* Vertically centers text */
            padding: 0 20px; /* Horizontal buffer padding */
            height: 55px; /* Uniform rigid button height */
            width: 100%; /* Spans full width of the 250px container */
            box-sizing: border-box; /* Includes padding in the total width calculation */
            color: #333;
            text-decoration: none;
            border-bottom: 1px solid #eee;
        }

            /* Hover effect for top-level links */
            .nav-menu > li > a:hover {
                background-color: #f1f1f1;
            }

    /* ==========================================================================
   3. DROPDOWN FLYOUT SUBMENUS (Schedules & Programs)
   ========================================================================== */

    /* Position the nested sub-lists to fly out to the right */
    .nav-menu li ul {
        list-style: none;
        margin: 0;
        padding: 0;
        background-color: #ffffff;
        box-shadow: 2px 4px 5px rgba(0,0,0,0.1);
        border-left: 1px solid #ddd; /* Adds a clean separator between panels */
        /* Position Magic */
        position: absolute;
        top: 0; /* Aligns the top edge perfectly with the parent item */
        left: 100%; /* Pushes the menu exactly 100% past the left wall (to the right) */
        width: 220px; /* Sets a clean, uniform width for flyout panels */
        /* Visibility Control with smooth transition */
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease-in-out;
        z-index: 1000; /* Ensures flyout sits cleanly on top of main page content */
    }

    /* Reveal the submenu ONLY when hovering over the parent <li> */
    .nav-menu > li:hover > ul {
        opacity: 1;
        visibility: visible;
    }

    /* Style the nested flyout links */
    .nav-menu li ul li a {
        display: block;
        padding: 12px 20px;
        font-size: 0.95em;
        color: #444;
        text-decoration: none;
        border-bottom: 1px solid #f0f0f0;
        background-color: #ffffff;
    }

        /* Hover effect inside the flyout panel */
        .nav-menu li ul li a:hover {
            background-color: #f5f5f5;
            color: #000;
        }

    /* ==========================================================================
   4. AUTOMATIC CARET/ARROW INDICATORS
   ========================================================================== */

    /* Target only the main links that have a child <ul> dropdown coming next */
    .nav-menu > li > a:has(+ ul) {
        position: relative;
        padding-right: 40px; /* Make space so text doesn't overlap the arrow */
    }

        /* Create the arrow using pure CSS styling */
        .nav-menu > li > a:has(+ ul)::after {
            content: '';
            position: absolute;
            right: 20px; /* Positions it neatly near the right edge */
            top: 50%; /* Centers vertically relative to container height */
            /* Draw geometric angle */
            border: solid #666;
            border-width: 0 2px 2px 0;
            display: inline-block;
            padding: 3px;
            transform: translateY(-50%) rotate(-45deg); /* Aligns arrow directly to the right */
            transition: transform 0.2s ease-in-out, border-color 0.2s ease-in-out;
        }

    /* Nudge arrow styling slightly forward on hover */
    .nav-menu > li:hover > a::after {
        border-color: #000;
        transform: translateY(-50%) rotate(-45deg) scale(1.1);
    }
