/* ==========================================================================
   Dil modülü — bayraklı dil seçici + RTL (Arapça) düzeltmeleri
   ========================================================================== */

.lang-switch {
    position: relative;
    direction: ltr;             /* menü her zaman soldan sağa okunur */
    flex: 0 0 auto;
    z-index: 120;
}

.lang-switch__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.78);
    cursor: pointer;
    font: inherit;
    line-height: 1;
    transition: color .25s ease, border-color .25s ease, background .25s ease;
}
.lang-switch__btn:hover {
    color: #fff;
    border-color: var(--color-accent, #5cb9ff);
    background: rgba(92, 185, 255, 0.12);
}

.lang-flag {
    width: 22px;
    height: 15px;
    display: block;
    border-radius: 2px;
    flex: 0 0 auto;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
    overflow: hidden;
}

.lang-switch__code {
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.lang-switch__caret {
    width: 13px;
    height: 13px;
    opacity: 0.65;
    transition: transform .25s ease;
}
.lang-switch.is-open .lang-switch__caret { transform: rotate(180deg); }

/* --- Açılır menü --- */
.lang-switch__menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 190px;
    padding: 6px;
    background: rgba(10, 15, 23, 0.96);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.lang-switch.is-open .lang-switch__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-switch__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.85rem;
    text-decoration: none;
    transition: background .2s ease, color .2s ease;
}
.lang-switch__item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}
.lang-switch__item.is-active {
    background: rgba(92, 185, 255, 0.14);
    color: #fff;
}
.lang-switch__name { flex: 1 1 auto; }
.lang-switch__short {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    opacity: 0.5;
}

/* --- Varyant: ana sayfa (sosyal ikonların yanı) --- */
.lang-switch--landing { margin-left: 14px; }
.lang-switch--landing .lang-switch__btn {
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
}

/* --- Varyant: alt siteler üst şerit (logoların solu) --- */
.lang-switch--strip .lang-switch__btn {
    height: 64px;
    padding: 0 14px;
    border-radius: 10px;
    background: rgba(10, 15, 23, 0.85);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid var(--color-border, rgba(255,255,255,0.12));
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.lang-switch--strip .lang-flag { width: 26px; height: 18px; }
.lang-switch--strip .lang-switch__code { font-size: 0.84rem; }

/* Üst şeritte dil seçici + site switcher'ı yan yana tutan sarmalayıcı */
.top-strip__right {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 900px) {
    .lang-switch--strip .lang-switch__btn { height: 46px; padding: 0 10px; }
    .lang-switch--strip .lang-flag { width: 22px; height: 15px; }
    .lang-switch__menu { right: auto; left: 0; }
}

/* Ana sayfada sosyal ikonlar mobilde gizleniyor — dil seçici görünür kalsın */
@media (max-width: 860px) {
    .lang-switch--landing {
        display: block;
        margin-left: 10px;
    }
}


/* ==========================================================================
   RTL — Arapça
   ========================================================================== */

html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

/* Yön bağımsız kalması gerekenler */
html[dir="rtl"] .lang-switch,
html[dir="rtl"] .site-switcher,
html[dir="rtl"] .landing-topbar__socials,
html[dir="rtl"] .top-strip__info,
html[dir="rtl"] .menu-row__num,
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] .stat__value,
html[dir="rtl"] time {
    direction: ltr;
}

html[dir="rtl"] .top-strip__info,
html[dir="rtl"] .landing-topbar__socials {
    /* ters çevrilen flex sırasını görsel olarak eski hâline getir */
    flex-direction: row;
}

/* Sayı/İngilizce metin taşıyan rozet ve etiketler ortalansın */
html[dir="rtl"] .stat,
html[dir="rtl"] .lang-switch__item { text-align: initial; }

/* Sola dayalı süsleme çizgileri sağa geçsin */
html[dir="rtl"] .section-title,
html[dir="rtl"] .section-head,
html[dir="rtl"] .card,
html[dir="rtl"] .menu-row__label { text-align: right; }

html[dir="rtl"] .menu-row__arrow svg { transform: scaleX(-1); }

/* Arapça'da harf birleşmelerini bozan geniş harf aralığını kapat */
html[dir="rtl"] * {
    letter-spacing: normal !important;
    word-spacing: normal;
}
