/* Right-to-left pages (Arabic, Hebrew; board #1436). Loaded by _i18n_head.html
   only when html_dir() is "rtl". Flexbox and grid already mirror with
   dir="rtl"; this file handles what must not mirror or mirrors by hand. */

/* Directional icons point the reading way */
[dir="rtl"] :is(.fa-arrow-right, .fa-arrow-left, .fa-chevron-right, .fa-chevron-left,
    .fa-angle-right, .fa-angle-left, .fa-arrow-right-long, .fa-caret-right, .fa-caret-left) {
    transform: scaleX(-1);
}

/* Code, commands, keys, email and URL fields, and file names stay left-to-right */
[dir="rtl"] :is(code, pre, kbd, samp, .mx-codeblock, .docs-code-block, .mo-calls li,
    input[type="email"], input[type="url"], input[type="password"], .license-key, .product-key) {
    direction: ltr;
    unicode-bidi: isolate;
}
[dir="rtl"] :is(pre, .mx-codeblock pre, .docs-code-block) { text-align: left; }
[dir="rtl"] :is(input[type="email"], input[type="url"])::placeholder { text-align: right; }

/* Prices and counts keep their own order inside Arabic or Hebrew sentences */
[dir="rtl"] :is([data-price-eur], .mo-count b, .price, .tier-price) { unicode-bidi: isolate; }

/* Before/after comparisons keep the photo's own geometry: the edit still
   wipes in from the same side as on every other page */
[dir="rtl"] :is(.mo-ba, .mo-bleed, .mo-cropstage, .cal-ba, .stage, .before-after-divider) { direction: ltr; }

/* The language menu opens towards the page, not off its edge */
[dir="rtl"] .lang-select-menu { right: auto; left: 0; }

/* Arabic and Hebrew script runs larger in the line; give headings room */
[dir="rtl"] :is(h1, h2, h3, .mo-line, .mo-type, .mo-statement) { line-height: 1.25; }
