/*
 * Direction-only adaptation for the Persian site.
 * Colors, assets, component geometry and visual hierarchy stay shared with EN.
 */

html[dir="rtl"] {
  direction: rtl;
}

html[dir="rtl"] body {
  text-align: right;
  font-family: "Vazirmatn", "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Directional affordances use the same glyphs and SVGs, mirrored with RTL. */
html[dir="rtl"] .arrow,
html[dir="rtl"] .cn-arrow svg {
  display: inline-block;
  transform: scaleX(-1);
}
html[dir="rtl"] .fs-arrow svg,
html[dir="rtl"] .expand-arrow svg {
  transform: scaleX(-1);
}
html[dir="rtl"] .rdc-item {
  transform: translateX(4px);
}
html[dir="rtl"] .rdc-item.on {
  transform: none;
}
html[dir="rtl"] .btn-ghost:hover .arrow {
  transform: scaleX(-1) translateX(5px);
}
html[dir="rtl"] a.mod-link:hover h3 .arrow,
html[dir="rtl"] .persona-card .pc-secondary:hover .arrow {
  transform: scaleX(-1) translateX(4px);
}
html[dir="rtl"] .field select {
  background-position: left 14px center;
}

/* Technical and machine-readable content keeps its intrinsic direction. */
html[dir="rtl"] code,
html[dir="rtl"] pre,
html[dir="rtl"] kbd,
html[dir="rtl"] samp,
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="url"],
html[dir="rtl"] [data-ltr] {
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
}

html[dir="rtl"] .arrow,
html[dir="rtl"] .pc-secondary svg,
html[dir="rtl"] [data-directional-icon] {
  transform: scaleX(-1);
}

html[dir="rtl"] .ej-branch .ej-path.taken::after {
  content: "← Bob";
}

/* Inline Latin names stay stable inside Persian sentences. */
html[dir="rtl"] bdi,
html[dir="rtl"] [lang="en"] {
  direction: ltr;
  unicode-bidi: isolate;
}

html[dir="rtl"] .article-body,
html[dir="rtl"] .legal-body {
  text-align: right;
}
