/* Right-to-left (Arabic) overrides. Loaded by _LayoutHome only when the UI culture is RTL. */

:root {
    --font: 'IBM Plex Sans Arabic', 'Plus Jakarta Sans', sans-serif;
    --font-display: 'Noto Kufi Arabic', 'Sora', sans-serif;
    --font-label: 'IBM Plex Sans Arabic', 'Plus Jakarta Sans', sans-serif;
}

html[dir="rtl"] body {
    font-family: var(--font);
    text-align: right;
}

/* Arabic is cursive: letter spacing breaks the joins and uppercase has no meaning. */
html[dir="rtl"] body *:not(i):not(.fa):not(.fas):not(.far):not(.fab):not(.fa-solid):not(.fa-brands) {
    letter-spacing: 0 !important;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
html[dir="rtl"] strong {
    font-family: var(--font-display);
}

html[dir="rtl"] h1,
html[dir="rtl"] h2 {
    line-height: 1.35;
}

/* Latin fragments (brand names, phone numbers, e-mails) keep their own direction. */
html[dir="rtl"] a[href^="tel:"],
html[dir="rtl"] a[href^="mailto:"] {
    direction: ltr;
    unicode-bidi: embed;
}

/* Arrows that point "forward" should point left. */
html[dir="rtl"] .fa-arrow-right,
html[dir="rtl"] .fa-chevron-right,
html[dir="rtl"] .fa-angle-right,
html[dir="rtl"] .fa-paper-plane {
    transform: scaleX(-1);
}

/* Form controls */
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea {
    text-align: right;
}

html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="url"] {
    direction: ltr;
    text-align: right;
}

/* Bulleted lists: move the marker to the right edge. */
html[dir="rtl"] .ad-points li,
html[dir="rtl"] .erp-points li,
html[dir="rtl"] .erp-versions-points li {
    padding-left: 0;
    padding-right: 16px;
}

html[dir="rtl"] .project-points li,
html[dir="rtl"] .page-list li {
    padding-left: 0;
    padding-right: 22px;
}

html[dir="rtl"] .prod-points li {
    padding-left: 0;
    padding-right: 16px;
}

html[dir="rtl"] .ad-points li::before,
html[dir="rtl"] .erp-points li::before,
html[dir="rtl"] .erp-versions-points li::before,
html[dir="rtl"] .project-points li::before,
html[dir="rtl"] .page-list li::before,
html[dir="rtl"] .prod-points li::before {
    left: auto;
    right: 0;
}

html[dir="rtl"] .uzser-aside::before {
    left: auto;
    right: 0;
}

/* Team tree: the first card sits on the right in RTL, so the bus ends swap. */
html[dir="rtl"] .org-dept:first-child::after {
    left: calc(-1 * var(--org-gap) / 2 - 1px);
    right: calc(50% - 1px);
}

html[dir="rtl"] .org-dept:last-child::after {
    right: calc(-1 * var(--org-gap) / 2 - 1px);
    left: calc(50% - 1px);
}

html[dir="rtl"] .org-in {
    right: auto;
    left: 10px;
}
