/*
 * RTL / Persian stylesheet.
 *
 * Loaded automatically by WordPress (locale_stylesheet) for RTL locales, and
 * printed after the global styles from theme.json, so equal-specificity
 * overrides below win on cascade order.
 *
 * @package OnlineLMS
 */

@font-face {
	font-family: 'YekanBakh';
	src: url('assets/fonts/YekanBakh/YekanBakhFaNum-VF.woff2') format('woff2'),
		url('assets/fonts/YekanBakh/YekanBakhFaNum-VF.woff') format('woff');
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

/* The Latin presets have no Persian coverage, so prepend YekanBakh to each of
   them. This keeps every `has-*-font-family` utility class and every
   var(--wp--preset--font-family--*) reference in the templates working. */
:root {
	--wp--preset--font-family--yekanbakh: 'YekanBakh', Tahoma, sans-serif;
	--wp--preset--font-family--inter: 'YekanBakh', Inter, system-ui, sans-serif;
	--wp--preset--font-family--inter-tight: 'YekanBakh', 'Inter Tight', Inter, sans-serif;
	--wp--preset--font-family--manrope: 'YekanBakh', Manrope, sans-serif;
}

html,
body {
	direction: rtl;
}

:root body,
:root :is(h1, h2, h3, h4, h5, h6, button, input, select, textarea, .wp-block-heading) {
	font-family: var(--wp--preset--font-family--yekanbakh);
}

/* Persian needs a little more leading; negative Latin tracking hurts Farsi glyphs. */
:root body {
	line-height: 1.85;
}

:root :is(h1, h2, h3, h4, h5, h6, .wp-block-heading) {
	letter-spacing: normal;
}

/* Keep button / on-dark text pure white; background "white" stays cream #f0ece4. */
:root .has-white-color {
	color: #ffffff !important;
}

:root :where(.wp-element-button, .wp-block-button__link).has-white-color {
	color: #ffffff !important;
}

/* Flip the physical offsets that theme.json declares for LTR. */
:root .wp-block-quote {
	border-width: 0 2px 0 0;
}

:root .wp-block-search .wp-block-search__button {
	margin-left: 0;
	margin-inline-start: 1.125rem;
}

:root ol.wp-block-list,
:root ul.wp-block-list {
	padding-left: 0;
	padding-inline-start: var(--wp--preset--spacing--40);
}

/* theme.json declares this one with !important, so match it. */
:root .wp-block-post-comments-form input[type="checkbox"] {
	margin: 0 0 0 0.2rem !important;
}

/* Latin-only fragments (code, URLs) keep their own direction so digits and
   punctuation are not reordered by the RTL base direction. */
code,
kbd,
pre,
samp,
.wp-block-code {
	direction: ltr;
	text-align: left;
	unicode-bidi: isolate;
}

/* Carousels are transform-driven and must stay LTR. */
.owl-stage-outer {
	direction: ltr;
}
