/**
 * Right-to-left overrides for Arabic. Loaded only when the active
 * interface language is Arabic. Most of the theme uses logical
 * properties (margin-inline, text-align: start) that flip automatically
 * under dir="rtl"; this file fixes the remaining physical left/right
 * cases and provides an Arabic-capable font stack.
 */

.cp-rtl {
	direction: rtl;
}

/* Arabic-capable font stack (the bundled Inter subset has no Arabic
   glyphs; the browser falls back per glyph to these). */
.cp-rtl body,
body.cp-rtl {
	font-family: "Inter", "Segoe UI", Tahoma, "Geeza Pro", "Noto Sans Arabic",
		"Noto Kufi Arabic", sans-serif;
}

/* headings keep the balanced wrap but align to the start (right) */
.cp-rtl h1,
.cp-rtl h2,
.cp-rtl h3,
.cp-rtl h4 { text-align: right; }

/* nav drop-down opens from the right edge */
.cp-rtl .cp-nav__sub,
.cp-rtl .cp-nav__list ul {
	left: auto;
	right: 0;
}

/* language menu aligns to the left edge in RTL */
.cp-rtl .cp-langswitch__list {
	right: auto;
	left: 0;
}

/* hero stat cards: accent border moves to the right */
@media (min-width: 900px) {
	.cp-rtl .cp-stat {
		border-left: 0;
		border-right: 3px solid var(--cp-accent);
		padding-left: 0;
		padding-right: 1.25rem;
	}
}

/* definition facts: accent border on the right */
.cp-rtl .cp-what__facts li {
	border-left: 0;
	border-right: 2px solid var(--cp-accent);
	padding-left: 0;
	padding-right: 0.9rem;
}

/* section heading accent underline sits on the right */
.cp-rtl .cp-machine__section h2::after,
.cp-rtl .cp-related h2::after {
	left: auto;
	right: 0;
}

/* card availability badge moves to the right corner */
.cp-rtl .cp-card__badge {
	left: auto;
	right: 0.8rem;
}

/* breadcrumb separator points the other way */
.cp-rtl .cp-breadcrumbs li + li::before {
	content: "‹";
	margin-right: 0;
	margin-left: 0.35rem;
}

/* a phone number keeps its own direction, so the leading "+" is not
   pushed to the far end of the number by the surrounding RTL text */
.cp-rtl a[href^="tel:"] {
	direction: ltr;
	unicode-bidi: isolate;
}

/* the technical blueprint stays left-to-right (engineering drawing);
   only its numeric labels must not be reordered by the RTL context */
.cp-rtl .cp-blueprint__svg,
.cp-rtl .cp-blueprint__svg text {
	direction: ltr;
}

/* directional arrows flip horizontally */
.cp-rtl .cp-cat-tile__arrow svg {
	transform: scaleX(-1);
}

.cp-rtl .cp-cat-tile:hover .cp-cat-tile__arrow {
	transform: translateX(-3px);
}

/* lightbox prev/next swap sides */
.cp-rtl .cp-lightbox__nav--prev { left: auto; right: 1rem; }
.cp-rtl .cp-lightbox__nav--next { right: auto; left: 1rem; }

/* mobile nav submenu indent flips */
@media (max-width: 980px) {
	.cp-rtl .cp-nav__sub,
	.cp-rtl .cp-nav__list ul {
		padding: 0 0 0.5rem 0;
		padding-inline-start: 1rem;
	}
	.cp-rtl .cp-nav__caret { margin-left: 0; margin-right: auto; }
}
