/* Header language dropdown (templates/partials/lang-switcher.php).

   The toggle keeps the legacy .lang-link class on purpose: main.css already
   recolors .lang-link for every header state (transparent over the hero,
   white on .navbar:hover, navy on detail/services/about pages). Everything
   here therefore paints with currentColor, so those rules keep working
   without another round of per-page overrides.

   The menu itself sits on its own white panel, so its colors are fixed. */

.lang-dd {
    position: relative;
    flex-direction: row;
    line-height: 1;
}

.lang-dd .lang-dd-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 12px 0 10px;
    background: none;
    border: 2px solid currentColor;
    border-color: color-mix(in srgb, currentColor 55%, transparent);
    border-radius: 19px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .2px;
    white-space: nowrap;
    cursor: pointer;
    transition: color .2s, border-color .2s;
}

.lang-dd .lang-dd-toggle:hover,
.lang-dd .lang-dd-toggle[aria-expanded="true"] {
    border-color: var(--primary-yellow);
}

.lang-dd .lang-dd-toggle:focus-visible {
    outline: 2px solid var(--primary-yellow);
    outline-offset: 2px;
}

.lang-flag {
    display: block;
    flex: none;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
}

/* Full native name in a pill from 1400px. The header row doesn't shrink
   (fixed-size nav items + two CTA buttons), so below that the pill would push
   the search button off-screen on 1280–1366px laptops: drop to a borderless
   flag + code there, ~35px wider than the old bare "TR" link. */
.lang-dd-code {
    display: none;
}

.lang-dd-caret {
    font-size: 10px;
    opacity: .8;
    transition: transform .2s;
}

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

@media (max-width: 1399px) {
    .lang-dd--desktop {
        margin-right: 12px;
    }

    .lang-dd--desktop .lang-dd-toggle,
    .lang-dd--desktop .lang-dd-toggle:hover,
    .lang-dd--desktop .lang-dd-toggle[aria-expanded="true"] {
        height: 34px;
        gap: 6px;
        padding: 0;
        border: 0;
    }

    .lang-dd--desktop .lang-dd-name {
        display: none;
    }

    .lang-dd--desktop .lang-dd-code {
        display: inline;
    }
}

/* Menu panel */
.lang-dd-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1010;
    min-width: 190px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border: 1px solid #e3e8ed;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 31, 58, .18);
}

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

.lang-dd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--c-navy);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    transition: background .15s;
}

.lang-dd-item:hover,
.lang-dd-item:focus-visible {
    background: var(--c-ivory, #f6f3ee);
    color: var(--c-navy);
    text-decoration: none;
}

.lang-dd-item:focus-visible {
    outline: 2px solid var(--primary-yellow);
    outline-offset: -2px;
}

.lang-dd-item.is-current {
    font-weight: 700;
}

.lang-dd-check {
    margin-left: auto;
    font-size: 13px;
    color: var(--primary-yellow);
}

/* Phone header: compact pill next to the search icon. */
.lang-dd--mobile {
    margin-right: 0;
}

.lang-dd--mobile .lang-dd-toggle {
    height: 32px;
    gap: 6px;
    padding: 0 9px 0 7px;
    border-width: 1.5px;
    font-size: 13px;
    font-weight: 700;
}

.lang-dd--mobile .lang-dd-name {
    display: none;
}

.lang-dd--mobile .lang-dd-code {
    display: inline;
}

.lang-dd--mobile .lang-flag {
    width: 20px;
    height: 14px;
}
