/*
 * H2MIRI Mobile Menu Styles
 * Hamburger menu and drawer navigation for mobile devices
 */

/* ==============================
   MOBILE MENU TOGGLE BUTTON
   ============================== */

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    gap: 6px;
    z-index: 999;
}

.mobile-menu-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger animation - active state */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(10px, 10px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ==============================
   MOBILE MENU DRAWER
   ============================== */

.mobile-menu-drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 998;
}

.mobile-menu-drawer.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 320px;
    height: 100%;
    background-color: #000;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

.mobile-menu-content.active {
    transform: translateX(0);
}

/* ==============================
   NAVIGATION MENU INSIDE DRAWER
   ============================== */

.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 80px 0 20px 0;
}

.mobile-menu-nav li {
    margin: 0;
    padding: 5px;
}

.mobile-menu-nav a {
    display: block;
    padding: 16px 20px;
    color: white;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
}

.mobile-menu-nav a:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.mobile-menu-nav a[aria-current="page"] {
    background-color: rgba(255, 255, 255, 0.2);
    border-left: 4px solid #003366;
    padding-left: 16px;
}

/* ==============================
   CTA BUTTON IN MOBILE MENU
   ============================== */

.mobile-menu-cta {
    padding: 20px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu-cta .join-button {
    width: 100%;
    display: block;
    text-align: center;
    margin: 0;
    padding: 14px 20px;
    font-size: 1rem;
    background-color: #ffffff;
    color: #003366;
    font-weight: 600;
    border-radius: 5px;
}

.mobile-menu-cta .join-button:hover {
    background-color: #f0f0f0;
    color: #003366;
}

/* ==============================
   RESPONSIVE BREAKPOINTS
   ============================== */

/* Show hamburger menu on mobile (0px - 768px) */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    /* Hide desktop navigation on mobile */
    .wp-block-navigation {
        display: none;
    }

    /* Ensure header stays accessible */
    header {
        position: relative;
        z-index: 997;
    }

    /* Make the main flex container space between on mobile */
    header > .wp-block-group.is-layout-flex {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    /* Hide the outer centered layout on mobile */
    header > .wp-block-group.alignwide {
        justify-content: space-between !important;
    }

    .join-button {
        margin-left: 0;
        border-radius: 0;

    }
}

/* Hide hamburger menu on desktop (769px+) */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }

    .mobile-menu-drawer,
    .mobile-menu-content {
        display: none !important;
    }

    /* Restore desktop navigation */
    .wp-block-navigation {
        display: flex !important;
    }
}

/* ==============================
   SCROLLING BEHAVIOR
   ============================== */

body.menu-open {
    overflow: hidden;
}
