/* ============================================================
   YouTube Gallery 9:16 — Carousel Styles v1.2.0
   ============================================================ */

/* ── Wrapper ─────────────────────────────────────────────────── */
.yt916-carousel-wrap {
	position: relative;
	width: 100%;
	max-width: 360px;   /* Portrait 9:16 default width */
	margin: 0 auto;
	outline: none;
	user-select: none;
	-webkit-user-select: none;
}

/* ── Track outer (clips overflow) ───────────────────────────── */
.yt916-track-outer {
	position: relative;
	width: 100%;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
}

/* ── Track ───────────────────────────────────────────────────── */
.yt916-track {
	position: relative;
	width: 100%;
}

/* ── Slide — 9:16 aspect ratio ───────────────────────────────── */
.yt916-slide {
	display: none;
	position: relative;
	width: 100%;
	padding-top: 177.78%;   /* 16/9 * 100 = 177.78% */
	background: #000;
}

.yt916-slide.active {
	display: block;
}

/* ── Slide inner (fills the padding-top trick) ───────────────── */
.yt916-slide-inner {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

/* ── Thumbnail ───────────────────────────────────────────────── */
/* The YouTube thumbnail is 16:9 but the container is 9:16.
   We use a background-image approach via JS to fill correctly,
   but keep the <img> as a CSS fallback with scale trick. */
.yt916-thumb {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
	transform: translate(-50%, -50%) scale(1.8); /* scale up to fill vertical space */
	display: block;
	transition: opacity 0.3s ease;
}

/* ── Play button ─────────────────────────────────────────────── */
.yt916-play-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	cursor: pointer;
	pointer-events: all;
	transition: transform 0.25s ease, opacity 0.25s ease;
	opacity: 0.92;
	z-index: 3;
}

.yt916-play-btn:hover {
	transform: translate(-50%, -50%) scale(1.12);
	opacity: 1;
}

/* ── Inline player (iframe fills the slide) ──────────────────── */
.yt916-player {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 5;
	background: #000;
	display: none;  /* Hidden by default — shown only when playing */
}

.yt916-player.playing {
	display: block;
}

.yt916-player iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* ── Arrows ──────────────────────────────────────────────────── */
.yt916-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.92);
	color: #222;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
	transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
	padding: 0;
	outline: none;
}

.yt916-arrow:hover {
	background: #ffffff;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
	transform: translateY(-50%) scale(1.08);
}

.yt916-arrow:active {
	transform: translateY(-50%) scale(0.96);
}

.yt916-arrow-prev {
	left: -20px;   /* Slightly outside the card, like in the example */
}

.yt916-arrow-next {
	right: -20px;
}

/* ── Dots ────────────────────────────────────────────────────── */
.yt916-dots {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 7px;
	margin-top: 12px;
}

.yt916-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: none;
	background: rgba(0, 0, 0, 0.2);
	cursor: pointer;
	padding: 0;
	transition: background 0.25s ease, transform 0.25s ease, width 0.25s ease;
	outline: none;
}

.yt916-dot.active {
	background: #1a1a1a;
	width: 22px;
	border-radius: 4px;
	transform: none;
}

.yt916-dot:hover:not(.active) {
	background: rgba(0, 0, 0, 0.45);
	transform: scale(1.2);
}

/* ── Responsive: arrows inside on very small screens ─────────── */
@media (max-width: 440px) {
	.yt916-carousel-wrap {
		max-width: 100%;
	}
	.yt916-arrow-prev {
		left: 8px;
	}
	.yt916-arrow-next {
		right: 8px;
	}
	.yt916-arrow {
		background: rgba(255, 255, 255, 0.75);
		width: 34px;
		height: 34px;
	}
}
