/* Homepage companies logo marquee */
.chimisanat-home-companies {
	--hc-ink: #0f172a;
	--hc-muted: #64748b;
	--hc-line: rgba(15, 23, 42, 0.08);
	--hc-card: #ffffff;
	--hc-gap: 0.85rem;
	--hc-duration: 40s;
	position: relative;
	margin: 0 0 1.75rem;
	padding: 1.75rem 0 1.5rem;
	overflow: hidden;
	background:
		radial-gradient(80% 120% at 100% 0%, rgba(15, 118, 110, 0.06), transparent 55%),
		linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
	border-block: 1px solid var(--hc-line);
}

.chimisanat-home-companies__inner {
	position: relative;
}

.chimisanat-home-companies__head {
	text-align: center;
	margin: 0 auto 1.35rem;
	max-width: 40rem;
}

.chimisanat-home-companies__title {
	margin: 0;
	color: var(--hc-ink);
	font-size: clamp(1.15rem, 2.4vw, 1.45rem);
	font-weight: 800;
	line-height: 1.45;
}

.chimisanat-home-companies__subtitle {
	margin: 0.45rem 0 0;
	color: var(--hc-muted);
	font-size: 0.88rem;
	font-weight: 500;
	line-height: 1.7;
}

.chimisanat-home-companies__marquee {
	position: relative;
	overflow: hidden;
	/* Keep transform math LTR so -50% always equals one group width. */
	direction: ltr;
	mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

.chimisanat-home-companies__track {
	display: flex;
	width: max-content;
	/* No gap on track — gap between groups breaks seamless -50% loop. */
	gap: 0;
	animation: chimisanat-hc-marquee var(--hc-duration) linear infinite;
	will-change: transform;
}

.chimisanat-home-companies__marquee:hover .chimisanat-home-companies__track {
	animation-play-state: paused;
}

.chimisanat-home-companies__group {
	display: flex;
	align-items: stretch;
	flex-shrink: 0;
	gap: 0;
}

.chimisanat-home-companies__item {
	flex: 0 0 auto;
	/* Trailing space lives on items so group1+group2 stitch without track gap. */
	padding-inline-end: var(--hc-gap);
}

.chimisanat-home-companies__card {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 9.5rem;
	height: 4.5rem;
	padding: 0.65rem 0.85rem;
	border-radius: 0.9rem;
	background: var(--hc-card);
	border: 1px solid var(--hc-line);
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
	text-decoration: none;
	direction: rtl;
	transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

a.chimisanat-home-companies__card:hover,
a.chimisanat-home-companies__card:focus-visible {
	transform: translateY(-3px);
	border-color: rgba(15, 118, 110, 0.35);
	box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
	outline: none;
}

.chimisanat-home-companies__logo {
	display: block;
	width: 100%;
	height: 100%;
	max-height: 2.85rem;
	object-fit: contain;
	filter: grayscale(0.15);
	opacity: 0.92;
	transition: filter 0.2s ease, opacity 0.2s ease;
}

a.chimisanat-home-companies__card:hover .chimisanat-home-companies__logo,
a.chimisanat-home-companies__card:focus-visible .chimisanat-home-companies__logo {
	filter: grayscale(0);
	opacity: 1;
}

@keyframes chimisanat-hc-marquee {
	from {
		transform: translate3d(0, 0, 0);
	}
	to {
		/* Exactly one group (50% of two identical groups). */
		transform: translate3d(-50%, 0, 0);
	}
}

@media (max-width: 640px) {
	.chimisanat-home-companies {
		--hc-gap: 0.65rem;
		--hc-duration: 32s;
		padding: 1.35rem 0 1.15rem;
		margin-bottom: 1.25rem;
	}

	.chimisanat-home-companies__head {
		margin-bottom: 1rem;
	}

	.chimisanat-home-companies__subtitle {
		font-size: 0.8rem;
	}

	.chimisanat-home-companies__card {
		width: 8.25rem;
		height: 4rem;
		padding: 0.55rem 0.7rem;
		border-radius: 0.75rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.chimisanat-home-companies__track {
		animation: none;
		flex-wrap: wrap;
		width: 100%;
		justify-content: center;
		row-gap: var(--hc-gap);
	}

	.chimisanat-home-companies__group[aria-hidden="true"] {
		display: none;
	}

	.chimisanat-home-companies__marquee {
		direction: rtl;
		mask-image: none;
		-webkit-mask-image: none;
		overflow: visible;
	}

	.chimisanat-home-companies__item {
		padding-inline-end: 0;
	}
}
