/* ==========================================================================
   RTL overrides for Arabic. Most of the theme uses logical properties, so
   this file only fixes what cannot be expressed that way.
   ========================================================================== */

body { direction: rtl; }

/* Display face has weak Arabic coverage — fall back to a system Arabic stack
   for headings so the medina doesn't render in Latin metrics. */
h1, h2, h3, h4, h5,
.mma-brand__name,
.mma-btn,
.mma-eyebrow,
.mma-stats__value,
.mma-nav__link,
.mma-pillar__label,
.mma-pcard__title,
.mma-rev__quote {
	font-family: "Noto Kufi Arabic", "Cairo", "Tahoma", var(--display);
	letter-spacing: 0;
}

/* Tighter line height suits Arabic diacritics. */
h1, h2, h3 { line-height: 1.28; }

/* Mirror decorative arrows. */
.mma-pillar__go,
.mma-entry span,
.mma-404__card span,
.mma-guide__go,
.mma-project__go,
.mma-matlib__link { display: inline-block; transform: scaleX(-1); }

/* The zellige pattern block reads better mirrored. */
.mma-pillar__pattern { transform: scaleX(-1); }

/* Drawer slides in from the right. */
.mma-drawer { inset-inline-start: auto; inset-inline-end: 0; }

/* Tabular figures should stay LTR. */
.mma-mkt__num,
.mma-mega__count,
.mma-chip span,
.mma-railtree span,
.mma-badge,
.mma-product__sku span {
	direction: ltr;
	unicode-bidi: embed;
}

/* Phone numbers and emails are LTR strings inside RTL text. */
.mma-foot__contact a,
.mma-contact__value,
.mma-trade-link--wa span { unicode-bidi: plaintext; }

/* Market bars grow from the right. */
.mma-mkt__bar span { margin-inline-start: auto; }

/* Search field group. */
.mma-search__cat { border-inline-end: 0; border-inline-start: 1px solid var(--line); }

/* Prose lists. */
.mma-prose ul, .mma-prose ol, .mma-toc__list { padding-inline-start: 1.2em; padding-inline-end: 0; }
