/*
  RTL RULES AS UTILITIES. Later builds use these instead of remembering them.

  1. Layout uses logical properties only (inline-start/end, block-start/end).
     The page is dir="rtl"; start is the right-hand side.
  2. Isolation. Any Latin word or digit run inside Arabic text is wrapped in
     <bdi> (the ar() helper in ui/src/html.ts does this automatically). The
     .iso class does the same for an element that must stay an element.
     .ltr is for content that is itself left-to-right (a code, a URL).
  3. Direction in icons. An icon that points along the reading direction
     (chevron, arrow, progress, timeline) carries .icon--dir and is mirrored
     under RTL. An icon with no direction (clock, camera, check, lamp,
     rotation) is never mirrored. The registry in ui/src/icons.ts decides;
     no call site chooses.
  4. Never letter-space Arabic. The property is banned in ui/ by test.
  5. Figures: Western digits, tabular lining numerals everywhere.
*/

bdi,
.iso {
  unicode-bidi: isolate;
}

/* A short multi-word Latin run stays on one line (set by ar()). */
.run {
  white-space: nowrap;
}

.ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

[dir="rtl"] .icon--dir {
  transform: scaleX(-1);
}

.figure {
  font-variant-numeric: lining-nums tabular-nums;
}
