/**
 * Single-post YouTube facade.
 *
 * Self-contained, scoped to the .elc-video block. Enqueued only on single posts.
 * Not part of the theme SCSS pipeline — safe to fold into SCSS later.
 */

/* Black stage, 85vh tall. Poster and player are letterboxed inside it. */
.elc-video {
	position: relative;
	display: block;
	width: 100%;
	height: 85vh;
	background-color: #000;
	overflow: hidden;
}

/* Full-bleed click target over the poster. */
.elc-video__play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

/* Poster image — contained so it letterboxes on the black stage. */
.elc-video__play img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
}

/* Play badge — always visible so the poster reads as a video. */
.elc-video__icon {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 84px;
	height: 84px;
	border-radius: 50%;
	background-color: rgba(0, 0, 0, 0.6);
	transform: translate(-50%, -50%);
	transition: background-color 0.2s ease, transform 0.2s ease;
	pointer-events: none; /* let clicks fall through to the button */
}

.elc-video__icon::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 52%; /* nudge to optically centre the triangle */
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 16px 0 16px 26px;
	border-color: transparent transparent transparent #fff;
	transform: translate(-50%, -50%);
}

.elc-video__play:hover .elc-video__icon,
.elc-video__play:focus-visible .elc-video__icon {
	background-color: rgba(200, 0, 0, 0.85);
	transform: translate(-50%, -50%) scale(1.05);
}

/* Injected player — 16:9, centred, letterboxed by the black stage. */
.elc-video__iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	width: min(100%, calc(85vh * 16 / 9));
	max-height: 85vh;
	aspect-ratio: 16 / 9;
	border: 0;
	transform: translate(-50%, -50%);
}
