/* components/marquee.css
   Scrolling partner logo strip.

   Part of assets/css/. The load order lives in
   inc/setup.php - add new files there, not with @import. */

.partner-tile {
	aspect-ratio: 5 / 3;
	background: #fff;
	border: 1px solid var(--line);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
}

.partner-tile img { max-height: 100%; width: auto; object-fit: contain; }

.partner-tile .ph-label { font-size: 10px; text-align: center; }

.marquee {
	position: relative;
	overflow: hidden;
	/* Room for the hover lift, which overflow: hidden would otherwise clip. */
	padding: 10px 0;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.marquee-track {
	display: flex;
	width: max-content;
	/* GSAP drives this now, and pauses it when the row is off screen. The CSS keyframe
	   version animated a 9000px track forever, visible or not. */
}

.marquee-group { display: flex; gap: 20px; padding-right: 20px; }

.marquee .partner-tile { width: 190px; flex: none; aspect-ratio: 5 / 3; }

/* Only linked logos get the affordance; the three without a URL stay inert. */
a.partner-tile {
	position: relative;
	overflow: hidden;
	transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

a.partner-tile::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 2px;
	z-index: 2;
	background: var(--red);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

a.partner-tile:hover,
a.partner-tile:focus-visible {
	transform: translateY(-4px);
}

a.partner-tile:hover::before,
a.partner-tile:focus-visible::before { transform: scaleX(1); }

/* Kept gentle - logos distort quickly, and the tile padding stops any clipping. */
a.partner-tile img { transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1); }

a.partner-tile:hover img,
a.partner-tile:focus-visible img { transform: scale(1.06); }

a.partner-tile:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
	.marquee { overflow-x: auto; mask-image: none; -webkit-mask-image: none; }

	.marquee-group:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	a.partner-tile,
		a.partner-tile img,
		a.partner-tile::before { transition: none; }

	a.partner-tile:hover,
		a.partner-tile:focus-visible { transform: none; }

	a.partner-tile:hover img,
		a.partner-tile:focus-visible img { transform: none; }
}

@media (max-width: 680px) {
	.marquee .partner-tile { width: 150px; }
}
