.anlamtv-lang-switcher {
    position: relative;
    display: inline-block;
    font-size: 13px;
    /* عمداً direction ثابت (rtl) تحمیل نمی‌شود؛ جهت از صفحه/عنصر والد به ارث
       می‌رسد، تا خاصیت منطقی inset-inline-end پایین‌تر همیشه سمت درست
       (راست در راست‌چین، چپ در چپ‌چین) را انتخاب کند و پاپ‌آپ هرگز از سمت
       مقابل بیرون نزند/بریده نشود. */
}

.anlamtv-lang-switcher__trigger {
    appearance: none;
    background: transparent;
    border: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    font: inherit;
}

.anlamtv-lang-switcher__trigger:hover,
.anlamtv-lang-switcher.is-open .anlamtv-lang-switcher__trigger {
    background: rgba(127, 127, 127, 0.15);
}

.anlamtv-lang-switcher__icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.anlamtv-lang-switcher__current {
    white-space: nowrap;
}

.anlamtv-lang-switcher__menu {
    position: absolute;
    top: 100%;
    inset-inline-start: 0; /* لبه‌ی شروع منو (راست در راست‌چین، چپ در چپ‌چین)
                               دقیقاً روی همان لبه‌ی دکمه می‌نشیند و منو به‌سمت
                               پایان (چپ در راست‌چین، راست در چپ‌چین) باز
                               می‌شود؛ یعنی هیچ‌وقت از سمت مقابل بیرون نمی‌زند. */
    margin: 6px 0 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    color: #222;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 120px;
    z-index: 100;
    display: none;
}

.anlamtv-lang-switcher.is-open .anlamtv-lang-switcher__menu {
    display: block;
}

.anlamtv-lang-switcher__item {
    margin: 0;
}

.anlamtv-lang-switcher__link {
    display: block;
    padding: 7px 10px;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
}

a.anlamtv-lang-switcher__link:hover,
a.anlamtv-lang-switcher__link:focus {
    background: #f2f2f2;
    outline: none;
}

a.anlamtv-lang-switcher__link:focus {
    /* بازخورد بصری واضح‌تر هنگام کلیک/فوکوس، تا کاربر مطمئن شود سیستم
       درخواست تغییر زبان را دریافت کرده است. */
    background: #eef3ff;
    box-shadow: inset 0 0 0 1.5px #7a9bff;
    color: #1a3fae;
}

a.anlamtv-lang-switcher__link:active {
    background: #e3ecff;
}

.anlamtv-lang-switcher__link.is-current {
    color: #d32f2f;
    font-weight: bold;
    cursor: default;
}
