.lp-yte {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	max-width: 100%;
	margin: 1.5em 0;
	border-radius: 14px;
	background: #000;
	cursor: pointer;
}

.lp-yte__thumb {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.lp-yte:hover .lp-yte__thumb,
.lp-yte:focus-within .lp-yte__thumb {
	transform: scale(1.03);
	opacity: 0.85;
}

.lp-yte__title {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	z-index: 1;
	padding: 14px 16px 40px;
	background: linear-gradient(rgb(0 0 0 / 72%), transparent);
	color: #fff;
	font-size: 0.95rem;
	font-weight: 500;
	line-height: 1.4;
	pointer-events: none;
}

.lp-yte__play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 1;
	display: flex;
	padding: 0;
	border: 0;
	background: none;
	transform: translate(-50%, -50%);
	cursor: pointer;
}

.lp-yte__play-bg {
	fill: rgb(20 20 20 / 82%);
	transition: fill 0.2s ease;
}

.lp-yte:hover .lp-yte__play-bg,
.lp-yte__play:focus-visible .lp-yte__play-bg {
	fill: #f03;
}

.lp-yte__play:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 4px;
	border-radius: 12px;
}

.lp-yte.is-loaded {
	cursor: default;
}

.lp-yte iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.lp-yte__thumb,
	.lp-yte__play-bg {
		transition: none;
	}

	.lp-yte:hover .lp-yte__thumb {
		transform: none;
	}
}

/* When WordPress wraps the facade in its responsive embed figure, that wrapper
   already reserves a 16:9 box (a ::before padding trick, or aspect-ratio in
   newer versions) meant for an absolutely-positioned iframe. Our facade is a
   normal in-flow element with its OWN 16:9 box, so the two stack and leave a
   large empty gap above the video. Collapse the wrapper's reserved box and let
   the facade's own box define the height. */
.wp-block-embed:has(.lp-yte) .wp-block-embed__wrapper {
	position: static;
	padding: 0;
	aspect-ratio: auto;
}

.wp-block-embed:has(.lp-yte) .wp-block-embed__wrapper::before {
	content: none;
	display: none;
	padding: 0;
}

.wp-block-embed:has(.lp-yte) .wp-block-embed__wrapper > .lp-yte {
	margin: 0;
}

/* Fallback for browsers without :has() — fill the reserved box instead. */
@supports not selector(:has(*)) {
	.wp-block-embed__wrapper {
		position: relative;
	}

	.wp-block-embed__wrapper > .lp-yte {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		margin: 0;
		aspect-ratio: auto;
	}
}
