/*
 * Language switcher.
 *
 * Kept out of the SCSS bundle on purpose: the Vite sources are not present on
 * this server, so the bundle cannot be rebuilt here. Everything is scoped to
 * .lang-switch / .lang-inline and uses the theme's own custom properties, so
 * it can be pasted into the SCSS unchanged on the next real build.
 */

/* ---------------- Top bar dropdown ---------------- */

.lang-switch {
    position: relative;
    line-height: 1;
}

/* The default disclosure triangle would sit next to our own caret. */
.lang-switch > summary {
    list-style: none;
}
.lang-switch > summary::-webkit-details-marker {
    display: none;
}

.lang-switch__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--topbar-text);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .06em;
    padding: 4px 2px;
    transition: color .15s;
    user-select: none;
}

.lang-switch__toggle:hover,
.lang-switch[open] .lang-switch__toggle {
    color: #fff;
}

.lang-switch__toggle:focus-visible {
    outline: 1px solid currentColor;
    outline-offset: 2px;
}

.lang-switch__caret {
    transition: transform .15s;
    opacity: .7;
}
.lang-switch[open] .lang-switch__caret {
    transform: rotate(180deg);
}

.lang-switch__menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 60;
    margin: 0;
    padding: 4px;
    min-width: 150px;
    list-style: none;
    background: var(--body-bg, #fff);
    color: var(--text-color, #18191a);
    border: 1px solid var(--line, rgba(0, 0, 0, .12));
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
}

.lang-switch__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 4px;
    font-size: 13px;
    letter-spacing: 0;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .12s;
}

.lang-switch__item:hover {
    background: var(--grey-bg, rgba(0, 0, 0, .05));
    color: inherit;
}

.lang-switch__item.is-current {
    font-weight: 600;
}

/* ---------------- Mobile drawer row ---------------- */

.lang-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--line, rgba(0, 0, 0, .1));
}

.lang-inline__label {
    font-size: 14px;
}

.lang-inline__options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.lang-inline__pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--line, rgba(0, 0, 0, .15));
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: .04em;
    color: inherit;
    text-decoration: none;
}

.lang-inline__pill.is-current {
    border-color: currentColor;
    font-weight: 600;
}

/* ---------------- Shared ---------------- */

.lang-flag {
    display: block;
    flex: 0 0 auto;
    border-radius: 2px;
}
