/* ==========================================================================
   ICRI Theme — RTL override stylesheet
   ========================================================================== */
/*
 * Loaded ONLY when the active site language is right-to-left (Persian,
 * the theme's default language) — see icri_enqueue_assets() in
 * functions.php, which conditionally enqueues this file with is_rtl().
 *
 * WordPress core CSS (admin bar, block library, etc.) and Bootstrap 5's own
 * utility classes (.ms-*, .me-*, .ps-*, .pe-*, .float-start, .float-end...)
 * already use CSS logical properties, so they flip automatically once the
 * page has dir="rtl" — no override needed for those.
 *
 * What genuinely needs fixing here are the few spots in our own
 * assets/css/style.css that used physical left/right values or a
 * hardcoded transform-origin/translateX direction. Each rule below undoes
 * exactly one of those, and is intentionally scoped to that one selector
 * so nothing else in the design is touched.
 */

/* ==========================================================================
   Persian typography
   ========================================================================== */
/*
 * Archivo / Inter / IBM Plex Mono (the base type system in style.css) only
 * cover Latin glyphs. On Persian pages the browser was silently falling
 * back to its default serif font for every Persian character — this is
 * the main reason Persian pages looked broken. Vazirmatn is loaded as a
 * webfont in icri_enqueue_assets() alongside the others and substituted
 * in here for the RTL context.
 */
:root{
  --font-display: 'Vazirmatn', 'Segoe UI', sans-serif;
  --font-body:    'Vazirmatn', 'Segoe UI', sans-serif;
  --font-mono:    'Vazirmatn', 'Segoe UI', sans-serif;
}

/* Persian script needs more vertical breathing room than Latin. */
body{ line-height: 1.9; }
.about-copy p{ line-height: 1.9; }

/* Vazirmatn's own weights already read clearly without the extra
   negative tracking that was tuned for Archivo. */
h1,h2,h3,h4,h5,h6{ letter-spacing: 0; }
.eyebrow, .prod-tag, .prod-code{ letter-spacing: 0; }

/* Nav-link underline should grow from the reading-start edge (right in RTL). */
.icri-navbar .nav-link::after {
  transform-origin: right;
}

/* Service card top accent bar — same reading-start logic as the nav underline. */
.service-card::before {
  transform-origin: right;
}

/* "Founded" badge on the About image sits at the image's outer corner. */
.about-media .badge-since {
  left: auto;
  right: -28px;
}

@media (max-width: 767.98px) {
  .about-media .badge-since {
    left: auto;
    right: 12px;
  }
}

/* Product card category tag sits at the reading-start corner of the image. */
.product-card .prod-tag {
  left: auto;
  right: 12px;
}

/* Same reading-start logic for the single-product hero image tag. */
.product-hero-grid .prod-tag {
  left: auto;
  right: 16px;
}

/* "View Product" arrow should point toward reading-forward (left in RTL). */
.product-card .prod-link:hover i {
  transform: translateX(-4px);
}

/* Floating back-to-top button mirrors to the opposite corner in RTL. */
.back-to-top {
  right: auto;
  left: 26px;
}
