/* =========================================================================
   i18n.css · dil seçici, Arapça yazı tipi ve sağdan sola (RTL) düzen.
   site.css'ten sonra yüklenir. Beş demo sitede birebir aynı dosya; renkler site.css tokenlarından gelir.
   ========================================================================= */

/* ---------- Dil seçici ---------- */
/* Yuvarlak bayraklar: circle-flags (HatScripts, MIT) · assets/img/flags/ */
.lang-flag { width: 28px; height: 28px; flex: none; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 .6px rgb(0 0 0 / .18); }
.lang-switch__list { display: flex; margin: 0; padding: 0; list-style: none; }
.lang-switch__link { color: var(--navy); text-decoration: none; }
.lang-switch__link:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.lang-switch__link[lang="ar"] { font-family: "Noto Sans Arabic", var(--font); }

/* Sayfanın kenarına sabit bayrak sekmesi (LTR sağda, RTL solda) */
.lang-switch--float {
    position: fixed; z-index: 40; top: 50%; right: 0; transform: translateY(-50%);
    padding: 6px; background: var(--white); border: .6px solid var(--line); border-right: 0;
    border-radius: var(--r-md) 0 0 var(--r-md); box-shadow: var(--shadow-dd);
}
[dir="rtl"] .lang-switch--float { right: auto; left: 0; border-right: .6px solid var(--line); border-left: 0; border-radius: 0 var(--r-md) var(--r-md) 0; }
.lang-switch--float .lang-switch__list { flex-direction: column; gap: 2px; }
.lang-switch--float .lang-switch__link { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; }
.lang-switch--float .lang-switch__link:hover { background: var(--platinum); }
.lang-switch--float .lang-switch__link.is-current { box-shadow: inset 0 0 0 1px var(--navy); }
.lang-switch__toggle { display: none; }
@media (max-width: 640px) {
    .lang-switch--float { top: auto; bottom: 24px; transform: none; padding: 4px; }
    .lang-switch--float .lang-switch__link { width: 40px; height: 40px; }
    .lang-switch--float .lang-flag { width: 24px; height: 24px; }
    /* Küçük sekme: yalnızca geçerli dilin bayrağı; diğerleri dokununca üstte açılır */
    .lang-switch--float.is-collapsible .lang-switch__toggle {
        display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
        background: none; border: 0; border-radius: 50%; cursor: pointer;
    }
    .lang-switch--float.is-collapsible .lang-switch__toggle:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
    .lang-switch--float.is-collapsible .lang-switch__list { flex-direction: column-reverse; }
    .lang-switch--float.is-collapsible .lang-switch__link.is-current { display: none; }
    .lang-switch--float.is-collapsible:not(.is-open) .lang-switch__list { display: none; }
    .lang-switch--float.is-collapsible.is-open { display: flex; flex-direction: column-reverse; gap: 2px; }
    .lang-switch--float.is-collapsible.is-open .lang-switch__toggle { box-shadow: inset 0 0 0 1px var(--navy); }
}
@media print { .lang-switch--float { display: none; } }

/* Mobil menü: bayraklı düğmeler */
.lang-switch--mobile .lang-switch__list { flex-wrap: wrap; gap: var(--s-8); }
.lang-switch--mobile .lang-flag { width: 22px; height: 22px; }
.lang-switch--mobile .lang-switch__link {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
    border: .6px solid var(--line); border-radius: var(--r-pill); font-size: 15px; font-weight: 500;
}
.lang-switch--mobile .lang-switch__link.is-current { border-color: var(--navy); font-weight: 600; }

/* Çevirisi olmayan içerik notu */
.lang-note { margin-bottom: var(--s-24); padding: 12px 16px; border-radius: var(--r-md); background: var(--platinum); color: var(--gun-metal); font-size: var(--fs-small); }

/* ---------- Arapça yazı tipi ---------- */
html[lang="ar"] { --font: "Noto Sans Arabic", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif; }
html[lang="ar"] body { line-height: 1.7; }
/* Arapçada harf aralığı ve büyük harf dönüşümü yazıyı bozar */
html[lang="ar"] *:not([lang="tr"]):not([lang="en"]) { letter-spacing: normal !important; }
html[lang="ar"] .hero__kicker { text-transform: none; }

/* ---------- Sağdan sola (RTL) ---------- */
[dir="rtl"] .icon--dir { transform: scaleX(-1); }
[dir="rtl"] .lightbox__prev .icon, [dir="rtl"] .lightbox__next .icon { transform: scaleX(-1); }

[dir="rtl"] .skip-link { left: auto; right: 16px; }

/* Cam şerit dokuları ve degradeler aynalanır */
[dir="rtl"] .reeded--hero { inset: 0 0 0 auto; transform: scaleX(-1); }
[dir="rtl"] .reeded--page { transform: scaleX(-1); }
[dir="rtl"] .reeded--cta { inset: 0 0 0 auto; transform: none; }
[dir="rtl"] .hero__scrim, [dir="rtl"] .cta-banner__scrim { transform: scaleX(-1); }
[dir="rtl"] .hero__emblem { right: auto; left: max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter))); }
@media (max-width: 1024px) { [dir="rtl"] .hero__emblem { left: -60px; } }
@media (max-width: 640px) { [dir="rtl"] .hero__emblem { left: -70px; } }

/* Mobil menü sağ yerine soldan açılır */
[dir="rtl"] .mnav__panel { inset: 0 auto 0 0; transform: translateX(-100%); }
[dir="rtl"] .mnav.is-open .mnav__panel { transform: none; }
[dir="rtl"] .mnav__link, [dir="rtl"] .accordion__btn { text-align: right; }

/* Metin blokları */
[dir="rtl"] .prose ul, [dir="rtl"] .prose ol { padding-left: 0; padding-right: 1.3em; }
[dir="rtl"] .prose blockquote { padding-left: 0; padding-right: 20px; border-left: 0; border-right: 3px solid var(--red); }
[dir="rtl"] .home-quote::before { inset: 0 0 0 auto; }

/* Kartlar ve döşemeler */
[dir="rtl"] .tile { padding-right: var(--s-32); padding-left: 72px; }
[dir="rtl"] .tile__arrow { right: auto; left: 28px; }
@media (max-width: 640px) {
    [dir="rtl"] .tile { padding: 24px 24px 24px 64px; }
    [dir="rtl"] .tile__arrow { right: auto; left: 20px; }
    [dir="rtl"] .lightbox__prev { left: auto; right: 20px; }
    [dir="rtl"] .lightbox__next { right: auto; left: 20px; }
}

/* IBAN, e-posta, telefon, adres gibi Latin değerler soldan sağa kalır */
[dir="rtl"] .copy__input--mono, [dir="rtl"] a[href^="tel:"], [dir="rtl"] a[href^="mailto:"] { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] a[href^="tel:"], [dir="rtl"] a[href^="mailto:"] { display: inline-block; }
[dir="rtl"] [lang="tr"], [dir="rtl"] [lang="en"] { unicode-bidi: isolate; }
