/* ============================================================
   Arabic / RTL layer. Loaded only on /ar.

   Most of the layout mirrors for free because the base stylesheet
   uses flex, grid and logical spacing. What does not mirror for
   free is here: typography, anything anchored with left/right,
   transforms that point in a direction, and the numerals.

   Typography note: Arabic has no italics and no small caps, and it
   sits lower and taller than Latin at the same point size. So the
   Arabic face is set slightly larger with looser line height, and
   the uppercase-plus-tracking treatment used on English eyebrows is
   removed entirely — letter-spacing on Arabic breaks the joins
   between letters and is a hallmark of a badly localised site.
   ============================================================ */

:root{
  --f-disp:'IBM Plex Sans Arabic','Archivo',system-ui,sans-serif;
  --f-body:'Noto Naskh Arabic',Georgia,serif;
}

body{font-size:1.09rem;line-height:1.9}

h1,h2,h3,h4,.disp{letter-spacing:0;font-stretch:normal;line-height:1.35}
h1{line-height:1.28}

/* Arabic does not slant. The gradient stays, the italic never existed. */
.hero-h em{font-style:normal}

/* Kill Latin-only tracking and casing everywhere it appears. */
.hero-eyebrow,.phead-k,.acard-k,.bcard-cat,.mega-h,.ftr-h,.fc-k,.k,.srv-n,.factband dt,.statement-k,
.sf label,.lf label,.tape-head,.mstat-l,.bar-m,.mbar-m,.jcard-stats dt,
.acard-stats dt,.specs dt,.calc-label,.mout-k,.mfield label,.sub label,
.pcard-specs,.logo-txt,.crumbs,.ann,.bdg,.tag,.ctable thead th,.prose th{
  letter-spacing:0;
  text-transform:none;
}
.logo-txt{font-size:1.05rem}

/* Numerals stay Western Arabic — that is what Dubai property uses in
   contracts, listings and DLD reporting. Force the direction on any
   number run so a price never reverses inside an RTL paragraph. */
/* Only runs that are entirely Latin get isolated. A phrase like
   "4,200,000 درهم" must stay RTL or the currency word jumps to the wrong
   end — bidi already handles the numeral inside it correctly. */
.tape-num,.mstat-v,.kpi-v,.pager a,.pager span{direction:ltr;unicode-bidi:isolate}
.pcard-price,.pd-price,.mstat-v,.calc-out,.mout-v,.mfield output,
.calc-table td,.mout-rows dd{text-align:right}
/* The figure, its scale word and the currency are one Arabic phrase:
   "286.43 مليار درهم". Keep them in source order, right to left. */
.tape-total{flex-direction:row}

/* Anything pinned to a physical edge in the base sheet.
   (.skip and .hp use clip-path in the base sheet, so nothing to do there.) */
.pcard-badges{left:auto;right:.8rem}
.wa-float{right:auto;left:1.1rem}
.step::before{right:auto;left:1.2rem}
.numbered li{padding-left:0;padding-right:3.3rem}
.numbered li::before{left:auto;right:0}
.callout{border-left:0;border-right:3px solid var(--gold);border-radius:var(--r-md) 0 0 var(--r-md)}
.prose blockquote{border-left:0;border-right:3px solid var(--gold);padding-left:0;padding-right:1.2rem;margin-right:0}
.statement-q{border:0;padding:0}
.progress{left:auto;right:0}
.timeline li{border-left:0;border-right:2px solid var(--line);padding-left:0;padding-right:1.1rem}
.timeline li::before{left:auto;right:-5px}
.spark span{left:auto;right:50%;translate:50% 0}

/* Directional icons and chevrons have to physically flip. */
.lnk .ic,.cta-list .ic,.glist .ic,.srv-go .ic,.svc-next a .ic{transform:scaleX(-1)}
.lnk:hover .ic{transform:scaleX(-1) translateX(4px)}
.srv-row a:hover .srv-go{transform:translateX(-6px)}
.svc-next a:hover .ic{transform:scaleX(-1) translateX(4px)}
.acc-btn::after{border-right:0;border-left:2px solid var(--gold-dk);transform:rotate(-45deg)}
.acc-btn[aria-expanded=true]::after{transform:rotate(135deg)}

/* The hero grid mask is anchored to the top-left in LTR. */
.hero-grid{mask-image:radial-gradient(ellipse 90% 70% at 70% 20%,#000 20%,transparent 78%)}

/* Range inputs: the browser mirrors the track but not the gradient. */
.calc-range{background:linear-gradient(270deg,var(--gold) var(--p,10%),var(--ink-3) var(--p,10%))}
.mfield input[type=range]{background:linear-gradient(270deg,var(--gold) var(--p,10%),var(--line) var(--p,10%))}

/* Tables and definition lists read from the right. */
table.t th,table.t td,.ctable th,.ctable td,.prose th,.prose td,.calc-table th{text-align:right}
.calc-table td,.right{text-align:left}

/* Latin strings embedded in Arabic text — emails, refs, URLs, ORNs. */
.mono,.pd-ref,.apanel-brn,[dir="ltr"]{direction:ltr;unicode-bidi:embed;text-align:right}

/* The mega menu is centred with a translate; that survives, but the
   proof card gradient reads better mirrored. */
.mega-proof-v{direction:ltr;text-align:right}

/* Arabic set at the same measure as English runs long, so tighten the
   maximum line length rather than letting paragraphs sprawl. */
.prose,.hero-sub,.lead,.sec-note{max-width:64ch}
.art-grid{grid-template-columns:1fr minmax(0,62ch) 1fr}

/* Form fields keep their own direction for typed content. */
.lf input[type=email],.lf input[type=tel],.sub-row input{direction:ltr;text-align:right}

/* Buttons with an icon plus label: gap handles it, but the burger
   animation uses translateY only, so it is direction-safe already. */

/* Example-content notice: the arrow points in the reading direction. */
.exnote-cta .ic{transform:scaleX(-1)}

[dir=rtl] .adv-route-go svg,[dir=rtl] .adv-btn svg{transform:scaleX(-1)}
