/*
    Right-to-left pages (Persian, Arabic, Hebrew). Loaded by _SiteLayout.cshtml only when
    I18n.IsRtl, after bootstrap.rtl.min.css, style.css and theme.css.

    style.css and theme.css use logical properties (margin-inline-start, inset-inline-end,
    text-align: start ...), so most of the layout mirrors by itself. This file holds what
    logical properties cannot express.
*/

/* Arrows and chevrons point the reading direction */
[dir="rtl"] .bi-arrow-right,
[dir="rtl"] .bi-arrow-left,
[dir="rtl"] .bi-chevron-right,
[dir="rtl"] .bi-chevron-left,
[dir="rtl"] .bi-arrow-right-short,
[dir="rtl"] .bi-arrow-left-short,
[dir="rtl"] .bi-box-arrow-up-right {
    display: inline-block;
    transform: scaleX(-1);
}

/* Phone numbers, emails, prices and MLS numbers stay left-to-right inside RTL text */
[dir="rtl"] .phone-numbers,
[dir="rtl"] a[href^="tel:"],
[dir="rtl"] a[href^="mailto:"],
[dir="rtl"] .property-card__price,
[dir="rtl"] .price {
    direction: ltr;
    unicode-bidi: isolate;
}

/* Form fields that take Latin input */
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="number"],
[dir="rtl"] input[type="url"] {
    direction: ltr;
    text-align: end;
}

/* Bootstrap RTL already mirrors the dropdowns; keep the language menu under its button */
[dir="rtl"] .site-lang .dropdown-menu-end {
    --bs-position: start;
}

/* Theme fonts (PT Sans, Manrope) have no Persian, Arabic or Hebrew letters: use system fonts
   that do, with the theme font kept for Latin text such as numbers and names */
[dir="rtl"] body {
    font-family: var(--body-font-family, "PT Sans"), "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Sans Hebrew", Arial, sans-serif;
}
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6,
[dir="rtl"] .section-title {
    font-family: var(--title-font-family, var(--body-font-family, "PT Sans")), "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Sans Hebrew", Arial, sans-serif;
    letter-spacing: 0;
}
