/**
 * Arabic mirroring.
 *
 * Most of the layout already uses logical properties, so this file only handles
 * the places where a physical direction was unavoidable — and the type changes
 * Arabic needs to read well at the same sizes.
 */

[dir="rtl"] body,
.bz-lang-ar body,
body.bz-rtl {
	font-family: var(--bz-arabic);
}

body.bz-rtl :is(h1, h2, h3, h4, .bz-btn, .bz-nav__list a, .bz-tag, .bz-chip) {
	font-family: var(--bz-arabic);
	letter-spacing: 0;
}

/* Latin-script names and codes stay left-to-right inside Arabic text. */
body.bz-rtl :is(.bz-brand__latin, .bz-mono, code, .bz-newsrow__date, .bz-card__meta, .bz-doc__body span) {
	direction: ltr;
	unicode-bidi: isolate;
	font-family: var(--bz-mono);
}

body.bz-rtl .bz-hero__arabic,
body.bz-rtl .bz-brand__arabic,
body.bz-rtl .bz-pillar__arabic {
	direction: rtl;
}

/* The staggered photo wall reads better mirrored rather than flipped. */
body.bz-rtl .bz-wall__cell:nth-child(1) {
	grid-column: 2;
}

body.bz-rtl .bz-gallerygrid > *:first-child {
	grid-column: span 2;
}

/* Arrows are directional glyphs, not layout — flip them. */
body.bz-rtl .bz-newsrow__arrow,
body.bz-rtl .bz-textlink span,
body.bz-rtl .bz-btn span[aria-hidden="true"] {
	transform: scaleX(-1);
	display: inline-block;
}

/* The marquee must travel the other way or it reads as reversed text. */
body.bz-rtl .bz-marquee__track {
	animation-direction: reverse;
}

/* Progress bars fill from the right. */
body.bz-rtl .bz-progress__fill,
body.bz-rtl .bz-bar i {
	margin-inline-start: auto;
}

/* Blockquote rule sits on the correct edge. */
body.bz-rtl .bz-prose blockquote {
	border-inline-start: 3px solid var(--bz-seahorse);
}

/* Numbers stay in Western digits so figures match the printed reports. */
body.bz-rtl :is(.bz-figure__value, .bz-wall__stat strong, .bz-datechip strong) {
	font-family: var(--bz-sans);
	font-feature-settings: "lnum" 1;
}
