/**
 * Vidéos YouTube C'BAU — carrousel accueil, sidebar blog, lightbox.
 */

/* Accueil — vignettes façon player natif */
.video-search.cbeau-youtube-carousel,
.video-search:has(.cbeau-youtube-poster) {
	--cbeau-video-radius: var(--theme-radius, 0.75rem);
}

.video-search:has(.cbeau-youtube-poster) .swiper-slide {
	aspect-ratio: 16 / 9;
}

.video-search:has(.cbeau-youtube-poster) .video-item {
	overflow: hidden;
	border-radius: var(--cbeau-video-radius);
	background: rgb(var(--colors-gray-900, 15 23 42));
}

.video-search:has(.cbeau-youtube-poster) .video-item iframe {
	display: none !important;
}

.video-search:has(.cbeau-youtube-poster) .cbeau-youtube-poster,
.video-search:has(.cbeau-youtube-poster) .cbeau-youtube-poster img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.video-search:has(.cbeau-youtube-poster) .cbeau-youtube-poster img {
	object-fit: cover;
	border-radius: var(--cbeau-video-radius);
}

.video-search:has(.cbeau-youtube-poster) .video-search-icon {
	top: 0.75rem;
	inset-inline-start: 0.75rem;
}

.video-search:has(.cbeau-youtube-poster) .video-play-button {
	width: 3.25rem;
	height: 3.25rem;
	background-color: rgba(0, 0, 0, 0.72);
}

/* Lightbox lecture YouTube */
.cbeau-yt-lightbox {
	max-width: min(920px, calc(100vw - 2rem));
	margin: 0 auto;
}

.cbeau-yt-lightbox__inner {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: var(--theme-radius, 0.75rem);
	overflow: hidden;
	background: #000;
}

.cbeau-yt-lightbox__inner iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.cbeau-yt-popup .mfp-content {
	padding: 0 1rem;
}

.cbeau-yt-popup .mfp-close {
	color: #fff;
	opacity: 0.9;
}

/* Cartes vidéo — grille blog + sidebar */
.cbeau-video-list {
	display: grid;
	gap: 1rem;
}

.cbeau-video-list--grid {
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	margin-block: 1.5rem 2rem;
}

.cbeau-video-list--sidebar {
	grid-template-columns: 1fr;
	gap: 1rem;
}

.cbeau-video-card {
	margin: 0;
}

.cbeau-video-card__link {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	width: 100%;
	padding: 0;
	border: 1px solid rgb(var(--colors-gray-200, 229 231 235));
	border-radius: calc(var(--theme-radius, 0.75rem));
	background: rgb(var(--colors-white, 255 255 255));
	color: inherit;
	text-align: start;
	text-decoration: none;
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.cbeau-video-card__link:hover {
	border-color: rgb(var(--colors-primary-background, 8 57 40));
	box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.08));
	transform: translateY(-1px);
}

.cbeau-video-card__thumb {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: rgb(var(--colors-gray-100, 243 244 246));
}

.cbeau-video-card__thumb img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	display: block;
}

.cbeau-video-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	min-width: 0;
	padding: 0.875rem 1rem 1rem;
}

.cbeau-video-card__title {
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.35;
	color: rgb(var(--colors-gray-900, 17 24 39));
}

.cbeau-video-list--sidebar .cbeau-video-card__title {
	font-size: 0.9rem;
}

.cbeau-video-card__cta {
	font-size: 0.78rem;
	font-weight: 600;
	color: rgb(var(--colors-primary-background, 8 57 40));
}

.cbeau-video-card__play {
	position: absolute;
	right: 0.625rem;
	bottom: 0.625rem;
	width: 2.35rem;
	height: 2.35rem;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.72);
	pointer-events: none;
}

.cbeau-video-card__play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 54%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 0.45rem 0 0.45rem 0.72rem;
	border-color: transparent transparent transparent #fff;
}

.blog-sidebar .widget .cbeau-video-list {
	margin-top: 0.25rem;
}

.blog-sidebar .widget:has(.cbeau-video-list) .widget-title {
	margin-bottom: 0.875rem;
}

@media screen and (max-width: 767.98px) {
	.video-search:has(.cbeau-youtube-poster) .swiper-slide {
		aspect-ratio: 16 / 10;
	}

	.cbeau-video-list--grid {
		grid-template-columns: 1fr;
	}

	.blog-sidebar .widget .cbeau-video-list--sidebar {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.75rem;
	}

	.blog-sidebar .widget .cbeau-video-card__body {
		padding: 0.625rem 0.75rem 0.75rem;
	}

	.blog-sidebar .widget .cbeau-video-card__title {
		font-size: 0.82rem;
	}
}

@media screen and (max-width: 479.98px) {
	.blog-sidebar .widget .cbeau-video-list--sidebar {
		grid-template-columns: 1fr;
	}
}
