/**
 * AdProMax — right-to-left overrides.
 *
 * The theme is built on logical properties (margin-inline, padding-block,
 * inset-inline-start, border-inline-end), so RTL mostly works with no overrides at
 * all. What remains here are the cases logical properties cannot express: physical
 * transforms, gradients with a fixed direction, and elements that must stay LTR
 * because their content is Latin or numeric.
 *
 * Digits stay Western (0–9) in every language, including Arabic. Nothing in this
 * file — or anywhere else in the theme — substitutes Eastern Arabic-Indic numerals.
 */

/* Directional glyphs mirror; brand marks never do. */
[dir="rtl"] .apm-arrow {
	transform: scaleX(-1);
}

[dir="rtl"] .apm-social-list svg,
[dir="rtl"] .apm-contact-list__icon svg,
[dir="rtl"] .apm-share svg {
	transform: none;
}

/* The hero and About washes are anchored to a physical corner in the approved
   design; flip the anchor so the light falls on the same side of the reading flow. */
[dir="rtl"] .apm-about-hero {
	background:
		radial-gradient(900px 420px at 18% -10%, rgba(61, 80, 224, 0.14), transparent 62%),
		linear-gradient(180deg, var(--apm-bg-hero-top) 0%, var(--apm-bg-section) 100%);
}

[dir="rtl"] .apm-ea {
	background:
		radial-gradient(1100px 620px at 88% -10%, rgba(61, 80, 224, 0.24), transparent 62%),
		radial-gradient(820px 520px at 4% 8%, rgba(217, 59, 135, 0.14), transparent 60%),
		var(--apm-dark-deep);
}

/* Chat bubbles are positioned by speaker, not by reading direction. */
[dir="rtl"] .apm-chat__thread li.is-them {
	border-end-end-radius: var(--apm-radius-lg);
	border-end-start-radius: var(--apm-space-2xs);
}

[dir="rtl"] .apm-chat__thread li.is-us {
	border-end-start-radius: var(--apm-radius-lg);
	border-end-end-radius: var(--apm-space-2xs);
}

/* The dashboard illustration is a Latin product UI; it stays LTR inside an RTL page
   so its columns, numbers and account identifiers read correctly. */
[dir="rtl"] .apm-showcase__frame,
[dir="rtl"] .apm-wl-panel__grid {
	direction: ltr;
}

[dir="rtl"] .apm-showcase__url,
[dir="rtl"] .apm-kpi__value,
[dir="rtl"] .apm-mono[dir="ltr"] {
	direction: ltr;
	unicode-bidi: isolate;
}

/* Code blocks stay LTR; Arabic prose around them does not. */
[dir="rtl"] .apm-entry-content pre,
[dir="rtl"] .apm-entry-content .wp-block-code {
	direction: ltr;
	text-align: left;
}

/* The pillar chevron rotates on the block axis, which is direction-independent —
   but the closed-state arrow glyph in the flow list is inline, so it mirrors. */
[dir="rtl"] .apm-flow__btn .apm-arrow,
[dir="rtl"] .apm-aud__tab .apm-arrow {
	transform: scaleX(-1);
}

/* Numeric and identifier cells keep Latin alignment in tables. */
[dir="rtl"] .apm-showcase .apm-num {
	text-align: right;
}

/* Print: page-break rules are unaffected by direction, but the URL suffix on links
   must not reverse. */
@media print {
	[dir="rtl"] .apm-entry-content a[href^="http"]::after {
		direction: ltr;
		unicode-bidi: isolate;
	}
}
