/* ==========================================================================
   ETQAN EMC — RTL layer (Arabic)

   main.css is written with logical properties (margin-inline, padding-inline, inset-inline,
   border-inline, text-align: start/end, border-start-end-radius …), so the whole layout
   mirrors by itself when the document direction is rtl. This file only holds what logic
   cannot express:
     1. Arabic typography (tracking off, vertical breathing room)
     2. directional transforms / gradients / clip paths / keyframes
     3. bidi islands and LTR-only controls (e-mail, phone)
   Loaded only when WordPress reports an RTL locale (is_rtl()), after main.css.
   Photographs, logos, numerals, e-mail addresses and phone numbers are never mirrored.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Typography — Tajawal stays the only face; Arabic needs more line room and no tracking
   -------------------------------------------------------------------------- */
html[dir="rtl"] body { line-height: 1.8; }

/* Arabic letters join: any letter-spacing breaks the word shapes, so it is switched off everywhere. */
html[dir="rtl"] *,
html[dir="rtl"] *::before,
html[dir="rtl"] *::after { letter-spacing: 0 !important; }

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] .section-title,
html[dir="rtl"] .page-header__title,
html[dir="rtl"] .portfolio-hero__title,
html[dir="rtl"] .project-hero__title { line-height: 1.4; }

html[dir="rtl"] p,
html[dir="rtl"] li,
html[dir="rtl"] .page-header__subtitle,
html[dir="rtl"] .section-intro { line-height: 1.85; }

html[dir="rtl"] .btn,
html[dir="rtl"] .site-nav__menu > li > a,
html[dir="rtl"] .mobile-nav__menu li a,
html[dir="rtl"] .archive-filter__item,
html[dir="rtl"] .form-label,
html[dir="rtl"] .form-input,
html[dir="rtl"] .form-select,
html[dir="rtl"] .form-textarea { line-height: 1.5; }

/* small uppercase labels: the Arabic glyphs read smaller than Latin at the same size */
html[dir="rtl"] .section-label,
html[dir="rtl"] .hero__eyebrow,
html[dir="rtl"] .hero-state__num,
html[dir="rtl"] .hero-state__name,
html[dir="rtl"] .project-card__division,
html[dir="rtl"] .project-hero__tag,
html[dir="rtl"] .footer-col__heading { font-size: 0.9em; text-transform: none; }

/* Latin brand/technical snippets inside Arabic text keep their own direction */
html[dir="rtl"] bdi.ltr,
html[dir="rtl"] .ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* --------------------------------------------------------------------------
   2. Hero V3 — mirrored composition (photograph on the left, charcoal panel on the right)
   -------------------------------------------------------------------------- */
html[dir="rtl"] .hero__more:hover span { transform: translateX(-3px); }
html[dir="rtl"] .hero-rail__fill { transform-origin: right center; }
html[dir="rtl"] .hero-rail__seg::before {
  background: linear-gradient(270deg, var(--accent) 0 14px, rgba(255, 255, 255, 0.3) 14px);
}
html[dir="rtl"] .hero-slide__img { transform-origin: 40% 50%; }
html[dir="rtl"] .hero__title { line-height: 1.3; }
html[dir="rtl"] .hero__title-line--soft { margin-top: 0.05em; font-size: 0.82em; }
html[dir="rtl"] .hero__lede { line-height: 1.7; }

@media (min-width: 1100px) {
  /* the angled edge faces the photograph, i.e. the panel's left edge */
  html[dir="rtl"] .hero__panel { clip-path: polygon(0 0, 100% 0, 100% 100%, 56px 100%); }
}
@media (prefers-reduced-motion: no-preference) {
  html[dir="rtl"] .hero-slide.is-entering { animation-name: hero-reveal-rtl; }
}
@keyframes hero-reveal-rtl { from { clip-path: inset(0 16% 0 0); opacity: 0; } to { clip-path: inset(0); opacity: 1; } }

/* --------------------------------------------------------------------------
   3. Navigation drawer — opens from the left edge in RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .mobile-nav__panel { transform: translateX(-100%); }
html[dir="rtl"] .mobile-nav.is-open .mobile-nav__panel { transform: translateX(0); }

/* --------------------------------------------------------------------------
   4. Layouts that used a physical direction trick
   -------------------------------------------------------------------------- */
/* alternating division features: the "reverse" rows flip to the other side in RTL too */
html[dir="rtl"] .division-feature--reverse { direction: ltr; }
html[dir="rtl"] .division-feature--reverse .division-feature__content,
html[dir="rtl"] .division-feature--reverse .division-feature__visual { direction: rtl; }
@media (max-width: 900px) {
  html[dir="rtl"] .division-feature,
  html[dir="rtl"] .division-feature--reverse { direction: rtl; }
}

/* --------------------------------------------------------------------------
   5. Forms — LTR-only values stay left-to-right, aligned to the Arabic start edge
   -------------------------------------------------------------------------- */
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="url"] { direction: ltr; text-align: end; }
html[dir="rtl"] input[type="email"]::placeholder,
html[dir="rtl"] input[type="tel"]::placeholder { text-align: end; }
html[dir="rtl"] .form-select { background-position: left 0.85rem center; }

/* --------------------------------------------------------------------------
   6. Misc
   -------------------------------------------------------------------------- */
html[dir="rtl"] .pagination .page-numbers,
html[dir="rtl"] .nav-links { direction: rtl; }

/* Breadcrumbs sit over the project photograph: keep them at the full on-dark tone in RTL, where
   the same photo puts them over a different part of the image. */
html[dir="rtl"] .project-hero .breadcrumbs a,
html[dir="rtl"] .project-hero .breadcrumbs span { color: var(--color-on-dark); }
