/* Arabic docs (/ar/): right-to-left reading.
   scripts/rtl.js sets html[data-lang="ar"][dir="rtl"] on those pages. */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

/* Nashra's own Arabic face, as the dashboard uses it. The browser only fetches it for
   Arabic glyphs (unicode-range), and it needs app.nashra.ai to send CORS headers for
   /fonts/*; until then it fails quietly and IBM Plex Sans Arabic takes over. */
@font-face {
  font-family: 'Thmanyah Sans';
  src: url('https://app.nashra.ai/fonts/thmanyah/ThmanyahSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Thmanyah Sans';
  src: url('https://app.nashra.ai/fonts/thmanyah/ThmanyahSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Thmanyah Sans';
  src: url('https://app.nashra.ai/fonts/thmanyah/ThmanyahSans-Bold.woff2') format('woff2');
  font-weight: 600 700;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

html[data-lang="ar"] body {
  font-family: 'Thmanyah Sans', 'IBM Plex Sans Arabic', system-ui, sans-serif;
}

/* Arabic needs more leading than Latin for its marks above and below the line. */
html[data-lang="ar"] .dai-article {
  line-height: 1.9;
}

/* Code, URLs, DNS records and shortcuts stay left to right inside Arabic prose. */
html[data-lang="ar"] .dai-article :is(pre, code, kbd) {
  direction: ltr;
  unicode-bidi: isolate;
}
html[data-lang="ar"] .dai-article pre {
  text-align: left;
}

/* Steps: the connector line is pinned with a physical left offset; mirror it under the number. */
html[data-lang="ar"] .dai-step-connector {
  left: auto;
  right: 0.875rem;
  transform: translateX(50%);
}

/* On-this-page links are hard-set to text-left. */
html[data-lang="ar"] .dai-toc-item {
  text-align: right;
}
