/* Unicode Khmer renders directly from the original text nodes. */
@font-face {
	font-family: "Flower Plus Unicode Khmer Fallback";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("fonts/noto-sans-khmer.woff2") format("woff2");
	/* Let Latin branding, icons, and the riel symbol retain their existing faces. */
	unicode-range: U+1780-17DA, U+17DC-17FF, U+19E0-19FF;
}

@font-face {
	font-family: "SraiKhmer";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("fonts/sraikhmer-normal.woff2") format("woff2");
}

html[lang^="km"] body {
	font-family: "Flower Plus Unicode Khmer Fallback", "Open Sans", Helvetica, Arial, sans-serif;
}

/* Keep converted text together as one flex/grid item, with natural wrapping. */
html[lang^="km"] .flower-plus-khmer-text-flow {
	min-width: 0;
}

/* Real inline text participates in wrapping and reserves its full line height. */
html[lang^="km"] .flower-plus-srai-word {
	display: inline-block !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: visible !important;
	line-height: inherit;
	text-overflow: clip !important;
	vertical-align: baseline;
	white-space: nowrap !important;
}

html[lang^="km"] .flower-plus-srai-visual {
	display: inline !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: visible !important;
	text-overflow: clip !important;
	white-space: nowrap !important;
	font-family: "SraiKhmer", "Flower Plus Unicode Khmer Fallback", sans-serif !important;
	font-size: 1.35em;
	font-style: normal;
	font-weight: 400;
	letter-spacing: normal;
	line-height: 1.25;
	text-transform: none !important;
}

html[lang^="km"] .flower-plus-srai-visual::after {
	content: attr(data-srai-text);
}

html[lang^="km"] .flower-plus-khmer-fallback {
	display: inline !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: visible !important;
	font-family: "Flower Plus Unicode Khmer Fallback", sans-serif !important;
	font-size: 1em;
	letter-spacing: normal;
	line-height: inherit;
	text-transform: none !important;
	vertical-align: baseline;
	white-space: normal !important;
	text-overflow: clip !important;
}

html[lang^="km"] :is(h1, h2, h3, h4, h5, h6) .flower-plus-srai-visual {
	font-size: 1.2em;
}

/* Keep the Decoration About title on one line at desktop width. */
@media (min-width: 1100px) {
	html[lang^="km"] .fpd-about__copy h2 .flower-plus-srai-visual {
		font-size: 1.08em;
	}
}

/* The Unicode source remains available to assistive technology. */
html[lang^="km"] .flower-plus-srai-original {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	border: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
}

/* Khmer marks need natural spacing and enough room on wrapped headings. */
html[lang^="km"] .fp-decoration-full :is(h1, h2, h3, h4, h5, h6) {
	letter-spacing: normal !important;
	line-height: 1.35 !important;
	text-transform: none !important;
}
