/* ==========================================================================
   Sudan Media Monitor — RTL overrides
   Logical CSS properties in base.css handle most of the mirroring
   automatically. This file contains only rules that cannot use logical
   properties (legacy properties, third-party components, bidi isolation).
   ========================================================================== */

/* Topbar stays LTR internally — brand + search + account */
[dir="rtl"] .smf-topbar { flex-direction: row; }
[dir="rtl"] .smf-topbar .topbar-search { direction: rtl; }

/* Arabic text renders in a dedicated Arabic-script family rather than relying
   on whatever the OS happens to substitute for the Latin-first stack. This is
   the legibility half of WCAG 2.2 for the AR locale. */
[dir="rtl"] body,
[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select,
[dir="rtl"] button {
  font-family: "Noto Kufi Arabic", var(--body-font);
}
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
  font-family: "Noto Kufi Arabic", var(--head-font);
}
/* Keep Latin-only technical runs (IDs, scores, URLs) on the Latin face. */
[dir="rtl"] .bdi-wrap { font-family: var(--body-font); }

/* Table cells align to reading direction */
[dir="rtl"] .smf-table th,
[dir="rtl"] .smf-table td { text-align: right; }


/* Bidi isolation: Latin runs (numbers, proper nouns, URLs) inside Arabic text
   must not reorder adjacent punctuation or neighbouring RTL characters.
   Apply .bdi-wrap on any inline element that may contain Latin-only content
   inside an Arabic paragraph. */
.bdi-wrap { unicode-bidi: isolate; }

/* Map always renders LTR so place names and compass labels stay readable */
[dir="rtl"] .smf-map-container { direction: ltr; }

@media (max-width: 1000px) {
  [dir="rtl"] .smf-sidebar { display: none; }
}
