/**
 * codebycp YouTube Video Slider styles.
 */

.codebycp-yts {
	position: relative;
}

.codebycp-yts__viewport {
	overflow: hidden;
}

/* Slide card ------------------------------------------------------------ */
.codebycp-yts__card {
	position: relative;
	display: block;
	width: 100%;
	cursor: pointer;
	overflow: hidden;
	background: #000;
	outline: none;
	-webkit-tap-highlight-color: transparent;
}

.codebycp-yts__card:focus-visible {
	box-shadow: 0 0 0 3px rgba(255, 0, 51, 0.55);
}

.codebycp-yts__media {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: inherit;
}

.codebycp-yts__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .5s ease;
	will-change: transform;
}

.codebycp-yts__overlay {
	position: absolute;
	inset: 0;
	transition: background-color .3s ease;
	pointer-events: none;
}

/* Play button ----------------------------------------------------------- */
.codebycp-yts__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 68px;
	height: 68px;
	color: #fff;
	background-color: #ff0033;
	border-radius: 50%;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
	transition: transform .28s ease, background-color .28s ease, box-shadow .28s ease;
	pointer-events: none;
	z-index: 2;
}

.codebycp-yts__card:hover .codebycp-yts__play {
	transform: translate(-50%, -50%) scale(1.08);
}

.codebycp-yts__play svg {
	width: 24px;
	height: 24px;
	fill: currentColor;
	margin-left: 2px; /* optically center the triangle */
}

.codebycp-yts__play i {
	font-size: 24px;
	line-height: 1;
	margin-left: 2px;
}

/* Caption --------------------------------------------------------------- */
.codebycp-yts__caption {
	margin-top: 14px;
	text-align: center;
	font-weight: 600;
	color: #1a1a1a;
	line-height: 1.4;
}

/* Arrows ---------------------------------------------------------------- */
.codebycp-yts__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #fff;
	color: #1a1a1a;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
	transition: background-color .25s ease, color .25s ease, opacity .25s ease;
	z-index: 5;
}

.codebycp-yts__arrow svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.codebycp-yts__arrow--prev {
	left: -12px;
}

.codebycp-yts__arrow--next {
	right: -12px;
}

.codebycp-yts__arrow.swiper-button-disabled {
	opacity: .35;
	cursor: default;
}

/* Pagination ------------------------------------------------------------ */
.codebycp-yts__pagination {
	position: static;
	margin-top: 20px;
	display: flex;
	justify-content: center;
	align-items: center;
}

.codebycp-yts .swiper-pagination-bullet {
	width: 9px;
	height: 9px;
	background: rgba(0, 0, 0, 0.25);
	opacity: 1;
	transition: background-color .25s ease, transform .25s ease;
}

.codebycp-yts .swiper-pagination-bullet-active {
	background: #ff0033;
	transform: scale(1.15);
}

/* Lightbox -------------------------------------------------------------- */
.codebycp-yts__lightbox {
	position: fixed;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0, 0, 0, 0.88);
	opacity: 0;
	visibility: hidden;
	z-index: 99999;
	transition: opacity .28s ease, visibility .28s ease;
}

.codebycp-yts__lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.codebycp-yts__lightbox-inner {
	position: relative;
	width: 100%;
	max-width: 960px;
	transform: scale(.96);
	transition: transform .28s ease;
}

.codebycp-yts__lightbox.is-open .codebycp-yts__lightbox-inner {
	transform: scale(1);
}

.codebycp-yts__lightbox-video {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 12px;
	overflow: hidden;
}

.codebycp-yts__lightbox-video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

.codebycp-yts__close {
	position: absolute;
	top: -46px;
	right: 0;
	width: 38px;
	height: 38px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 26px;
	line-height: 1;
	color: #fff;
	background: transparent;
	border: 2px solid #fff;
	border-radius: 50%;
	cursor: pointer;
	transition: transform .2s ease, opacity .2s ease;
}

.codebycp-yts__close:hover {
	transform: rotate(90deg);
	opacity: .8;
}

@media (max-width: 767px) {
	.codebycp-yts__arrow--prev { left: 4px; }
	.codebycp-yts__arrow--next { right: 4px; }
	.codebycp-yts__close { top: -44px; }
}

/* Prevent background scroll when a lightbox is open */
body.codebycp-yts-lock {
	overflow: hidden;
}
