/* ==========================================================================
   Client Logo Slider – băng logo chạy liên tục từ phải sang trái (marquee)
   Markup: includes/class-frontend.php · Tốc độ: assets/js/clients-frontend.js
   ========================================================================== */

.clients {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 200px;
	margin: 0 auto;
	padding: 0;
	background: var(--clients-bg, #f6f2f3); /* chọn trong Dashboard › Client Logo Slider */
	overflow: hidden;
}

.wrp-carousel {
	position: relative;
	display: flex;
	align-items: center;
	width: 1300px;
	max-width: 100%;
	height: 200px;
	margin: 0 auto;
}

@media (min-width: 992px) {
	.wrp-carousel {
		height: 300px;
	}
}

@media (max-width: 991px) {
	.wrp-carousel {
		width: 100%;
		padding: 0 20px;
	}
}

/* ---------- Băng chạy ---------- */
.clients-marquee {
	--clients-gap: 40px;
	--clients-item: 220px;          /* desktop: ~5 logo / 1300px */
	--clients-duration: 30s;        /* JS tính lại theo tốc độ px/giây */
	position: relative;
	width: 100%;
	overflow: hidden;
	/* Mờ dần 2 mép */
	-webkit-mask-image: linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%);
	mask-image: linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%);
}

.clients-marquee__track {
	display: flex;
	width: max-content;
	animation: clients-marquee var(--clients-duration) linear infinite;
	will-change: transform;
}

/* Rê chuột (desktop) / focus bàn phím: tạm dừng để xem logo, bấm link */
@media (hover: hover) and (pointer: fine) {
	.clients-marquee:hover .clients-marquee__track {
		animation-play-state: paused;
	}
}

.clients-marquee:focus-within .clients-marquee__track {
	animation-play-state: paused;
}

.clients-marquee__group {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.clients-marquee__item {
	display: flex;
	flex: 0 0 var(--clients-item);
	align-items: center;
	justify-content: center;
	width: var(--clients-item);
	margin: 0 var(--clients-gap) 0 0;   /* khoảng cách đặt bên phải -> 2 nhóm dài bằng nhau */
	padding: 0;
	list-style: none;
}

.clients-marquee__item a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
}

.clients-marquee__item img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: 118px;
	object-fit: contain;
	transition: transform 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
	.clients-marquee__item a:hover img {
		transform: scale(1.05);
	}
}

/* Dịch đúng bằng 1 nhóm (một nửa băng) rồi lặp lại -> nối liền */
@keyframes clients-marquee {
	from {
		transform: translate3d(0, 0, 0);
	}
	to {
		transform: translate3d(-50%, 0, 0);
	}
}

@media (max-width: 991px) {
	.clients-marquee {
		--clients-gap: 32px;
		--clients-item: 180px;
	}
}

@media (max-width: 767px) {
	.clients,
	.wrp-carousel {
		width: 100%;
		padding: 0 20px;
	}

	.clients-marquee {
		--clients-gap: 24px;
		--clients-item: 140px;          /* smartphone: ~2–3 logo */
	}

	.clients-marquee__item img {
		height: 90px;
	}
}

/* Khách bật "giảm chuyển động": đứng yên, vuốt ngang để xem */
@media (prefers-reduced-motion: reduce) {
	.clients-marquee {
		overflow-x: auto;
		-webkit-mask-image: none;
		mask-image: none;
	}

	.clients-marquee__track {
		animation: none;
	}

	.clients-marquee__group[aria-hidden="true"] {
		display: none;
	}
}
