/* =====================================================================
   ALMA Language Switcher — modernes, dezentes Design
   Trigger blendet sich via currentColor in den Header ein,
   das Dropdown-Panel ist immer eigenstaendig lesbar.
   ===================================================================== */

.als {
    --als-accent: #a9694e;
    --als-panel-bg: #ffffff;
    --als-panel-ink: #2b2620;
    --als-panel-mute: #7a7266;
    --als-panel-line: rgba(0, 0, 0, .08);
    --als-radius: 12px;

    position: relative;
    display: inline-flex;
    align-items: center;
    font-family: inherit;
    font-size: .82rem;
    line-height: 1;
    -webkit-font-smoothing: inherit;
}

/* --- Dropdown-Grundgeruest (natives <details>, funktioniert ohne JS) --- */
.als__dd {
    position: relative;
}
.als__dd > summary {
    list-style: none;
    cursor: pointer;
}
.als__dd > summary::-webkit-details-marker {
    display: none;
}

.als__toggle {
    display: inline-flex;
    align-items: center;
    gap: .5em;
    padding: .5em .8em;
    border: 1px solid currentColor;
    border-radius: 999px;
    color: inherit;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-weight: 600;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
    transition: background-color .18s ease, opacity .18s ease, border-color .18s ease;
    opacity: .92;
}
.als__toggle:hover,
.als__dd[open] > .als__toggle {
    opacity: 1;
    background: rgba(127, 127, 127, .12);
}
.als__dd > summary:focus-visible {
    outline: 2px solid var(--als-accent);
    outline-offset: 2px;
}

.als__cur {
    display: inline-flex;
    align-items: center;
    gap: .45em;
}
.als__flag {
    font-size: 1.05em;
    line-height: 1;
}
.als__globe {
    font-size: 1em;
    line-height: 1;
}
.als__txt {
    display: inline-block;
}

/* Chevron */
.als__caret {
    width: .5em;
    height: .5em;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-15%);
    transition: transform .2s ease;
    opacity: .8;
}
.als__dd[open] .als__caret {
    transform: rotate(-135deg) translateY(-15%);
}

/* --- Dropdown-Panel --- */
.als__menu {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    z-index: 1000;
    min-width: 12.5rem;
    margin: 0;
    padding: .4rem;
    list-style: none;
    background: var(--als-panel-bg);
    color: var(--als-panel-ink);
    border: 1px solid var(--als-panel-line);
    border-radius: var(--als-radius);
    box-shadow: 0 18px 44px -20px rgba(0, 0, 0, .38), 0 4px 12px -8px rgba(0, 0, 0, .2);
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
    animation: als-pop .16s ease;
}
@keyframes als-pop {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.als__menu li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.als__item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem .7rem;
    border-radius: 8px;
    color: var(--als-panel-ink);
    text-decoration: none;
    font-size: .92rem;
    transition: background-color .15s ease, color .15s ease;
}
.als__item:hover,
.als__item:focus-visible {
    background: rgba(169, 105, 78, .10);
    color: var(--als-panel-ink);
    outline: none;
}
.als__item .als__txt {
    flex: 1 1 auto;
}
.als__item.is-active {
    font-weight: 600;
    color: var(--als-accent);
}
.als__check {
    width: 1em;
    height: 1em;
    flex: 0 0 auto;
}
.als__check::after {
    content: "✓";
    color: var(--als-accent);
    font-size: .95em;
}

/* Reset-Eintrag */
.als__reset-wrap {
    margin-top: .3rem;
    padding-top: .3rem;
    border-top: 1px solid var(--als-panel-line);
}
.als__reset {
    color: var(--als-panel-mute);
    font-size: .84rem;
}

/* --- Inline-Variante: DE | EN | ES | FR --- */
.als--inline .als__inline {
    display: inline-flex;
    align-items: center;
    gap: .55em;
    margin: 0;
    padding: 0;
    list-style: none;
}
.als--inline .als__inline li {
    margin: 0;
    list-style: none;
}
.als__code {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    opacity: .6;
    transition: opacity .15s ease;
}
.als__code:hover,
.als__code:focus-visible {
    opacity: 1;
    outline: none;
}
.als__code.is-active {
    opacity: 1;
    color: var(--als-accent);
}
.als__sep {
    opacity: .35;
    font-weight: 300;
}

/* --- In WP-Menue eingebettet --- */
li.als-menu-item {
    display: inline-flex;
    align-items: center;
}
li.als-menu-item::before,
li.als-menu-item::after {
    display: none !important;
    content: none !important;
}

/* --- Mobil: Panel nicht abschneiden --- */
@media (max-width: 600px) {
    .als__menu {
        right: 0;
        min-width: 11rem;
        max-width: 78vw;
    }
}

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
    .als__menu { animation: none; }
    .als__caret,
    .als__toggle,
    .als__item,
    .als__code { transition: none; }
}
