/* Arabic and right to left. */

/* Google Sans has no Arabic: the Arabic pages take it from Noto Sans Arabic, the font of the app's Arabic
   (OFL, assets/fonts/NotoSansArabic-OFL.txt). Latin text stays Google Sans; the font is declared for the
   Arabic pages only, so the name "العربية" in the language switcher of other pages does not load it. */
@font-face {
  font-family: "Noto Sans Arabic";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/NotoSansArabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011,
    U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

html[lang="ar"] {
  --md-text-font: "Google Sans", "Noto Sans Arabic";
}

/* Icons that point along the text turn with it, as the app mirrors them: the arrows, Undo, Redo, Next
   element, Quit (hooks/mirrored_icons.py marks them). Circuit symbols and instruments never turn. */
[dir="rtl"] .md-typeset .twemoji--mirrored svg {
  transform: scaleX(-1);
}

/* Formulas read left to right inside right-to-left text. */
[dir="rtl"] .md-typeset .arithmatex {
  direction: ltr;
  unicode-bidi: isolate;
}
