/* Computer Heiler – Sprachumschalter.
   Bewusst eigenständig gehalten und nicht in input.css eingebaut: so lässt sich
   der Umschalter ohne einen Tailwind-Build ändern. Die Farbwerte entsprechen
   den Tokens aus assets/css/tailwind.css (brand-500 #056c95, line #e2e8f0 …). */

.ch-lang {
    position: relative;
    flex-shrink: 0;
}

.ch-lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background-color: #fff;
    padding: 0.5rem 0.625rem;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25rem;
    color: #334155;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

@media (hover: hover) {
    .ch-lang-toggle:hover {
        background-color: #eef7fb;
        border-color: #aed8ea;
        color: #045a7d;
    }
}

.ch-lang-toggle:focus-visible {
    outline: 2px solid #056c95;
    outline-offset: 2px;
}

.ch-lang-toggle .ch-lang-globe {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

.ch-lang-toggle .ch-lang-caret {
    width: 0.75rem;
    height: 0.75rem;
    flex-shrink: 0;
    transition: transform .15s ease;
}

.ch-lang-toggle[aria-expanded="true"] .ch-lang-caret {
    transform: rotate(180deg);
}

/* Menü. Das hidden-Attribut wird komplett entfernt bzw. gesetzt – anders als bei
   der Hauptnavigation muss hier keine Utility-Klasse dagegen ankommen. */
.ch-lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.375rem);
    z-index: 60;
    margin: 0;
    min-width: 11rem;
    list-style: none;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    background-color: #fff;
    padding: 0.25rem;
    box-shadow: 0 10px 30px -12px rgba(15, 23, 42, .25);
}

.ch-lang-menu[hidden] {
    display: none;
}

.ch-lang-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    border-radius: 0.375rem;
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    white-space: nowrap;
}

@media (hover: hover) {
    .ch-lang-item:hover {
        background-color: #eef7fb;
        color: #045a7d;
    }
}

.ch-lang-item:focus-visible {
    outline: 2px solid #056c95;
    outline-offset: -2px;
}

.ch-lang-item[aria-current="true"] {
    background-color: #eef7fb;
    color: #045a7d;
    font-weight: 600;
}

/* Sprachkürzel als Marke links neben dem Sprachnamen */
.ch-lang-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    border-radius: 0.25rem;
    background-color: #f6f8fb;
    padding: 0.125rem 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: #64748b;
}

.ch-lang-item[aria-current="true"] .ch-lang-code {
    background-color: #d6ecf5;
    color: #045a7d;
}

/* Auf sehr schmalen Geräten nur das Kürzel im Schalter zeigen */
@media (max-width: 380px) {
    .ch-lang-toggle .ch-lang-globe {
        display: none;
    }
}
