/* YouTube Video Showcase — front-end styles */

.yvs-showcase {
	--yvs-radius: 16px;
	--yvs-accent: #6d2352;
	--yvs-dot: #d9c9c0;
	--yvs-gap: 24px;
	position: relative;
	padding: 20px 0;
	background: transparent; /* inherit the site's own background */
}

/* ---------- Carousel ---------- */

.yvs-showcase .yvs-swiper {
	padding-bottom: 36px; /* room for pagination dots */
}

.yvs-showcase .yvs-nav {
	position: absolute;
	top: calc(50% - 18px); /* centre on the video, ignoring the dots */
	transform: translateY(-50%);
	z-index: 5;
	width: 44px;
	height: 44px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #fff;
	color: #222;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.yvs-showcase .yvs-prev { left: -10px; }
.yvs-showcase .yvs-next { right: -10px; }

.yvs-showcase .yvs-nav:hover,
.yvs-showcase .yvs-nav:focus-visible {
	transform: translateY(-50%) scale(1.08);
}

.yvs-showcase .yvs-nav.is-disabled {
	opacity: 0;
	pointer-events: none;
}

.yvs-showcase .swiper-pagination-bullet {
	width: 8px;
	height: 8px;
	background: var(--yvs-dot);
	opacity: 1;
}

.yvs-showcase .swiper-pagination-bullet-active {
	background: var(--yvs-accent);
	width: 22px;
	border-radius: 5px;
	transition: width 0.25s ease;
}

/* Hide the controls when everything already fits (Swiper's watchOverflow). */
.yvs-showcase .swiper-pagination-lock { display: none; }

/* ---------- Grid ---------- */

.yvs-showcase .yvs-grid {
	display: grid;
	grid-template-columns: repeat(var(--yvs-columns, 3), minmax(0, 1fr));
	gap: var(--yvs-gap);
}

@media (max-width: 1023px) {
	.yvs-showcase .yvs-grid {
		grid-template-columns: repeat(min(var(--yvs-columns, 3), 2), minmax(0, 1fr));
	}
}

@media (max-width: 639px) {
	.yvs-showcase .yvs-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 18px;
	}
}

/* ---------- Card ---------- */

/* A card is the 16:9 video frame: thumbnail, play button, rounded corners. */
.yvs-showcase .yvs-card {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: var(--yvs-radius);
	overflow: hidden;
	background: #111;
	cursor: pointer;
	isolation: isolate; /* keeps rounded corners clipping the iframe in Safari */
}

/*
 * Selectors are deliberately specific (and use !important on sizing) so
 * page builders/themes such as Elementor (".elementor img { height:auto }")
 * can't shrink the poster or player inside the 16:9 frame.
 */
.yvs-showcase .yvs-card img.yvs-poster,
.yvs-showcase .yvs-card iframe {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

.yvs-showcase .yvs-card img.yvs-poster {
	object-fit: cover; /* also crops the letterbox bars off hqdefault fallbacks */
	object-position: center;
	transition: transform 0.4s ease;
}

.yvs-showcase .yvs-card:hover img.yvs-poster {
	transform: scale(1.03);
}

.yvs-showcase .yvs-play-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 68px;
	height: 68px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(60, 60, 60, 0.55);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 2;
	transition: background 0.2s ease, transform 0.2s ease;
}

.yvs-showcase .yvs-play-btn svg {
	margin-left: 3px; /* optical centring of the triangle */
}

.yvs-showcase .yvs-card:hover .yvs-play-btn,
.yvs-showcase .yvs-play-btn:focus-visible {
	background: rgba(40, 40, 40, 0.75);
	transform: translate(-50%, -50%) scale(1.08);
}

.yvs-showcase .yvs-card.is-playing {
	cursor: default;
}

.yvs-showcase .yvs-title {
	margin: 12px 2px 0;
	font-size: 1rem;
	line-height: 1.35;
	font-weight: 600;
}

.yvs-empty {
	text-align: center;
	padding: 40px 20px;
	color: #777;
}

@media (max-width: 639px) {
	.yvs-showcase {
		--yvs-radius: 12px;
	}

	.yvs-showcase .yvs-nav {
		display: none; /* swipe on phones */
	}

	.yvs-showcase .yvs-play-btn {
		width: 56px;
		height: 56px;
	}
}
