/* Load after the template styles so the public header has one layout at every
   page and enough room for the English and Chinese navigation labels. */
.site-header.navbar-inverse {
    min-height: 0;
    padding-top: 0;
}

.site-header .header-container {
    /* Match the content gutters. Course pages also apply their existing
       .course.container width to this container at wide breakpoints. */
    padding: 12px 15px;
}

@media (min-width: 768px) {
    .site-header .header-container-home {
        /* Align with the slider on larger screens; retain the shared 15px
           content gutters on mobile. */
        padding-right: 0;
        padding-left: 0;
    }
}

.site-header .navbar-header {
    float: none;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.site-header .navbar-header::before,
.site-header .navbar-header::after {
    display: none;
}

.site-header .header-container .navbar-brand {
    float: none;
    order: 1;
    flex: 0 1 auto;
    min-width: 0;
    height: auto;
    margin: 0 auto 0 0;
    padding: 0;
}

.site-header .dslc-logo {
    width: clamp(140px, 30vw, 240px);
}

.site-header .navbar-brand .dslc-logo > img {
    width: 187.1127%;
    margin: 0;
}

.site-header .languagePicker {
    order: 2;
    flex: 0 0 auto;
    float: none;
    margin: 0;
}

.site-header .dropbtn {
    min-height: 44px;
}

.site-header .dropdown-content {
    right: 0;
    z-index: 1001;
}

.site-header .navbar-toggle {
    order: 3;
    flex: 0 0 auto;
    width: 44px;
    min-height: 44px;
    margin: 0;
}

.site-header .mainNav {
    margin: 0;
    padding: 0;
}

.site-header .navbar-nav > li > a {
    min-height: 44px;
}

.site-header .dropdown-menu > li > a {
    white-space: normal;
    overflow-wrap: break-word;
}

.site-header a:focus-visible,
.site-header button:focus-visible {
    outline: 2px solid #357bb8;
    outline-offset: 3px;
}

/* Bootstrap 3 normally expands at 768px. Keep this longer menu collapsed
   through tablet widths to prevent it from colliding with the brand. */
@media (max-width: 1199px) {
    .site-header .navbar-toggle,
    .site-header .mobileOnly {
        display: block !important;
    }

    .site-header .desktopOnly {
        display: none !important;
    }

    .site-header .navbar-collapse {
        clear: both;
        margin: 12px 0 0;
        padding: 0;
        border-top: 1px solid #e5e5e5;
        box-shadow: none;
    }

    .site-header .navbar-collapse.collapse {
        display: none !important;
    }

    .site-header .navbar-collapse.collapse.in {
        display: block !important;
        overflow-y: visible !important;
    }

    .site-header .mainNav,
    .site-header .mainNav > li {
        float: none !important;
        width: 100%;
    }

    .site-header .navbar-nav .open .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        min-width: 0;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .site-header .navbar-nav .open .dropdown-menu > li > a {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        padding: 12px 20px;
        color: #fff;
        background-color: #357bb8;
    }

    .site-header .navbar-nav .open .dropdown-menu > li > a:hover,
    .site-header .navbar-nav .open .dropdown-menu > li > a:focus {
        background-color: #92C400;
    }
}

@media (min-width: 1200px) {
    .site-header .header-container {
        display: flex;
        align-items: center;
        gap: 24px;
    }

    .site-header .header-container::before,
    .site-header .header-container::after {
        display: none;
    }

    .site-header .navbar-header {
        flex: 0 0 auto;
    }

    .site-header .dslc-logo {
        width: 220px;
    }

    .site-header .navbar-collapse {
        flex: 1 1 auto;
        min-width: 0;
        padding: 0;
    }

    .site-header .mainNav {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        float: none !important;
    }

    .site-header .mainNav > li {
        float: none;
    }

    .site-header .mainNav > li > a {
        padding-right: 10px;
        padding-left: 10px;
    }

    .site-header .dropdown-menu {
        right: 0;
        left: auto;
        min-width: 240px;
        max-width: 320px;
    }
}
