/* Arabic / RTL overrides. Loaded only when the session locale is "ar". */
:root {
    --default-font: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
    --heading-font: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
    --nav-font: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
}

/* Every text element uses the Arabic font. Icon fonts (<i>) are left alone. */
html[lang="ar"] body,
html[lang="ar"] :is(h1, h2, h3, h4, h5, h6, p, a, li, span, div, small, strong, em, label, button, input, textarea, select, td, th, blockquote) {
    font-family: var(--default-font);
}

html[lang="ar"] :is(h1, h2, h3, h4, h5, h6, .sitename) {
    font-family: var(--heading-font);
    letter-spacing: 0;
}

/* Arabic has no letter-case or wide tracking; remove tracking and uppercase */
html[lang="ar"] * {
    letter-spacing: 0 !important;
    text-transform: none !important;
}

html[lang="ar"] body {
    line-height: 1.8;
}

/* Icons that point in a direction */
[dir="rtl"] .bi-arrow-right::before,
[dir="rtl"] .bi-arrow-right-circle::before,
[dir="rtl"] .bi-arrow-right-short::before,
[dir="rtl"] .bi-chevron-right::before,
[dir="rtl"] .bi-chevron-left::before,
[dir="rtl"] .fa-arrow-right::before {
    display: inline-block;
    transform: scaleX(-1);
}

/* AOS slide directions mirror in RTL */
[dir="rtl"] [data-aos="fade-right"]:not(.aos-animate) {
    transform: translate3d(100px, 0, 0);
}

[dir="rtl"] [data-aos="fade-left"]:not(.aos-animate) {
    transform: translate3d(-100px, 0, 0);
}

/* Keep phone numbers, emails and URLs reading left-to-right inside RTL text */
[dir="rtl"] a[href^="mailto:"],
[dir="rtl"] a[href^="tel:"],
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"] {
    direction: ltr;
    unicode-bidi: plaintext;
}

/* Italic looks wrong in Arabic script */
html[lang="ar"] body * {
    font-style: normal !important;
}
