﻿:root {
    --header-height: 160px; /* fallback */
}

.main-content {
    margin-top: calc(var(--header-height) - 2px);
}

.alert-banner {
    transition: all .4s ease, opacity .4s ease;
}

.alert-banner.is-hidden {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: none;
}

.alert-banner[style*="max-height: 0"] {
    height: 0 !important;
    border: none !important;
    line-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.alert-banner.prehide {
    display: none !important;
}

/* UTILITY HEADER */

.site-header {
    position: fixed;
    width: 100%;
    z-index: 999;
    background: white;
}

.site-utility-header {
    height: 50px;
    background-color: #046B98;
    display: flex;
    font-size: 0.875rem;
    transition: height 0.3s ease, padding 0.3s ease;
}

.utility-header-logo {
    height: 25px;
}

.utility-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.utility-header-link-container {
    display: flex;
    grid-gap: 4rem;
    margin: 0;
    padding: 0;
}

.utility-header-link {
    display: none;
}

.utility-header-language-resources-link {
    display: block;
}

.language-resources-link {
    display: flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.language-resources-link .ca-gov-icon-globe {
    font-size: 1.2rem;
    color: #fff;
    margin-right: 0.625rem;
}

.utility-header-language-resource-icon {
    margin-right: 12px;
}

.utility-header-link-container a,
.utility-header-link-container a:hover {
    color: #fff;
    text-decoration: none;
}

.utility-search {
    display: none;
}


@media (min-width: 992px) {
    .site-utility-header {
        height: 65px;
    }

    .site-utility-header.shrunk {
        height: 55px;
    }

    .utility-header-link {
        display: flex;
        align-items: center;
    }

    .utility-search {
        display: block;
    }
}

/* MAIN NAV */
.main-header {
    height: 90px;
    border-bottom: 5px solid #323A45;
    transition: height 0.3s ease, padding 0.3s ease;
}

.main-header.shrunk {
    height: 80px;
}

.main-header-inner {
    height: 100%;
}

.main-nav-wrapper {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.main-nav-wrapper {
    background: #fff;
}

.main-nav-container {
    height: 100%;
    display: none;
    align-items: center;
    justify-content: space-between;
}

.main-nav-logo img {
    height: 93px;
    max-height: 65px !important;
    transition: height 0.3s ease;
}

.main-header.shrunk .main-nav-logo img {
    height: 50px;
}

.main-nav-menu {
    height: 100%;
}

.main-nav-toggle {
    display: none;
    background: none;
    font-size: 2rem;
    border: none;
    color: #00587C;
}

.main-nav-list {
    height: 100%;
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav-item {
    position: relative;
    cursor: pointer;
    min-width: 120px;
}

.main-nav-item button, ul#main-nav-menu li {
    font-size: 1.075rem;
}

.main-nav-link {
    color: #00587C;
    font-family: "Roboto flex";
    font-size: .875rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    padding: 1rem;
    border: none;
    background: none;
    text-align: left;
    cursor: inherit;
}

.main-nav-item .submenu {
    position: absolute;
    top: 106%;
    left: 0;
    background: #fff;
    box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
    margin: 0;
    padding: 0;
    list-style: none;
    z-index: 200;
    column-count: 1;
    column-gap: 0;
    width: max-content;
    max-width: 50vw;
    min-width: 280px;
    /* calculating the max height of the dropdowns (100vh) with the utility/main nav (155px) and some extra padding (16px) */
    max-height: calc(100vh - 155px - 16px);
    overflow-y: auto;
    overflow-x: hidden;
}

.main-nav-item .submenu.two-column {
    column-count: 2;
    column-fill: auto;
}

@media (min-width: 60em) {
    .main-nav-item .submenu.two-column {
        column-count: 1;
        column-fill: auto;
    }

    .main-nav-item .submenu.two-column li {
        padding: 10px 20px 10px 20px;
    }
}

@media (max-height: 725px) {
    .main-nav-item .submenu.two-column {
        column-count: 2 !important;
    }
}

.main-nav-item .submenu li {
    break-inside: avoid;
    padding: 10px 35px;
}

.main-nav-item .submenu li a {
    display: block;
    white-space: normal;
    color: #00587C;
    text-decoration: none;
}

.main-nav-item.align-submenu-right .submenu {
    left: auto;
    right: 0;
}

.main-nav-item.has-submenu.subnav-open {
    background: #E8E9E9;
}

.main-nav-item.has-submenu.subnav-open .main-nav-link {
    color: #000;
}

.chevron svg {
    transition: transform 0.3s ease;
    transform-origin: center;
}

.chevron svg path {
    transition: fill 0.3s ease;
}

.main-nav-item.subnav-open .chevron svg {
    transform: rotate(180deg);
    fill: pink;
}

.main-nav-item.subnav-open .chevron svg path {
    fill: #000 !important;
}

.submenu li {
    padding: 10px 35px;
    font-size: .875rem;
    font-weight: 400;
}

.submenu li:hover {
    background-color: #E8E9E9;
}

.submenu li a:hover {
    text-decoration: none;
}

/*MOBILE NAV*/
@media (max-width: 992px) {
    #mobile-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 998;
        display: none;
        background: #fff;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        margin-bottom: 0;
    }

    #mobile-nav.open {
        display: block;
    }
}

html.lock-scroll,
body.lock-scroll {
    overflow: hidden;
    overscroll-behavior: none;
}

.mobile-nav-toggle {
    border: none;
    background-color: transparent;
}

.hamburger-icon .line {
    stroke: #046B98;
    stroke-width: 7;
    stroke-linecap: round;
    stroke-miterlimit: 10;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
    transform-box: fill-box;
}

.hamburger-icon.open .line1 {
    transform: translateY(17.34962px) rotate(45deg);
}

.hamburger-icon.open .line2 {
    opacity: 0;
}

.hamburger-icon.open .line3 {
    transform: translateY(-17.3496px) rotate(-45deg);
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
}

.mobile-nav-item {
    border-bottom: 1px solid #b1b6bc !important;
}

.mobile-nav-item:hover {
    background-color: #e9e9e9;
}

.mobile-nav-link {
    font-family: "Roboto flex";
    color: #00587C;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 1.1rem 4rem 1.1rem 2rem;
    background: none;
    border: none;
    font-size: 1.125rem;
}

.mobile-nav-link.active {
    background: rgba(217, 217, 217, 0.40);
    box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
    color: #323A45;
}

.mobile-nav-link svg {
    transition: transform 0.3s ease;
    width: 1rem !important;
    height: 1rem !important;
}

.mobile-nav-link.active svg {
    transform: rotate(90deg);
}

.mobile-submenu {
    padding-left: 1.5rem;
    background: #fff;
    margin-top: 5px;
    padding-top: 1.85rem;
    padding-left: 3.5rem;
    padding-bottom: 2rem;
}

.mobile-submenu[hidden] {
    display: none;
}

.mobile-submenu-item {
    list-style: none;
    color: #00587C;
    font-family: "Roboto flex";
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

.mobile-submenu > li.mobile-submenu-item:last-child {
    margin-bottom: 0;
}

.mobile-search {
    background-color: #323A45;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (max-width: 992px) {
    #main-nav-menu, .main-nav-list {
        display: none !important;
    }
}

@media (max-width: 992px) {
    .main-header {
        height: 80px;
    }

    .main-nav-logo img {
        height: 50px;
        max-height: 70px !important;
    }

    .mobile-nav-toggle svg {
        width: 40px !important;
        height: 45px !important;
    }
}

@media (min-width: 992px) {
    .mobile-nav,
    .mobile-nav-toggle {
        display: none !important;
    }

    .main-nav-container {
        display: flex;
    }
}

@media (min-width: 1280px) {
    .main-nav-link {
        gap: 0.5rem;
        padding: 1rem 1.95rem;
    }

    .main-nav-item:last-child button {
        padding-right: 0;
    }

    .utility-header-link-container {
        grid-gap: 5.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-utility-header.shrunk {
        height: 100px;
    }

    .main-header.shrunk {
        height: 133px;
    }

    .alert-banner {
        transition: none;
    }
}

.main-header .main-header-inner .main-nav-wrapper .main-nav-logo img {
    display: block !important;
    border: none !important;
    position: relative !important;
    background: none !important;
}
