/* NileStack — Arabic landing page (/ar) only.
   Loaded after styles.css, by ar/index.html and no other page, so the Arabic
   font is never downloaded by an English reader.

   Noto Sans Arabic, self-hosted: the `arabic` subset of the variable font
   (weights 100–900 in one file) from @fontsource-variable/noto-sans-arabic
   5.3.0. unicode-range is copied from that package, so the browser fetches
   this file only for Arabic characters; Latin words on the page (NileStack,
   ADCOM, MCX, 3GPP) fall through to Inter. SIL Open Font License 1.1 — see
   fonts/OFL-NotoSansArabic.txt. */
@font-face {
  font-family: 'Noto Sans Arabic';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/noto-sans-arabic-arabic-var.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891,
    U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41,
    U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

/* ---- Typography ---- */
html[lang="ar"] {
  /* Arabic needs more room between lines than Latin: ascenders, descenders
     and dots stack higher and lower. */
  --lh-h1: 1.4;
  --lh-h2: 1.5;
  --lh-micro: 1.75;
}

html[lang="ar"] body {
  font-family: 'Noto Sans Arabic', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  line-height: 1.85;
}

/* Letter-spacing breaks the joins between Arabic letters, and uppercase means
   nothing in Arabic. The Latin wordmark in the header keeps its tracking. */
html[lang="ar"] main *,
html[lang="ar"] footer *,
html[lang="ar"] .skip-link {
  letter-spacing: 0 !important;
  text-transform: none !important;
}

html[lang="ar"] .hero .supporting,
html[lang="ar"] .section-deck,
html[lang="ar"] h3,
html[lang="ar"] .card h3 { line-height: 1.7; }

html[lang="ar"] .statement { line-height: 1.6; max-width: 34ch; }
html[lang="ar"] h1 { max-width: 22ch; }

/* The eyebrow and table-head labels are set very small for Latin capitals;
   Arabic at that size loses its dots. */
html[lang="ar"] .eyebrow,
html[lang="ar"] table.data thead th,
html[lang="ar"] table.data.stack td[data-label]::before,
html[lang="ar"] .footer-h { font-size: var(--step--1) !important; }

html[lang="ar"] .chip { font-size: 0.8125rem; line-height: 1.5; }

/* ---- Right-to-left fixes for components that use physical sides ---- */
html[dir="rtl"] .skip-link { left: auto; right: var(--gutter); }

html[dir="rtl"] .card--risk,
html[dir="rtl"] .not-claim {
  border-left: 1px solid var(--coral);
  border-right: 6px solid var(--coral);
}

html[dir="rtl"] .callout { box-shadow: inset -3px 0 0 var(--navy); }

html[dir="rtl"] table.data th,
html[dir="rtl"] table.data td { padding: var(--space-2) 0 var(--space-2) var(--space-3); }
html[dir="rtl"] table.data td:last-child,
html[dir="rtl"] table.data th:last-child { padding-left: 0; }

@media (max-width: 700px) {
  html[dir="rtl"] table.data.stack th,
  html[dir="rtl"] table.data.stack td { padding: 2px 0; }
}

html[dir="rtl"] .timeline li { border-left: 0; border-right: 1px solid var(--teal); }
html[dir="rtl"] .timeline li:first-child { border-right: 0; }

@media (max-width: 560px) {
  html[dir="rtl"] .timeline li { border-right: 0; }
}

html[dir="rtl"] .ribbon li { padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5); }
/* The shared edge between two ribbon cells is on the other side in RTL. */
html[dir="rtl"] .ribbon li + li { border-left: 1px dashed var(--grey); border-right-style: none; }
html[dir="rtl"] .ribbon li:not(:last-child)::after {
  right: auto;
  left: -12px;
  transform: rotate(-135deg);
}

@media (max-width: 760px) {
  html[dir="rtl"] .ribbon li + li { border-right-style: dashed; border-left-style: dashed; }
  html[dir="rtl"] .ribbon li:not(:last-child)::after { left: auto; right: var(--space-4); transform: rotate(135deg); }
}

/* ---- Header: no main navigation on this page, only the language link ---- */
.lang-switch a { font-weight: 600; }

@media (max-width: 1000px) {
  header nav.lang-switch {
    order: 0;
    flex: 0 0 auto;
    display: flex;
    margin-block-start: 0;
    border-top: 0;
  }

  header nav.lang-switch a:not(.btn) { min-height: 44px; padding-inline: 4px; }
}

/* An email address is a left-to-right string inside right-to-left text. */
html[dir="rtl"] a[href^="mailto:"] { unicode-bidi: isolate; }

@media print {
  html[lang="ar"] body { line-height: 1.6; }
}

/* Arabic button labels can wrap at phone width; give the second line room. */
html[lang="ar"] .btn { line-height: 1.5; padding-block: 8px; text-align: center; }

/* The Arabic week labels are longer than the English ones; let the short
   final segment of the 90-day bar grow to fit its label. */
html[dir="rtl"] .timeline > .span-2 { min-width: max-content; }
