/* =====================================================
   LANGUAGE SWITCHER
   Expandable "Language" sub-item rendered inside the "Me"
   dropdown (desktop) and the mobile navigation drawer.
   Reuses .profile-dropdown-item visual language; adds the
   expandable list of selectable languages.
   WCAG 2.1 AA: 44px targets, 4.5:1 contrast, visible focus.
   ===================================================== */

.language-switcher {
    display: block;
    width: 100%;
}

/* The toggle row reuses .profile-dropdown-item; we only add
   the layout needed for the trailing code + chevron. */
.language-switcher-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.language-switcher-label {
    flex: 1 1 auto;
    text-align: left;
}

.language-switcher-current {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--text-secondary, #4B5563);
    text-transform: uppercase;
}

.language-switcher-chevron {
    font-size: 0.7rem;
    color: var(--text-secondary, #4B5563);
}

/* Expanded list of languages */
.language-switcher-list {
    list-style: none;
    margin: 0;
    padding: 0.25rem 0;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 6px;
}

.language-switcher-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 44px;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary, #1f2937);
    text-align: left;
    transition: background-color 0.15s ease;
}

.language-switcher-option:hover,
.language-switcher-option:focus-visible {
    background-color: rgba(0, 0, 0, 0.06);
    outline: none;
}

.language-switcher-option:focus-visible {
    box-shadow: inset 0 0 0 2px var(--community-primary, #2563eb);
}

.language-switcher-option.active {
    font-weight: 600;
    color: var(--community-primary, #2563eb);
}

.language-switcher-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--text-secondary, #4B5563);
}

.language-switcher-option.active .language-switcher-code {
    color: var(--community-primary, #2563eb);
}

.language-switcher-name {
    flex: 1 1 auto;
}

.language-switcher-check {
    font-size: 0.8rem;
    color: var(--community-primary, #2563eb);
}

/* Mobile variant — larger touch targets, full-width inside the drawer */
.language-switcher--mobile .language-switcher-option {
    min-height: 48px;
    font-size: 1rem;
    padding-left: 2.5rem;
}

.language-switcher--mobile .language-switcher-list {
    background: rgba(0, 0, 0, 0.04);
}

@media (prefers-reduced-motion: reduce) {
    .language-switcher-option {
        transition: none;
    }
}
