@use "@wordpress/base-styles/mixins" as *;

.wp-block-video {
	// This block has customizable padding, border-box makes that more predictable.
	box-sizing: border-box;
	video {
		width: 100%;
		height: auto;
		vertical-align: middle;
	}

	@supports (position: sticky) {
		[poster] {
			object-fit: cover;
		}
	}

	&.aligncenter {
		text-align: center;
	}

	// Supply caption styles to videos, even if the theme hasn't opted in.
	// Reason being: the new markup, <figcaptions>, are not likely to be styled in the majority of existing themes,
	// so we supply the styles so as to not appear broken or unstyled in those themes.
	:where(figcaption) {
		@include caption-style();
	}
}
