/*
 * Základní vzhled videa. Selektory :where() mají nulovou specifičnost,
 * takže jakékoli pravidlo šablony nebo Design systému má přednost.
 * Výjimkou jsou rozměry náhledu (viz níže).
 * Poměr stran z nastavení modulu přichází v proměnné --he-video-ratio.
 */
:where( .he-video ) {
	margin: 1.5em 0;
}

:where( .he-video__frame ) {
	position: relative;
	aspect-ratio: var( --he-video-ratio, 16 / 9 );
	overflow: hidden;
	background: #000;
}

:where( .he-video__button, .he-video__iframe ) {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

:where( .he-video__button ) {
	cursor: pointer;
}

/*
 * Rozměry náhledu mají vyšší specifičnost: šablony a Elementor nastavují obrázkům
 * height: auto (img, .elementor img) a náhled by se pak do rámečku nevešel
 * a ukázal jen horní část. Ořez a umístění jdou v Design systému změnit.
 */
.he-video .he-video__thumb {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
}

:where( .he-video__thumb ) {
	object-fit: cover;
	object-position: center center;
}

:where( .he-video__play ) {
	position: absolute;
	top: 50%;
	left: 50%;
	display: flex;
	width: 72px;
	transform: translate( -50%, -50% );
	transition: transform .2s, opacity .2s;
	pointer-events: none;
}

:where( .he-video__play ) > :where( img, svg ) {
	display: block;
	width: 100%;
	height: auto;
}

:where( .he-video__button:hover, .he-video__button:focus-visible ) :where( .he-video__play ) {
	transform: translate( -50%, -50% ) scale( 1.1 );
}

:where( .he-video__button:focus-visible ) {
	outline: 3px solid currentColor;
	outline-offset: -3px;
}

:where( .he-video__caption ) {
	margin-top: .5em;
	font-size: .875em;
}
