/*
 * The shared site bar.
 *
 * Loaded by all three pages, next to `tokens.css` and before the app's own
 * stylesheet, so an app can override it and nothing here depends on an app.
 *
 * It is `hidden` in the markup and unhidden by the script once it has decided
 * the page is not framed. Doing it that way round means an embedded page never
 * paints a bar it is about to remove, and a page with JavaScript switched off
 * shows nothing rather than an empty 56px band.
 */

.site-bar {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    height: var(--h-header);
    padding: 0 var(--s-6);
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-line);
    font-family: var(--font-ui);
}

.site-bar[hidden] {
    display: none;
}

.site-bar__brand {
    display: flex;
    align-items: center;
    flex: none;
}

.site-bar__logo {
    display: block;
    height: 1.875rem;
    width: auto;
}

/* A hairline the height of a cap, not the height of the bar. */
.site-bar__rule {
    flex: none;
    width: 1px;
    height: 1.25rem;
    background: var(--c-line);
}

.site-bar__section {
    flex: none;
    font-size: var(--text-2xs);
    font-weight: var(--weight-medium);
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--c-ink-muted);
}

.site-bar__nav {
    display: flex;
    align-items: stretch;
    gap: var(--s-1);
    margin-left: auto;
    height: 100%;
    /* The three labels are the only thing here that can outgrow the bar. */
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.site-bar__nav::-webkit-scrollbar {
    display: none;
}

.site-bar__link {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    padding: 0 var(--s-3);
    white-space: nowrap;
    font-size: var(--text-sm);
    color: var(--c-ink-soft);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease-out);
}

.site-bar__link:hover {
    color: var(--c-brand-strong);
}

/*
 * The current view is a <span>, not a link: there is nowhere for it to go. The
 * underline is drawn with an inset shadow rather than a border so it sits on
 * the bar's own bottom hairline instead of adding a second one.
 */
.site-bar__link--current {
    font-weight: var(--weight-medium);
    color: var(--c-brand-strong);
    box-shadow: inset 0 -2px 0 var(--c-brand);
}

/* The logo's orange square, at the size the logo uses it. */
.site-bar__marker {
    width: 6px;
    height: 6px;
    flex: none;
    background: var(--c-frame);
}

.site-bar__lang {
    flex: none;
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: 0.06em;
    color: var(--c-ink-muted);
    text-decoration: none;
}

.site-bar__lang:hover {
    color: var(--c-accent);
}

.site-bar :focus-visible {
    outline: 2px solid var(--c-focus);
    outline-offset: 2px;
    border-radius: var(--r-xs);
}

/*
 * Narrow screens: the section label is the first thing to go — the logo and the
 * three view names already say what the bar is, and it is the only part that
 * repeats something.
 */
@media (max-width: 46rem) {
    .site-bar {
        gap: var(--s-3);
        padding: 0 var(--s-4);
    }

    .site-bar__section,
    .site-bar__rule:first-of-type {
        display: none;
    }

    .site-bar__link {
        padding: 0 var(--s-2);
    }
}
