/* The shared Astra header is used on the public site and signed-in dashboards.
 * Keep social links in normal layout flow, independent of menu length. */
body #masthead,
body .ast-mobile-popup-drawer {
    --om-header-surface: linear-gradient(135deg, #fbf7ed 0%, #f2f8f5 100%);
    --om-header-accent: #126a59;
    --om-header-line: rgba(18, 106, 89, 0.16);
}

body #masthead .ast-header-social-1-wrap {
    transform: none !important;
}

body #masthead :is(.ast-primary-header-bar, .ast-mobile-header-content, .ast-mobile-popup-content) {
    background: var(--om-header-surface) !important;
    border-bottom: 1px solid var(--om-header-line);
}

body #masthead .main-header-menu > .menu-item > .menu-link,
body .ast-mobile-popup-drawer .main-header-menu > .menu-item > .menu-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 11px 17px !important;
    border: 1px solid transparent;
    border-radius: 999px !important;
    background: transparent !important;
    color: var(--om-header-accent) !important;
    font-family: "Inter", sans-serif !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    line-height: 1.4 !important;
    letter-spacing: -0.015em;
    text-transform: none !important;
    text-decoration: none !important;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease !important;
}

body #masthead .main-header-menu > .menu-item.om-anchor-active > .menu-link,
body:not(.home) #masthead .main-header-menu > .menu-item.current-menu-item > .menu-link,
body .ast-mobile-popup-drawer .main-header-menu > .menu-item.om-anchor-active > .menu-link {
    border-color: var(--om-header-line);
    background: #e3eee7 !important;
}

body #masthead .main-header-menu > .menu-item > .menu-link:is(:hover, :focus-visible),
body .ast-mobile-popup-drawer .main-header-menu > .menu-item > .menu-link:is(:hover, :focus-visible) {
    border-color: var(--om-header-accent);
    background: var(--om-header-accent) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14) !important;
}

body #masthead :is(a, button):focus-visible,
body .ast-mobile-popup-drawer :is(a, button):focus-visible {
    outline: 3px solid var(--om-header-accent) !important;
    outline-offset: 4px;
}

body #masthead .main-header-menu .sub-menu {
    padding: 8px;
    border: 1px solid var(--om-header-line);
    border-radius: 18px;
    background: #f2f8f5 !important;
    box-shadow: 0 14px 36px rgba(11, 36, 64, 0.1);
}

body #masthead .main-header-menu .sub-menu .menu-link {
    border-radius: 12px;
    background: transparent !important;
    color: var(--om-header-accent) !important;
    font-family: "Inter", sans-serif !important;
    font-size: 16px;
    text-transform: none !important;
}

body #masthead .main-header-menu .sub-menu .menu-link:is(:hover, :focus-visible) {
    background: #e3eee7 !important;
}

@media (min-width: 922px) {
    body #masthead #ast-desktop-header .ast-builder-grid-row:has(> .site-header-primary-section-right > [data-section="section-hb-social-icons-1"]) {
        grid-template-columns: auto auto minmax(0, 1fr);
        align-items: center;
        column-gap: clamp(18px, 2.5vw, 36px);
    }

    body #masthead #ast-desktop-header .site-header-primary-section-right:has(> [data-section="section-hb-social-icons-1"]) {
        display: contents;
    }

    body #masthead #ast-desktop-header .site-header-primary-section-right > [data-section="section-hb-social-icons-1"] {
        grid-column: 2;
        grid-row: 1;
        justify-self: start;
        margin: 0;
    }

    body #masthead #ast-desktop-header .site-header-primary-section-right > .ast-builder-menu {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        min-width: 0;
        margin: 0;
    }

    body #masthead .main-header-menu {
        align-items: center;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 6px 5px;
        background: transparent !important;
    }

    body #masthead .main-header-menu > .menu-item > .menu-link {
        white-space: nowrap;
    }
}

@media (max-width: 921px) {
    body #masthead .main-header-menu,
    body .ast-mobile-popup-drawer .main-header-menu {
        padding: 10px 14px;
        background: #f2f8f5 !important;
    }

    body #masthead .main-header-menu > .menu-item > .menu-link,
    body .ast-mobile-popup-drawer .main-header-menu > .menu-item > .menu-link {
        justify-content: flex-start;
        margin: 4px 0;
        padding: 12px 18px !important;
    }

    body #masthead .main-header-menu > .menu-item > .ast-menu-toggle {
        top: 7px;
        right: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body #masthead .main-header-menu .menu-link,
    body .ast-mobile-popup-drawer .main-header-menu .menu-link {
        transition: none !important;
        transform: none !important;
    }
}
