/*
 * Button shine (Phase 4 design update): a band of light sweeps across a button when the
 * reader points at it or moves to it with the keyboard, like light catching a coin. The client
 * chose the "shine" style over the rainbow glow.
 *
 * Every kind of button on the site gets it: the theme's .btn buttons (Subscribe, account,
 * Read the Story), the hero slider's buttons, the Button block in articles, and the Media Room
 * buttons. To give another button the shine, add the class "rr-shine" to it.
 * Readers who ask their device to reduce motion see no sweep.
 */

:is(.btn, .uk-button, .wp-block-button__link, .mr-listen__link, .mr-card__button, .rr-shine) {
	position: relative;
	isolation: isolate;
	overflow: hidden;
}

:is(.btn, .uk-button, .wp-block-button__link, .mr-listen__link, .mr-card__button, .rr-shine)::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	z-index: 1;
	width: 60%;
	/* Warm gold edges and a bright core: shows on blue, white (a hovered outline button) and gold buttons. */
	background: linear-gradient(105deg, rgba(253, 191, 86, 0) 0%, rgba(253, 191, 86, 0.55) 35%, rgba(255, 248, 225, 0.9) 50%, rgba(253, 191, 86, 0.55) 65%, rgba(253, 191, 86, 0) 100%);
	transform: translateX(-180%) skewX(-18deg);
	pointer-events: none;
}

/* The sweep: across once, from left to right. Touch screens: on tap. */
:is(.btn, .uk-button, .wp-block-button__link, .mr-listen__link, .rr-shine):is(:hover, :focus-visible, :active)::after,
.mr-card:is(:hover, :focus-visible) .mr-card__button::after {
	transform: translateX(260%) skewX(-18deg);
	transition: transform 0.75s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
	:is(.btn, .uk-button, .wp-block-button__link, .mr-listen__link, .mr-card__button, .rr-shine)::after {
		display: none;
	}
}
