/* Default styling of Windea SearchHighlighter matches. sr1 is an exact match including
 * diacritics and shines in the native <mark> yellow; sr2 matched only after ASCII folding
 * and uses a muted pastel. Both keep dark text for WCAG AA contrast, also inside links.
 * Client-side renderers that rebuild the markup safely use <mark data-highlight-kind="sr1|sr2">;
 * that selector keeps element+attribute specificity to beat the Bootstrap reboot mark rule.
 * :where() keeps zero specificity, so a host theme overrides it; prefer the custom properties. */
:root {
	--wd-search-exact-bg: #ffff00;
	--wd-search-plain-bg: #fff8b0;
	--wd-search-color: #212529;
}

:where(sr1, sr2),
mark[data-highlight-kind="sr1"],
mark[data-highlight-kind="sr2"] {
	border-radius: 2px;
	background-color: var(--wd-search-exact-bg);
	color: var(--wd-search-color);
	font-weight: 600;
}

:where(sr2),
mark[data-highlight-kind="sr2"] {
	background-color: var(--wd-search-plain-bg);
}

/* Forced colors drop author backgrounds: use the system mark colors and keep the
 * exact/ASCII distinction without relying on color (WCAG 1.4.1). */
@media (forced-colors: active) {
	:where(sr1),
	mark[data-highlight-kind="sr1"] {
		background-color: Mark;
		color: MarkText;
	}

	:where(sr2),
	mark[data-highlight-kind="sr2"] {
		background-color: transparent;
		color: CanvasText;
		text-decoration: underline dotted;
	}
}
