/* ================================================================
   BENYAN MUSANDAM — ARABIC / RTL LAYER
   Loaded last on /ar/ pages only (html[dir="rtl"]).
   Type: Amiri for display (the naskh counterpart to Playfair),
   IBM Plex Sans Arabic for body and UI, Inter kept for Latin runs
   such as grades (C30/37), standards (BS EN 206) and phone numbers.
   ================================================================ */

:root[dir="rtl"] {
  --font-sans: "IBM Plex Sans Arabic", "Inter", system-ui, sans-serif;
  --font-display: "Amiri", "IBM Plex Sans Arabic", Georgia, serif;
  --font-mono: "IBM Plex Sans Arabic", "JetBrains Mono", monospace;
}

/* ---------- 1. TYPE: connected script never takes tracking ---------- */
[dir="rtl"] body {
  font-family: var(--font-sans);
  line-height: 1.85;
}
[dir="rtl"] *,
[dir="rtl"] *::before,
[dir="rtl"] *::after { letter-spacing: 0 !important; }

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[dir="rtl"] .hero-title, [dir="rtl"] .inner-hero__title, [dir="rtl"] .calc-hero__title,
[dir="rtl"] .panel-title, [dir="rtl"] .plate-title, [dir="rtl"] .capability-title,
[dir="rtl"] .project-item__title, [dir="rtl"] .client-strip__title,
[dir="rtl"] .spec-cell__value, [dir="rtl"] .mix-dial__pct {
  font-family: var(--font-display);
  font-weight: 700;
}
[dir="rtl"] .hero-title       { line-height: 1.3; font-size: clamp(54px, 8.6vw, 118px); }
[dir="rtl"] .inner-hero__title,
[dir="rtl"] .calc-hero__title { line-height: 1.4; }
[dir="rtl"] h2                { line-height: 1.45; }
[dir="rtl"] p                 { line-height: 1.9; }

/* Arabic has no true italic — accents keep their colour, lose the slant */
[dir="rtl"] .engraved-heading,
[dir="rtl"] em { font-style: normal; padding-right: 0; padding-left: 0.04em; }

/* Labels were uppercase + wide-tracked Latin; in Arabic they become quiet, bold, readable */
[dir="rtl"] .eyebrow,
[dir="rtl"] .spec-cell__label,
[dir="rtl"] .panel-label,
[dir="rtl"] .panel-row__k,
[dir="rtl"] .project-facts dt,
[dir="rtl"] .footer-heading,
[dir="rtl"] .plant-card__tag,
[dir="rtl"] .direct-label,
[dir="rtl"] .contact-stats__label,
[dir="rtl"] .hero-rail,
[dir="rtl"] .cf-field label,
[dir="rtl"] .calc-inputs label span,
[dir="rtl"] .mix-dial__name,
[dir="rtl"] .btn {
  text-transform: none;
  font-family: var(--font-sans);
}
[dir="rtl"] .eyebrow          { font-size: 12px; font-weight: 600; }
[dir="rtl"] .spec-cell__label,
[dir="rtl"] .panel-label,
[dir="rtl"] .panel-row__k,
[dir="rtl"] .project-facts dt { font-size: 12px; font-weight: 600; }
[dir="rtl"] .btn              { font-size: 14px; font-weight: 600; }
[dir="rtl"] .footer-heading   { font-size: 14px; }

/* Latin runs inside Arabic text: grades, phone numbers, emails */
[dir="rtl"] a[href^="tel:"]:not(.direct-row),
[dir="rtl"] a[href^="mailto:"]:not(.direct-row),
[dir="rtl"] .direct-value,
[dir="rtl"] .footer-contact-value,
[dir="rtl"] .marquee--clients .marquee__item,
[dir="rtl"] .project-facts dd {
  unicode-bidi: isolate;
}
[dir="rtl"] a[href^="tel:"]:not(.direct-row),
[dir="rtl"] a[href^="mailto:"]:not(.direct-row),
[dir="rtl"] .footer-contact-value a,
[dir="rtl"] .trust-pill,
[dir="rtl"] .direct-value { direction: ltr; unicode-bidi: isolate; text-align: right; }
[dir="rtl"] .marquee--clients .marquee__item { font-family: "Playfair Display", Georgia, serif; }

/* ---------- 2. MIRRORED GEOMETRY ---------- */
[dir="rtl"] .btn-arrow,
[dir="rtl"] .direct-arrow { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .btn:hover .btn-arrow,
[dir="rtl"] .btn-primary:hover .btn-arrow,
[dir="rtl"] .btn-ghost:hover .btn-arrow { transform: scaleX(-1) translateX(4px); }
[dir="rtl"] .direct-row:hover .direct-arrow { transform: scaleX(-1) translateX(4px); }

[dir="rtl"] .tick-frame::before {
  left: auto; right: 10px;
  border-left: 0; border-right: 1.5px solid var(--brand);
}
[dir="rtl"] .tick-frame::after {
  right: auto; left: 10px;
  border-right: 0; border-left: 1.5px solid var(--brand);
}
[dir="rtl"] .panel-graphic.tick-frame::before,
[dir="rtl"] .panel-graphic.tick-frame::after { border-color: var(--hero-ink); }

/* Heroes: the dark side follows the text to the right */
[dir="rtl"] .inner-hero__shade {
  background:
    linear-gradient(270deg, rgba(8,9,11,0.88) 0%, rgba(8,9,11,0.62) 38%, rgba(8,9,11,0.18) 70%, rgba(8,9,11,0.05) 100%),
    linear-gradient(0deg, rgba(8,9,11,0.70) 0%, rgba(8,9,11,0) 45%),
    linear-gradient(180deg, rgba(8,9,11,0.45) 0%, rgba(8,9,11,0) 22%);
}
[dir="rtl"] .inner-hero--half .inner-hero__shade {
  background:
    linear-gradient(270deg, rgba(8,9,11,0.94) 0%, rgba(8,9,11,0.8) 34%, rgba(8,9,11,0.42) 62%, rgba(8,9,11,0.12) 100%),
    linear-gradient(0deg, rgba(8,9,11,0.72) 0%, rgba(8,9,11,0) 60%),
    linear-gradient(180deg, rgba(8,9,11,0.6) 0%, rgba(8,9,11,0) 30%);
}
[dir="rtl"] .inner-hero--half .inner-hero__bg { object-position: 28% 52%; }
[dir="rtl"] .inner-hero--plain {
  background:
    radial-gradient(120% 140% at 88% 8%, rgba(249, 115, 22, 0.16), transparent 58%),
    radial-gradient(90% 120% at 12% 100%, rgba(249, 115, 22, 0.07), transparent 60%),
    linear-gradient(205deg, #1B1D21 0%, #121316 48%, #0C0D0F 100%);
}
[dir="rtl"] .inner-hero--plain::after { background: linear-gradient(270deg, var(--brand) 0%, rgba(249, 115, 22, 0.15) 38%, transparent 72%); }
[dir="rtl"] .cinematic-overlay {
  background:
    linear-gradient(to left,
      rgba(8, 10, 14, 0.82) 0%, rgba(8, 10, 14, 0.62) 14%, rgba(8, 10, 14, 0.40) 30%,
      rgba(8, 10, 14, 0.22) 46%, rgba(8, 10, 14, 0.10) 62%, rgba(8, 10, 14, 0.04) 76%, transparent 100%),
    linear-gradient(to bottom, transparent 48%, rgba(8, 10, 14, 0.06) 66%, rgba(8, 10, 14, 0.16) 100%),
    linear-gradient(to bottom, rgba(8, 10, 14, 0.30) 0%, rgba(8, 10, 14, 0.14) 8%, transparent 22%);
}
[dir="rtl"] .blueprint {
  mask-image: radial-gradient(120% 90% at 82% 50%, #000 0%, rgba(0, 0, 0, 0.35) 55%, transparent 85%);
  -webkit-mask-image: radial-gradient(120% 90% at 82% 50%, #000 0%, rgba(0, 0, 0, 0.35) 55%, transparent 85%);
}

/* Lines that grow from the reading start */
[dir="rtl"] .scroll-progress-bar { left: auto; right: 0; }
[dir="rtl"] .footer-heading::after { left: auto; right: 0; }
[dir="rtl"] .nav-links a.active::after,
[dir="rtl"] .nav-links a:not(.active):hover::after { left: auto; right: 14px; }
[dir="rtl"] .section-header .eyebrow::after,
[dir="rtl"] .material-story__header .eyebrow::after {
  margin-left: 0; margin-right: 12px;
  background: linear-gradient(270deg, var(--brand) 0%, transparent 100%);
}
[dir="rtl"] .material-steps::after {
  left: auto; right: 0;
  background: linear-gradient(270deg, var(--brand), rgba(249, 115, 22, 0.15));
}
[dir="rtl"] .capability-card::before { transform-origin: right; }

/* Dividers that sat on the left edge */
[dir="rtl"] .spec-cell { border-left: 0; border-right: 1px solid rgba(255, 255, 255, 0.08); }
[dir="rtl"] .spec-cell:first-child { border-right: 0; }
[dir="rtl"] .contact-stats__grid > div { border-left: 0; border-right: 1px solid rgba(255,255,255,0.08); }
[dir="rtl"] .contact-stats__grid > div:first-child { border-right: 0; }

/* Values aligned to the far edge */
[dir="rtl"] .panel-row__v { text-align: left; }
[dir="rtl"] [style*="text-align:left"],
[dir="rtl"] .calc-result-card, [dir="rtl"] .result-row { text-align: right; }

/* Decorative corners on the plates */
[dir="rtl"] .primary-service--plate .plate-index { right: auto; left: 26px; }
[dir="rtl"] .project-plate {
  background:
    radial-gradient(120% 130% at 0% 0%, rgba(249, 115, 22, 0.13), transparent 60%),
    linear-gradient(202deg, #1D1F23 0%, #141518 58%, #0D0E10 100%);
}
[dir="rtl"] .panel-graphic {
  background:
    radial-gradient(110% 130% at 0% 0%, rgba(249, 115, 22, 0.14), transparent 58%),
    linear-gradient(205deg, #1D1F23 0%, #141518 55%, #0E0F11 100%);
}

/* Hover nudges move toward the reading direction */
[dir="rtl"] .mix-legend__row:hover { transform: translateX(-4px); }
[dir="rtl"] .split-word { transform: translateY(105%) rotate(-2.4deg); }
[dir="rtl"] .split-ready .split-word { transform: none; }

/* Marquee scrolls the other way so the loop stays seamless */
@keyframes marquee-rtl { to { transform: translateX(50%); } }
[dir="rtl"] .marquee__track { animation-name: marquee-rtl; }

/* Floating controls move to the left edge */
[dir="rtl"] .whatsapp-float { right: auto; left: 22px; }
[dir="rtl"] .to-top { right: auto; left: 22px; }
@media (max-width: 560px) {
  [dir="rtl"] .whatsapp-float { left: 16px; }
  [dir="rtl"] .to-top { left: 16px; }
}

/* ---------- 3. FORMS ---------- */
[dir="rtl"] .cf-field select {
  background-position: left 14px center;
  padding-right: 14px;
  padding-left: 40px;
}
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="number"] { direction: ltr; text-align: right; }
[dir="rtl"] .calc-inputs select {
  background-position: 12px calc(50% + 1px), 8px calc(50% + 1px);
  padding-right: 13px;
  padding-left: 28px;
}

/* ---------- 4. SKIP LINK ---------- */
[dir="rtl"] .skip-link { left: auto; right: 16px; }
