/* Right-to-left corrections for the apex site (loaded only when I18N::isRtl()).
 * Boxes are mirrored by the -rtl.css twins; this sheet handles what mirroring cannot:
 * text direction of numbers/names/coordinates, and the Hebrew typeface. */

/* Typeface: Cinzel and Inter have no Hebrew glyphs, and 57 rules (manual.css, forge.css...)
   name them DIRECTLY instead of through the tokens, so Hebrew fell through to the browser
   serif (Times New Roman Hebrew - the "old, unreadable" look). Owner ruling 2026-08-23:
   Segoe UI, the same face the game uses in Hebrew. Blanket override on every element,
   then the Latin brand marks get Cinzel back and code stays monospace. */
:root[lang="he"] {
  --font-display: 'Segoe UI', Arial, 'Arial Hebrew', Tahoma, sans-serif;
  --font-sans:    'Segoe UI', Arial, 'Arial Hebrew', Tahoma, sans-serif;
}
:root[lang="he"] body, :root[lang="he"] body * { font-family: 'Segoe UI', Arial, 'Arial Hebrew', Tahoma, sans-serif !important; letter-spacing: 0 !important; }
:root[lang="he"] .brand, :root[lang="he"] .nav-brand, :root[lang="he"] .logo-text, :root[lang="he"] .footer-brand,
:root[lang="he"] .brand *, :root[lang="he"] .nav-brand *, :root[lang="he"] .footer-brand * { font-family: 'Cinzel', Georgia, serif !important; }
:root[lang="he"] code, :root[lang="he"] kbd, :root[lang="he"] pre, :root[lang="he"] .forge-mono, :root[lang="he"] code * { font-family: ui-monospace, Consolas, monospace !important; }
:root[lang="he"] body { -webkit-font-smoothing: antialiased; }
/* Display headings were tracked for Cinzel capitals; Hebrew has no capitals, tracking reads as gaps. */
:root[lang="he"] h1, :root[lang="he"] h2, :root[lang="he"] h3,
:root[lang="he"] .page-title, :root[lang="he"] .eyebrow { letter-spacing: 0; }

/* Left-to-right runs inside right-to-left text */
[dir="rtl"] .brand, [dir="rtl"] .nav-brand, [dir="rtl"] .logo-text,
[dir="rtl"] code, [dir="rtl"] kbd, [dir="rtl"] .forge-mono,
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="url"], [dir="rtl"] input[type="password"],
[dir="rtl"] .countdown, [dir="rtl"] .timer, [dir="rtl"] .stat-value, [dir="rtl"] .hof-points,
[dir="rtl"] .coords, [dir="rtl"] .version, [dir="rtl"] .patch-version {
  direction: ltr; unicode-bidi: isolate;
}
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="url"], [dir="rtl"] input[type="password"] { text-align: right; }

/* Inline styles never pass the build-time mirror; same rule the stylesheets get. */
[dir="rtl"] [style*="float:right"], [dir="rtl"] [style*="float: right"] { float: left !important; }
[dir="rtl"] [style*="float:left"], [dir="rtl"] [style*="float: left"] { float: right !important; }
[dir="rtl"] [style*="text-align:right"], [dir="rtl"] [style*="text-align: right"] { text-align: left !important; }
[dir="rtl"] [style*="text-align:left"], [dir="rtl"] [style*="text-align: left"] { text-align: right !important; }

/* The tagline sheen is a masked copy of the wordmark's own pixels, laid over an
 * image that is NOT mirrored, so its offsets must stay LTR (the twin flips
 * left -> right and the copy lands 137px off: a doubled "THE LEGACY EVOLVES"). */
[dir="rtl"] .hero-legacy-lift { left: 36.585%; right: auto; }

/* Header CTA: weight 800 Segoe UI renders as a heavy 'Black' face in Hebrew and looked like a
   different font next to the 500-weight nav links. Match the nav links. */
:root[lang="he"] .site-nav .btn-primary { font-weight: 600 !important; letter-spacing: 0 !important; font-size: 0.8125rem; }

/* ── Directional glyphs ───────────────────────────────────────────────────
 * A chevron, an arrow and the play triangle all mean "forward", and forward
 * is LEFT in Hebrew. The build-time mirror (rtl/rtlcss.php) flips BOXES:
 * offsets, margins, float, text-align. It deliberately never touches the
 * inside of an <svg>, because a path is artwork, not layout. So every glyph
 * whose meaning is a DIRECTION has to be turned over here, once, by name.
 *
 * icon() stamps data-icon="<name>" on every SVG it emits, which is the hook.
 * The one hand-written chevron on the landing hero's START JOURNEY button was
 * given the same attribute so it joins this rule instead of needing its own.
 *
 * chevron-down is deliberately absent: down is down in both directions.
 * ───────────────────────────────────────────────────────────────────────── */
[dir="rtl"] svg[data-icon="chevron-right"],
[dir="rtl"] svg[data-icon="chevron-left"],
[dir="rtl"] svg[data-icon="arrow-right"],
[dir="rtl"] svg[data-icon="arrow-left"],
[dir="rtl"] svg[data-icon="play"] {
  transform: scaleX(-1);
}

/* ── Clocks count down left to right in every language ────────────────────
 * The hero clock is a four-column grid of day / hour / minute / second
 * segments in that DOM order. Under dir=rtl the grid fills from the right,
 * so it read seconds-first and the largest unit ended up on the far right.
 *
 * A duration is not a sentence. Hebrew writes the time of day and durations
 * with the larger unit on the left exactly as English does, so the container
 * is pinned to LTR and only its Hebrew LABELS keep their own direction. Same
 * reasoning as the map coordinate fields further up this file.
 * ───────────────────────────────────────────────────────────────────────── */
[dir="rtl"] .hero-clock,
[dir="rtl"] .jmcard-countdown-val,
[dir="rtl"] .sd-card-launch-val,
[dir="rtl"] .sd-modal-launchchip .val,
[dir="rtl"] .cd-num {
  direction: ltr;
}
