/* ==========================================================================
   RTL adjustments (rtl.css)
   The layout is built with CSS logical properties (inline/start-end), so this
   file only fixes genuinely directional elements.
   ========================================================================== */

/* ---------- Arabic typography tuning ---------- */

html[lang="ar"] {
    --section-y: clamp(2.5rem, 6vw, 4.25rem); /* unchanged, listed for clarity */
}

html[lang="ar"] body {
    letter-spacing: 0;
}

html[lang="ar"] .hero__title,
html[lang="ar"] .section__title,
html[lang="ar"] .page-head__title,
html[lang="ar"] .result-main__value {
    letter-spacing: 0;
    line-height: 1.35;
}

/* ---------- Directional icons flip ---------- */

html[dir="rtl"] .icon-arrow {
    transform: scaleX(-1);
}

html[dir="rtl"] .faq__chev {
    transform: none;
}

html[dir="rtl"] .faq[open] .faq__chev {
    transform: rotate(180deg);
}

/* ---------- Search select/caret positions ---------- */

html[dir="rtl"] .search-box__icon {
    inset-inline-start: 0.95rem;
}

/* ---------- Numbers, formulas and code stay LTR ---------- */

html[dir="rtl"] .formula,
html[dir="rtl"] .result-main__value,
html[dir="rtl"] .result-row dd,
html[dir="rtl"] .result-table td {
    direction: ltr;
    unicode-bidi: isolate;
}

html[dir="rtl"] .input--num {
    direction: ltr;
    unicode-bidi: plaintext;
}

/* ---------- Breadcrumbs separator already symmetric ("/") ---------- */

/* ---------- Dropdown panel alignment ---------- */

html[dir="rtl"] .dropdown-panel {
    inset-inline-start: 0;
    inset-inline-end: auto;
}

/* ---------- Skip-link and misc ---------- */

html[dir="rtl"] .skip-link {
    inset-inline-start: 1rem;
}
