/* ==================== MOBILE MENU - GATEWAY COLLEGE ==================== */

@media (max-width: 921px) {
    
    /* ========== Header - Fixed Position ========== */
    .ast-mobile-header-wrap,
    #ast-mobile-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 9999999 !important;
        transition: background 0.2s ease, box-shadow 0.2s ease !important;
    }
    
    /* White background when scrolled */
    .ast-mobile-header-wrap.scrolled,
    #ast-mobile-header.scrolled {
        background: rgba(20, 20, 20, 0.5) !important; 
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    /* White background when menu is open */
    body.gateway-menu-active .ast-mobile-header-wrap,
    body.gateway-menu-active #ast-mobile-header {
        background: rgba(20, 20, 20, 0.5) !important; 
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    /* ========== Hamburger to X Icon Toggle ========== */
    
    /* Ensure hamburger is always visible */
    .menu-toggle,
    .ast-mobile-menu-toggle,
    .ast-button-wrap button {
        position: relative !important;
        z-index: 99999999 !important;
    }
    
    /* Default state: Show hamburger, hide X */
    .menu-toggle .ast-menu-svg,
    .ast-mobile-menu-toggle .ast-menu-svg {
        display: inline-flex !important;
        opacity: 1 !important;
        transition: opacity 0.2s ease !important;
    }
    
    .menu-toggle .ast-close-svg,
    .ast-mobile-menu-toggle .ast-close-svg {
        display: none !important;
        opacity: 0 !important;
        transition: opacity 0.2s ease !important;
    }
    
    /* Open state: Hide hamburger, show X */
    .menu-toggle.gateway-menu-open .ast-menu-svg,
    .ast-mobile-menu-toggle.gateway-menu-open .ast-menu-svg,
    button.gateway-menu-open .ast-menu-svg {
        display: none !important;
        opacity: 0 !important;
    }
    
    .menu-toggle.gateway-menu-open .ast-close-svg,
    .ast-mobile-menu-toggle.gateway-menu-open .ast-close-svg,
    button.gateway-menu-open .ast-close-svg {
        display: inline-flex !important;
        opacity: 1 !important;
    }
    
    /* Icon color - always dark for consistency */
    .menu-toggle svg,
    .ast-mobile-menu-toggle svg,
    .ast-theme-transparent-header .menu-toggle svg,
    .ast-theme-transparent-header .ast-mobile-menu-toggle svg,
    .ast-mobile-header-wrap.scrolled .menu-toggle svg,
    .ast-mobile-header-wrap.scrolled .ast-mobile-menu-toggle svg,
    body.gateway-menu-active .menu-toggle svg,
    body.gateway-menu-active .ast-mobile-menu-toggle svg {
        fill: #ffffff!important;
    }
    
    /* ========== Hide Astra's Default Menu ========== */
    #ast-mobile-site-navigation,
    .main-header-bar-navigation .ast-mobile-site-navigation {
        display: none !important;
    }
    
    /* ========== Menu Overlay ========== */
    .gateway-menu-overlay {
        position: fixed;
        top: 90px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 999 !important;
        pointer-events: none;
    }
    
    .gateway-menu-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    
    /* ========== Custom Menu Panel ========== */
    .gateway-menu-panel {
        position: fixed;
        top: 90px;
        left: -85%;
        width: 85%;
        max-width: 400px;
        height: calc(100vh - 90px);
        height: calc(100dvh - 90px);
        background: #ffffff;
        z-index: 1000 !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        overscroll-behavior: contain;
    }
    
    .gateway-menu-panel.active {
        left: 0;
    }
    
    .gateway-menu-content {
        padding: 20px 0;
    }
    
    /* ========== Navigation Styles ========== */
    .gateway-primary-nav {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .gateway-primary-nav li {
        border-bottom: 1px solid #f0f0f0;
        margin: 0;
    }
    
    .gateway-primary-nav li a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        color: #333;
        text-decoration: none;
        font-size: 16px;
        transition: background 0.2s ease;
    }
    
    .gateway-primary-nav li a:hover,
    .gateway-primary-nav li a:active {
        background: rgba(0, 102, 204, 0.05);
    }
    
    .gateway-primary-nav li.current-menu-item > a,
    .gateway-primary-nav li.current_page_item > a {
        color: #0066cc;
        font-weight: 600;
    }
    
    .gateway-primary-nav li a::after {
        content: '';
        width: 8px;
        height: 8px;
        border-top: 2px solid currentColor;
        border-right: 2px solid currentColor;
        transform: rotate(45deg);
        opacity: 0.5;
    }
    
    .gateway-primary-nav .sub-menu {
        list-style: none;
        padding-left: 20px;
        margin: 0;
    }
    
    .gateway-primary-nav .sub-menu li a {
        padding: 12px 20px;
        font-size: 15px;
    }
    
    /* ========== Custom Links ========== */
    .gateway-custom-links {
        margin-top: 20px;
        padding: 20px 0;
        border-top: 2px solid #e0e0e0;
    }
    
    .gateway-custom-links-title {
        padding: 0 20px 10px;
        font-size: 13px;
        color: #999;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-weight: 600;
    }
    
    .gateway-custom-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 20px;
        margin: 5px 0;
        background: #f8f9fa;
        color: #333;
        text-decoration: none;
        font-size: 15px;
        transition: all 0.2s ease;
    }
    
    .gateway-custom-link:hover,
    .gateway-custom-link:active {
        background: #e9ecef;
        transform: translateX(5px);
    }
    
    .gateway-custom-link svg {
        width: 16px;
        height: 16px;
        stroke: currentColor;
        fill: none;
    }
    
    /* ========== Body Scroll Lock - CRITICAL ========== */
    body.gateway-menu-active {
        position: fixed !important;
        overflow: hidden !important;
        touch-action: none !important;
        width: 100% !important;
    }
    
    /* iOS support */
    @supports (-webkit-touch-callout: none) {
        body.gateway-menu-active {
            min-height: -webkit-fill-available !important;
        }
    }
}

/* ========== Desktop: Hide Custom Elements ========== */
@media (min-width: 922px) {
    .gateway-menu-overlay,
    .gateway-menu-panel {
        display: none !important;
    }
}

/* ========== Hide Screen Reader Text ========== */
.menu-toggle .screen-reader-text,
.ast-mobile-menu-toggle .screen-reader-text {
    display: none !important;
}