/* =============================================================
   PD Video Carousel — static perspective scaffold
   ============================================================= */

.pdep-carousel {
	width: 100%;
	overflow: hidden;
}

.pdep-carousel__track {
	position: relative;
	width: 100%;
	height: var(--pdep-carousel-height, 500px);
	perspective: 1000px;
}

/* All slots: centered by margin auto; transform drives ALL motion (no left/right changes between states) */
.pdep-carousel__slot {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	margin: auto;
	width: 50%;
	height: 100%;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	border-radius: var(--pdep-carousel-radius, 8px);
	overflow: hidden;
	transform-origin: center center;
	transform: translateX(0) rotateY(0deg);
	opacity: 0;
	will-change: transform, opacity, width;
	transition: transform 450ms cubic-bezier(0.4, 0, 0.2, 1),
	            opacity 450ms cubic-bezier(0.4, 0, 0.2, 1),
	            width 450ms cubic-bezier(0.4, 0, 0.2, 1),
	            transform-origin 450ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Center: flat, dominant, full opacity */
.pdep-carousel__slot--center {
	width: var(--pdep-carousel-center-width, 60%);
	transform: translateX(0) rotateY(0deg);
	z-index: 10;
	opacity: 1;
}

/* Left flank: translateX shifts inner edge flush against center's left edge + gap.
   Formula: -(50% + W + gap) where W = center-width expressed as element-relative %
   (element = 50% track, so 1%_track = 2%_element → W_track% = W_element%). */
.pdep-carousel__slot--left {
	width: 50%;
	transform-origin: right center;
	transform: translateX(calc(-1 * (var(--pdep-carousel-center-width, 60%) + var(--pdep-carousel-gap, 16px) + 50%)))
	           rotateY(calc(-1 * var(--pdep-carousel-angle, 35deg)));
	-webkit-mask-image: linear-gradient(to right, transparent, black var(--pdep-carousel-fade, 50%));
	mask-image: linear-gradient(to right, transparent, black var(--pdep-carousel-fade, 50%));
	z-index: 5;
	opacity: 0.78;
}

/* Right flank: mirror of left */
.pdep-carousel__slot--right {
	width: 50%;
	transform-origin: left center;
	transform: translateX(calc(var(--pdep-carousel-center-width, 60%) + var(--pdep-carousel-gap, 16px) + 50%))
	           rotateY(var(--pdep-carousel-angle, 35deg));
	-webkit-mask-image: linear-gradient(to left, transparent, black var(--pdep-carousel-fade, 50%));
	mask-image: linear-gradient(to left, transparent, black var(--pdep-carousel-fade, 50%));
	z-index: 5;
	opacity: 0.78;
}

/* Off: parked off right — animates in from outside right edge when promoted to flank */
.pdep-carousel__slot--off {
	width: 50%;
	transform: translateX(calc(150% + var(--pdep-carousel-center-width, 60%) + var(--pdep-carousel-gap, 16px)))
	           rotateY(calc(1.5 * var(--pdep-carousel-angle, 35deg)));
	opacity: 0;
	z-index: 1;
	pointer-events: none;
}

/* Gradient scrim: poster < scrim (::before, z:1) < text overlay (z:2) < flank label (z:3) */
.pdep-carousel__slot::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 60%);
	pointer-events: none;
}

/* Center slot content overlay */
.pdep-carousel__slot-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 1.6em;
	z-index: 2;
}

.pdep-carousel__slot-overlay span {
	display: inline-block;
	color: var(--pdep-carousel-category-color, #fff);
	font-size: 14px;
	font-weight: 600;
	text-transform: uppercase;
	margin-bottom: 0.5em;
}

.pdep-carousel__slot-overlay h2 {
	margin: 0 0 0.5em;
	color: var(--pdep-carousel-title-color, #fff);
	font-weight: 900;
	line-height: 1.2;
}

.pdep-carousel__slot-overlay p {
	margin: 0;
	color: var(--pdep-carousel-excerpt-color, #fff);
	opacity: 0.9;
}

/* Side slots: poster thumbnail only, no overlay */
.pdep-carousel__slot--left .pdep-carousel__slot-overlay,
.pdep-carousel__slot--right .pdep-carousel__slot-overlay {
	display: none;
}

/* =============================================================
   Flank vertical labels — flanks only, anchored to inner edge
   writing-mode: vertical-lr renders text top-to-bottom with no
   transform needed, so top/bottom/center anchoring is trivial.
   ============================================================= */

/* Hidden by default; shown only on flanks */
.pdep-carousel__flank-label {
	display: none;
	position: absolute;
	margin: 0;
	padding: 0;
	white-space: nowrap;
	font-weight: 700;
	font-size: 14px;
	color: var(--pdep-carousel-label-color, #fff);
	pointer-events: none;
	writing-mode: vertical-lr;
	z-index: 3;
}

/* Left flank: inner edge = slot's right side */
.pdep-carousel__slot--left .pdep-carousel__flank-label {
	display: block;
	right: var(--pdep-label-padding, 1em);
}

/* Right flank: inner edge = slot's left side */
.pdep-carousel__slot--right .pdep-carousel__flank-label {
	display: block;
	left: var(--pdep-label-padding, 1em);
}

/* =============================================================
   Arrows
   ============================================================= */

.pdep-carousel__arrows {
	position: absolute;
	left: 1.2em;
	right: 1.2em;
	display: flex;
	align-items: center;
	z-index: 20;
	pointer-events: none;
}

/* Vertical */
.pdep-carousel__arrows--v-top    { top: 1.2em; }
.pdep-carousel__arrows--v-bottom { bottom: 1.2em; }

/* Horizontal */
.pdep-carousel__arrows--h-center { justify-content: center; gap: 0.75em; }
.pdep-carousel__arrows--h-split  { justify-content: space-between; }

.pdep-carousel__arrow {
	pointer-events: auto;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.8);
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.pdep-carousel__arrow i {
	display: block;
}

.pdep-carousel__arrow svg {
	fill: currentColor;
	display: block;
}

.pdep-carousel__arrow:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

/* =============================================================
   Flank label position variants
   ============================================================= */

/* Center (default) — vertically centered regardless of text length */
.pdep-flank-label-center .pdep-carousel__slot--left .pdep-carousel__flank-label,
.pdep-flank-label-center .pdep-carousel__slot--right .pdep-carousel__flank-label {
	top: 50%;
	transform: translateY(-50%);
}

/* Top — text starts at top edge, runs downward; no spill above */
.pdep-flank-label-top .pdep-carousel__slot--left .pdep-carousel__flank-label,
.pdep-flank-label-top .pdep-carousel__slot--right .pdep-carousel__flank-label {
	top: var(--pdep-label-padding, 1em);
}

/* Bottom — text ends at bottom edge, runs upward; no spill below */
.pdep-flank-label-bottom .pdep-carousel__slot--left .pdep-carousel__flank-label,
.pdep-flank-label-bottom .pdep-carousel__slot--right .pdep-carousel__flank-label {
	top: auto;
	bottom: var(--pdep-label-padding, 1em);
}

/* =============================================================
   Inline player — Stage 2
   z-index stack: scrim(1) < overlay(2) < label(3) < player(4) < play-btn(5)
   ============================================================= */

.pdep-carousel__player {
	display: none;
	position: absolute;
	inset: 0;
	z-index: 4;
	background: #000;
}

.pdep-carousel__slot--playing .pdep-carousel__player {
	display: block;
}

.pdep-carousel__player video,
.pdep-carousel__player iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.pdep-carousel__play-btn {
	display: none;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 5;
	width: 4.5em;
	height: 4.5em;
	border-radius: 50%;
	border: 3px solid rgba(255, 255, 255, 0.9);
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	cursor: pointer;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background 0.2s ease, transform 0.2s ease;
}

.pdep-carousel__play-btn:hover {
	background: rgba(0, 0, 0, 0.78);
	transform: translate(-50%, -50%) scale(1.08);
}

.pdep-carousel__play-btn i {
	font-size: 1.8em; /* fallback; overridden by play_btn_icon_size control */
	display: block;
}

.pdep-carousel__play-btn svg {
	width: 1.8em;
	height: 1.8em;
	margin-left: 0.15em; /* optical center for triangle path */
	display: block;
}

/* Visible only on the center tile that has inline video */
.pdep-carousel__slot--center.pdep-carousel__slot--has-inline .pdep-carousel__play-btn {
	display: flex;
}

/* Hide play button and text overlay while video is active.
   !important beats the center+has-inline show rule (0,3,0 specificity).
   pointer-events:none ensures nothing intercepts clicks on the player. */
.pdep-carousel__slot--playing .pdep-carousel__play-btn,
.pdep-carousel__slot--playing .pdep-carousel__slot-overlay {
	display: none !important;
	pointer-events: none;
}
