/* ==========================================================================
   Video List element

   Cấu trúc DOM:
   .ux-video-list  (.ux-video-list--grid | .ux-video-list--slider)
     ├─ .ux-video-list__grid            (chế độ grid)
     │    └─ .ux-video-list__item …
     └─ .ux-video-list__viewport        (chế độ slider)
          ├─ .ux-video-list__scroller
          │    └─ .ux-video-list__item …
          └─ .ux-video-list__nav (--prev | --next)

   .ux-video-list__item
     ├─ .ux-video-list__media   (video hoặc img — phủ kín, object-fit:cover)
     ├─ .ux-video-list__link    (phủ kín, bắt click)
     └─ .ux-video-list__caption (tuỳ chọn)

   Kích thước item (chiều rộng theo cột, chiều cao theo aspect-ratio hoặc height)
   được sinh inline / qua <style> theo _id trong render.php.
   ========================================================================== */

.ux-video-list { position: relative; }

/* --- ITEM: khung chứa video --- */
.ux-video-list__item {
	position: relative;
	display: block;
	margin: 0;
	overflow: hidden;
	background-color: #0a0a1e;
	/* aspect-ratio + border-radius đặt inline; width/height đặt qua <style> theo _id */
}

/* Media phủ kín khung, cắt gọn theo object-fit */
.ux-video-list__media {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 50%;
	display: block;
	border: 0;
	margin: 0;
	padding: 0;
	pointer-events: none;
	transition: transform .6s cubic-bezier(.2, .6, .35, 1);
}
.ux-video-list__item:hover .ux-video-list__media { transform: scale(1.04); }

/* Link phủ kín */
.ux-video-list__link {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: block;
}

/* --- CAPTION (tuỳ chọn) --- */
.ux-video-list__caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 3;
	padding: 1.2em 1em 1em;
	color: #fff;
	text-align: center;
	background: linear-gradient(to top, rgba(0, 0, 0, .65), rgba(0, 0, 0, 0));
	pointer-events: none;
}
.ux-video-list__title { margin: 0 0 .25em; color: #fff; font-size: 1em; line-height: 1.25; }
.ux-video-list__text  { margin: 0 0 .6em; font-size: .8em; opacity: .9; }
.ux-video-list__btn {
	display: inline-block;
	padding: .5em 1.1em;
	font-size: .78em;
	line-height: 1;
	color: #fff;
	background: #000037;
	border-radius: 999px;
	pointer-events: auto;
}

/* ==========================================================================
   GRID
   ========================================================================== */
.ux-video-list__grid {
	display: grid; /* grid-template-columns + gap sinh theo _id */
}

/* ==========================================================================
   SLIDER (cuộn ngang + peek + mũi tên)
   ========================================================================== */
.ux-video-list__viewport { position: relative; }

.ux-video-list__scroller {
	display: flex;
	flex-wrap: nowrap;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;            /* Firefox */
}
.ux-video-list__scroller::-webkit-scrollbar { display: none; } /* WebKit */

.ux-video-list__scroller > .ux-video-list__item {
	flex: 0 0 auto;                   /* width thật sinh theo _id */
	scroll-snap-align: start;
}

/* Kéo-thả để cuộn */
.ux-video-list__scroller.is-draggable { cursor: grab; }
.ux-video-list__scroller.is-dragging {
	cursor: grabbing;
	scroll-behavior: auto;
	scroll-snap-type: none;
	user-select: none;
}
.ux-video-list__scroller.is-dragging .ux-video-list__link { pointer-events: none; }

/* Mũi tên */
.ux-video-list__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #000037;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
	cursor: pointer;
	opacity: .95;
	transition: background .2s ease, color .2s ease, opacity .2s ease;
}
.ux-video-list__nav:hover { background: #000037; color: #fff; opacity: 1; }
.ux-video-list__nav[hidden] { display: none; }
.ux-video-list__nav--prev { left: 8px; }
.ux-video-list__nav--next { right: 8px; }
.ux-video-list__nav svg { display: block; }

/* Mobile: ẩn mũi tên, dùng vuốt cảm ứng */
@media (max-width: 849px) {
	.ux-video-list__nav { display: none !important; }
}
