/* Ghatan Commercial · Persian / right-to-left (v8.2)
   Loaded only when the site is in Persian (<html lang="fa-IR" dir="rtl">). Layout mostly flips by
   itself (flex, grid, logical properties); this file fixes type and the pieces that don't. */

:root {
  --ff-mono: 'IBM Plex Mono', 'Vazirmatn', ui-monospace, monospace;
}
html[dir="rtl"] body { font-family: 'Inter', 'Vazirmatn', system-ui, sans-serif; }

/* Persian letters join; letter-spacing breaks them apart. Latin brand text keeps its tracking. */
html[dir="rtl"] body *:not([lang="en"]):not([lang="en"] *):not(.gci__name):not(.gci__name *) { letter-spacing: 0 !important; }
/* No italics in Persian, and a little more line height for its taller letterforms. */
html[dir="rtl"] :is(em, i, .italic, [class*="__h"] em, h1 em, h2 em) { font-style: normal; }
html[dir="rtl"] :is(h1, h2, h3, .page-h1, .gx-hero__h, .section-h2) { line-height: 1.35 !important; }
html[dir="rtl"] :is(p, li, dd, .page-sub) { line-height: 1.95; }
html[dir="rtl"] body { word-spacing: .02em; }

/* Numbers, emails, phones, URLs and legal names stay left-to-right inside Persian text. */
html[dir="rtl"] :is(a[href^="tel:"], a[href^="mailto:"], .gx-brk__name, .gx-top__brk, .gx-brand, .gx-fcard__price, .num, [class*="__price"], [class*="stat-num"], [class*="__num"]) { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] input[type="email"], html[dir="rtl"] input[type="tel"], html[dir="rtl"] input[type="password"] { direction: ltr; text-align: right; }

/* Arrows and chevrons that mean "forward" point left in RTL. */
html[dir="rtl"] :is(.btn-ghost-arrow, .gx-stair__go svg, .gcm-biz svg, .gx-arrow, .arrow, [class*="__arrow"], [class*="-arrow"]) { transform: scaleX(-1); }
html[dir="rtl"] .gx-feat__more svg, html[dir="rtl"] .gx-news__more svg { transform: scaleX(-1); }

/* Header & menu */
html[dir="rtl"] .gx-brand__sub { direction: rtl; }

/* Join card: the sliding pill moves the other way. */
html[dir="rtl"] .gcm-who { margin: 0 0 1.75rem 2.5rem; }
html[dir="rtl"] .gcm-who i { left: auto; right: 3px; transform: translateX(calc(var(--i) * -100%)); }
html[dir="rtl"] .gcm-close { right: auto; left: .85rem; }
html[dir="rtl"] .gcm-f--pw input { padding-right: .85rem; padding-left: 3.75rem; }
html[dir="rtl"] .gcm-eye { right: auto; left: .4rem; }
html[dir="rtl"] .gcm-forgot { text-align: left; }

/* Footer brokerage block */
html[dir="rtl"] .gx-brk__people { margin: 0 auto 0 0; }

/* Staircase: the copy column stays on the reading side */
html[dir="rtl"] .gx-stair__item a { text-align: right; }

/* Tool pages: tools are English instruments; keep their frame LTR. */
html[dir="rtl"] .gt-tool-iframe { direction: ltr; }

/* Off-screen helpers (skip link, honeypots) sit at left:-9999px in LTR; in RTL that widens the page. */
html[dir="rtl"] .gx-skip, html[dir="rtl"] .form__hp, html[dir="rtl"] [style*="-9999px"] { left: auto !important; right: -9999px !important; }
html[dir="rtl"] .gx-skip:focus { right: 1rem !important; }
html[dir="rtl"] body { overflow-x: clip; }
html[dir="rtl"] .gx-stair__view { overflow: clip; }

/* Mixed-direction text: each block or run takes the direction of its first strong letter, so English
   listing data, addresses and headlines read correctly inside the right-to-left page (every Persian
   translation starts with an invisible right-to-left mark). */
html[dir="rtl"] :is(p, h1, h2, h3, h4, h5, li, dd, dt, td, th, label, figcaption, blockquote, a, span, strong, small, button) { unicode-bidi: plaintext; }
/* Figures stay left-to-right. */
html[dir="rtl"] :is(.stat-val, .gx-proof__num, [class*="__price"], [class*="-price"], .gx-fcard__price) { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .hero-stats > div, html[dir="rtl"] .stat-lbl { text-align: right; }
/* The calculators and research data are English instruments: they keep left-to-right inside a Persian page. */
html[dir="rtl"] .gcx-root, html[dir="rtl"] .gx-guide { direction: ltr; text-align: left; }
html[dir="rtl"] .gcx-root * { unicode-bidi: normal; }
