/* Gig media: poster, video and the after-show carousel (ctk-portal 0.5.7). */

.ckgm-poster {
	margin: 0 auto 20px;
	max-width: 420px;
}

/* The image keeps its own shape; width/height attributes reserve the space (no layout shift). */
.ckgm-poster__img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 70vh;
	object-fit: contain;
}

.ckgm-video {
	margin: 20px auto 0;
	width: 100%;
	max-width: 720px;
	aspect-ratio: 16 / 9;
	background: #000;
}

.ckgm-video__el,
.ckgm-video .ckgm-yt,
.ckgm-video iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Click-to-play YouTube: nothing from YouTube loads until pressed. */
.ckgm-yt {
	position: relative;
	width: 100%;
	height: 100%;
	background: #111;
}

.ckgm-yt__play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--wp--preset--color--bone, #f2ece1);
	text-decoration: none;
}

.ckgm-yt__cover {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.6;
}

.ckgm-yt__btn {
	position: relative;
	width: 68px;
	height: 68px;
	border-radius: 50%;
	background: var(--wp--preset--color--ember, #ff4f1f);
}

.ckgm-yt__btn::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 54%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 12px 0 12px 20px;
	border-color: transparent transparent transparent #fff;
}

.ckgm-yt__note {
	position: absolute;
	bottom: 10px;
	left: 12px;
	font-size: 12px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: 0.8;
}

.ckgm-yt__play:focus-visible,
.ckgm-carousel__btn:focus-visible,
.ckgm-carousel__track:focus-visible {
	outline: 2px solid var(--wp--preset--color--ember-light, #ff8a5c);
	outline-offset: 3px;
}

/* After-show carousel. */
.ckgm-carousel {
	margin-top: 20px;
}

.ckgm-carousel__track {
	display: flex;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	overscroll-behavior-x: contain;
	scrollbar-width: thin;
}

.ckgm-slide {
	flex: 0 0 100%;
	scroll-snap-align: start;
	margin: 0;
}

.ckgm-slide__frame {
	aspect-ratio: 4 / 3;
	background: #000;
}

.ckgm-slide__img,
.ckgm-slide__frame .ckgm-video__el,
.ckgm-slide__frame iframe {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	border: 0;
}

.ckgm-slide__caption {
	margin: 8px 0 0;
	font-size: 14px;
	opacity: 0.85;
}

.ckgm-carousel__nav {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	margin-top: 10px;
}

.ckgm-carousel__nav[hidden] {
	display: none;
}

.ckgm-carousel__btn {
	min-width: 44px;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid rgba(255, 255, 255, 0.4);
	background: transparent;
	color: var(--wp--preset--color--bone, #f2ece1);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.ckgm-carousel__btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.ckgm-carousel__count {
	font-size: 14px;
	font-variant-numeric: tabular-nums;
	opacity: 0.8;
}

@media (prefers-reduced-motion: reduce) {
	.ckgm-carousel__track {
		scroll-behavior: auto;
	}
}

/* 0.5.9: screen-reader announcement of the slide number (announced once scrolling settles). */
.ckgm-carousel__live {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}
