.nav-lang { margin-left: .5rem; }
.lang-switch { position: relative; }
.lang-switch > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .45em; }
.lang-switch > summary::-webkit-details-marker { display: none; }

/* Flaggen-Grundstil */
.lang-flag {
    width: 22px; height: 15px; object-fit: cover;
    border-radius: 3px; border: 1px solid rgba(0,0,0,.12);
    display: inline-block; vertical-align: middle; flex-shrink: 0;
}

/* Desktop: kompakter Button, der die aktuelle Flagge rahmt (Sprachname ausgeblendet). */
.lang-switch > summary.lang-toggle {
    padding: 5px; border: 1px solid #e5e7eb; border-radius: 9px;
    transition: background .15s, border-color .15s;
}
.lang-switch > summary.lang-toggle:hover,
.lang-switch[open] > summary.lang-toggle {
    border-color: var(--blue); background: #eff6ff;
}
.lang-toggle .lang-current { display: none; }

/* Dropdown-Liste */
.lang-switch ul {
    position: absolute; top: calc(100% + .4em); inset-inline-end: 0;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,.14);
    min-width: 180px; margin: 0; padding: .3em 0; z-index: 50; list-style: none;
}
.lang-switch ul li a {
    display: flex; align-items: center; gap: .6em;
    padding: .55em 1.1em; color: var(--text); text-decoration: none;
    font-size: .9rem; white-space: nowrap;
}
.lang-switch ul li a:hover { background: #eff6ff; color: var(--blue); }
.lang-switch ul li a[aria-current="true"] { font-weight: 700; background: #f3f4f6; }

/* Mobil: im aufklappbaren Menü als normaler Eintrag mit Flagge + Sprachkürzel. */
@media (max-width: 768px) {
    .nav-lang { margin-left: 0; }
    .lang-switch > summary.lang-toggle {
        width: 100%; justify-content: flex-start;
        border: none; border-radius: var(--radius-sm);
        padding: .5rem .9rem; gap: .6em; font-size: .9rem; font-weight: 600;
    }
    .lang-toggle .lang-current { display: inline; }
    .lang-switch ul { position: static; box-shadow: none; border: none; min-width: 0; padding-inline-start: 1.4em; }
}
