/* === Partners Strip ===
 * CSS-only horizontal marquee. Anti-dead-but-loaded compliant (Borrow #7):
 * no JS library; animation is hardware-accelerated transform on the inner track.
 * Track contents are duplicated server-side so the loop appears seamless;
 * the duplicate has aria-hidden="true" so screen readers announce each brand once.
 *
 * Pause on hover for accessibility (gives sighted users time to read).
 * Paused entirely under prefers-reduced-motion.
 */

.ns-partners-strip__viewport {
	overflow: hidden;
	position: relative;
	width: 100%;
}

.ns-partners-strip__track {
	display: flex;
	gap: 4rem;
	width: max-content;
	animation: ns-partners-marquee 60s linear infinite;
	will-change: transform;
	/* GPU compositing for smoother sub-pixel rendering on the marquee. */
	transform: translate3d(0, 0, 0);
	backface-visibility: hidden;
	-webkit-font-smoothing: antialiased;
}

.ns-partners-strip__viewport:hover .ns-partners-strip__track,
.ns-partners-strip__viewport:focus-within .ns-partners-strip__track {
	animation-play-state: paused;
}

.ns-partners-strip__cell {
	flex: 0 0 auto;
	/* box-sizing: border-box so the 160×80 footprint includes the padding;
	   ensures text-placeholder cells (which keep padding) render the same outer
	   size as logo cells (which strip padding via :has(img) below). */
	box-sizing: border-box;
	width: 160px;
	height: 80px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #ffffff;
	/* Dashed border = scaffolding placeholder per design-direction.md convention.
	   When a real logo file lands at assets/images/partners/<slug>.svg the cell
	   renders an <img> instead and the dashed border still reads as "logo-bound"
	   — change is.is-confirmed below to a solid border once Brandon confirms a brand. */
	border: 1px dashed var(--wp--preset--color--gray);
	color: var(--wp--preset--color--gray);
	font-size: 0.8125rem;
	font-weight: 600;
	text-align: center;
	padding: 0.5rem;
}

/* Confirmed brands: solid border, primary text color. Cell still renders
   placeholder text until logo art arrives, but the visual signal is "this brand
   is locked in" rather than "this is a candidate." */
.ns-partners-strip__cell.is-confirmed {
	border-style: solid;
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
}

.ns-partners-strip__placeholder {
	line-height: 1.2;
	display: block;
}

.ns-partners-strip__logo {
	/* Allow logos to fill more of the cell. Wide-aspect logos hit max-width
	   first (~144px), square-aspect logos hit max-height first (~70px) and
	   stop scaling — gives consistent visual presence across mixed aspects. */
	max-width: 90%;
	max-height: 88%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

/* PNG logos that ship with white background instead of transparency
   (e.g. COREtec from Shaw Widen CDN — only public-source format with the
   actual brand mark) get mix-blend-mode: multiply so the white burns away
   against the Alice Blue strip bg. SVG logos already have transparent bg
   from their source files and are not affected. */
.ns-partners-strip__logo[src$=".png"] {
	mix-blend-mode: multiply;
}

/* When a real logo lands, the cell loses its dashed-border placeholder shape.
   This rule fires once <img> is present (since :has(img) is now broadly supported).
   !important ensures it wins over .is-confirmed border rule when both apply. */
.ns-partners-strip__cell:has(img) {
	border: none !important;
	background: transparent !important;
	padding: 0 !important;
}

@keyframes ns-partners-marquee {
	from { transform: translate3d(0, 0, 0); }
	/* Move by half so when the original track scrolls fully off-screen,
	   the duplicate is in its place. Loops imperceptibly. translate3d forces
	   GPU compositing for smoother sub-pixel motion. */
	to   { transform: translate3d(-50%, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
	.ns-partners-strip__track {
		animation-play-state: paused;
	}
}

@media (max-width: 781px) {
	.ns-partners-strip__cell {
		width: 120px;
		height: 60px;
		font-size: 0.75rem;
	}
	.ns-partners-strip__track {
		gap: 2.5rem;
		animation-duration: 30s;
	}
}
