/* ------------------------------------------------------------------
   Right-to-left overrides for the Hebrew landing pages.

   Loaded ONLY by /landing/he/*.html, after cmm.css and mes.css.
   Every rule is scoped under [dir="rtl"], so this file cannot affect
   the English pages or any other language. cmm.css is shared with the
   live English landing pages and is deliberately NOT touched.

   The shared design system is almost entirely flexbox and grid, which
   mirror themselves from the dir attribute alone. Only the handful of
   rules that hard-code a physical side need an override, and they are
   all listed below.
   ------------------------------------------------------------------ */

/* ------------------------------------------------------------------
   Typography. Archivo carries no Hebrew glyphs, so Hebrew characters
   would otherwise fall back to an arbitrary system default. Keeping
   Archivo FIRST means Latin runs (QA-Report, MES, CMM, numbers) still
   render in the brand face while Hebrew characters resolve to a Hebrew
   face, per character. System fonts only - no extra web font is
   downloaded, so the Hebrew pages weigh the same as the English ones.
   ------------------------------------------------------------------ */
html[dir="rtl"] {
  --font-sans: "Archivo", "Heebo", "Assistant", "Noto Sans Hebrew", "Arial Hebrew", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Noto Sans Hebrew", ui-monospace, "SF Mono", monospace;
}

/* ------------------------------------------------------------------
   Navigation
   ------------------------------------------------------------------ */

/* The dropdown hangs off the right edge of its trigger in RTL. */
[dir="rtl"] .nav-dropdown-panel {
  left: auto;
  right: -10px;
}

/* ------------------------------------------------------------------
   Content chrome
   ------------------------------------------------------------------ */

/* Accent bar on the problem cards moves to the reading edge. */
[dir="rtl"] .pain-card::before {
  left: auto;
  right: 0;
}

/* Step number sits in the corner where the eye enters the card. */
[dir="rtl"] .step-num {
  right: auto;
  left: 24px;
}

/* Custom list bullets. */
[dir="rtl"] .ai-balloon-highlights li {
  padding-left: 0;
  padding-right: 22px;
}
[dir="rtl"] .ai-balloon-highlights li::before {
  left: auto;
  right: 0;
}

/* Decorative background glows, mirrored so the composition still
   balances against the reversed layout. */
[dir="rtl"] .page-bg::before {
  left: auto;
  right: 12%;
}
[dir="rtl"] .page-bg::after {
  right: auto;
  left: -240px;
}

/* ------------------------------------------------------------------
   Inventory cycle diagram (MES page)

   The grid reverses on its own, so step 01 lands on the right. Only the
   connector chevron needs work: it moves to the opposite shared edge
   and points the way the flow now runs. Scoped to the width range where
   the diagram is horizontal - below 900px mes.css stacks it and points
   the chevron downwards, which is direction-neutral and must be left
   alone.
   ------------------------------------------------------------------ */
@media (min-width: 901px) {
  [dir="rtl"] .invnode + .invnode::after {
    left: auto;
    right: -11px;
    border-right: 0;
    border-left: 2px solid hsl(var(--border));
    transform: translateY(-50%) rotate(-45deg);
  }
}

/* ------------------------------------------------------------------
   Left-to-right islands

   The hero visual is a photograph of a real inspection report: an A4
   document laid out left to right, with fiducial corner marks, a PDF
   hint and floating tolerance chips positioned against it by hand. A
   technical drawing is not mirrored for a Hebrew reader, and neither is
   this. Pinning the container to LTR keeps every offset in cmm.css
   valid without duplicating any of it.
   ------------------------------------------------------------------ */
[dir="rtl"] .hero-visual {
  direction: ltr;
}

/* ...but any Hebrew wording inside those overlays still has to read
   right to left. The chip keeps its designed position; only its text
   flow flips back. */
[dir="rtl"] .hero-visual .tol-chip,
[dir="rtl"] .hero-visual .pdf-hint {
  direction: rtl;
}

/* Measured values, tolerances and part numbers are always LTR, in any
   language: ⌀25.400 ±0.05 → 25.413 must never be re-ordered. */
[dir="rtl"] .tol-data,
[dir="rtl"] .dim-label,
[dir="rtl"] code {
  direction: ltr;
  unicode-bidi: isolate;
}

/* The embedded video keeps its own geometry. */
[dir="rtl"] .video-frame {
  direction: ltr;
}

/* Header language panel opens from the opposite edge in RTL. */
[dir="rtl"] .nav-lang-panel { right: auto; left: -10px; }
