/**
 * Video carousel + YouTube modal player — layout only.
 * Visual tokens come from Core Framework (--space-*, --text-*) with fallbacks.
 */

.maxs-video {
	--maxs-video-card-width: 365px;
	--maxs-video-gap: var(--space-m, 1.5rem);
	--maxs-video-radius: var(--radius-m, 14px);
	--maxs-video-red: var(--primary, #c8102e);
	--maxs-video-related-height: 132px;
	width: 100%;
}

/* ---------- Carousel ---------- */

.maxs-chicken.maxs-video-carousel.splide {
	visibility: visible;
	width: 100%;
	max-width: 100%;
	overflow: hidden;
}

.maxs-video-carousel.splide:not(.is-initialized) .splide__list {
	display: flex;
	gap: var(--maxs-video-gap);
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.maxs-video-carousel .splide__track {
	overflow: hidden;
}

.maxs-video-carousel__slide {
	width: var(--maxs-video-card-width);
	flex: 0 0 auto;
}

.maxs-video-card {
	display: flex;
	flex-direction: column;
	gap: var(--space-s, 0.75rem);
	width: 100%;
	padding: 0;
	margin: 0;
	border: 0;
	background: none;
	text-align: left;
	cursor: pointer;
	color: inherit;
	font: inherit;
}

.maxs-video-card__media {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 365.39 / 305;
	overflow: hidden;
	border-radius: var(--maxs-video-radius);
	background: #1a1a1a;
}

.maxs-video-card__media img,
.maxs-video-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Slight dark overlay by default (bottom-weighted for title legibility); darker on hover. */
.maxs-video-card__media::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.7) 0%,
		rgba(0, 0, 0, 0.25) 45%,
		rgba(0, 0, 0, 0.2) 100%
	);
	transition: background 0.3s ease;
	pointer-events: none;
}

.maxs-video-card__content {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-s, 0.6rem);
	padding: var(--space-m, 1rem);
	pointer-events: none;
}

.maxs-video-card__tag {
	display: inline-block;
	align-self: flex-start;
	padding: 0.3em 0.65em;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.9);
	border-radius: 3px;
	font-size: var(--text-xs, 0.6875rem);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #fff;
	line-height: 1.1;
}

.maxs-video-card__play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	transform: translate(-50%, -50%) scale(0.8);
	border-radius: 50%;
	background: var(--maxs-video-red);
	color: #fff;
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.3s ease;
	pointer-events: none;
}

.maxs-video-card__play svg {
	width: 28px;
	height: 28px;
	margin-left: 3px;
}

.maxs-video-card:hover .maxs-video-card__media::after,
.maxs-video-card:focus-visible .maxs-video-card__media::after {
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.8) 0%,
		rgba(0, 0, 0, 0.55) 45%,
		rgba(0, 0, 0, 0.5) 100%
	);
}

.maxs-video-card:hover .maxs-video-card__play,
.maxs-video-card:focus-visible .maxs-video-card__play {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

.maxs-video-card:hover .maxs-video-card__img,
.maxs-video-card:focus-visible .maxs-video-card__img {
	transform: scale(1.04);
}

/* Title sits inside the thumbnail; font/white color come from Bricks
   `.heading-white.brxe-heading` (Wonder Light). Size uses the Core Framework token
   (two classes win over the global rule). */
.maxs-video-card .maxs-video-card__title {
	margin: 0;
	font-size: var(--text-l, 1.2rem);
	line-height: 1.2;
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* ---------- Single full-width hero card ---------- */

.maxs-video-hero {
	width: 100%;
}

.maxs-video-hero .maxs-video-card {
	width: 100%;
}

.maxs-video-hero .maxs-video-card__media {
	aspect-ratio: 16 / 9;
}

/* Scale the play button + title up for the larger hero. */
.maxs-video-hero .maxs-video-card__play {
	width: clamp(64px, 7vw, 96px);
	height: clamp(64px, 7vw, 96px);
}

.maxs-video-hero .maxs-video-card__play svg {
	width: clamp(28px, 3vw, 42px);
	height: clamp(28px, 3vw, 42px);
}

.maxs-video-hero .maxs-video-card__content {
	padding: var(--space-l, 1.5rem);
}

.maxs-video-hero .maxs-video-card__title {
	font-size: var(--text-2xl, 1.6rem);
}

/* ---------- Modal ---------- */

.maxs-video-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	background: #000;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.maxs-video-modal[hidden] {
	display: none;
}

.maxs-video-modal.is-open {
	opacity: 1;
}

/* Appearance (red, uppercase, Futura) comes from the site `.btn` class; we only
   position it and relax the min-width so it hugs the label. */
.maxs-video-modal__back.btn {
	position: absolute;
	top: clamp(1rem, 3vw, 2rem);
	left: clamp(1rem, 3vw, 2rem);
	z-index: 10;
	min-width: 0;
	gap: var(--space-s, 0.5rem);
}

.maxs-video-modal__back-arrow {
	font-size: 1.1em;
	line-height: 1;
}

.maxs-video-modal__stage {
	position: relative;
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.maxs-video-modal__player {
	width: 100%;
	max-width: min(100%, calc((100vh - 0px) * 16 / 9));
	aspect-ratio: 16 / 9;
	max-height: 100%;
	background: #000;
}

.maxs-video-modal__player iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

.maxs-video-modal__info {
	position: absolute;
	left: clamp(1rem, 4vw, 3.5rem);
	bottom: calc(var(--maxs-video-related-height) + 1.5rem);
	z-index: 6;
	max-width: min(560px, 70vw);
	color: #fff;
	text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.3s ease, transform 0.3s ease;
	pointer-events: none;
}

/* Font/color from Bricks `.heading-white.brxe-heading` (Wonder Light, white);
   size uses the Core Framework token (two classes to win over the global rule). */
.maxs-video-modal .maxs-video-modal__title {
	margin: 0 0 0.4rem;
	font-size: var(--text-3xl, 2rem);
	line-height: 1.1;
}

.maxs-video-modal__desc {
	margin: 0;
	font-size: var(--text-s, 0.9375rem);
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.85);
}

/* ---------- Related strip ---------- */

.maxs-video-modal__related {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 7;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 1rem clamp(1rem, 4vw, 3.5rem);
	background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 60%, rgba(0, 0, 0, 0));
	transform: translateY(100%);
	opacity: 0;
	transition: transform 0.3s ease, opacity 0.3s ease;
	pointer-events: none;
}

.maxs-video-modal.is-related-visible .maxs-video-modal__related {
	transform: translateY(0);
	opacity: 1;
	pointer-events: auto;
}

.maxs-video-modal.is-related-visible .maxs-video-modal__info {
	opacity: 1;
	transform: translateY(0);
}

.maxs-video-related__list {
	display: flex;
	flex: 1;
	gap: var(--space-s, 0.75rem);
	margin: 0;
	padding: 0.25rem 0;
	list-style: none;
	overflow-x: auto;
	scroll-behavior: smooth;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.maxs-video-related__list::-webkit-scrollbar {
	display: none;
}

.maxs-video-related__item {
	flex: 0 0 auto;
	scroll-snap-align: start;
}

.maxs-video-related__card {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	width: 170px;
	padding: 0;
	border: 0;
	background: none;
	text-align: left;
	cursor: pointer;
	color: #fff;
	font: inherit;
}

.maxs-video-related__media {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--radius-s, 8px);
	background: #1a1a1a;
	border: 2px solid transparent;
	transition: border-color 0.2s ease;
}

.maxs-video-related__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.maxs-video-related__now {
	position: absolute;
	left: 0.4rem;
	bottom: 0.4rem;
	display: none;
	padding: 0.2em 0.5em;
	background: var(--maxs-video-red);
	border-radius: 3px;
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.maxs-video-related__card.is-playing .maxs-video-related__media {
	border-color: var(--maxs-video-red);
}

.maxs-video-related__card.is-playing .maxs-video-related__now {
	display: inline-block;
}

/* Futura body font + white color come from Bricks `.brxe-text`; size from token. */
.maxs-video-related__title {
	font-size: var(--text-xs, 0.75rem);
	line-height: 1.25;
	color: rgba(255, 255, 255, 0.92);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.maxs-video-related__nav {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 1.25rem;
	cursor: pointer;
	transition: background 0.2s ease;
}

.maxs-video-related__nav:hover,
.maxs-video-related__nav:focus-visible {
	background: var(--maxs-video-red);
}

@media (max-width: 768px) {
	.maxs-video {
		--maxs-video-card-width: 78vw;
		--maxs-video-related-height: 116px;
	}

	.maxs-video-modal__info {
		max-width: 90vw;
	}

	.maxs-video-related__card {
		width: 130px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.maxs-video-modal,
	.maxs-video-modal__related,
	.maxs-video-modal__info,
	.maxs-video-card__play,
	.maxs-video-card__img {
		transition: none;
	}
}
