/* =====================================================================
 * Public language switcher (kor2 point 7)
 * ---------------------------------------------------------------------
 * Self-contained. Everything is scoped under .langswitch so it cannot
 * affect the rest of the site, and it does NOT touch navigation.css or
 * components.css (owned elsewhere). Colors reuse the existing palette
 * custom properties from variables.css.
 * ===================================================================== */

.langswitch {
    display: inline-block;
}

.langswitch-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.langswitch-item {
    margin: 0;
    padding: 0;
}

/* Real links/spans: keyboard focusable, works without JS. */
.langswitch-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--secondary-color, #232153);
    border-radius: var(--border-radius, 20px);
    font-size: 0.8rem;
    line-height: 1.2;
    text-decoration: none;
    color: var(--secondary-color, #232153);
    background: transparent;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

a.langswitch-link:hover,
a.langswitch-link:focus-visible {
    background-color: var(--secondary-color, #232153);
    color: var(--light-color, #FEEEE1);
}

/* Always-visible focus ring for keyboard users. */
.langswitch-link:focus-visible {
    outline: 3px solid var(--accent-color, #D46627);
    outline-offset: 2px;
}

/* The language currently in use: highlighted, not a link. */
.langswitch-item.is-current .langswitch-link {
    background-color: var(--primary-color, #D89E19);
    border-color: var(--primary-color, #D89E19);
    color: var(--dark-color, #212121);
    cursor: default;
}

.langswitch-code {
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* The full language name is kept for wider viewports / the mobile menu; on the
 * compact desktop top bar only the 2-letter code shows. */
.langswitch--desktop .langswitch-name {
    display: none;
}

/* ---- Mobile menu variant ---- */
.langswitch--mobile {
    display: block;
    width: 100%;
}

.langswitch--mobile .langswitch-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.langswitch--mobile .langswitch-link {
    font-size: 1rem;
    padding: 8px 16px;
}

.langswitch--mobile .langswitch-name {
    display: inline;
}

/* Honour reduced-motion: drop the hover/focus transition entirely. */
@media (prefers-reduced-motion: reduce) {
    .langswitch-link {
        transition: none;
    }
}
