/* ---------------------------------------------------------------------------
 * Sprachauswahl als Dropdown (DE / EN / NL)
 * Wird von allen Seiten in allen drei Sprachfassungen eingebunden.
 * Kommt ohne Bootstrap-JS aus: geöffnet wird per js/lang-switch.js, ohne
 * JavaScript greift der :focus-within-Fallback weiter unten.
 * ------------------------------------------------------------------------- */

.lang-switch {
    position: relative;
    display: inline-block;
    margin-left: 4px;
}

/* ── Auslöser: aktuelle Sprache ─────────────────────────────────────────── */
.lang-current {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #e3e3e3;
    border-radius: 40px;
    background: transparent;
    color: #333;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

.lang-current:hover,
.lang-current:focus-visible {
    background-color: var(--gold-light, rgba(255, 199, 0, 0.12));
    border-color: var(--gold, #FFC700);
    color: #000;
}

.lang-current:focus-visible {
    outline: 2px solid var(--gold, #FFC700);
    outline-offset: 2px;
}

.lang-current .lang-globe {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    opacity: 0.75;
}

.lang-current .lang-caret {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    opacity: 0.6;
    transition: transform 0.2s;
}

.lang-switch.open .lang-current {
    background-color: var(--gold-light, rgba(255, 199, 0, 0.12));
    border-color: var(--gold, #FFC700);
    color: #000;
}

.lang-switch.open .lang-caret {
    transform: rotate(180deg);
}

/* ── Aufklappmenü ───────────────────────────────────────────────────────── */
.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1050;
    display: none;
    min-width: 170px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.lang-switch.open .lang-menu {
    display: block;
}

/* Ohne JavaScript: Tastatur-/Touch-Fokus öffnet das Menü */
.lang-switch:not(.has-js):focus-within .lang-menu {
    display: block;
}

.lang-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 9px;
    color: #333;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s, color 0.2s;
}

.lang-menu a:hover,
.lang-menu a:focus-visible {
    background-color: var(--gold-light, rgba(255, 199, 0, 0.12));
    color: #000;
}

.lang-menu a[aria-current="true"] {
    font-weight: 800;
    color: #000;
}

/* Kürzel (DE/EN/NL) rechts neben dem ausgeschriebenen Sprachnamen */
.lang-menu .lang-code {
    margin-left: auto;
    padding-left: 12px;
    color: #aaa;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.lang-menu a[aria-current="true"] .lang-code {
    color: #b38f00;
}

/* ── Mobil: im aufgeklappten Burger-Menü mitfließen statt überlagern ────── */
@media (max-width: 991.98px) {
    .lang-switch {
        width: 100%;
        margin: 4px 0 0;
    }

    .lang-current {
        width: 100%;
        justify-content: flex-start;
    }

    .lang-menu {
        position: static;
        width: 100%;
        margin-top: 6px;
        box-shadow: none;
    }
}
