/* =========================================================
   NUUSBCA Sponsor Grid/Carousel — Frontend Styles v1.0.2
   ========================================================= */

.nuusbca-sponsor-carousel {
	position: relative;
	width: 100%;
}

/* ---------- Grid (default / desktop / tablet) ----------
   Key fix: use auto columns + justify-content:center so
   a row of 3 logos doesn't stretch to fill a 5-col container.
   Each column is only as wide as its content needs to be.
   -------------------------------------------------------- */

.nuusbca-sc-grid {
	display: grid;
	/* Elementor responsive control overrides grid-template-columns.
	   The default here uses auto so logos never stretch. */
	grid-template-columns: repeat(5, auto);
	justify-content: center;
	align-items: center;
	gap: 24px;
}

.nuusbca-sc-item {
	display: flex;
	align-items: center;
	justify-content: center;
}

.nuusbca-sc-logo-link {
	display: block;
	text-align: center;
}

.nuusbca-sc-logo-img {
	max-width: 100%;
	max-height: 100px; /* overridden by Elementor Style control */
	width: auto;
	height: auto;
	display: block;
	margin: 0 auto;
	object-fit: contain; /* scales proportionally within its column box */
}

/* Grayscale hover (toggled by Elementor selector when enabled) */
.nuusbca-sc-logo-link:hover .nuusbca-sc-logo-img,
.nuusbca-sc-item:hover .nuusbca-sc-logo-img {
	filter: none !important;
}

/* ---------- Carousel wrapper (clipping viewport) ---------- */

.nuusbca-sc-carousel-viewport {
	display: none;        /* hidden until JS activates carousel mode */
	overflow: hidden;
	width: 100%;
	position: relative;
}

/* ---------- Carousel mode — activated by JS adding .is-carousel ---------- */

.nuusbca-sponsor-carousel.is-carousel .nuusbca-sc-grid {
	display: none; /* hide the grid; carousel viewport takes over */
}

.nuusbca-sponsor-carousel.is-carousel .nuusbca-sc-carousel-viewport {
	display: block;
}

/* The track slides horizontally inside the viewport */
.nuusbca-sc-track {
	display: flex;
	flex-wrap: nowrap;
	will-change: transform;
	transition: transform 0.4s ease;
}

.nuusbca-sc-slide {
	flex: 0 0 auto;  /* width set inline by JS based on slides-per-view */
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px 12px;
	box-sizing: border-box;
}

.nuusbca-sc-slide .nuusbca-sc-logo-img {
	max-height: 90px;
	pointer-events: none; /* prevent image drag interfering with swipe */
}

.nuusbca-sc-slide .nuusbca-sc-logo-link {
	pointer-events: auto;
}

/* ---------- Dot indicators ---------- */

.nuusbca-sc-dots {
	display: none;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin-top: 14px;
}

.nuusbca-sponsor-carousel.is-carousel .nuusbca-sc-dots {
	display: flex;
}

.nuusbca-sc-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: #cccccc;
	cursor: pointer;
	padding: 0;
	border: none;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.nuusbca-sc-dot.is-active {
	background-color: #3C4981;
	transform: scale(1.3);
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
	.nuusbca-sc-track {
		transition: none;
	}
}
