/* Topbar */
.topbar {
    background: var(--color-primary);
    color: #cfe3e1;
}

.topbar__inner {
    min-height: 44px;
    padding-top: 6px;
    padding-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 14px;
}

.topbar__social {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar__social-list {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.topbar__social-list img {
    height: 22px;
    width: auto;
}

.topbar__social-list a:hover {
    opacity: .7;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-shrink: 0;
}

.topbar__auth {
    display: flex;
    align-items: center;
    gap: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.topbar__auth a {
    color: #cfe3e1;
}

.topbar__auth a:hover {
    color: var(--color-accent-gold);
}

.topbar__logout {
    margin: 0;
}

.topbar__logout button {
    padding: 0;
    border: 0;
    background: none;
    color: #cfe3e1;
    font: inherit;
    cursor: pointer;
}

.topbar__logout button:hover {
    color: var(--color-accent-gold);
}

.topbar__auth-sep {
    opacity: .4;
    color: #cfe3e1;
}

/* Site header */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
    padding-top: 22px;
    padding-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.site-header__identity {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 0;
}

.state-symbols {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 20px;
    border-right: 1px solid var(--color-border);
    flex-shrink: 0;
}

.state-symbols__coat {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.state-symbols__flag {
    width: 56px;
    height: 28px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}

.site-header__brand {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
    min-width: 0;
    color: inherit;
}

.site-header__brand:hover {
    color: inherit;
}

.site-header__logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex-shrink: 0;
}

.site-header__title {
    display: block;
    font-family: var(--font-serif);
    font-size: 24px;
    line-height: 1.2;
    color: var(--color-primary);
    font-weight: 700;
    letter-spacing: -.01em;
}

.site-header__subtitle {
    display: block;
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 3px;
    letter-spacing: .02em;
}

.site-search {
    display: flex;
    align-items: stretch;
    width: 400px;
    flex-shrink: 0;
}

.site-search__input {
    flex: 1;
    min-width: 0;
    border: 1.5px solid #d6dbd6;
    border-right: 0;
    border-radius: 6px 0 0 6px;
    padding: 11px 14px;
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--color-text);
    background: var(--color-bg-alt);
    outline: none;
}

.site-search__btn {
    border: 0;
    background: var(--color-primary);
    color: #fff;
    padding: 0 20px;
    border-radius: 0 6px 6px 0;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.site-search__btn:hover {
    background: var(--color-accent-green);
}

/* Nav */
.site-nav {
    background: linear-gradient(105deg, var(--color-primary) 0%, var(--color-accent-green) 100%);
}

.site-nav__list {
    display: flex;
    align-items: stretch;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav__item {
    position: relative;
}

.site-nav__link {
    display: flex;
    align-items: center;
    height: 52px;
    padding: 0 13px;
    white-space: nowrap;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
}

.site-nav__item.is-current > .site-nav__link,
.site-nav__item:hover > .site-nav__link {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.site-nav__item.is-current > .site-nav__link {
    border-bottom-color: var(--color-accent-gold);
}

.site-nav__dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent-gold);
    margin-right: 7px;
    flex-shrink: 0;
}

.site-nav__caret {
    margin-left: 6px;
    flex-shrink: 0;
    opacity: .75;
}

.site-nav__dropdown {
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    width: max-content;
    min-width: 240px;
    max-width: 320px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-accent-gold);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 16px 36px rgba(3, 60, 68, .22);
    padding: 8px 0;
    margin: 0;
    list-style: none;
    z-index: 60;
}

.site-nav__dropdown--right {
    left: auto;
    right: 0;
}

.site-nav__item:hover > .site-nav__dropdown,
.site-nav__item:focus-within > .site-nav__dropdown {
    display: block;
}

/* Long titles wrap instead of stretching the dropdown across the screen */
.site-nav__dropdown a {
    display: block;
    padding: 8px 18px;
    font-size: 14px;
    line-height: 1.35;
    color: var(--color-text);
    white-space: normal;
}

.site-nav__dropdown a:hover {
    background: var(--color-bg-soft);
    color: var(--color-primary);
}

/* Mobile menu button (shown on narrow screens only) */
.site-nav__toggle {
    display: none;
}

@media (max-width: 1100px) {
    .topbar__inner {
        flex-wrap: wrap;
        justify-content: center;
    }

    .topbar__actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .site-header__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }

    .site-search {
        width: 100%;
    }

    /* "Menu ☰" at the right edge, within reach of the thumb; the whole bar stays clickable */
    .site-nav__toggle {
        display: flex;
        flex-direction: row-reverse;
        justify-content: flex-start;
        align-items: center;
        gap: 10px;
        width: 100%;
        height: 52px;
        padding: 0;
        border: 0;
        background: none;
        color: #fff;
        font-family: var(--font-sans);
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
    }

    .site-nav__toggle-bars,
    .site-nav__toggle-bars::before,
    .site-nav__toggle-bars::after {
        display: block;
        width: 22px;
        height: 2px;
        background: currentColor;
        border-radius: 1px;
    }

    .site-nav__toggle-bars {
        position: relative;
    }

    .site-nav__toggle-bars::before,
    .site-nav__toggle-bars::after {
        content: "";
        position: absolute;
        left: 0;
    }

    .site-nav__toggle-bars::before {
        top: -7px;
    }

    .site-nav__toggle-bars::after {
        top: 7px;
    }

    .site-nav__list {
        display: none;
        flex-direction: column;
        padding-bottom: 12px;
    }

    .site-nav.is-open .site-nav__list {
        display: flex;
    }

    .site-nav__link {
        height: auto;
        padding: 12px 4px;
        border-bottom: 1px solid rgba(255, 255, 255, .15);
    }

    .site-nav__item.is-current > .site-nav__link {
        border-bottom-color: var(--color-accent-gold);
    }

    .site-nav__caret {
        display: none;
    }

    .site-nav__dropdown,
    .site-nav__dropdown--right {
        display: block;
        position: static;
        width: auto;
        min-width: 0;
        max-width: none;
        padding: 4px 0 8px 14px;
        background: none;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .site-nav__dropdown a {
        padding: 7px 4px;
        color: #e4f0ee;
        white-space: normal;
    }

    .site-nav__dropdown a:hover {
        background: none;
        color: var(--color-accent-gold);
    }
}

@media (max-width: 600px) {
    .topbar__social > span {
        display: none;
    }

    /* State symbols on their own line, so the library name gets the full width */
    .site-header__identity {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .state-symbols {
        align-self: center;
        gap: 16px;
        padding-right: 0;
        border-right: 0;
    }

    .site-header__brand {
        flex: none;
        width: 100%;
    }

    .state-symbols__coat {
        width: 40px;
        height: 40px;
    }

    .state-symbols__flag {
        width: 40px;
        height: 20px;
    }

    .site-header__logo {
        width: 48px;
        height: 48px;
    }

    .site-header__title {
        font-size: 18px;
    }

    .a11y-toggle span {
        display: none;
    }
}

/* Phones: sign-in links get their own line so the top bar never overflows */
@media (max-width: 600px) {
    /* Full row width, so the 100% wide sign-in line does not stretch the bar past the screen */
    .topbar__actions {
        width: 100%;
        flex-shrink: 1;
        gap: 10px;
    }

    .topbar__auth {
        justify-content: center;
        width: 100%;
    }
}
