/* Scope all changes to the existing navigation. Astra owns the header and logo. */
#masthead {
    --ht-nav-heading: #251c51; /* Existing HT dropdown navy; Astra has no navy token. */
    --ht-nav-accent: var(--ast-global-color-0);
    --ht-nav-surface: var(--ast-global-color-5);
    --ht-nav-divider: var(--ast-global-color-6);
}
#masthead .ht-nav-icon { width: 24px; height: 24px; flex: 0 0 24px; vertical-align: middle; margin-right: 10px; }
#mega-menu-wrap-primary #mega-menu-primary > li.mega-ht-thought-leadership.mega-menu-megamenu > .mega-sub-menu {
    background: var(--ht-nav-surface);
    border: 1px solid var(--ht-nav-divider);
    border-radius: 4px;
    box-shadow: 0 14px 30px rgb(0 0 0 / 12%);
    padding: 30px 20px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    overscroll-behavior: contain;
}
#mega-menu-wrap-primary #mega-menu-primary .mega-ht-thought-leadership .mega-ht-nav-group > .mega-menu-link {
    display: flex;
    align-items: center;
    color: var(--ht-nav-heading);
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    text-transform: none;
    margin-bottom: 16px;
    padding: 0;
    background: transparent;
    cursor: default;
}
#mega-menu-wrap-primary #mega-menu-primary #ht-thought-leadership-panel li.mega-ht-nav-destination > .mega-menu-link {
    color: var(--ht-nav-accent);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    padding: 9px 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
    text-transform: none;
    background: transparent;
}
#mega-menu-wrap-primary #mega-menu-primary #ht-thought-leadership-panel li.mega-ht-nav-destination > .mega-menu-link::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-top: 1px solid currentColor;
    border-right: 1px solid currentColor;
    transform: rotate(45deg);
    margin-left: 6px;
}
#mega-menu-wrap-primary #mega-menu-primary #ht-thought-leadership-panel li.mega-ht-nav-destination > .mega-menu-link:hover {
    color: var(--ht-nav-heading);
    text-decoration: underline;
    text-underline-offset: 4px;
}
#mega-menu-wrap-primary #mega-menu-primary a.mega-menu-link:focus-visible,
#ast-mobile-header .menu-link:focus-visible,
#ast-mobile-header .ast-menu-toggle:focus-visible {
    outline: 2px solid var(--ht-nav-accent);
    outline-offset: -2px;
}
#mega-menu-wrap-primary #mega-menu-primary > li.mega-ht-thought-leadership.mega-menu-megamenu.mega-toggle-on > .mega-menu-link {
    color: var(--ht-nav-accent);
    background: var(--ht-nav-surface);
}
@media (min-width: 922px) {
    #mega-menu-wrap-primary #mega-menu-primary > li.mega-ht-thought-leadership.mega-menu-megamenu > .mega-sub-menu {
        --ht-panel-width: min(1056px, calc(100vw - 48px));
        width: var(--ht-panel-width);
        max-width: none;
        left: var(--ht-panel-left, 50%) !important;
        margin-left: calc(var(--ht-panel-width) / -2);
        top: 100%;
    }
    #mega-menu-wrap-primary #mega-menu-primary > li.mega-ht-thought-leadership.mega-menu-megamenu > .mega-sub-menu > .mega-menu-row > .mega-sub-menu {
        display: flex;
        align-items: stretch;
    }
    #mega-menu-wrap-primary #mega-menu-primary .mega-ht-thought-leadership .mega-menu-column {
        flex: 1 1 25%;
        min-width: 0;
        width: 25%;
    }
    #mega-menu-wrap-primary #mega-menu-primary .mega-ht-thought-leadership .mega-menu-column + .mega-menu-column {
        border-left: 1px solid var(--ht-nav-divider);
    }
    #mega-menu-wrap-primary #mega-menu-primary .mega-ht-thought-leadership .mega-menu-column > .mega-sub-menu > .mega-menu-item {
        padding: 0 22px;
    }
}
/* Astra switches to its existing hamburger at 921px. It uses the same WP menu. */
@media (max-width: 921px) {
    #ast-mobile-header .ht-nav-group > .menu-link { color: var(--ht-nav-heading); font-weight: 600; }
    #ast-mobile-header .ht-nav-destination > .menu-link { color: var(--ht-nav-accent); }
    #ast-mobile-header .ht-thought-leadership > .sub-menu { background: var(--ht-nav-surface); }
    #ast-mobile-header .ht-nav-icon { width: 20px; height: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    #mega-menu-wrap-primary #mega-menu-primary .mega-ht-thought-leadership > .mega-sub-menu { transition: none !important; }
}
/* Keyboard access must not wait for the hover animation's visibility delay. */
#mega-menu-wrap-primary #mega-menu-primary > .mega-ht-thought-leadership.mega-toggle-on:focus-within > #ht-thought-leadership-panel {
    visibility: visible;
    opacity: 1;
    transition: none;
    transform: none;
}
