/**
 * MRT Media Slider - frontend styles.
 * Modern, responsive, with smooth transitions. Scoped to .msp-slider.
 */

.msp-slider {
	--msp-radius: 14px;
	--msp-accent: #2563eb;
	--msp-accent-hover: #1d4ed8;
	--msp-overlay: rgba(8, 12, 24, 0.55);
	--msp-text: #ffffff;
	position: relative;
	width: 100%;
	margin: 0 auto;
	box-sizing: border-box;
}

.msp-slider *,
.msp-slider *::before,
.msp-slider *::after {
	box-sizing: border-box;
}

.msp-slider .swiper {
	width: 100%;
	padding-bottom: 4px;
	overflow: hidden;
}

/* --- Side peek / cutout effect --- */
/* Each slide is sized as a fraction of the container so that `per-view` slides
   plus a `peek` sliver on each side fit across the width. Swiper runs in
   slidesPerView:'auto' mode and reads these widths; the neighbours spill past
   the slider bounds and are cropped by the wrapper's overflow:hidden. All
   slides stay full strength, so the infinite loop stays seamless with no
   edge "pop". The --msp-pv-* and --msp-peek vars are set inline by slider.js. */
.msp-slider.msp-peek .swiper-slide {
	width: calc(100% / (var(--msp-pv-mobile, 1) + 2 * var(--msp-peek, 0.18)));
}

@media (min-width: 768px) {
	.msp-slider.msp-peek .swiper-slide {
		width: calc(100% / (var(--msp-pv-tablet, 2) + 2 * var(--msp-peek, 0.18)));
	}
}

@media (min-width: 1024px) {
	.msp-slider.msp-peek .swiper-slide {
		width: calc(100% / (var(--msp-pv-desktop, 1) + 2 * var(--msp-peek, 0.18)));
	}
}

/* --- Slide --- */
/* No drag/grab cursor — media reads as interactive (clickable), not draggable. */
.msp-slider .swiper-slide {
	cursor: default;
}

.msp-slider .msp-lightbox-trigger,
.msp-slider .msp-media-frame {
	cursor: pointer;
}

.msp-slide-inner {
	position: relative;
	height: 100%;
	display: flex;
	flex-direction: column;
}

.msp-slide-inner > a {
	display: block;
	text-decoration: none;
	color: inherit;
	height: 100%;
}

.msp-media-frame {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
	border-radius: var(--msp-radius);
	background: #0f172a;
	box-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.35);
	aspect-ratio: 16 / 9;
}

/* Fixed-height mode overrides the aspect ratio. */
.msp-slider.msp-fixed-height .msp-media-frame {
	aspect-ratio: auto;
	height: var(--msp-height, 420px);
}

.msp-slider.msp-fixed-height .swiper-slide {
	height: var(--msp-height, 420px);
}

.msp-slide-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
	will-change: transform;
}

.msp-slide-inner:hover .msp-slide-image {
	transform: scale(1.05);
}

/* --- Play button for video slides --- */
.msp-play-button {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 74px;
	height: 74px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: #111827;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 3;
	transition: transform 0.25s ease, background 0.25s ease;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.msp-play-button svg {
	margin-left: 4px;
}

.msp-play-button::after {
	content: "";
	position: absolute;
	inset: -10px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.6);
	animation: msp-pulse 2.2s ease-out infinite;
}

@keyframes msp-pulse {
	0% { transform: scale(0.85); opacity: 0.9; }
	70% { transform: scale(1.25); opacity: 0; }
	100% { transform: scale(1.25); opacity: 0; }
}

.msp-slide-inner:hover .msp-play-button {
	transform: translate(-50%, -50%) scale(1.08);
	background: #ffffff;
}

.msp-video-tag {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 3;
	background: rgba(0, 0, 0, 0.65);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 4px 9px;
	border-radius: 6px;
	backdrop-filter: blur(4px);
}

/* --- Caption overlay --- */
.msp-caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	padding: 26px 22px 20px;
	background: linear-gradient(to top, var(--msp-overlay) 0%, rgba(8, 12, 24, 0.25) 55%, transparent 100%);
	color: var(--msp-text);
	transform: translateY(0);
}

.msp-caption-title {
	margin: 0 0 6px;
	font-size: 20px;
	line-height: 1.25;
	font-weight: 700;
	color: #fff;
}

.msp-caption-text {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	opacity: 0.92;
}

.msp-caption-text p {
	margin: 0 0 6px;
}

.msp-caption-text p:last-child {
	margin-bottom: 0;
}

/* --- Button --- */
.msp-button-wrap {
	margin-top: 14px;
	text-align: center;
}

.msp-button {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: transparent;
	color: #3a3330;
	text-decoration: none;
	font-size: 15px;
	font-weight: 500;
	padding: 14px 34px;
	border-radius: 999px;
	transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

/* Gradient pill border with a transparent interior (masked ring). */
.msp-button::before {
	content: "";
	position: absolute;
	inset: 0;
	padding: 2px;
	border-radius: inherit;
	background: linear-gradient(90deg, rgba(162, 98, 68, 1) 0%, rgba(231, 137, 98, 1) 20%, rgba(247, 181, 145, 1) 40%, rgba(224, 132, 94, 1) 60%, rgba(162, 86, 58, 1) 80%, rgba(134, 78, 57, 1) 100%);
	-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
	-webkit-mask-composite: xor;
	        mask-composite: exclude;
	pointer-events: none;
}

.msp-button:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 20px -10px rgba(162, 86, 58, 0.55);
}

/* --- Swiper navigation arrows --- */
.msp-slider .swiper-button-next,
.msp-slider .swiper-button-prev {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	color: #111827;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
	transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
	margin-top: calc(0px - 22px);
}

.msp-slider .swiper-button-next:hover,
.msp-slider .swiper-button-prev:hover {
	background: #fff;
	transform: scale(1.06);
}

.msp-slider .swiper-button-next::after,
.msp-slider .swiper-button-prev::after {
	font-size: 16px;
	font-weight: 700;
}

.msp-slider .swiper-button-disabled {
	opacity: 0.35;
}

/* --- Pagination dots --- */
.msp-slider .swiper-pagination {
	position: relative;
	margin-top: 16px;
	bottom: 0;
}

.msp-slider.msp-fixed-height .swiper-pagination,
.msp-slider .swiper-pagination-bullets.swiper-pagination-horizontal {
	bottom: 12px;
}

.msp-slider .swiper-pagination-bullet {
	width: 9px;
	height: 9px;
	background: #cbd5e1;
	border: none;
	opacity: 1;
	transition: width 0.25s ease, background 0.25s ease;
}

.msp-slider .swiper-pagination-bullet-active {
	width: 9px;
	border-radius: 50%;
	background: #EB946D;
}

/* Dots inside the frame (fixed height) should be light on dark media. */
.msp-slider.msp-fixed-height .swiper-pagination-bullet {
	background: rgba(255, 255, 255, 0.55);
}

.msp-slider.msp-fixed-height .swiper-pagination-bullet-active {
	background: #EB946D;
}

/* --- Infinite lightbox (Swiper-powered) --- */
/* A single fullscreen overlay shared by every slider on the page. The Swiper
   inside runs in loop mode so navigation past the last item flows seamlessly
   into the first, with no "jump back to start". */
html.msp-lb-lock,
html.msp-lb-lock body {
	overflow: hidden;
}

.msp-lb {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.msp-lb.is-open {
	display: block;
	opacity: 1;
}

.msp-lb__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(6, 9, 18, 0.92);
	-webkit-backdrop-filter: blur(2px);
	        backdrop-filter: blur(2px);
}

.msp-lb__stage {
	position: absolute;
	inset: 0;
}

.msp-lb__swiper,
.msp-lb__swiper .swiper-wrapper {
	width: 100%;
	height: 100%;
}

.msp-lb__swiper .swiper-slide {
	height: 100%;
}

.msp-lb__slide {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 5vh 7vw;
	box-sizing: border-box;
}

.msp-lb__media {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	max-width: 100%;
	max-height: 100%;
}

.msp-lb__img,
.msp-lb__video {
	max-width: min(1200px, 86vw);
	max-height: 80vh;
	width: auto;
	height: auto;
	border-radius: 10px;
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
	background: #000;
}

.msp-lb__caption {
	max-width: min(900px, 86vw);
	text-align: center;
	color: #e7e9ee;
}

.msp-lb__caption h4 {
	margin: 0 0 4px;
	font-size: 18px;
	font-weight: 700;
	color: #fff;
}

.msp-lb__caption p {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: #c2c8d4;
}

.msp-lb__close {
	position: absolute;
	top: 18px;
	right: 22px;
	z-index: 5;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.msp-lb__close:hover {
	background: rgba(255, 255, 255, 0.24);
	transform: scale(1.05);
}

.msp-lb__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	width: 52px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.msp-lb__arrow:hover {
	background: rgba(255, 255, 255, 0.24);
}

.msp-lb__arrow::before {
	content: "";
	width: 11px;
	height: 11px;
	border-top: 2px solid #fff;
	border-right: 2px solid #fff;
}

.msp-lb__prev {
	left: 22px;
}

.msp-lb__prev::before {
	transform: translateX(2px) rotate(-135deg);
}

.msp-lb__next {
	right: 22px;
}

.msp-lb__next::before {
	transform: translateX(-2px) rotate(45deg);
}

@media (max-width: 767px) {
	.msp-lb__arrow {
		width: 42px;
		height: 42px;
	}
	.msp-lb__prev {
		left: 8px;
	}
	.msp-lb__next {
		right: 8px;
	}
	.msp-lb__slide {
		padding: 8vh 8vw;
	}
	.msp-lb__img,
	.msp-lb__video {
		max-width: 92vw;
		max-height: 72vh;
	}
}

@media (prefers-reduced-motion: reduce) {
	.msp-lb {
		transition: none;
	}
}

/* --- Notices (admin preview only) --- */
.msp-notice {
	margin: 12px 0;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
	.msp-caption-title { font-size: 18px; }
}

@media (max-width: 767px) {
	.msp-slider {
		--msp-radius: 12px;
	}
	.msp-caption {
		padding: 20px 16px 16px;
	}
	.msp-caption-title {
		font-size: 16px;
	}
	.msp-caption-text {
		font-size: 13px;
	}
	.msp-play-button {
		width: 60px;
		height: 60px;
	}
	.msp-play-button svg {
		width: 28px;
		height: 28px;
	}
	.msp-slider .swiper-button-next,
	.msp-slider .swiper-button-prev {
		width: 38px;
		height: 38px;
	}
	.msp-slider .swiper-button-next::after,
	.msp-slider .swiper-button-prev::after {
		font-size: 14px;
	}
	.msp-slider.msp-fixed-height .msp-media-frame,
	.msp-slider.msp-fixed-height .swiper-slide {
		height: min(var(--msp-height, 420px), 60vh);
	}
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
	.msp-slide-image,
	.msp-button,
	.msp-play-button {
		transition: none;
	}
	.msp-play-button::after {
		animation: none;
	}
	.msp-slide-inner:hover .msp-slide-image {
		transform: none;
	}
}
