/*
 * RTL + Arabic overrides for the najd-robotics theme.
 * Loaded only when is_rtl() (Arabic locale) — see inc/enqueue.php.
 * The layout is flex/grid based, so this only mirrors the handful of
 * physical-direction rules and swaps in an Arabic typeface.
 */

/* Arabic typeface (Cairo) replaces the Latin display/body fonts. */
[dir="rtl"] {
	--font-body: "Cairo", "Inter", system-ui, -apple-system, sans-serif;
	--font-display: "Cairo", "Space Grotesk", system-ui, sans-serif;
}
[dir="rtl"] body { letter-spacing: 0; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] .eyebrow { letter-spacing: 0; }

/* ---- Header ---- */
[dir="rtl"] .brand { margin-right: 0; margin-left: auto; }
[dir="rtl"] .nav-toggle { margin-left: 0; margin-right: auto; }

/* ---- Skip link ----
   The LTR sheet hides it with left:-9999px. In RTL documents, content
   overflowing on the LEFT is scrollable, so that rule adds ~10,000px of
   horizontal scroll (page pans/zooms wrong, especially on mobile).
   Park it off the START (right) edge instead — never scrollable in RTL. */
[dir="rtl"] .skip-link { left: auto; right: -9999px; }
[dir="rtl"] .skip-link:focus { left: auto; right: 1rem; }

/* ---- Hero badge / card tag pinned to a physical side ---- */
[dir="rtl"] .hero-badge { left: auto; right: -18px; }
[dir="rtl"] .scard .media .tag { left: auto; right: 1rem; }
/* Mirror the LTR mobile rule (left:8px) — without this the RTL -18px wins
   on small screens and the badge hangs off the viewport edge. */
@media ( max-width: 520px ) {
	[dir="rtl"] .hero-badge { right: 8px; bottom: 8px; }
}

/* ---- Lightbox controls swap sides ---- */
[dir="rtl"] .lb-close { right: auto; left: 1rem; }
[dir="rtl"] .lb-prev  { left: auto; right: 1rem; transform: scaleX(-1); }
[dir="rtl"] .lb-next  { right: auto; left: 1rem; transform: scaleX(-1); }

/* ---- Capability matrix table ---- */
[dir="rtl"] table.matrix th,
[dir="rtl"] table.matrix td { text-align: right; }

/* ---- Editorial (blog) ---- */
[dir="rtl"] .entry-content blockquote {
	border-left: 0;
	border-right: 4px solid rgba(0, 0, 0, .15);
	padding-left: 0;
	padding-right: 1rem;
}
[dir="rtl"] .entry-content ul,
[dir="rtl"] .entry-content ol { padding-left: 0; padding-right: 1.4em; }
[dir="rtl"] .comment-list .children { padding-left: 0; padding-right: 1.5rem; }

/* ---- WordPress media alignments ---- */
[dir="rtl"] .alignleft  { float: right; margin: .4rem 0 1rem 1.4rem; }
[dir="rtl"] .alignright { float: left;  margin: .4rem 1.4rem 1rem 0; }

/* Directional arrow icons in buttons/links flip to point the RTL way. */
[dir="rtl"] .btn svg,
[dir="rtl"] .card-service .arrow svg,
[dir="rtl"] .textlink svg { transform: scaleX(-1); }

/* (Language-switcher styles live in styles.css — loaded for both languages.) */
