/**
 * Accessible pause/play control for core/video and core/image (e.g. GIFs).
 *
 * Mirrors the glassy motion toggle used by the custom blocks
 * (section-background, marquee, marquee-text) so the control looks identical
 * wherever motion appears on the site. Part of the site-wide "Pause, Stop,
 * Hide" (WCAG 2.2.2) motion controls.
 */

.sta-motion-toggle-wrap {
	position: relative;
}

/* Paused inline SVG (light DOM). Shadow-root SVGs get a style injected by view.js. */
.sta-motion-toggle-wrap.is-motion-paused svg,
.sta-motion-toggle-wrap.is-motion-paused svg * {
	animation-play-state: paused !important;
}

.sta-motion-toggle {
	position: absolute;
	right: 24px;
	bottom: 24px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	cursor: pointer;
	pointer-events: auto;
	transition:
		color 0.2s ease,
		background-color 0.2s ease;
}

.sta-motion-toggle__icon {
	display: block;
	width: 100%;
	height: 100%;
	fill: currentColor;
	opacity: 0.7;
	transition: opacity 0.2s ease;
}

.sta-motion-toggle__icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

.sta-motion-toggle__icon[hidden] {
	display: none;
}

.sta-motion-toggle.is-theme-lite {
	background: rgba(12, 18, 26, 0.05);
	color: #0c121a;
}

.sta-motion-toggle.is-theme-dark {
	background: rgba(255, 255, 255, 0.05);
	color: #fff;
}

.sta-motion-toggle.is-size-large {
	width: 48px;
	height: 48px;
}

.sta-motion-toggle.is-size-medium {
	width: 36px;
	height: 36px;
}

.sta-motion-toggle.is-size-small {
	width: 24px;
	height: 24px;
}

.sta-motion-toggle.is-size-xsmall {
	width: 16px;
	height: 16px;
}

.sta-motion-toggle.is-theme-lite:hover,
.sta-motion-toggle.is-theme-lite:focus-visible {
	background: #0c121a;
	color: #fff;
}

.sta-motion-toggle.is-theme-dark:hover,
.sta-motion-toggle.is-theme-dark:focus-visible {
	background: #fff;
	color: #0c121a;
}

.sta-motion-toggle:focus-visible {
	outline: 2px solid #0061ff;
	outline-offset: 2px;
}

.sta-motion-toggle__freeze {
	pointer-events: none;
}

/* `is-group-hover` is set by view.js on every item of a sync group. */
.sta-motion-toggle:hover .sta-motion-toggle__icon,
.sta-motion-toggle:focus-visible .sta-motion-toggle__icon {
	opacity: 1;
}

@media (hover: none), (max-width: 833px) {
	.sta-motion-toggle__icon {
		opacity: 1;
	}
}
