/* ==========================================================================
   YouTube facade (click-to-play)
   Aucune requête vers YouTube tant que l'utilisateur n'a pas cliqué :
   l'embed n'existe pas dans le DOM au chargement, donc aucun CMP ne peut
   le supprimer et laisser un trou à la place de la vidéo.
   ========================================================================== */

.ydu-video {
	position: relative;
	width: 100%;
	margin: 0 auto;
	background: #020202;
	overflow: hidden;
}

/* Ratio 16/9 — fallback padding-hack pour les navigateurs sans aspect-ratio */
.ydu-video::before {
	content: "";
	display: block;
	padding-bottom: 56.25%;
}

@supports (aspect-ratio: 16 / 9) {
	.ydu-video {
		aspect-ratio: 16 / 9;
	}
	.ydu-video::before {
		display: none;
	}
}

.ydu-video__btn {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	margin: 0;
	border: 0;
	background: none;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

.ydu-video__thumb {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity .25s ease;
}

.ydu-video__btn:hover .ydu-video__thumb,
.ydu-video__btn:focus-visible .ydu-video__thumb {
	opacity: .8;
}

.ydu-video__btn:focus-visible {
	outline: 3px solid #ee8900;
	outline-offset: -3px;
}

/* Bouton lecture */
.ydu-video__play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 82px;
	height: 58px;
	margin: -29px 0 0 -41px;
	border-radius: 14px;
	background: rgba(2, 2, 2, .65);
	transition: background .25s ease, transform .25s ease;
}

.ydu-video__play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	margin: -11px 0 0 -8px;
	border-style: solid;
	border-width: 11px 0 11px 19px;
	border-color: transparent transparent transparent #fff;
}

.ydu-video__btn:hover .ydu-video__play,
.ydu-video__btn:focus-visible .ydu-video__play {
	background: #ee8900;
	transform: scale(1.06);
}

/* Mention sous le bouton */
.ydu-video__notice {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	margin: 0;
	padding: 10px 16px;
	background: linear-gradient(to top, rgba(2, 2, 2, .78), rgba(2, 2, 2, 0));
	color: #fff;
	font-size: 13px;
	line-height: 1.35;
	text-align: center;
	pointer-events: none;
}

@media (max-width: 767px) {
	.ydu-video__play {
		width: 62px;
		height: 44px;
		margin: -22px 0 0 -31px;
	}
	.ydu-video__notice {
		font-size: 11px;
		padding: 8px 10px;
	}
}

/* État lecture : l'iframe injectée occupe tout le cadre */
.ydu-video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.ydu-video.is-playing .ydu-video__notice {
	display: none;
}

/* WPBakery applique son propre hack de ratio (padding-top: 56.25%) sur
   .wpb_video_wrapper. Comme la facade porte déjà son ratio, on neutralise
   celui du wrapper, sinon la hauteur est doublée.
   .ydu-video-host est posée par le JS ; la règle :has() évite le
   reflow sur les navigateurs qui la supportent. */
.ydu-video-host,
.wpb_video_wrapper:has(> .ydu-video) {
	padding-top: 0 !important;
	height: auto !important;
}
