/* Arabic typography is a language contract shared by all presentation themes.
 * :lang() follows the rendered language (including ar-* and nested language
 * labels), not direction: an English RTL preview keeps its Latin typography.
 */
:root {
	--sg-font-arabic-body: "Cairo", Tahoma, Arial, sans-serif;
	--sg-font-arabic-heading: "Alexandria", "Cairo", Tahoma, Arial, sans-serif;
}

/* Deliberately override theme/component font declarations, including rich-text
 * inline fonts. Restrict this to text elements; preserve SVG, icon fonts, code
 * samples and the WordPress admin toolbar. Pseudo-element icons are untouched.
 */
:where(body, body a, body button, body input, body select, body textarea,
body div, body span, body p, body li, body dt, body dd, body label, body legend,
body option, body optgroup, body th, body td, body caption, body blockquote,
body figcaption, body summary, body small, body strong, body b, body em, body i,
body u, body s, body mark, body time, body h1, body h2, body h3, body h4,
body h5, body h6):lang(ar):not(:where(#wpadminbar, #wpadminbar *,
.dashicons, .ab-icon, [class^="fa-"], [class*=" fa-"], code, code *, pre, pre *)) {
	font-family: var(--sg-arabic-text-font, var(--sg-font-arabic-body)) !important;
	letter-spacing: normal !important;
}

body:lang(ar) {
	line-height: 1.9;
}

/* Heading descendants (links and emphasis) inherit the same family. Give Arabic
 * marks room instead of inheriting the tightly packed Latin display leading.
 */
body :is(h1, h2, h3, h4, h5, h6):lang(ar) {
	--sg-arabic-text-font: var(--sg-font-arabic-heading);
	line-height: 1.5 !important;
}

/* Arabic display faces need a smaller scale than the themes' Latin display
 * type. Keep a responsive hierarchy without cramming long translated titles
 * into the narrow columns used by editorial and card layouts. */
body h1:lang(ar), body .sg-home-hero__title:lang(ar) { font-size: clamp(2rem, 4.5vw, 4rem) !important; }
body h2:lang(ar) { font-size: clamp(1.5rem, 3vw, 2.75rem) !important; }
body h3:lang(ar) { font-size: clamp(1.125rem, 1.6vw, 1.5rem) !important; }

/* Introductory prose is often a full paragraph in translated content, even
 * where the Latin theme treats it as a short display statement. */
body :is(.sg-generic-content__intro, .sg-component-heading__intro,
.sg-inner-hero__intro, .sg-product-hero__intro,
.sg-home-hero__content > p:not(.sg-eyebrow)):lang(ar) {
	font-size: clamp(1.0625rem, 1.5vw, 1.375rem) !important;
	line-height: 1.9 !important;
}
body :is(.sg-rich-text p, .sg-rich-text li, .sg-card__body > p):lang(ar) {
	font-size: clamp(1rem, 1.15vw, 1.125rem) !important;
	line-height: 1.9 !important;
}
