/* Command Navy — the Arabic typography foundation (Phase 0, 2026-08-19).
 *
 * WHY THIS FILE EXISTS. The shipped Arabic faces (Rubik body, Alexandria
 * display, Plex Sans Arabic labels) render ~25% smaller than Latin at equal
 * px — measured: Rubik Latin x-height 8px vs Arabic letter-body 6px at 16px —
 * and the English design is tuned to the edge of smallness (10.5–12.5px
 * registers). Arabic inherited those px values with NO compensation anywhere,
 * so every Arabic page ran visibly smaller, thinner and weaker than its
 * English twin. English's small-slot emphasis system (UPPERCASE + tracking)
 * has no Arabic form at all, so size and weight must carry what caps carried.
 *
 * SCOPE. Linked ONLY by base_navy.html, after every other navy sheet, so
 * these overrides win ties by cascade order and reach no legacy page.
 * Everything is scoped :lang(ar) — the property of the SCRIPT, not the page
 * direction — so Latin islands inside an Arabic page keep their EN metrics.
 *
 * THIS IS THE FOUNDATION, NOT THE REDESIGN: token compensation, the mono
 * register swap, tracking zero, control font inheritance is in components.css,
 * and explicit floors for the measured worst offenders. Per-page composition
 * stays where it is.
 */

/* --- 1. Token compensation --------------------------------------------------
   The size tokens the navy profile/account/stores sheets consume
   (tokens/typography.css values in the comments). Arabic floors: nothing
   visible below 12px, labels carry weight instead of caps. */
html:lang(ar) {
  --text-label: 12.5px;    /* 11px   — mono-register label */
  --text-meta: 12.5px;     /* 12px   */
  --text-xs: 13.5px;       /* 12.5px */
  --size-dense: 12px;      /* 11px   */
  --size-control: 12.5px;  /* 11.5px */
  --size-tab: 13px;        /* 12px   */
  --size-row: 13.5px;      /* 13px   */
  --size-row-lg: 14px;     /* 13.5px */
  /* Single-line labels: never leading 1 — the shadda and teeth need headroom. */
  --leading-flat: 1.4;

  /* --- 2. The mono register must never carry Arabic WORDS. ---------------
     Arabic glyphs fell through IBM Plex Mono to the Arabic alias, but the
     SPACES stayed in Plex Mono at a fixed 0.6em advance — labels rendered as
     scattered fragments. On an Arabic page the whole register becomes a real
     Arabic sans; digits inside it follow, which also stops dates towering
     1.8× over the letters beside them. Mono-for-figures remains the EN rule;
     the V2 typography pass may split digits back out per element. */
  --nx-font-mono: "IBM Plex Sans Arabic", "Rubik", "Segoe UI", system-ui, sans-serif;
}

/* --- 3. Arabic is cursive: tracking is always 0, no exceptions. -------------
   (0,1,1) specificity + last-in-cascade beats every single-class tracked
   utility (.cf-card-edit carried 0.44px onto Arabic). The existing per-class
   direction-scoped zeroing rules stay; this closes the classes they missed. */
html:lang(ar) * { letter-spacing: 0; }

/* --- 4. Body rhythm. -------------------------------------------------------- */
html:lang(ar) body { line-height: 1.7; }

/* --- 5. Explicit floors for the measured worst offenders --------------------
   (hardcoded px in the navy sheets that no token override can reach).
   Values from the accepted Arabic spec: muted/captions 12.5px/500, labels
   12.5px/600, section headings 16px/700, tabs 14.5px, buttons 14px. */

/* Muted captions and notes that measured 10.4–11px. */
html:lang(ar) .nxpc-feature-caption,
html:lang(ar) .nxpc-continue-note,
html:lang(ar) .nxpc-col-meta,
html:lang(ar) .nxh-float-caption,
html:lang(ar) .nxh-legend-note,
html:lang(ar) .nxh-arts-note,
html:lang(ar) .nxh-product-family,
html:lang(ar) .cf-operation-place > small {
  font-size: 12.5px;
  font-weight: 500;
}

/* Small body copy that measured 11–12px. */
html:lang(ar) .nxpc-feature-line,
html:lang(ar) .nxpc-feature-body,
html:lang(ar) .nxpc-continue-body,
html:lang(ar) .nx-row-caption,
html:lang(ar) .nxh-section-note { font-size: 13px; }

/* The mono-register labels (family already swapped by the token above). */
html:lang(ar) .nx-kicker,
html:lang(ar) .eyebrow,
html:lang(ar) .cf-card-kicker,
html:lang(ar) .migration-kicker,
html:lang(ar) .cf-field-kicker,
html:lang(ar) .nxa-row-kicker,
html:lang(ar) .cf-progression-stat-label,
html:lang(ar) .stores-group,
html:lang(ar) .planner-timeline-kind,
html:lang(ar) .stores-open-badge {
  font-size: 12.5px;
  font-weight: 600;
}

/* Section headings whose EN form leans on uppercase + tracking: Arabic has
   neither, so size + weight carry the hierarchy instead. */
html:lang(ar) .cf-module-head h2,
html:lang(ar) .cf-privacy-group-head h3,
html:lang(ar) .cf-progression-recent h3,
html:lang(ar) .cf-progression-group h3 {
  font-size: 16px;
  font-weight: 700;
}

/* Navigation and controls. */
html:lang(ar) .nx-tab { font-size: 14.5px; }
html:lang(ar) .nx-tabbar a { font-size: 12px; font-weight: 600; }
html:lang(ar) .nx-chip { font-size: 12px; font-weight: 600; }
/* The role badge (Kit B4) is 11.5px in Latin; Arabic takes the floor. */
html:lang(ar) .role { font-size: 12px; }
html:lang(ar) .nx-body label { font-size: 13px; }
html:lang(ar) button { font-size: 14px; }
html:lang(ar) .nx-signout button { font-size: 13.5px; }

/* --- V2 hierarchy surfaces (2026-08-20) -------------------------------------
   Compact support text on the corrected Homepage / Product Center. English
   reads these at 11.5px comfortably; Arabic does not, and the answer is the
   floor rather than a smaller layout. */
html:lang(ar) .nxpc-support-caption,
html:lang(ar) .nxpc-card-line,
html:lang(ar) .nxpc-continue-body,
html:lang(ar) .nxh-tile span,
html:lang(ar) .nxh-shelf-money,
html:lang(ar) .nxh-panel-row > div > span,
html:lang(ar) .nxh-panel--hero span,
html:lang(ar) .nxh-tech-head span {
  font-size: 12.5px;
}
html:lang(ar) .nxh-panel-cap,
html:lang(ar) .nxh-prod-aff,
html:lang(ar) .nxh-minor,
html:lang(ar) .nxpc-continue-note,
html:lang(ar) .nxpc-foot { font-size: 12px; }
/* The planned tile's "قريبًا" rides the name line at 9.5px in English; Arabic
   never goes below the floor, and the word still fits the tile as a nowrap
   unit at 12px (measured at 375, 2026-09-06). */
html:lang(ar) .pcw-tool.is-planned .pcw-tool-note { font-size: 12px; }
