/*!
 * Osool — RTL adjustments
 * Loaded unconditionally, after osool.css. Most mirroring in this system is
 * free: osool.css uses logical properties (padding-inline-start,
 * inset-inline-start, text-align: end, border-inline-start …) which flip
 * automatically once `dir="rtl"` is set on <html> by js/i18n.js — no
 * duplicate rules needed for nav, tables, cards, forms, panels, timeline or
 * the peer-set bar.
 *
 * This file exists for the handful of things that do NOT flip for free:
 * directional icon glyphs, and a couple of physical-property escape hatches.
 *
 * What must NOT be mirrored here: chart time axes. Time reads
 * left-to-right in both languages — that is a chart-config decision made in
 * js/charts.js, not a CSS rule. See plan §5.4.
 */

[dir="rtl"] {
  /* Chevrons, carets and arrow glyphs that imply "next"/"back" must point
     the other way in RTL. Apply .icon-directional to any such glyph. */
}

[dir="rtl"] .icon-directional,
[dir="rtl"] .bi-chevron-right,
[dir="rtl"] .bi-chevron-left,
[dir="rtl"] .bi-arrow-right,
[dir="rtl"] .bi-arrow-left,
[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
  transform: scaleX(-1);
}

/* Ranking bar charts (horizontal bars) are a list, not a time series — they
   DO mirror. Apply this hook class to a ranking chart's wrapper so
   charts.js can read it and set the ApexCharts `yaxis.opposite` /
   `xaxis.reversed` flags accordingly per company. Kept here only as the
   marker selector; the actual chart mirroring logic lives in charts.js. */
[dir="rtl"] [data-chart-mirror="list"] {
  direction: rtl;
}

/* Time-series chart containers stay LTR internally regardless of page
   direction, so axis ticks and candle order never reverse. The legend and
   tooltip are still repositioned to the end edge by charts.js options. */
[dir="rtl"] [data-chart-mirror="time"] {
  direction: ltr;
}

/* Segmented control and filter-bar chip order follows source order via
   flex + logical properties already; nothing physical to override. */

/* Sticky sub-nav horizontal scroll (company page, <1200px, §9.6) — ensure
   the scroll snap starts from the correct edge in RTL. */
[dir="rtl"] .subnav-scroll {
  scroll-snap-type: x mandatory;
}

/* Command palette shortcut hint (⌘K) stays LTR — it's a literal keycap,
   not prose. */
[dir="rtl"] .kbd-hint {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}
