/* ==========================================================================
   BtB Club & Country Carousel
   Swipeable rail of circular team badges from the club-or-country taxonomy.
   Shared tokens come from btb.css; fallbacks keep the element safe elsewhere.
   ========================================================================== */

/*
 * Full-bleed rail, matching the Post Loop and Taxonomy carousels: the element
 * breaks out of the page container to the full viewport width and
 * --btb-club-inset re-aligns the header and first badge with the standard BtB
 * container while the rail continues past the screen edges.
 *
 * Add "btb-no-bleed" in Extra Class Name to keep an instance contained.
 */
.pca-btb-club-carousel {
	--btb-club-badge-size: 90px;
	--btb-club-gap: 15px;
	--btb-club-border: var(--pca-navy, #1F1933);
	--btb-club-inset: var(--btb-rail-inset, calc(max((100vw - 1800px) / 2, 0px) + 80px));
	position: relative;
	left: 50%;
	width: 100vw;
	max-width: none;
	margin-left: -50vw;
}

.btb-main-most-viewed .pca-btb-club-carousel,
.pca-btb-club-carousel.btb-no-bleed {
	--btb-club-inset: 0px;
	left: auto;
	width: 100%;
	margin-left: 0;
}

.pca-btb-club-carousel *,
.pca-btb-club-carousel *::before,
.pca-btb-club-carousel *::after {
	box-sizing: border-box;
}

/* Header row: WYSIWYG heading left, arrows right — matches the Post Loop. */
.pca-btb-club-carousel__header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 22px;
	padding-inline: var(--btb-club-inset);
}

/* Heading typography lives centrally in btb.css under .btb-section-heading */
.pca-btb-club-carousel__heading {
	min-width: 0;
}

/* Rail */
.pca-btb-club-carousel__viewport {
	overflow-x: auto;
	overflow-y: visible;
	scroll-snap-type: x proximity;
	scroll-padding-inline: var(--btb-club-inset);
	overscroll-behavior-inline: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	outline: none;
	padding-block: 0;
}

.pca-btb-club-carousel__viewport::-webkit-scrollbar {
	display: none;
}

.pca-btb-club-carousel__viewport.is-dragging {
	scroll-snap-type: none;
	cursor: grabbing;
}

.pca-btb-club-carousel__viewport:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
	border-radius: 8px;
}

.pca-btb-club-carousel__track {
	display: flex;
	align-items: center;
	gap: var(--btb-club-gap);
	width: max-content;
	/* On the track (not the scroller) so the trailing gutter always renders. */
	padding-inline: var(--btb-club-inset);
}

/* Badges */
.pca-btb-club-carousel__badge {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 var(--btb-club-badge-size);
	width: var(--btb-club-badge-size);
	height: var(--btb-club-badge-size);
	/* padding: 3%; */
	border: 4px solid var(--btb-club-border);
	border-radius: 50%;
	background: #fff;
	overflow: hidden;
	scroll-snap-align: start;
	transform: translateY(0);
	transition: transform .3s ease, box-shadow .3s ease;
}

.pca-btb-club-carousel__badge:hover,
.pca-btb-club-carousel__badge:focus-visible {transform: scale(0.95);border-color: var(--nectar-extra-color-3);}

.pca-btb-club-carousel__badge:focus-visible {
	outline: 3px solid var(--btb-club-border);
	outline-offset: 3px;
}

.pca-btb-club-carousel__logo {
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	object-fit: contain;
	object-position: center;
	margin: 0 !important;
}

/* Text fallback for clubs without a logo yet. */
.pca-btb-club-carousel__fallback-name {
	color: var(--btb-club-border);
	font-family: 'owners-narrow', sans-serif;
	font-size: 15px;
	font-weight: 800;
	line-height: 1.1;
	text-align: center;
	text-transform: uppercase;
	overflow-wrap: break-word;
	max-width: 100%;
}

/* Arrows: same white circle UI as every other BtB carousel. */
.pca-btb-club-carousel__arrows {
	display: flex;
	gap: var(--btb-arrow-gap, 10px);
	justify-content: flex-end;
	margin-left: auto;
	flex: 0 0 auto;
}

html body .pca-btb-club-carousel__arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--btb-arrow-size, 44px);
	height: var(--btb-arrow-size, 44px);
	padding: 0;
	border: 0;
	border-radius: 999px !important;
	background: var(--btb-arrow-bg, #fff);
	color: var(--btb-arrow-color, #111);
	cursor: pointer;
	transition: transform .2s ease, opacity .2s ease;
}

html body .pca-btb-club-carousel__arrow:hover:not(:disabled),
html body .pca-btb-club-carousel__arrow:focus-visible {
	transform: scale(1.05);
}

html body .pca-btb-club-carousel__arrow:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

html body .pca-btb-club-carousel__arrow:disabled {
	opacity: .3;
	cursor: default;
}

.pca-btb-club-carousel-editor-notice {
	padding: 18px 20px;
	border: 1px dashed #8c8f94;
	background: #fff;
	color: #1d2327;
}

@media (max-width: 690px) {
	.pca-btb-club-carousel {
		--btb-club-badge-size: 85px;
		--btb-club-gap: 12px;
		--btb-club-inset: var(--btb-rail-inset-mobile, 20px);
	}

	.pca-btb-club-carousel.btb-no-bleed {
		--btb-club-inset: 0px;
	}

	.pca-btb-club-carousel__badge {
		border-width: 3px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pca-btb-club-carousel__badge {
		transition: none;
	}
}
