/* =====================================================================
   RepoTruth — RTL infrastructure (Arabic).
   PHASE 0: scaffold only. Arabic pages are NOT built yet, so this file is
   loaded by NObody. It is staged so that when /ar/ ships it only needs to:
     1. set <html lang="ar" dir="rtl">
     2. add <link rel="stylesheet" href="/assets/styles.rtl.css">
   No change to the shared styles.css is required at that point because the
   base sheet should use CSS *logical properties* (margin-inline-*, padding-
   inline-*, inset-inline-*, text-align:start/end). This file holds only the
   irreducible PHYSICAL cases that logical properties cannot express.

   Activation contract: every rule here is scoped to [dir="rtl"], so loading
   the file on a non-RTL page is a no-op. Safe to ship inert.
   ===================================================================== */

/* ---- Direction baseline ------------------------------------------------ */
[dir="rtl"] body {
  text-align: start; /* honored via logical alignment in base sheet */
}

/* ---- Brand / code / numerals must stay LTR inside RTL flow ------------- */
/* Pair with <span dir="ltr"> in markup; this is the styling backstop. */
[dir="rtl"] .brand-name,
[dir="rtl"] [dir="ltr"],
[dir="rtl"] code,
[dir="rtl"] .mono {
  direction: ltr;
  unicode-bidi: isolate;
}

/* ---- Active-state underline origin (physical) -------------------------- */
/* In LTR the nav underline grows from the left; in RTL it should grow from
   the right. The base rule animates width; here we anchor the origin side. */
[dir="rtl"] .primary-nav a::after { left: auto; right: 0; transform-origin: right; }

/* ---- Directional affordances (mirror) ---------------------------------- */
/* "next/forward" points left in RTL; "back" points right. Hook classes are
   reserved for when iconography is introduced. */
[dir="rtl"] .icon-next { transform: scaleX(-1); }
[dir="rtl"] .icon-prev { transform: scaleX(-1); }

/* ---- Arabic typography scope ------------------------------------------- */
[lang="ar"] {
  font-family: "Segoe UI", "Noto Sans Arabic", "Tahoma", system-ui, sans-serif;
  line-height: 1.85; /* Arabic script benefits from extra leading */
}

/* NOTE: do NOT add content/visual changes here for non-Arabic languages.
   This file exists purely so Arabic activation is a two-line change later. */
