/* ============================================================
   Aicon Contracting — RTL layer for the Arabic site (/ar/)
   Loaded AFTER hud.css (or after index.html's inline <style>),
   so these rules win on equal specificity.

   Everything is scoped to [dir="rtl"], so this file is inert if
   it is ever pulled into an English page by mistake.
   ============================================================ */

/* ---------- Arabic type ----------
   Spectral and IBM Plex Mono carry no Arabic glyphs. Noto Naskh
   Arabic matches the brand guidelines; IBM Plex Sans Arabic covers
   the mono/label role, since no Arabic monospace pairs with Plex.  */
[dir="rtl"] {
  --serif: "Noto Naskh Arabic", "Spectral", Georgia, serif;
  --mono: "IBM Plex Sans Arabic", "IBM Plex Mono", Consolas, monospace;
}

/* Arabic is cursive: letter-spacing pulls the joins apart and makes
   words look broken. The English design leans on wide tracking, so it
   has to be neutralised wherever Arabic text renders. */
[dir="rtl"] body,
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4,
[dir="rtl"] p, [dir="rtl"] a, [dir="rtl"] span, [dir="rtl"] li,
[dir="rtl"] button, [dir="rtl"] figcaption, [dir="rtl"] strong,
[dir="rtl"] .eyebrow, [dir="rtl"] .statement, [dir="rtl"] .lede,
[dir="rtl"] .meta-label, [dir="rtl"] .meta-value,
[dir="rtl"] .figure-label, [dir="rtl"] .work-name, [dir="rtl"] .work-tag,
[dir="rtl"] .filter-btn, [dir="rtl"] .filter-label,
[dir="rtl"] .site-nav a, [dir="rtl"] .hd nav a,
[dir="rtl"] .sec-head h2, [dir="rtl"] .hsg-label, [dir="rtl"] .hs-btn,
[dir="rtl"] .abtn, [dir="rtl"] .btn, [dir="rtl"] .card .sys,
[dir="rtl"] .cap .sys, [dir="rtl"] .stage .sno, [dir="rtl"] .stage .out,
[dir="rtl"] .statusbar, [dir="rtl"] .side a, [dir="rtl"] .wa-chip,
[dir="rtl"] .project-nav a, [dir="rtl"] .project-nav .dir,
[dir="rtl"] .footer-nav a, [dir="rtl"] .footer-legal span,
[dir="rtl"] .sector-tags span, [dir="rtl"] .work-row-meta,
[dir="rtl"] .work-row-period, [dir="rtl"] .video-frame figcaption {
  letter-spacing: normal;
  line-height: 1.75;          /* Naskh needs more leading than Spectral */
}
/* higher-specificity holdouts from the home page's inline CSS
   (.hero .tag, .endcap .tag, .card .att) and the photo caption */
[dir="rtl"] .hero .tag,
[dir="rtl"] .endcap .tag,
[dir="rtl"] .card .att,
[dir="rtl"] .bleed-caption,
[dir="rtl"] .statusbar span,
[dir="rtl"] .statusbar button,
[dir="rtl"] .hud div span {
  letter-spacing: normal;
}

/* headings stay tighter than body copy */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[dir="rtl"] .statement, [dir="rtl"] .work-name { line-height: 1.4; }

/* Latin runs inside Arabic pages (EN/AR switch, acronyms, figures)
   keep their own direction so brackets and digits sit correctly. */
[dir="rtl"] .ltr {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

/* ---------- header ---------- */
[dir="rtl"] .wordmark { margin-right: 0; margin-left: auto; }
[dir="rtl"] .site-nav a::before,
[dir="rtl"] .hd nav a::before { margin-right: 0; margin-left: .55em; }
[dir="rtl"] .site-nav a:hover::before,
[dir="rtl"] .site-nav a.active::before,
[dir="rtl"] .site-nav a:focus-visible::before,
[dir="rtl"] .hd nav a:hover::before,
[dir="rtl"] .hd nav a:focus-visible::before { transform: scale(1) translateX(-3px); }

/* language switch — always Latin, sits at the end of the nav */
.lang-switch {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .16em;
  text-decoration: none;
  color: var(--paper-40);
  border: 1px solid var(--edge-dim);
  border-radius: 6px;
  padding: .25rem .6rem;
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
  transition: color .25s ease, border-color .25s ease;
}
.lang-switch:hover { color: var(--paper); border-color: var(--edge); }
.lang-switch::before { content: none !important; }

/* ---------- alignment flips ---------- */
[dir="rtl"] .work-row-loc,
[dir="rtl"] .work-row.four .work-row-period { text-align: right; }
[dir="rtl"] .work-row.four .work-row-loc { text-align: right; }
[dir="rtl"] .bleed-caption { left: auto; right: 0; }
[dir="rtl"] .xp-note { border-left: none; border-right: 3px solid var(--blue); }
[dir="rtl"] .cap li span,
[dir="rtl"] .way li span { text-align: left; }

/* ---------- project hero prev/next ----------
   In RTL the reading order reverses, so "previous" belongs on the
   right and "next" on the left; the glyphs are flipped in the markup. */
[dir="rtl"] .hero-nav.prev { left: auto; right: clamp(16px, 3vw, 42px); }
[dir="rtl"] .hero-nav.next { right: auto; left: clamp(16px, 3vw, 42px); }

/* ---------- clipped corners mirror ---------- */
[dir="rtl"] .btn,
[dir="rtl"] .abtn {
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
[dir="rtl"] .hs-btn {
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
[dir="rtl"] .gallery figure,
[dir="rtl"] .video-frame,
[dir="rtl"] .card {
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}
[dir="rtl"] .cap {
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}

/* ---------- home page chrome (index inline styles) ---------- */
[dir="rtl"] .side { left: auto; right: var(--margin); }
[dir="rtl"] .hsg + .hsg { border-left: none; border-right: 1px solid var(--edge-dim); }
@media (max-width: 680px) {
  [dir="rtl"] .hsg + .hsg { border-right: none; border-top: 1px solid var(--edge-dim); }
}
@media (max-width: 1480px) {
  [dir="rtl"] .wrap { padding-left: var(--margin); padding-right: calc(var(--margin) + 130px); }
}
@media (max-width: 980px) {
  [dir="rtl"] .wrap { padding-right: var(--margin); }
}

/* floating WhatsApp chip is injected by fx.js with right:24px */
[dir="rtl"] .wa-chip { right: auto; left: 24px; }
