/**
 * Stunner Shorts — video carousel + lightbox. (Class prefix stays "six".)
 * Rendered by astra_child_six_carousel() in functions.php.
 */

.stunner-six {
	--six-gap: 16px;
	--six-tile: 188px;      /* tile width on desktop */
	--six-pad: 30px;        /* inner padding of the navy panel */
	--six-radius: 14px;

	position: relative;
	margin: 3.4em 0 2.8em;
	/* Top padding leaves room for the badge that straddles the top edge. */
	padding: 46px var(--six-pad) 32px;
	border-radius: var(--six-radius);
	/* Brand indigo at the top fading out to white at the bottom. Flat — no
	   shadow and no border, so the bottom edge dissolves into the page. */
	background: linear-gradient( 172deg, #2E2C8E 0%, #4a49a4 24%, #9a99d0 54%, #e8e7f6 84%, #ffffff 100% );
	border: 0;
	box-shadow: none;
	/* Nothing inside may widen the page on a phone. */
	max-width: 100%;
	box-sizing: border-box;
}

/* Single posts: the module lives inside the article card. Keep it inside the
   card's own padding rather than bleeding out, so it can never widen the
   page on mobile. */
.ast-single-post .stunner-six {
	margin-top: 3em;
	margin-bottom: 0.5em;
}

.stunner-six__inner {
	position: relative;
	max-width: 1180px;
	margin: 0 auto;
}

/* ---------- heading ---------- */

.stunner-six__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	/* Pulls the badge + link up so the badge overlaps the panel's top edge.
	   transform doesn't change layout, so the row still reserves its space;
	   the negative margin reclaims what the lift vacated. */
	transform: translateY( -34px );
	margin-bottom: -18px;
}

.stunner-six__title {
	margin: 0;
	padding: 0;
	/* Skewed box = "italic" rectangle. */
	transform: skewX( -11deg );
	background: linear-gradient( 135deg, #FF6210 0%, #ED4924 100% );
	border-radius: 4px;
	box-shadow: none;
	/* Beat the global gradient-text treatment on headings. */
	background-clip: border-box;
	-webkit-background-clip: border-box;
	-webkit-text-fill-color: currentColor;
	color: #fff;
}

/* Counter-skew the text so only the box is slanted. */
.stunner-six__title > span {
	display: block;
	padding: 11px 26px 10px;
	transform: skewX( 11deg );
	font-size: clamp( 19px, 0.9rem + 1vw, 27px );
	line-height: 1.05;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	color: #fff;
	-webkit-text-fill-color: #fff;
	white-space: nowrap;
}

.stunner-six__all {
	flex: 0 0 auto;
	padding: 6px 2px;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	/* Sits on the indigo end of the gradient. */
	color: var(--stunner-orange, #FF6210);
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.18s ease;
}

.stunner-six__all:hover,
.stunner-six__all:focus { color: #fff; }

/* ---------- rail ---------- */

.stunner-six__viewport {
	position: relative;
}

.stunner-six__rail {
	display: flex;
	gap: var(--six-gap);
	margin: 0;
	padding: 4px 0;
	list-style: none;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	/* Arrows replace the scrollbar, but horizontal wheel/trackpad/touch
	   scrolling still works because the element is still a scroller. */
	scrollbar-width: none;
	-ms-overflow-style: none;
	overscroll-behavior-x: contain;
}

.stunner-six__rail::-webkit-scrollbar { display: none; }

.stunner-six__item {
	flex: 0 0 var(--six-tile);
	margin: 0;
	scroll-snap-align: start;
}

/* ---------- arrows ---------- */

.stunner-six__nav {
	position: absolute;
	top: 50%;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	margin-top: -23px;
	padding: 0;
	border: 1px solid rgba( 255, 255, 255, 0.3 );
	border-radius: 50%;
	background: rgba( 16, 16, 48, 0.82 );
	backdrop-filter: blur( 3px );
	color: #fff;
	cursor: pointer;
	transition: background 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
	-webkit-appearance: none;
	appearance: none;
}

/* Sit just inside the rail's edges so they never push the page wider. */
.stunner-six__nav--prev { left: -10px; }
.stunner-six__nav--next { right: -10px; }

.stunner-six__nav::before {
	content: "";
	width: 11px;
	height: 11px;
	border-right: 2.5px solid currentColor;
	border-bottom: 2.5px solid currentColor;
}

.stunner-six__nav--prev::before { transform: rotate( 135deg ) translate( -2px, -2px ); }
.stunner-six__nav--next::before { transform: rotate( -45deg ) translate( -2px, -2px ); }

.stunner-six__nav:hover {
	background: var(--stunner-orange, #FF6210);
	border-color: var(--stunner-orange, #FF6210);
	transform: scale( 1.06 );
}

.stunner-six__nav[disabled] {
	opacity: 0;
	pointer-events: none;
}

/* ---------- tile ---------- */

.stunner-six__tile {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 9 / 16;
	padding: 0;
	border: 0;
	border-radius: 10px;
	overflow: hidden;
	background: #000;
	cursor: pointer;
	text-align: left;
	box-shadow: 0 6px 14px -6px rgba( 0, 0, 0, 0.7 );
	transition: transform 0.22s ease, box-shadow 0.22s ease;
}

@supports not ( aspect-ratio: 1 ) {
	.stunner-six__tile { height: 0; padding-bottom: 177.78%; }
}

.stunner-six__tile:hover,
.stunner-six__tile:focus-visible {
	transform: translateY( -5px );
	box-shadow: 0 14px 26px -8px rgba( 0, 0, 0, 0.85 );
	outline: none;
}

.stunner-six__tile:focus-visible {
	box-shadow: 0 0 0 3px var(--stunner-orange, #FF6210);
}

.stunner-six__thumb {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.stunner-six__play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 48px;
	height: 48px;
	margin: -24px 0 0 -24px;
	border-radius: 50%;
	background: rgba( 0, 0, 0, 0.55 );
	backdrop-filter: blur( 2px );
	transition: background 0.22s ease, transform 0.22s ease;
}

.stunner-six__play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 52%;
	transform: translate( -50%, -50% );
	border-style: solid;
	border-width: 9px 0 9px 15px;
	border-color: transparent transparent transparent #fff;
}

.stunner-six__tile:hover .stunner-six__play {
	background: var(--stunner-orange, #FF6210);
	transform: scale( 1.08 );
}

.stunner-six__label {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 30px 11px 11px;
	background: linear-gradient( to top, rgba( 0, 0, 0, 0.9 ), transparent );
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---------- responsive ---------- */

@media ( max-width: 921px ) {
	.stunner-six {
		--six-tile: 158px;
		--six-pad: 22px;
		padding-top: 42px;
	}
}

@media ( max-width: 600px ) {
	.stunner-six {
		--six-tile: 140px;
		--six-gap: 12px;
		--six-pad: 16px;
		/* Top margin only needs to clear the badge's 28px overhang. */
		margin: 2.2em 0 1.8em;
		padding-top: 38px;
		padding-bottom: 24px;
		border-radius: 12px;
	}

	.stunner-six__head {
		transform: translateY( -28px );
		margin-bottom: -14px;
		gap: 8px;
	}

	/* Small enough to stay on one line beside "Watch all" at 360px+. */
	.stunner-six__title > span {
		padding: 8px 15px 7px;
		font-size: 16px;
		letter-spacing: 0;
	}

	.stunner-six__all { font-size: 10px; letter-spacing: 0.06em; }

	.stunner-six__label { font-size: 11px; padding: 24px 9px 9px; }

	.stunner-six__play { width: 40px; height: 40px; margin: -20px 0 0 -20px; }

	/* Arrows stay, just smaller and tucked to the panel edge so they cover
	   as little of the artwork as possible. */
	.stunner-six__nav { width: 38px; height: 38px; margin-top: -19px; }
	.stunner-six__nav--prev { left: -8px; }
	.stunner-six__nav--next { right: -8px; }
	.stunner-six__nav::before { width: 9px; height: 9px; border-width: 2.5px; }
}

/* Very narrow phones: shrink rather than wrap, and never force the page
   wider than the viewport. */
@media ( max-width: 359px ) {
	.stunner-six { --six-tile: 126px; --six-pad: 13px; }
	.stunner-six__title > span { font-size: 14px; padding: 7px 12px 6px; }
	.stunner-six__all { font-size: 9px; }
}

@media ( prefers-reduced-motion: reduce ) {
	.stunner-six__tile,
	.stunner-six__play,
	.stunner-six__nav,
	.six-lb { transition: none; }
	.stunner-six__rail { scroll-behavior: auto; }
}

/* =========================================================================
   Lightbox
   ========================================================================= */

.six-lb {
	position: fixed;
	inset: 0;
	/* iOS reports 100vh as the height WITHOUT the browser toolbars, so a
	   video sized from vh overflows the visible area and buries the close
	   button. dvh tracks the actually-visible height; vh is the fallback. */
	height: 100vh;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	/* Padding reserves the control strips. Because the video is sized from
	   this padded box rather than from viewport units, it can never cover
	   the close button no matter how the browser chrome behaves. */
	padding: 74px 90px;
	box-sizing: border-box;
	background: rgba( 8, 7, 16, 0.94 );
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	touch-action: none;
	overscroll-behavior: contain;
}

@supports ( height: 100dvh ) {
	.six-lb { height: 100dvh; }
}

.six-lb.is-open { opacity: 1; visibility: visible; }

.six-lb__stage {
	position: relative;
	z-index: 1; /* below the controls — see .six-lb__btn */
	aspect-ratio: 9 / 16;
	/* Fill the padded box, but never get so tall that 9:16 would make it
	   wider than the screen. Width follows from the ratio. */
	height: min( 100%, calc( 92vw * 16 / 9 ) );
	width: auto;
	max-width: 100%;
	background: #000;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 24px 60px -20px rgba( 0, 0, 0, 0.9 );
}

.six-lb__stage iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.six-lb__caption {
	position: absolute;
	left: 50%;
	transform: translateX( -50% );
	bottom: 22px;
	width: min( 92vw, 560px );
	text-align: center;
	color: rgba( 255, 255, 255, 0.85 );
	font-size: 13px;
	font-weight: 700;
	line-height: 1.35;
	pointer-events: none;
	text-shadow: 0 1px 6px rgba( 0, 0, 0, 0.9 );
}

.six-lb__btn {
	position: absolute;
	/* Above the video stage. The stage follows these buttons in the DOM, so
	   without this it paints over them and the close button becomes
	   untappable wherever the two overlap. */
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 1px solid rgba( 255, 255, 255, 0.25 );
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.1 );
	color: #fff;
	cursor: pointer;
	transition: background 0.18s ease, opacity 0.18s ease;
	-webkit-appearance: none;
	appearance: none;
}

.six-lb__btn:hover { background: var(--stunner-orange, #FF6210); border-color: var(--stunner-orange, #FF6210); }
.six-lb__btn[disabled] { opacity: 0.3; cursor: default; }
.six-lb__btn[disabled]:hover { background: rgba( 255, 255, 255, 0.1 ); border-color: rgba( 255, 255, 255, 0.25 ); }

.six-lb__btn::before {
	content: "";
	width: 12px;
	height: 12px;
	border-right: 2.5px solid currentColor;
	border-bottom: 2.5px solid currentColor;
}

.six-lb__close { top: 18px; right: 18px; }
.six-lb__close::before {
	width: 18px; height: 18px;
	border: 0;
	background:
		linear-gradient( currentColor, currentColor ) center/18px 2.5px no-repeat,
		linear-gradient( currentColor, currentColor ) center/2.5px 18px no-repeat;
	transform: rotate( 45deg );
}

/* Arrows live in the lightbox's side padding, so they never sit on the video. */
.six-lb__prev { left: 18px; top: 50%; margin-top: -26px; }
.six-lb__next { right: 18px; top: 50%; margin-top: -26px; }

.six-lb__prev::before { transform: rotate( 135deg ) translate( -2px, -2px ); }
.six-lb__next::before { transform: rotate( -45deg ) translate( -2px, -2px ); }

.six-lb__count {
	position: absolute;
	top: 24px;
	left: 50%;
	transform: translateX( -50% );
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.14em;
	color: rgba( 255, 255, 255, 0.6 );
}

.six-lb__hint {
	position: absolute;
	bottom: 18px;
	left: 50%;
	transform: translateX( -50% );
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgba( 255, 255, 255, 0.4 );
	white-space: nowrap;
}

@media ( max-width: 820px ) {
	/* Clear strips above and below the video: the top holds the counter and
	   close button, the bottom the caption and the up/down arrows. */
	.six-lb {
		padding: 72px 10px 96px;
	}

	.six-lb__stage {
		height: min( 100%, calc( 94vw * 16 / 9 ) );
	}

	/* Bigger, solid, and guaranteed clear of the video. */
	.six-lb__close {
		top: 12px;
		right: 12px;
		width: 48px;
		height: 48px;
		background: rgba( 20, 18, 40, 0.94 );
		border-color: rgba( 255, 255, 255, 0.5 );
	}

	.six-lb__count { top: 26px; }

	.six-lb__prev,
	.six-lb__next {
		top: auto;
		bottom: 16px;
		margin-top: 0;
		width: 46px;
		height: 46px;
	}

	.six-lb__prev { left: calc( 50% - 56px ); }
	.six-lb__next { right: calc( 50% - 56px ); }

	.six-lb__prev::before { transform: rotate( 45deg ) translate( -2px, -2px ); }
	.six-lb__next::before { transform: rotate( -135deg ) translate( -2px, -2px ); }

	.six-lb__caption { bottom: 70px; }
	.six-lb__hint { display: none; }
}
