/*
 * Sticky dark header: logo, search with suggestions, language and account links.
 * Fixed height at every width, so nothing below it moves while it loads.
 */

.home-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--home-ink);
    border-bottom: 1px solid #1f1f1f;
}

.home-header__inner {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--rg-space-8);
    height: var(--home-header-height);
    max-width: 1520px;
    margin: 0 auto;
    padding: 0 var(--home-gutter);
}

.home-header__brand {
    display: inline-flex;
    align-items: center;
}

.home-header__logo {
    width: auto;
    height: 28px;
}

.home-header__actions {
    display: flex;
    align-items: center;
    gap: var(--rg-space-1);
}

.home-header__link {
    display: inline-flex;
    align-items: center;
    gap: var(--rg-space-2);
    height: 42px;
    padding: 0 14px;
    border-radius: var(--rg-radius-pill);
    color: var(--rg-color-inverse-text);
    font-size: var(--rg-font-size-base);
    white-space: nowrap;
    cursor: pointer;
    list-style: none;
    transition: background var(--rg-transition);
}

.home-page .home-header__link {
    color: var(--rg-color-inverse-text);
}

.home-header__link::-webkit-details-marker {
    display: none;
}

.home-header__link .home-icon {
    font-size: 17px;
}

.home-header__link:hover {
    background: var(--home-glass-light);
}

.home-page .home-header__link--solid {
    padding-right: 18px;
    background: var(--rg-color-surface);
    color: var(--home-ink);
}

.home-header__link--solid:hover {
    background: #e8e8e5;
}

.home-header__language {
    position: relative;
}

.home-header__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: flex;
    flex-direction: column;
    min-width: 96px;
    padding: 6px;
    border-radius: var(--rg-radius-md);
    background: var(--rg-color-surface);
    box-shadow: var(--home-pop-shadow);
}

.home-header__menu-link {
    padding: 10px 14px;
    border-radius: var(--rg-radius-sm);
    font-size: var(--rg-font-size-base);
}

.home-header__menu-link:hover,
.home-header__menu-link.is-active {
    background: var(--rg-color-surface-sunken);
}

/* Search */
.home-search {
    position: relative;
    justify-self: center;
    width: 100%;
    max-width: 560px;
}

.home-search__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 6px 0 18px;
    border-radius: var(--rg-radius-pill);
    background: var(--rg-color-surface);
    box-shadow: inset 0 0 0 1px var(--home-line);
}

.home-search__icon {
    font-size: 18px;
    color: var(--rg-color-ink-muted);
}

.home-search__input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--rg-color-ink);
    font-size: var(--rg-font-size-lg);
    appearance: none;
}

.home-page .home-search__input:focus-visible {
    outline: none;
}

.home-search__input::placeholder {
    color: var(--rg-color-text-muted);
}

.home-search__input::-webkit-search-cancel-button {
    display: none;
}

.home-search__bar:focus-within {
    box-shadow: inset 0 0 0 2px var(--home-ink);
}

.home-search__count {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    height: 34px;
    padding: 0 var(--rg-space-3);
    border-radius: var(--rg-radius-pill);
    background: var(--rg-color-surface-sunken);
    color: var(--rg-color-ink-muted);
    font-size: var(--rg-font-size-sm);
    white-space: nowrap;
}

@media (max-width: 1099px) {
    .home-header__inner {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: var(--rg-space-4);
    }

    .home-header__label {
        display: none;
    }

    .home-header__link,
    .home-page .home-header__link--solid {
        padding: 0 12px;
    }
}

@media (max-width: 699px) {
    .home-header__inner {
        grid-template-columns: 1fr auto;
        grid-template-rows: 44px 46px;
        gap: var(--rg-space-2) 0;
        align-content: center;
        padding: 0 var(--rg-space-3);
    }

    .home-header__brand {
        padding-left: var(--rg-space-1);
    }

    .home-header__logo {
        height: 22px;
    }

    .home-search {
        grid-column: 1 / -1;
        grid-row: 2;
        max-width: none;
    }

    .home-search__bar {
        padding-right: var(--rg-space-4);
    }

    .home-search__input {
        font-size: 16px;
    }

    .home-search__count {
        display: none;
    }

    .home-header__link,
    .home-page .home-header__link--solid {
        width: 44px;
        height: 44px;
        justify-content: center;
        padding: 0;
        background: transparent;
        color: var(--rg-color-inverse-text);
    }

    .home-header__link .home-icon {
        font-size: 21px;
    }

    .home-header__language summary span {
        display: none;
    }
}
