/* Desktop hamburger header — functions.php breakpoint filter + this file */

/* 404 widget search: global submit styling shows a clipped text button; keep icon-only like hplus. */
.error404 .ast-404-search input[type="submit"].search-submit {
	display: none !important;
}

.error404 .ast-404-search button.search-submit,
.error404 .ast-404-search .ast-search-submit {
	background-color: transparent !important;
	border-color: transparent !important;
	box-shadow: none !important;
}

@media screen and (min-width: 922px) {
    #ast-desktop-header {
        display: none !important;
    }

    #ast-mobile-header {
        display: block !important;
    }

    /* Tighten logo + tagline spacing in the above header. */
    #ast-mobile-header .ast-above-header-bar .site-branding {
        padding-top: 6px;
        padding-bottom: 10px;
    }

    #ast-mobile-header .ast-above-header-bar .site-description {
        margin-top: -25px;
    }

    /* Align search + toggle with .site-content > .ast-container (800px). */
    #ast-mobile-header .ast-primary-header-bar .ast-builder-grid-row {
        box-sizing: border-box;
        width: 100%;
        max-width: 800px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 20px;
        padding-right: 20px;
        justify-content: space-between;
    }

    /* Open menu strip: flush to the 800px column edges (no side inset). */
    #ast-mobile-header .ast-mobile-header-content {
        box-sizing: border-box;
        width: 100%;
        max-width: 800px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 0;
        padding-right: 0;
    }

    #ast-mobile-header .ast-mobile-header-content > .ast-builder-menu,
    #ast-mobile-header .ast-mobile-header-content > * {
        padding-top: 0;
        padding-bottom: 0;
    }

    #ast-mobile-header .site-header-primary-section-left {
        justify-content: flex-start;
        flex: 0 1 auto;
    }

    #ast-mobile-header .site-header-primary-section-right {
        justify-content: flex-end;
        flex: 0 1 auto;
        margin-left: auto;
    }

    /*
     * Astra slide-search in the left header section uses left:-1em (-16px),
     * which tucks the box under the tag cloud panel. Reset to flush with the
     * content column; that already leaves ~10px before the panel edge.
     */
    #ast-mobile-header .site-header-primary-section-left .ast-search-menu-icon.slide-search {
        overflow: visible;
        cursor: pointer;
    }

    #ast-mobile-header .site-header-primary-section-left .ast-search-menu-icon.slide-search .search-form {
        left: 0 !important;
        padding-left: 2.75rem !important;
        padding-right: 0 !important;
        display: none !important;
    }

    /* Magnifier is a sibling of the form; center it in the left icon column. */
    #ast-mobile-header .site-header-primary-section-left .ast-search-menu-icon.slide-search.ast-dropdown-active .ast-search-icon {
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 2.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 4;
        margin: 0;
    }

    #ast-mobile-header .site-header-primary-section-left .ast-search-menu-icon.slide-search.ast-dropdown-active .ast-search-icon .astra-search-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }
}

/* Hamburger dropdown: full-width segmented horizontal row (desktop + mobile). */
#ast-mobile-header .ast-mobile-header-content .main-header-bar-navigation,
#ast-mobile-header .ast-mobile-header-content .main-navigation,
#ast-mobile-header .ast-mobile-header-content .ast-main-header-bar-alignment {
    width: 100%;
}

#ast-mobile-header .ast-mobile-header-content .main-header-bar-navigation {
    border-top: 1px solid #d1d5db;
    border-bottom: 1px solid #d1d5db;
    background: #f8fafc;
}

#ast-mobile-header .ast-mobile-header-content .main-header-menu {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    gap: 0;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

#ast-mobile-header .ast-mobile-header-content .main-header-menu > .menu-item {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    margin: 0;
    border-right: 1px solid #d1d5db;
    border-top: none;
    border-bottom: none;
}

#ast-mobile-header .ast-mobile-header-content .main-header-menu > .menu-item:last-child {
    border-right: none;
}

#ast-mobile-header .ast-mobile-header-content .main-header-menu > .menu-item > .menu-link,
#ast-mobile-header .ast-mobile-header-content .main-header-menu > .menu-item > .mpi-account-menu-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.5rem;
    white-space: nowrap;
    box-sizing: border-box;
    border-bottom: none;
    border-radius: 0;
    padding: 0.55rem 0.5rem;
    text-align: center;
    transition: background-color 0.15s ease, color 0.15s ease;
}

#ast-mobile-header .ast-mobile-header-content .main-header-menu > .menu-item > .menu-link:hover,
#ast-mobile-header .ast-mobile-header-content .main-header-menu > .menu-item > .menu-link:focus,
#ast-mobile-header .ast-mobile-header-content .main-header-menu > .menu-item:hover > .menu-link,
#ast-mobile-header .ast-mobile-header-content .main-header-menu > .menu-item > .mpi-account-menu-link:hover,
#ast-mobile-header .ast-mobile-header-content .main-header-menu > .menu-item > .mpi-account-menu-link:focus,
#ast-mobile-header .ast-mobile-header-content .main-header-menu > .menu-item:hover > .mpi-account-menu-link {
    background-color: #eef2fb !important;
    color: #002276 !important;
}

#ast-mobile-header .ast-mobile-header-content .main-header-menu > .current-menu-item > .menu-link,
#ast-mobile-header .ast-mobile-header-content .main-header-menu > .current-menu-item > .mpi-account-menu-link,
#ast-mobile-header .ast-mobile-header-content .main-header-menu > .current-menu-ancestor > .menu-link,
#ast-mobile-header .ast-mobile-header-content .main-header-menu > .current-menu-ancestor > .mpi-account-menu-link {
    background-color: #eef2fb;
    color: #002276;
    font-weight: 600;
}

#ast-mobile-header .ast-mobile-header-content .main-header-menu > .menu-item > .ast-menu-toggle,
#ast-mobile-header .ast-mobile-header-content .main-header-menu > .menu-item > .sub-menu {
    display: none !important;
}

@media screen and (max-width: 480px) {
    #ast-mobile-header .ast-mobile-header-content .main-header-menu > .menu-item > .menu-link,
    #ast-mobile-header .ast-mobile-header-content .main-header-menu > .menu-item > .mpi-account-menu-link {
        min-height: 2.25rem;
        padding: 0.45rem 0.25rem;
        font-size: 0.875rem;
    }
}
