/* =========================================================
   SIPFox - pages written from right to left (Arabic, Persian)
   The page gets <html dir="rtl"> (modules/languages.py). The stylesheets use start / end
   (margin-inline-start, inset-inline-end, text-align: start...) instead of left / right,
   so the page mirrors by itself. Here only what does not.
   Loaded on every page by templates/i18n.html: every rule starts with [dir="rtl"].
   ========================================================= */

/* moves to the side (translateX(calc(Npx * var(--sf-dir, 1)))): the other way */
[dir="rtl"] {
    --sf-dir: -1;
}

/* Arabic and Persian letters are joined: spacing between the letters breaks them */
:lang(ar),
:lang(fa) {
    letter-spacing: normal !important;
}

/* arrows point to the other side (scale: the icons keep their own turns) */
[dir="rtl"] .fa-arrow-left,
[dir="rtl"] .fa-arrow-right,
[dir="rtl"] .fa-long-arrow-alt-left,
[dir="rtl"] .fa-long-arrow-alt-right,
[dir="rtl"] .fa-chevron-left,
[dir="rtl"] .fa-chevron-right,
[dir="rtl"] .fa-angle-left,
[dir="rtl"] .fa-angle-right,
[dir="rtl"] .fa-angle-double-left,
[dir="rtl"] .fa-angle-double-right,
[dir="rtl"] .fa-caret-left,
[dir="rtl"] .fa-caret-right,
[dir="rtl"] .fa-sign-out-alt,
[dir="rtl"] .fa-sign-in-alt,
[dir="rtl"] .fa-reply,
[dir="rtl"] .fa-share,
[dir="rtl"] .btn-arrow {
    scale: -1 1;
}

/* numbers, emails and addresses are read from left to right */
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="url"],
[dir="rtl"] input[type="number"] {
    direction: ltr;
    text-align: end;
}

/* centered in the space next to the open menu: the menu is on the right */
@media (min-width: 1025px) {
    [dir="rtl"] body:has(.main-content.scaled) .acm-topbar,
    [dir="rtl"] body:has(.main-content.scaled) .cc-net {
        left: calc(50% - var(--sf-sidebar-width) / 2);
    }
}

/* the arrow of the city list (call page) */
[dir="rtl"] .city-selector {
    background-position: left 12px center;
}
