/* Brand Logos (inc/brand-logos.php): greyscale until hovered or focused. */
.brand-logos {
	--brand-logo-height: 70px;
	--brand-logo-max-width: 180px;
	--brand-logo-gap: 2.5rem;

	padding: 2.5em 0;
	background: #fff;
}

.brand-logos__title {
	font-family: "Oswald", sans-serif;
	font-size: 2em;
	font-weight: 500;
	color: #1A1A1A;
	text-align: center;
	text-transform: uppercase;
	margin: 0 0 1em;
}

.brand-logos__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 1.5rem var(--brand-logo-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.brand-logos__item {
	margin: 0;
}

.brand-logos__link {
	display: flex;
	align-items: center;
	justify-content: center;
	height: var(--brand-logo-height);
	width: var(--brand-logo-max-width);
}

.brand-logos__image {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	filter: grayscale(1);
	opacity: 0.75;
	transition: filter 0.3s ease, opacity 0.3s ease;
}

.brand-logos__link:hover .brand-logos__image,
.brand-logos__link:focus-visible .brand-logos__image {
	filter: none;
	opacity: 1;
}

.brand-logos__link:focus-visible {
	outline: 2px solid #BD0000;
	outline-offset: 4px;
}

/* Carousel (default): one row scrolling right to left between two arrows (assets/js/brand-logos.js).
   Until the script runs (or without it), the row above is shown as-is. */
.brand-logos__carousel {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.brand-logos__viewport {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	/* Soft fade at both edges so logos slide in and out rather than being cut off. */
	-webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
	mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}

.brand-logos__carousel.is-carousel .brand-logos__list {
	flex-wrap: nowrap;
	justify-content: flex-start;
	width: max-content;
	will-change: transform;
}

.brand-logos__arrow {
	display: none;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #000;
	color: #fff;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.brand-logos__carousel.is-carousel .brand-logos__arrow {
	display: inline-flex;
}

.brand-logos__arrow--next svg {
	transform: scaleX(-1);
}

.brand-logos__arrow:hover,
.brand-logos__arrow:focus-visible {
	background: #BD0000;
}

.brand-logos__arrow:focus-visible {
	outline: 2px solid #BD0000;
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.brand-logos__image {
		transition: none;
	}
}

@media (max-width: 575px) {
	.brand-logos {
		--brand-logo-height: 50px;
		--brand-logo-max-width: 120px;
		--brand-logo-gap: 1.5rem;
	}

	.brand-logos__carousel {
		gap: 0.5rem;
	}

	.brand-logos__arrow {
		width: 32px;
		height: 32px;
	}

	.brand-logos__arrow svg {
		width: 16px;
		height: 16px;
	}
}
