/* Right-to-left pages (Arabic, /ar/): loaded only there (tools/build-langs.mjs). The pages run in dir="rtl",
   so text, flex rows and grids mirror by themselves; this file fixes what must not mirror (photography and
   art placed on one side) and what the left-to-right styles pin to one side. */

/* Arabic letters: the site's fonts have none; a good Arabic face follows each Latin one */
html[dir="rtl"] body { font-family: var(--font-body, Lexend), "IBM Plex Sans Arabic", "Noto Sans Arabic", "Segoe UI", "Geeza Pro", Tahoma, sans-serif; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] .auto-h {
  font-family: var(--font-display, "Big Shoulders"), "IBM Plex Sans Arabic", "Noto Kufi Arabic", "Segoe UI", "Geeza Pro", Tahoma, sans-serif;
  letter-spacing: 0; /* tracking breaks joined Arabic letters */
}
html[dir="rtl"] * { letter-spacing: 0 !important; }

/* hero slides: the product photography fills one side; the text column stays where the art leaves room
   (on the left, as in English) with its Arabic text set right-to-left inside it */
html[dir="rtl"] .hero .wrap { text-align: left; }
html[dir="rtl"] .hero .wrap > * { margin-right: auto; margin-left: 0; }
html[dir="rtl"] .hero .wrap h1, html[dir="rtl"] .hero .wrap h2, html[dir="rtl"] .hero .wrap p { text-align: right; }
html[dir="rtl"] .hero .scrollcue { left: auto; right: 32px; }

/* numbers, codes and grades stay left-to-right inside Arabic sentences */
html[dir="rtl"] .spectag, html[dir="rtl"] code, html[dir="rtl"] .grade { direction: ltr; unicode-bidi: isolate; }

/* counters (odometer digits are separate boxes in a row): numbers read left to right */
html[dir="rtl"] .stat .num, html[dir="rtl"] .odo, html[dir="rtl"] .counter, html[dir="rtl"] [data-count] { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .stat .num { justify-content: flex-end; }

/* arrows that point "forward" turn to the reading direction */
html[dir="rtl"] .arr, html[dir="rtl"] .arrow { display: inline-block; transform: scaleX(-1); }

/* Benzol IQ pill and the Oil advisor chip: laid out as in English (text, then the icon at the screen edge), so their
   padding and the icon's place stay right; only the words inside read right to left */
html[dir="rtl"] #oilbtn, html[dir="rtl"] #iqmorph, html[dir="rtl"] #advisorchip { direction: ltr; }
html[dir="rtl"] #oilbtn .say, html[dir="rtl"] #iqmorph .say, html[dir="rtl"] #advisorchip .txt { direction: rtl; unicode-bidi: isolate; }
