/* Right-to-left pages (ar, he). The canvas markup is mostly flex/grid, which follows `dir`;
   these rules fix what inline styles pin to the left. */
[dir=rtl] [style*="text-align: left"] { text-align: right !important; }
[dir=rtl] [style*="margin-left: auto"] { margin-left: 0 !important; margin-right: auto !important; }
[dir=rtl] pre, [dir=rtl] code, [dir=rtl] kbd, [dir=rtl] samp { direction: ltr; unicode-bidi: isolate; text-align: left; }
[dir=rtl] input[type=url], [dir=rtl] input[type=email] { direction: ltr; text-align: right; }
[dir=rtl] input[type=url]::placeholder, [dir=rtl] input[type=email]::placeholder { direction: rtl; }

/* Arabic is cursive: any letter-spacing breaks the joins, and tight line-heights clip the marks */
[lang=ar] * { letter-spacing: 0 !important; }
[lang=ar] h1, [lang=ar] h2, [lang=ar] h3 { line-height: 1.3 !important; }
[lang=ar] p, [lang=ar] li, [lang=ar] dd { line-height: 1.75; }
[lang=he] h1, [lang=he] h2 { letter-spacing: -0.01em !important; line-height: 1.15 !important; }

/* Arrows that mean "forward" point the other way */
[dir=rtl] .rtl-flip, [dir=rtl] svg[data-dir=fwd] { transform: scaleX(-1); }

/* Legal pages */
[dir=rtl] .lg-doc li { padding: 0 26px 0 0; }
[dir=rtl] .lg-doc li::before { left: auto; right: 4px; }
[dir=rtl] .lg-table th { text-align: right; }
[dir=rtl] .lg-print { margin-left: 0; margin-right: auto; }
