#header {
    display: flex;
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--background-color);
    z-index: 9998;
}

.navbar {
    width: 100%;
    background-color: var(--background-color);
    display: flex;
    justify-content: flex-end;
    border-bottom: 1px solid var(--text-color);
    height: 55px;
    z-index: 1;
    position: relative;
}

.navbar-button {
    width: 174px;
}

.signin-button {
    border: none;
    border-left: 1px solid var(--text-color);
}

.search-bar-wrapper {
    border-left: 1px solid var(--text-color);
    width: calc(28vw * var(--scale));
    display: flex;
    align-items: center;
}

.search-input {
    border: none;
    background-color: transparent;
}

.search-icon-wrapper {
    width: 29px;
    height: 29px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 20px;
}

.search-icon-open {
    position: relative;
    width: 100%;
    height: 100%;
}

.search-icon-close {
    position: relative;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.search-icon-close-line {
    height: 2px;
    width: 100%;
    background-color: var(--text-color);
    position: absolute;
    transform: rotateZ(45deg);
    pointer-events: none;
}

.search-icon-close-line-second {
    transform: rotateZ(-45deg);
}

.menu {
    position: fixed;
    z-index: 3;
    top: 0;
    width: 410px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    transform: translateX(calc(-410px + 72px));
    transition: transform var(--ease-transition);
}

.menu-top {
    height: 55px;
    min-height: 55px;
    border-bottom: 1px solid var(--text-color);
    display: flex;
    justify-content: flex-end;
    background-color: var(--background-color);
}

.menu-button {
    width: 72px;
    padding: 0;
    background-color: var(--background-color);
    border-bottom: none;
    border-top: none;
    border-left: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    row-gap: 7px;
    height: 100%;
}

.menu-content {
    display: flex;
    opacity: 1;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    height: calc(100vh - 55px);
}

.menu-links {
    width: 100%;
    overflow-y: auto;
    height: 100%; 
}

.nav {
    display: flex;
    flex-direction: column;
    row-gap: calc(2.1vw * var(--scale));
    padding: calc(4.8vw * var(--scale)) calc(2.6vw * var(--scale));
    list-style: none;
    display: flex;
    justify-content: center;
    min-height: calc(100vh - 55px);
}

.secondary-links {
    display: grid;
    grid-template-columns: 1fr auto;
    list-style: none;
    gap: calc(1.7vw * var(--scale));
    padding-left: 0;
}

.secondary-links li a {
    font-size: 20px !important;
    font-family: var(--font3);
}

.secondary-links li a:hover {
    text-decoration: underline;
}

.nav-link:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.nav li a, .nav li .links-label {
    line-height: 110%;
    font-size: 42px;
    color: var(--text-color);
    text-decoration: none;
    word-break: break-all;
}

.nav li .links-label {
    border-bottom: 1px solid var(--text-color-lower-opac);
    padding-bottom: calc(0.7vw * var(--scale));
    margin-bottom: calc(1.25vw * var(--scale));
    margin-top: calc(2.8vw * var(--scale));
}

.sidebar {
    width: 72px;
    min-width: 72px;
    border-right: 1px solid var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    color: var(--text-color);
    text-decoration: none;
    transform: rotate(-90deg);
    white-space: nowrap;
}

.logo img{
    height: calc(22px * var(--logo-scale));
    width: auto; 
}

.logo-text {
    font-size: 28px;
}

.menu-line {
    width: 27px;
    height: 2px;
    background-color: var(--text-color);
    pointer-events: none;
}

.first-line, .second-line {
    transition: transform var(--ease-transition);
}

.mobile-line {
    display: none;
}

.blur {
    z-index: 2;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;
    display: none;
}

.blur-lower-index {
    z-index: 0;
}

.navbar-mobile, .search-icon-wrapper-mobile, .mobile-logo {
    display: none;
}

.mobile-menu-cta {
    display: none;
}

#header ul li {
    line-height: 130%;
    margin-bottom: 0;

}

.custom-search {
    position: absolute;
    bottom: 0px;
    right: 0;
    transform: translateY(100%);
    width: calc(100% - 72px);
    background-color: var(--background-color);
}

.custom-search .section-header {
    border-top: none;
}

.custom-search .grid {
    display: none;
    padding-top: calc(2.5vw * var(--scale));
    padding-bottom: calc(2.5vw * var(--scale));
    max-height: 60vh;
    overflow-y: auto;
    border-bottom: 1px solid var(--text-color);
}

.custom-search {
    display: none;
}

.search-icon {
    position: absolute;
}

.site-content {
    padding-top: 55px;
}

#announcement-bar-root {
    transform: translateY(55px);
}

#announcement-bar-root .gh-announcement-bar {
    font-weight: 400;
    font-size: 16px;
    line-height: 150%;
    padding: 12px 6vw 12px calc(6vw + 72px);
}

li ul li .nav-link {
    word-break: unset;
}

/* Styles for large desktop */
@media (min-width: 1439px) {
    .navbar {
        height: calc(3.8vw * var(--scale));
    }

    .nav {
        min-height: calc(100vh - (3.8vw * var(--scale)));
    }

    .menu-content {
        height: calc(100vh - (3.8vw * var(--scale)));
    }

    .navbar-button {
        width: calc(12vw * var(--scale));
    }
    
    .search-icon-wrapper {
        width: calc(2vw * var(--scale));
        height: calc(2vw * var(--scale));
        margin-right: calc(1.4vw * var(--scale));
    }

    .menu {
        transform: translateX(calc((-29vw + 5vw) * var(--scale)));
        width: calc(29vw * var(--scale));
    }

    .menu-top {
        height: calc(3.8vw * var(--scale));
        min-height: calc(3.8vw * var(--scale));
    }

    .menu-button {
        width: calc(5vw * var(--scale));
        row-gap: calc(0.5vw * var(--scale));
    }
    
    .sidebar {
        width: calc(5vw * var(--scale));
        min-width: calc(5vw * var(--scale));
    }
    
    .logo {
        transform: rotate(-90deg);
    }
    
    .logo img{
        height: calc(1.5vw * var(--scale) * var(--logo-scale));
    }
    
    .logo-text {
        font-size: calc(1.9vw * var(--scale));
    }

    .menu-line {
        width: calc(1.875vw * var(--scale));
    }

    .blur {
        -webkit-backdrop-filter: blur(0.35vw);
        backdrop-filter: blur(0.35vw);
    }

    .nav li a, .nav li .links-label {
        font-size: calc(2.9vw * var(--scale));
    }

    .secondary-links li a {
        font-size: calc(1.38vw * var(--scale)) !important;
    }

    .nav-link:hover {
        text-decoration-thickness: calc(0.14vw * var(--scale));
    }

    .custom-search {
        width: calc(100% - (5vw * var(--scale)));
    }

    .site-content {
        padding-top: calc(3.8vw * var(--scale));
    }

    #announcement-bar-root {
        transform: translateY(calc(3.8vw * var(--scale)));
    }

    #announcement-bar-root .gh-announcement-bar {
        font-size: calc(1.11vw * var(--scale));
        padding: calc(0.8vw * var(--scale)) 6vw calc(0.8vw * var(--scale)) calc(6vw +  (5vw * var(--scale)));
        min-height: calc(3.3vw * var(--scale));
    }

    .gh-announcement-bar button {
        right: calc(0.55vw * var(--scale));
        margin-top: calc(-1.1vw * var(--scale));
        width: calc(2.2vw * var(--scale));
        height: calc(2.2vw * var(--scale));
    }

    .gh-announcement-bar button svg {
        width: calc(0.8vw * var(--scale));
        height: calc(0.8vw * var(--scale));
    }
}

/* Styles for tablet */
@media (max-width: 991px) {
    #header {
        position: fixed;
        background-color: transparent;
    }

    .navbar-button, .search-bar-wrapper, .sidebar {
        display: none;
    }

    .nav {
        align-items: center;
        row-gap: 26px;
        padding: 72px 30px;
        min-height: calc(100vh - 50px - 51px);
        text-align: center;
    }

    .menu-content {
        height: auto;
    }

    .menu {
        top: 0;
        position: fixed;
        width: 100%;
        min-width: 100%;
        transform: translateX(0);
        width: 100%;
        height: auto;
    }

    .navbar {
        height: 50px;
        border-bottom: none;
    }

    .menu-top {
        display: flex;
        align-items: stretch;
        justify-content: space-between;
        padding-left: 30px;
        height: 50px;
        min-height: 50px;
    }

    .menu-button {
        border-right: none;
        border-left: 1px solid var(--text-color) !important;
        padding-left: 24px;
        padding-right: 24px;
        width: auto;
        row-gap: 6px;
    }

    .mobile-logo {
        display: flex;
        align-items: center;
        justify-content: center;       
        margin-top: auto;
        margin-bottom: auto;
        text-decoration: none;
        color: var(--text-color);
    }

    .mobile-logo img {
        object-fit: scale-down;
        width: auto;
        height: calc(21px * var(--logo-scale));
    }

    .menu-and-search-wrapper {
        display: flex;
    }

    .search-icon-wrapper-mobile {
        display: flex;
        justify-content: center;
        align-items: center;
        padding-left: 28px;
        padding-right: 28px;
        border: none;
        background-color: transparent;
        position: relative;
    }

    .search-icon-wrapper-mobile svg{
        width: 30px;
        height: 30px;
    }

    .menu-content {
        display: none;
        flex-direction: column;
        opacity: 0;
        height: calc(100dvh - 50px);
        transition: opacity var(--ease-transition);
    }

    .mobile-line {
        display: block;
    }

    .nav li .links-label {
        padding-bottom: 15px;
        margin-bottom: 26px;
        margin-top: 0px;
        min-width: 40vw;
        display: flex;
        justify-content: center;
    }

    .secondary-links {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .secondary-links li {
        display: flex;
        justify-content: center;
    }

    .mobile-menu-cta {
        display: flex;
        width: 100%;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }

    .mobile-menu-cta button,  .mobile-menu-cta a{
        width: 100%;
        border: none;
        border-top: 1px solid var(--text-color);
        border-left: none;
    }

    .nav-link:hover {
        text-decoration: none;
    }

    .custom-search {
        width: 100%;
    }

    .search-bar-wrapper {
        width: 100%;
        height: 50px;
        border-left: none;
        border-bottom: 1px solid var(--text-color);
    }

    .search-input {
        padding: 14px 30px;
    }

    .custom-search .grid {
        padding-top: 30px;
        padding-bottom: 30px;
        max-height: 70dvh;
    }

    #announcement-bar-root {
        transform: translateY(50px);
    }

    #announcement-bar-root .gh-announcement-bar {
        padding: 12px 30px;
    }

    #announcement-bar-root .gh-announcement-bar-content {
        padding: 0px 30px;
    }

    .site-content {
        padding-top: 50px;
    }
}

/* Styles for mobile */
@media (max-width: 479px) {
    .menu-top {
        padding-left: 18px;
    }

    .menu-button {
        padding-left: 18px;
        padding-right: 18px;
    }

    .nav {
        min-height: calc(100vh - 50px - 41px);
    }

    .nav li a, .nav li .links-label {
        font-size: 36px;
    }

    .nav li .links-label {
        min-width: 65vw;
    }

    .search-input {
        padding: 14px 18px;
    }

    .custom-search .grid {
        padding-top: 18px;
        padding-bottom: 18px;
    }

    #announcement-bar-root .gh-announcement-bar {
        padding: 12px 18px;
    }

    #announcement-bar-root .gh-announcement-bar-content {
        padding: 0px 18px;
    }
}