/* Arabic typography layer — loaded only on /ar/ pages.
   Latin type rules assume no joining script: negative tracking and 1.08 line-height
   break Arabic letter connections and clip ascenders/diacritics. These overrides
   restore normal tracking, looser leading and a font stack that actually has glyphs. */

:lang(ar),
[dir="rtl"] {
  font-family: "Noto Naskh Arabic", "Geeza Pro", "Segoe UI", Tahoma, "Arial", sans-serif;
}

/* ---- headings: no negative tracking, looser leading ---- */
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] .h1,
[dir="rtl"] .h2,
[dir="rtl"] .code {
  letter-spacing: normal;
  line-height: 1.45;
  word-break: normal;
  overflow-wrap: break-word;
}

[dir="rtl"] .page-hero h1 {
  letter-spacing: normal;
  line-height: 1.4;
  max-width: 30ch;
}

/* ---- eyebrow labels: uppercase tracking is meaningless/noisy in Arabic ---- */
[dir="rtl"] .kicker,
[dir="rtl"] .page-hero-meta,
[dir="rtl"] .market-tag,
[dir="rtl"] .prod-cat,
[dir="rtl"] .guide-cat,
[dir="rtl"] .answer-label,
[dir="rtl"] .lang-code {
  letter-spacing: normal;
  text-transform: none;
}

/* ---- body copy: Arabic needs more leading to stay readable ---- */
[dir="rtl"] p,
[dir="rtl"] li,
[dir="rtl"] .page-hero p,
[dir="rtl"] .section-note,
[dir="rtl"] .article-lead {
  line-height: 1.85;
}

/* ---- tables: right align every cell, keep numeric columns from squeezing ---- */
[dir="rtl"] table th,
[dir="rtl"] table td {
  text-align: right;
}

[dir="rtl"] table th:first-child,
[dir="rtl"] table td:first-child {
  min-width: 8em;
}

/* ---- forms: placeholders and selects follow the writing direction ---- */
[dir="rtl"] input,
[dir="rtl"] select,
[dir="rtl"] textarea {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"] {
  direction: ltr;
  text-align: right;
}

/* ---- nav + buttons: flip arrow glyphs and icon spacing ---- */
[dir="rtl"] .link-arrow svg,
[dir="rtl"] .btn svg {
  transform: scaleX(-1);
}

[dir="rtl"] .btn {
  flex-direction: row-reverse;
}

/* ---- floating WhatsApp moves to the other side ---- */
[dir="rtl"] .wa-float {
  right: auto;
  left: 22px;
}
