/* Targeted overrides for the existing navigation, after the compiled theme. */
#main-header .dropdown-menu > li > a {
    white-space: normal;
    overflow-wrap: anywhere;
    padding-right: 36px;
}
#main-header .menu-item-has-children > a { cursor: pointer; }
#main-header a:focus-visible, #main-header .navbar-toggle:focus-visible {
    outline: 2px solid #c7ab55;
    outline-offset: -3px;
}
@media (min-width: 992px) {
    #main-header .dropdown-menu {
        width: 320px;
        max-width: calc(100vw - 24px);
    }
    #main-header .navbar-nav .dropdown-menu.depth_0 {
        left: 0;
        right: auto;
        transform: none;
    }
    #main-header .navbar-nav .dropdown-menu.depth_1 {
        left: 100%;
        right: auto;
        top: 0;
        transform: none;
    }
    #main-header li.dropdown:focus-within > .dropdown-menu,
    #main-header li.dropdown.activeDropdownSmall > .dropdown-menu {
        display: block;
        opacity: 1;
        z-index: 1;
        max-height: none;
        overflow: visible;
        transform: none;
    }
    /* Preserve the separate search row when Headroom shrinks the header. */
    #main-header.headroom--unpinned #main-navbar { height: auto; }
}
/* At exactly 992px the legacy rules show the section label on a second row. */
@media (min-width: 992px) and (max-width: 1200px) {
    #main-header .topmenu .navbar-brand { display: none; }
}
@media (max-width: 991px) {
    /* Include Bootstrap's negative side margins so the button reaches the right edge. */
    #main-navbar .navbar-header { width: calc(100% + 30px); }
    #main-navbar .navbar-main-collapse {
        max-height: min(50vh, calc(100vh - 183px));
        max-height: min(50dvh, calc(100dvh - 183px));
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
    }
    #main-header .dropdown-menu { min-width: 0; max-width: 100%; }
    #main-header .navbar-top-collapse {
        position: absolute;
        top: 46px;
        left: 0;
        right: 0;
        margin: 0;
        max-height: min(50vh, calc(100vh - 60px));
        overflow-y: auto;
        z-index: 5;
    }
    #main-header.solgf-menu-open { top: 0; }
}
