/**
 * The following styles get applied both on the front of your site
 * and in the editor.
 */
.axcelersblocks-video {
	position: relative;

	// width / height / object-fit / border-radius come from the Video sizing
	// control (videoWidth, videoHeight … attributes). Only the structural
	// baseline reset stays here since there is no user control for it.
	video {
		display: block; // prevents bottom whitespace gap from inline baseline
		max-width: 100%;
	}

	// Streaming-platform embed (iframe). Width + aspect-ratio are emitted per
	// block by the render helper; these are the structural defaults.
	&__embed {
		display: block;
		width: 100%;
		aspect-ratio: 16 / 9;
		border: 0;
	}

	// WordPress oEmbed fallback wrapper (TikTok, Twitch, Facebook …).
	&__embed-oembed {
		width: 100%;

		iframe,
		video {
			max-width: 100%;
		}
	}

	&__play-overlay,
	&__play-button {
		position: absolute;
		transition:
			opacity 160ms ease,
			visibility 160ms ease;
	}

	&__play-overlay {
		inset: 0;
		z-index: var( --axb-video-play-overlay-z-index, 2 );
		background: var( --axb-video-play-overlay-bg, rgba( 0, 0, 0, 0.45 ) );
		cursor: pointer;
	}

	&__play-button {
		top: 50%;
		left: 50%;
		z-index: var( --axb-video-play-button-z-index, 3 );
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: var( --axb-video-play-button-size, 64px );
		height: var( --axb-video-play-button-size, 64px );
		color: var( --axb-video-play-button-color, #fff );
		background: var( --axb-video-play-button-bg, rgba( 0, 0, 0, 0.72 ) );
		border-radius: var( --axb-video-play-button-radius, 999px );
		box-shadow: 0 10px 28px rgba( 0, 0, 0, 0.22 );
		cursor: pointer;
		transform: translate( -50%, -50% );
	}

	&__play-button:focus-visible {
		outline: 2px solid currentColor;
		outline-offset: 4px;
	}

	&__play-icon {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: var( --axb-video-play-icon-size, 28px );
		height: var( --axb-video-play-icon-size, 28px );
		color: var( --axb-video-play-icon-color, currentColor );
		line-height: 0;
	}

	&__play-icon svg {
		display: block;
		width: 100%;
		height: 100%;
	}

	&__play-icon svg:not( [fill] ) {
		fill: currentColor;
	}

	&.is-playing &__play-overlay,
	&.is-playing &__play-button {
		visibility: hidden;
		opacity: 0;
		pointer-events: none;
	}
}
