/**
 * Client logo slider — companies we work with.
 */

.ans-clients {
	padding: 3rem 0;
	background: var(--ans-bg);
	border-top: 1px solid var(--ans-border);
	border-bottom: 1px solid var(--ans-border);
	overflow: hidden;
}

.ans-clients__head {
	text-align: center;
	margin-bottom: 2rem;
}

.ans-clients__title {
	margin: 0;
	font-size: clamp(1.25rem, 2.5vw, 1.65rem);
	color: var(--ans-text);
	font-weight: 700;
}

.ans-clients__slider-wrap {
	position: relative;
	width: 100%;
}

.ans-clients__fade {
	position: absolute;
	top: 0;
	bottom: 0;
	width: min(120px, 12vw);
	z-index: 2;
	pointer-events: none;
}

.ans-clients__fade--left {
	left: 0;
	background: linear-gradient(90deg, var(--ans-bg) 0%, transparent 100%);
}

.ans-clients__fade--right {
	right: 0;
	background: linear-gradient(270deg, var(--ans-bg) 0%, transparent 100%);
}

.ans-clients__slider {
	overflow: hidden;
	width: 100%;
}

.ans-clients__track {
	display: flex;
	align-items: center;
	gap: 2.5rem;
	width: max-content;
	will-change: transform;
	animation: ansClientsMarquee 80s linear infinite;
}

@keyframes ansClientsMarquee {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(-50%);
	}
}

.ans-client-logo {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 150px;
	max-width: 200px;
	height: 80px;
	padding: 0.65rem 1.1rem;
	border-radius: 14px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background: rgba(255, 255, 255, 0.04);
	text-decoration: none;
	transition: border-color 0.25s ease, background 0.25s ease;
}

[data-theme="light"] .ans-client-logo {
	border-color: var(--ans-border);
	background: #ffffff;
}

.ans-client-logo:hover {
	border-color: rgba(255, 255, 255, 0.28);
	background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .ans-client-logo:hover {
	border-color: rgba(0, 0, 0, 0.18);
	background: #fafafa;
}

.ans-client-logo__img {
	display: block;
	max-height: 52px;
	max-width: 160px;
	width: auto;
	height: auto;
	object-fit: contain;
	object-position: center;
	filter: none;
	opacity: 1;
}

.ans-client-logo__text {
	font-family: var(--ans-font-heading);
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--ans-text);
	text-align: center;
	line-height: 1.25;
	white-space: nowrap;
}

/* Full-size logo on hover */
.ans-client-logo-preview {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	background: rgba(0, 0, 0, 0.72);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

.ans-client-logo-preview.is-active {
	opacity: 1;
	visibility: visible;
}

.ans-client-logo-preview__img {
	display: block;
	max-width: min(92vw, 560px);
	max-height: min(78vh, 420px);
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 12px;
	background: #ffffff;
	padding: 1.25rem;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .ans-client-logo-preview {
	background: rgba(0, 0, 0, 0.55);
}

@media (max-width: 768px) {
	.ans-clients {
		padding: 2.25rem 0;
	}

	.ans-clients__track {
		gap: 1.75rem;
		animation-duration: 60s;
	}

	.ans-client-logo {
		min-width: 130px;
		height: 70px;
		padding: 0.55rem 0.9rem;
	}

	.ans-client-logo__img {
		max-height: 44px;
		max-width: 130px;
	}

	.ans-client-logo__text {
		font-size: 0.78rem;
		white-space: normal;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ans-clients__track {
		animation: none;
		flex-wrap: wrap;
		justify-content: center;
		width: 100%;
		gap: 1rem;
		max-width: var(--ans-container, 1200px);
		margin: 0 auto;
		padding: 0 1rem;
	}

	.ans-clients__slider {
		overflow: visible;
	}

	.ans-clients__fade {
		display: none;
	}
}
