/* ==========================================================================
   Nour Nagy Designs — Arabic / RTL layer (v5.1.0)
   Loaded ONLY when the visitor selects Arabic (see inc/i18n.php).
   The base theme styles are untouched; everything here is an override.
   ========================================================================== */

/* --- Arabic typography ---------------------------------------------------
   The theme drives all type through CSS variables, so swapping the fonts
   here re-skins the entire site without touching any component styles.   */
html[dir="rtl"] {
  --serif: 'Amiri', 'Cormorant Garamond', Georgia, serif;      /* headings / display  */
  --script: 'Amiri', Georgia, serif;                            /* italic accent words */
  --display: 'IBM Plex Sans Arabic', 'Inter', sans-serif;       /* nav / UI / buttons  */
  --sans: 'IBM Plex Sans Arabic', 'Inter', system-ui, sans-serif; /* body copy         */
}

/* Latin tracking looks broken on connected Arabic script — flatten it. */
html[dir="rtl"] body,
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3,
html[dir="rtl"] h4, html[dir="rtl"] h5, html[dir="rtl"] h6,
html[dir="rtl"] a, html[dir="rtl"] button, html[dir="rtl"] p,
html[dir="rtl"] span, html[dir="rtl"] div, html[dir="rtl"] label,
html[dir="rtl"] blockquote, html[dir="rtl"] li, html[dir="rtl"] input,
html[dir="rtl"] select, html[dir="rtl"] textarea {
  letter-spacing: 0 !important;
}

/* Uppercase transforms are meaningless in Arabic and can widen Latin
   fallback glyphs oddly next to Arabic — neutralise on labels/buttons. */
html[dir="rtl"] .eyebrow,
html[dir="rtl"] .btn-bronze,
html[dir="rtl"] .btn-ghost,
html[dir="rtl"] .btn-outline,
html[dir="rtl"] .nav-cta,
html[dir="rtl"] .mm-cta {
  text-transform: none;
}

/* Arabic sits slightly higher on the line — a touch more leading helps. */
html[dir="rtl"] p,
html[dir="rtl"] .panel-p,
html[dir="rtl"] .srv-lede,
html[dir="rtl"] .hs-sub { line-height: 1.85; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 { line-height: 1.35; }

/* Italic is not native to Arabic script — keep accent words upright. */
html[dir="rtl"] em, html[dir="rtl"] .ti-q { font-style: normal; }

/* --- Direction-sensitive fixes ------------------------------------------ */

/* Contact/status notice: theme uses a hard border-left — mirror it. */
html[dir="rtl"] .nn-formnote {
  border-left: none !important;
  border-right: 3px solid var(--bronze, #b08d6a) !important;
  text-align: right;
}

/* Mobile-menu sub-lists are padded on the left in LTR. */
html[dir="rtl"] .mm-sub a { padding: .55rem 1.1rem .55rem 0; }

/* Loader counter pinned bottom-left in LTR. */
html[dir="rtl"] #loader.intro-xl .ld-count { left: auto; right: 4vw; }

/* --- Animation containers kept LTR --------------------------------------
   GSAP's pinned horizontal services track and the marquees are written in
   screen coordinates (translateX in px). Flipping their direction would
   fight the maths, so the TRACKS stay LTR while the text inside each card
   remains RTL.                                                            */
html[dir="rtl"] #srv-tw,
html[dir="rtl"] .srv-tr,
html[dir="rtl"] .marquee,
html[dir="rtl"] .mq-track,
html[dir="rtl"] #hero-stage,
html[dir="rtl"] #prog {
  direction: ltr;
}
html[dir="rtl"] .srv-card,
html[dir="rtl"] .srv-card * {
  direction: rtl;
  text-align: right;
}
html[dir="rtl"] .srv-card .sc-img { direction: ltr; } /* image crop untouched */

/* Hero scene copy re-centres itself; word spans flow naturally in RTL. */
html[dir="rtl"] .hs-inner { direction: rtl; }

/* Number counters and figures read better with latin digits kept LTR. */
html[dir="rtl"] .s-sn,
html[dir="rtl"] .srv-cnt,
html[dir="rtl"] .calc-res b,
html[dir="rtl"] input[type="number"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"] {
  direction: ltr;
  unicode-bidi: embed;
}
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"] { text-align: right; }

/* Forms: labels/inputs right-aligned, selects mirrored. */
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea { text-align: right; }
html[dir="rtl"] select {
  background-position: left .9rem center;
  padding-left: 2.4rem;
  padding-right: 1rem;
}

/* Brand wordmark is split into one span per character for the hover ripple —
   under RTL those inline-blocks lay out right-to-left and reverse the Latin
   name. Keep the wordmark (and loader logo) strictly LTR. */
html[dir="rtl"] .nav-logo,
html[dir="rtl"] .nl-word,
html[dir="rtl"] .ld-logo {
  direction: ltr;
  unicode-bidi: isolate;
}

/* Custom cursor label: Arabic word needs breathing room. */
html[dir="rtl"] #c-lab { letter-spacing: 0 !important; }

/* Journal / legal seeded content is still English (edited in WP later) —
   render those blocks LTR so mixed content stays readable. */
html[dir="rtl"] .legal-body,
html[dir="rtl"] .single-post .entry-content {
  direction: ltr;
  text-align: left;
}
