/*
 * Noto Naskh Arabic — applied to Arabic characters only.
 *
 * How the scoping works: the @font-face rule below carries a `unicode-range`
 * listing the Arabic Unicode blocks. That tells the browser to use this font
 * file for those characters and for nothing else. So even though the family is
 * named first in --font-stack, Latin letters, digits and punctuation still fall
 * through to Inter exactly as before — only Arabic text changes.
 *
 * Loaded on every page by app_include_css and web_include_css in hooks.py.
 */

@font-face {
	font-family: "Noto Naskh Arabic";
	/* One variable font file covers every weight from 400 to 700.
	   The second `src` entry is the fallback for browsers that do not
	   recognise the "truetype-variations" hint; they get the same file and
	   render it at its default weight. */
	src:
		url("/assets/mopwh_real_estate/fonts/Noto_Naskh_Arabic/NotoNaskhArabic-VariableFont_wght.ttf")
			format("truetype-variations"),
		url("/assets/mopwh_real_estate/fonts/Noto_Naskh_Arabic/NotoNaskhArabic-VariableFont_wght.ttf")
			format("truetype");
	font-weight: 400 700;
	font-style: normal;
	/* Show fallback text immediately, swap in Noto once the file arrives,
	   so a slow font download never leaves the page blank. */
	font-display: swap;
	unicode-range:
		U+0600-06FF, /* Arabic: letters, diacritics, Arabic-Indic digits ٠-٩ */
		U+0750-077F, /* Arabic Supplement */
		U+0870-08FF, /* Arabic Extended-A and Extended-B */
		U+200C-200D, /* zero-width non-joiner / joiner, used in Arabic shaping */
		U+FB50-FDFF, /* Arabic Presentation Forms-A */
		U+FE70-FEFF; /* Arabic Presentation Forms-B */
}

/*
 * Frappe sets --font-stack once, in
 * apps/frappe/frappe/public/scss/espresso/_typography.scss, on a plain `:root`.
 * We redeclare it here with Noto Naskh Arabic in front of Inter.
 *
 * The selector is `html:root` rather than `:root` on purpose: it is one
 * specificity step higher, so this wins even if another installed app's
 * stylesheet loads after ours and also targets `:root`.
 *
 * Noto has to be FIRST, not last. Several of the fallbacks further down the
 * list (Segoe UI, Helvetica Neue, -apple-system) do contain Arabic glyphs, so a
 * browser walking the list would stop at one of them and never reach Noto. The
 * unicode-range above is what keeps "first" from meaning "used for English".
 */
html:root {
	--font-stack:
		"Noto Naskh Arabic", "InterVariable", "Inter", "-apple-system", "BlinkMacSystemFont",
		"Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
		"Helvetica Neue", sans-serif;
}
