/*
 * Aeon Performance – YouTube click-to-play facade (inc/performance/youtube.php).
 *
 * The facade keeps the embed's size (--aeon-yt-ratio, default 16:9) so nothing moves when
 * the player loads. It always sizes itself: the theme's 16:9 wrappers (.content-video,
 * .youtube-video-container) are neutralised around it, because in article bodies
 * `.twitter-content .content-video` removes their padding and an absolutely positioned
 * child would collapse to zero height. Without privacy consent no thumbnail is fetched
 * from YouTube; the box then shows a neutral surface with the title.
 */

.aeon-yt {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: var(--aeon-yt-ratio, 16 / 9);
	margin: 0 0 1em;
	overflow: hidden;
	background: #0f0f0f;
	color: #fff;
}

.content-video:has(> .aeon-yt),
.youtube-video-container:has(> .aeon-yt) {
	height: auto;
	padding-top: 0;
	padding-bottom: 0;
}

.youtube-video-container:has(> .aeon-yt)::after {
	content: none;
}

.content-video > .aeon-yt,
.youtube-video-container > .aeon-yt,
p > .aeon-yt:only-child {
	margin: 0;
}

.aeon-yt__thumb,
.aeon-yt__frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.aeon-yt__thumb {
	object-fit: cover;
	margin: 0;
}

/* No consent for YouTube images: a quiet surface instead of a thumbnail. */
.aeon-yt--no-thumb {
	background:
		radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 60%),
		#1c1c1c;
}

/* The whole box is the play button. */
.aeon-yt__play {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	cursor: pointer;
}

.aeon-yt__play:focus {
	outline: none;
}

.aeon-yt__play:focus-visible {
	outline: 3px solid #fff;
	outline-offset: -6px;
}

.aeon-yt__icon {
	position: relative;
	display: block;
	width: 68px;
	height: 48px;
	border-radius: 14px;
	background: rgba(33, 33, 33, 0.8);
	transition: background-color 0.15s ease;
}

.aeon-yt__icon::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	margin: -10px 0 0 -7px;
	border-style: solid;
	border-width: 10px 0 10px 18px;
	border-color: transparent transparent transparent #fff;
}

.aeon-yt__play:hover .aeon-yt__icon,
.aeon-yt__play:focus-visible .aeon-yt__icon {
	background: #f00;
}

.aeon-yt__title {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1;
	padding: 12px 16px 28px;
	overflow: hidden;
	font-family: Roboto, Arial, sans-serif;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.3;
	white-space: nowrap;
	text-overflow: ellipsis;
	text-align: left;
	color: #fff;
	background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
	pointer-events: none;
}

.aeon-yt--playing .aeon-yt__title {
	display: none;
}

.aeon-yt noscript a {
	position: absolute;
	bottom: 12px;
	left: 16px;
	z-index: 3;
	color: #fff;
}

@media (max-width: 480px) {
	.aeon-yt__icon {
		width: 56px;
		height: 40px;
		border-radius: 12px;
	}

	.aeon-yt__title {
		padding: 10px 12px 24px;
		font-size: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.aeon-yt__icon {
		transition: none;
	}
}
