/* Right-to-left pages (/fa/...). Loaded only on dir="rtl" pages, after styles.css, site.css and guides.css.
   Fonts: Persian needs Vazirmatn; the Latin serif and sans fonts have no Arabic script. Digits stay in IBM Plex Mono. */
html[dir="rtl"]{--font-serif:"Vazirmatn",system-ui,sans-serif;--font-sans:"Vazirmatn",system-ui,sans-serif}

/* Persian letters must join. Letter-spacing (set for Latin uppercase labels) breaks the joins, so turn it off. */
html[dir="rtl"] *{letter-spacing:normal !important}
html[dir="rtl"] p,html[dir="rtl"] li{line-height:1.8}

/* the logo sits at the start (right); the auto margin must push the rest to the end (left) */
html[dir="rtl"] .site-nav .logo,html[dir="rtl"] .brand{margin-right:0;margin-left:auto}

/* side borders and padding: the start side is now the right side */
html[dir="rtl"] .notice-old{border-left:0;border-right:3px solid var(--atlas)}
html[dir="rtl"] .prose blockquote{border-left:0;border-right:3px solid var(--atlas)}
html[dir="rtl"] .toc ol,html[dir="rtl"] .sources ul{padding-left:0;padding-right:20px}
html[dir="rtl"] .prose th,html[dir="rtl"] .prose td{text-align:right}
html[dir="rtl"] .tag{margin-right:0;margin-left:6px}

/* code and addresses read left to right, even inside Persian text */
html[dir="rtl"] pre,html[dir="rtl"] code,html[dir="rtl"] .prose pre code{direction:ltr;unicode-bidi:isolate;text-align:left}
