/**
 * Inline text highlight (`.haam-text-highlight`) — yellow mark, shrinks on hover.
 */

:is(
	.haam-article,
	.haam-mag-single__content,
	.ai-article-container,
	.haam-cast-body__main,
	body.single-haam_portfolio .haam-svc__prose,
	.haam-ins-gloss-body,
	.haam-gloss-single__intro,
	.editor-styles-wrapper .is-root-container
) .haam-text-highlight {
	position: relative;
	display: inline;
	padding: 0 0.25em;
	z-index: 0;
	color: inherit;
	font-weight: inherit;
}

:is(
	.haam-article,
	.haam-mag-single__content,
	.ai-article-container,
	.haam-cast-body__main,
	body.single-haam_portfolio .haam-svc__prose,
	.haam-ins-gloss-body,
	.haam-gloss-single__intro,
	.editor-styles-wrapper .is-root-container
) .haam-text-highlight::before {
	content: "";
	display: block;
	position: absolute;
	z-index: -1;
	inset: 0 auto auto 0;
	width: 100%;
	height: 100%;
	background: color-mix(in srgb, #ffffff 22%, #ebd11a);
	border-radius: 2px;
	transform-origin: 0 1.35em;
	transition: transform 100ms ease-out 50ms, background-color 100ms ease-out 50ms;
}

:is(
	.haam-article,
	.haam-mag-single__content,
	.ai-article-container,
	.haam-cast-body__main,
	body.single-haam_portfolio .haam-svc__prose,
	.haam-ins-gloss-body,
	.haam-gloss-single__intro,
	.editor-styles-wrapper .is-root-container
) .haam-text-highlight:hover::before {
	transition: transform 100ms ease-out, background-color 100ms ease-out;
	transform: scaleY(0.18);
	background: color-mix(in srgb, #ffffff 38%, #ebd11a);
}

[dir="rtl"] :is(
	.haam-article,
	.haam-mag-single__content,
	.ai-article-container
) .haam-text-highlight::before {
	transform-origin: 100% 1.35em;
}

@media (prefers-reduced-motion: reduce) {
	:is(
		.haam-article,
		.haam-mag-single__content,
		.ai-article-container
	) .haam-text-highlight::before {
		transition: none;
	}

	:is(
		.haam-article,
		.haam-mag-single__content,
		.ai-article-container
	) .haam-text-highlight:hover::before {
		transform: none;
	}
}
