/**
 * 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 --- */
.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;
}

/* --- Lightbox caption tweaks (GLightbox) --- */
.glightbox-clean .gslide-description {
	background: #111827;
}

.glightbox-clean .gslide-title {
	font-size: 1.05em;
	font-weight: 700;
	color: #fff;
}

.glightbox-clean .gdesc-inner p {
	color: #d1d5db;
}

/* --- 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;
	}
}
