/* Global menubar — auto-loaded for the header snippet (site/snippets/header.php) */

.menubar {
    --fa-serif: 0;
    --fa-weight: 0; position: sticky;
    top: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: flex-end;
    padding-bottom: var(--space-3xs);
    gap: var(--space-s);
    min-height: var(--menubar-h);
    padding-inline: var(--space-s);
    background: var(--color-bar);
    border-bottom: var(--border);
    font-size: var(--fs-menu);
}

.menubar__cluster {
    display: flex;
    align-items: center;
    gap: var(--space-l);
}
.menubar__cluster--right {
    justify-content: flex-end;
}

.menubar__item {
    white-space: nowrap;
}

/* The centred wordmark is the dynamic logo snippet (site/snippets/logo.php);
   its styles live in assets/css/logo.snippet.css. */

/* Grid / Index toggle — a single glossy pill switch (Figma 290:5815) plus a
   label naming the current view. Sized in `em` so it tracks --fs-menu. */
.view-toggle {
    display: inline-flex;
    align-items: inline;
    gap: var(--space-2xs);
}
.view-toggle__label {
    white-space: nowrap;
    line-height: .9;
}

.view-switch {
    --sw-w: 2.5rem; /* 39px at 2rem — matches the Figma node */
    --sw-h: 1.5rem; /* 23px */
    --sw-pad: 0.3rem;
    position: relative;
    flex: none;
    width: var(--sw-w);
    height: var(--sw-h);
    padding: 0;
    /*border: 0.5px solid rgba(0, 0, 0, 0.28);*/
    border-radius: 999px;
    background: linear-gradient(180deg, #c9c9c9, #dcdcdc);
    box-shadow: inset 0 0.06em 0.13em rgba(0, 0, 0, 0.22);
    cursor: pointer;
}
.view-switch__knob {
    position: absolute;
    top: var(--sw-pad);
    left: var(--sw-pad);
    width: calc(var(--sw-h) - 2 * var(--sw-pad));
    height: calc(var(--sw-h) - 2 * var(--sw-pad));
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ffffff, #d4d4d4 50%, #bcbcbc);
    box-shadow: 0 0.06em 0.13em rgba(0, 0, 0, 0.4);
}
/* Only animate the knob once Alpine has hydrated (body.is-ready), so a page
   that loads on the persisted Index position places the knob there instead of
   sliding into it. */
.is-ready .view-switch__knob {
    transition: transform 0.2s ease;
}
.view-switch[aria-checked="true"] .view-switch__knob {
    transform: translateX(calc(var(--sw-w) - var(--sw-h)));
}
.view-switch:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Language switch */
.lang-switch {
    display: inline-flex;
    gap: var(--space-2xs);
}
.lang-switch__link[aria-current="true"] {
    text-decoration: underline;
    display: none;
}

@media (max-width: 48rem) {
    .menubar {
        font-size: 1.125rem;
    }
    /* TODO(frontend): collapse clusters into the mobile menu (Figma: "Landing Page - Menu Open"). */
}
