/**
 * VOD Section — full-width dark section with two slider rows.
 *
 * Desktop Figma node: 259-13067
 *
 * @package Hamechadesh
 */

/* ==========================================================================
   Section Container
   Full viewport width minus 10px (5px each side).
   ========================================================================== */

.hm-vod-section {
	width: calc(100% - 10px);
	max-width: none;
	margin-inline: auto;
	margin-top: var(--hm-space-section);
	margin-bottom: var(--hm-space-section);
	background-color: var(--hm-color-primary);
	border-radius: var(--hm-radius-xl);
	overflow: hidden;
	content-visibility: auto;
	contain-intrinsic-size: auto 700px;
	padding-top: 59px;
	padding-bottom: 79px;
	z-index: 51;
    position: relative;
}

/* ==========================================================================
   Header: VOD Logo | Divider | CTA Button
   Constrained to 1350px container width.
   ========================================================================== */

.hm-vod-section__header {
	display: flex;
	align-items: flex-end; /* bottom-aligned */
	gap: 15px;
	max-width: var(--hm-container-width);
	margin-inline: auto;
	padding-inline: var(--hm-container-padding);
	margin-bottom: 36px;
}

/* --- VOD gradient logo --- */

.hm-vod-section__logo {
	position: relative;
	display: inline-block;
	font-size: 32px;
	font-weight: 900;
	line-height: 1;
	background: linear-gradient(110.12deg, var(--hm-vs-start) 9.08%, var(--hm-vs-end) 85.42%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	-webkit-text-fill-color: transparent;
	flex-shrink: 0;
}

/* Plain variant: white text, dot matches hm-catposts style
   (vertically centered, 13px, 15px gap from title text) */
.hm-vod-section__logo--plain {
	background: none;
	-webkit-background-clip: unset;
	background-clip: unset;
	color: #ffffff;
	-webkit-text-fill-color: #ffffff;
}

.hm-vod-section__logo-dot {
	position: absolute;
	width: 13px;
	height: 13px;
	top: 4px;
	inset-inline-start: -6px;
}

/* Dot: 13px circle, vertically centered, 15px gap from title
   (matches hm-catposts__dot with align-self:center + gap:15px) */
.hm-vod-section__logo--plain .hm-vod-section__logo-dot {
	width: 13px;
	height: 13px;
	top: 50%;
	transform: translateY(-50%);
	inset-inline-start: -28px; /* 13px dot + 15px gap */
}

/* --- Divider line --- */

.hm-vod-section__divider {
	flex: 1;
	min-width: 0;
	border-bottom: 0.6px solid rgba(255, 255, 255, 0.25);
	margin-bottom: 9px;
}

/* --- CTA Button --- */

.hm-vod-section__cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 25px;
	border-radius: 6px;
	background: linear-gradient(140.99deg, var(--hm-vs-start) 9.08%, var(--hm-vs-end) 85.42%);
	font-size: 16px;
	font-weight: 300;
	line-height: 22px;
	color: var(--hm-color-primary);
	text-decoration: none;
	white-space: nowrap;
	flex-shrink: 0;
	margin-bottom: 9px;
	transition: opacity var(--hm-transition-fast);
}

.hm-vod-section__cta:hover {
	opacity: 0.85;
	color: var(--hm-color-primary);
}

.hm-vod-section__cta-chevron {
	width: 7px;
	height: 12px;
	flex-shrink: 0;
}

/* ==========================================================================
   Shared Card Styles
   ========================================================================== */

.hm-vod-section__card {
	position: relative;
	display: block;
	flex-shrink: 0;
	overflow: hidden;
	text-decoration: none;
	color: #ffffff;
	background-color: #383838;
	user-select: none;
	-webkit-user-select: none;
}

.hm-vod-section__card:hover {
	color: #ffffff;
}

/* Prevent link navigation during drag */
.hm-vod-section__card.is-dragging {
	pointer-events: none;
}

.hm-vod-section__card-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
	-webkit-user-drag: none;
}

.hm-vod-section__card-overlay {
	position: absolute;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.2);
	pointer-events: none;
}

/* Play icon — centered, proportional to card width */
.hm-vod-section__card-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 18.8%;
	height: auto;
	pointer-events: none;
	z-index: 1;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Title — positioned at bottom of card over the image */
.hm-vod-section__card-title {
	position: absolute;
	bottom: 0;
	inset-inline-start: 0;
	inset-inline-end: 0;
	padding: 12px;
	font-weight: 700;
	color: #ffffff;
	text-align: start;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	z-index: 1;
}

/* ==========================================================================
   Top Slider
   ========================================================================== */

.hm-vod-section__top-slider {
	position: relative;
}

.hm-vod-section__top-viewport {
	overflow: hidden;
	width: 100%;
	/* Fixed height = active card height → no layout jump on slide change */
	height: 342px;
	cursor: grab;
}

.hm-vod-section__top-viewport.is-grabbing {
	cursor: grabbing;
}

.hm-vod-section__top-track {
	display: flex;
	align-items: center;
	gap: 15px;
	height: 100%;
	direction: ltr; /* Predictable transform math; card content inherits RTL */
	will-change: transform;
}

/* Transition applied via JS class to avoid conflicts with drag */
.hm-vod-section__top-track.is-animating {
	transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* --- Top card: regular size --- */

.hm-vod-section__card--lg {
	width: 399px;
	height: 240px;
	border-radius: 14px;
	transition: width 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
	            height 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.hm-vod-section__card--lg .hm-vod-section__card-img {
	border-radius: 14px;
}

.hm-vod-section__card--lg .hm-vod-section__card-overlay {
	border-radius: 14px;
}

.hm-vod-section__card--lg .hm-vod-section__card-title {
	font-size: 20px;
	line-height: 20px;
	padding: 10px 10px;
	transition: font-size 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* --- Top card: active (center) size --- */

.hm-vod-section__card--lg.is-active {
	width: 568px;
	height: 342px;
}

.hm-vod-section__card--lg.is-active .hm-vod-section__card-title {
	font-size: 36px;
	line-height: 35px;
	padding: 16px 14px;
}

/* --- Card RTL text --- */

.hm-vod-section__card--lg .hm-vod-section__card-title,
.hm-vod-section__card--sm .hm-vod-section__card-title {
	direction: rtl;
}

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

.hm-vod-section__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	max-width: var(--hm-container-width);
	margin-inline: auto;
	padding-inline: var(--hm-container-padding);
	margin-top: -17px; /* Overlap arrows with bottom of cards */
	position: relative;
	z-index: 2;
}

.hm-vod-section__nav-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	line-height: 0;
	transition: opacity var(--hm-transition-fast), transform var(--hm-transition-fast);
}

.hm-vod-section__nav-btn:hover {
	opacity: 0.85;
	transform: scale(1.05);
}

/* "next" arrow points left (<) in RTL — flip the > SVG */
.hm-vod-section__nav-btn[data-dir="next"] svg {
	transform: scaleX(-1);
}

/* ==========================================================================
   Bottom Slider (Continuous Marquee — JS-driven)
   ========================================================================== */

.hm-vod-section__bottom-viewport {
	overflow: hidden;
	width: 100%;
	margin-top: 49px;
	cursor: grab;
}

.hm-vod-section__bottom-viewport.is-grabbing {
	cursor: grabbing;
}

.hm-vod-section__bottom-track {
	display: flex;
	gap: 10px;
	direction: ltr; /* Predictable animation; card content inherits RTL */
	will-change: transform;
}

/* --- Bottom card: small size --- */

.hm-vod-section__card--sm {
	width: 224px;
	height: 134px;
	border-radius: 8px;
	direction: rtl; /* Reset direction for card content */
	transition: transform 0.3s ease;
}

.hm-vod-section__card--sm:hover {
	transform: scale(1.08);
	z-index: 1;
}

.hm-vod-section__card--sm .hm-vod-section__card-img {
	border-radius: 8px;
}

.hm-vod-section__card--sm .hm-vod-section__card-overlay {
	border-radius: 8px;
}

.hm-vod-section__card--sm .hm-vod-section__card-title {
	font-size: 16px;
	line-height: 17px;
	padding: 8px;
	-webkit-line-clamp: 2;
}

/* ==========================================================================
   Responsive — Mobile (max-width: 767px)
   ========================================================================== */

@media (max-width: 767px) {
	.hm-vod-section {
		width: calc(100% - 10px);
		padding-top: 30px;
		padding-bottom: 40px;
		border-radius: 14px;
	}

	.hm-vod-section__header {
		gap: 10px;
		padding-inline: 10px;
		margin-bottom: 20px;
	}

	.hm-vod-section__logo {
		font-size: 30px;
	}

	.hm-vod-section__logo-dot {
		width: 10px;
		height: 10px;
		top: 3px;
		inset-inline-start: -5px;
	}

	.hm-vod-section__cta {
		padding: 4px 16px;
		font-size: 14px;
	}

	.hm-vod-section__top-viewport {
		height: 200px;
	}

	.hm-vod-section__card--lg {
		width: 220px;
		height: 150px;
		border-radius: 10px;
	}

	.hm-vod-section__card--lg .hm-vod-section__card-img,
	.hm-vod-section__card--lg .hm-vod-section__card-overlay {
		border-radius: 10px;
	}

	.hm-vod-section__card--lg .hm-vod-section__card-title {
		font-size: 14px;
		line-height: 16px;
		padding: 8px;
	}

	.hm-vod-section__card--lg.is-active {
		width: 300px;
		height: 200px;
	}

	.hm-vod-section__card--lg.is-active .hm-vod-section__card-title {
		font-size: 20px;
		line-height: 22px;
		padding: 10px;
	}

	.hm-vod-section__top-track {
		gap: 10px;
	}

	.hm-vod-section__nav {
		margin-top: -14px;
		padding-inline: 10px;
	}

	.hm-vod-section__nav-btn svg {
		width: 30px;
		height: 28px;
	}

	.hm-vod-section__bottom-viewport {
		margin-top: 30px;
	}

	.hm-vod-section__card--sm {
		width: 160px;
		height: 96px;
		border-radius: 6px;
	}

	.hm-vod-section__card--sm .hm-vod-section__card-img,
	.hm-vod-section__card--sm .hm-vod-section__card-overlay {
		border-radius: 6px;
	}

	.hm-vod-section__card--sm .hm-vod-section__card-title {
		font-size: 13px;
		line-height: 15px;
		padding: 6px;
	}

	.hm-vod-section__bottom-track {
		gap: 8px;
	}
}

/* ==========================================================================
   Responsive — Tablet (768px – 1023px)
   ========================================================================== */

@media (min-width: 768px) and (max-width: 1023px) {
	.hm-vod-section {
		padding-top: 40px;
		padding-bottom: 50px;
	}

	.hm-vod-section__header {
		margin-bottom: 24px;
	}

	.hm-vod-section__top-viewport {
		height: 260px;
	}

	.hm-vod-section__card--lg {
		width: 280px;
		height: 180px;
	}

	.hm-vod-section__card--lg .hm-vod-section__card-title {
		font-size: 16px;
		line-height: 18px;
	}

	.hm-vod-section__card--lg.is-active {
		width: 400px;
		height: 260px;
	}

	.hm-vod-section__card--lg.is-active .hm-vod-section__card-title {
		font-size: 26px;
		line-height: 28px;
	}

	.hm-vod-section__bottom-viewport {
		margin-top: 36px;
	}

	.hm-vod-section__card--sm {
		width: 190px;
		height: 114px;
	}
}

/* ==========================================================================
   Responsive — Small Desktop (1024px – 1349px)
   ========================================================================== */

@media (min-width: 1024px) and (max-width: 1349px) {
	.hm-vod-section {
		padding-top: 50px;
		padding-bottom: 60px;
	}

	.hm-vod-section__top-viewport {
		height: 300px;
	}

	.hm-vod-section__card--lg {
		width: 340px;
		height: 210px;
	}

	.hm-vod-section__card--lg.is-active {
		width: 480px;
		height: 300px;
	}

	.hm-vod-section__card--lg.is-active .hm-vod-section__card-title {
		font-size: 30px;
		line-height: 32px;
	}

	.hm-vod-section__card--sm {
		width: 200px;
		height: 120px;
	}
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.hm-vod-section__top-track.is-animating {
		transition: none;
	}

	.hm-vod-section__card--lg {
		transition: none;
	}

	.hm-vod-section__card--lg .hm-vod-section__card-title {
		transition: none;
	}
}
