/**
 * Partner logo carousel – front end styles.
 * Layout values come from CSS custom properties set inline by the shortcode.
 */

.plc-carousel {
	--plc-visible: var(--plc-visible-desktop, 5);
	--plc-gap: var(--plc-gap-base, 40px);
	--plc-arrow-size: 40px;
	--plc-arrow-color: currentColor;

	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	margin: 0 auto;
}

@media (max-width: 1024px) {
	.plc-carousel {
		--plc-visible: var(--plc-visible-tablet, 3);
		--plc-gap: calc(var(--plc-gap-base, 40px) * 0.75);
	}
}

@media (max-width: 767px) {
	.plc-carousel {
		--plc-visible: var(--plc-visible-mobile, 2);
		--plc-gap: calc(var(--plc-gap-base, 40px) * 0.5);
		--plc-arrow-size: 32px;
	}
}

.plc-carousel__viewport {
	--plc-fade: 32px; /* Soft fade at both edges of the strip; set to 0 to disable. */
	flex: 1 1 auto;
	-webkit-mask-image: linear-gradient(to right, transparent, #000 var(--plc-fade), #000 calc(100% - var(--plc-fade)), transparent);
	mask-image: linear-gradient(to right, transparent, #000 var(--plc-fade), #000 calc(100% - var(--plc-fade)), transparent);
	min-width: 0;
	overflow: hidden;
	touch-action: pan-y;
}

/* Reset theme list styles (Divi and others add padding/bullets). */
.plc-carousel .plc-carousel__track {
	position: relative; /* offsetParent for the items, used by the JS. */
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: var(--plc-gap);
	margin: 0;
	padding: 0;
	list-style: none;
	will-change: transform;
}

/* Whole set fits: no paging, just centered. */
.plc-carousel.is-static .plc-carousel__viewport {
	-webkit-mask-image: none;
	mask-image: none;
}

.plc-carousel.is-static .plc-carousel__track {
	justify-content: center;
	transform: none !important;
}

.plc-carousel.is-static .plc-carousel__arrow {
	visibility: hidden;
}

.plc-carousel .plc-carousel__item {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	height: var(--plc-logo-height, 80px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.plc-carousel .plc-carousel__item::before,
.plc-carousel .plc-carousel__item::marker {
	content: none;
}

/* "natural" layout: every logo takes its own width, the gap between them is equal. */
.plc-carousel--natural .plc-carousel__item {
	flex: 0 0 auto;
	max-width: 70%; /* Keeps extremely wide logos in check on small screens. */
}

/* "fixed" layout: equal slots, a set number of logos visible per breakpoint. */
.plc-carousel--fixed .plc-carousel__item {
	flex: 0 0 calc((100% - (var(--plc-visible) - 1) * var(--plc-gap)) / var(--plc-visible));
	max-width: calc((100% - (var(--plc-visible) - 1) * var(--plc-gap)) / var(--plc-visible));
}

/*
 * Automatic, proportional sizing, centered.
 * --plc-scale (set per logo) makes wide logos shorter so wide and tall logos look balanced.
 */
.plc-carousel .plc-carousel__img {
	display: block;
	width: auto;
	height: calc(var(--plc-logo-height, 80px) * var(--plc-scale, 1));
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	margin: 0 auto;
	-webkit-user-drag: none;
	user-select: none;
}

.plc-carousel__arrow {
	flex: 0 0 var(--plc-arrow-size);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--plc-arrow-size);
	height: var(--plc-arrow-size);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--plc-arrow-color);
	cursor: pointer;
	opacity: 0.6;
	transition: opacity 0.2s ease, background-color 0.2s ease;
}

.plc-carousel__arrow:hover,
.plc-carousel__arrow:focus-visible {
	opacity: 1;
	background: rgba(0, 0, 0, 0.06);
}

.plc-carousel__arrow:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.plc-carousel__arrow svg {
	width: 60%;
	height: 60%;
	pointer-events: none;
}

/* Arrows disabled for the marquee (kept for reduced-motion visitors, see carousel.js). */
.plc-carousel--hide-arrows:not(.plc-carousel--force-arrows) .plc-carousel__arrow {
	display: none;
}
