.bbsuite2-gallery-slider-wrapper {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
}

.bbsuite2-gallery-slider-group {
	width: 100%;
	display: flex;
	flex-direction: column;
}

.bbsuite2-gallery-slider {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	--bbs2-slides-to-show: 1;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.bbsuite2-gallery-slider::-webkit-scrollbar {
	display: none;
}

.bbsuite2-gallery-slider .bbsuite2-slide {
	flex: 0 0 calc(100% / var(--bbs2-slides-to-show));
	max-width: calc(100% / var(--bbs2-slides-to-show));
	scroll-snap-align: start;
	min-width: 0;
	box-sizing: border-box;
}

.bbsuite2-gallery-slider .bbsuite2-slider-item {
	height: 100%;
	min-width: 0;
	box-sizing: border-box;
}

/* NEW: media wrapper controls intrinsic width */
.bbsuite2-gallery-slider .bbsuite2-slider-media {
	display: block;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.bbsuite2-gallery-slider .bbsuite2-slider-link {
	display: block;
	width: 100%;
	height: auto;
	min-width: 0;
	box-sizing: border-box;
}

.bbsuite2-gallery-slider .bbsuite2-slider-image {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	object-fit: cover;
}

/* Caption always wraps */
.bbsuite2-gallery-slider .bbsuite2-slider-caption {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: normal;
	box-sizing: border-box;
}

/* =========================
   VARIABLE WIDTH MODE FIX
   ========================= */

.bbsuite2-gallery-slider--variablewidth {
	scroll-snap-type: x proximity;
}

.bbsuite2-gallery-slider--variablewidth .bbsuite2-slide {
	flex: 0 0 auto;
	max-width: 100%;
	width: auto;
	min-width: 0;
}

/* IMPORTANT: remove width control from item */
.bbsuite2-gallery-slider--variablewidth .bbsuite2-slider-item {
	max-width: 100%;
	min-width: 0;
}

/* THIS is the actual fix: media wrapper defines width */
.bbsuite2-gallery-slider--variablewidth .bbsuite2-slider-media {
	width: min-content;
	max-width: 100%;
}

/* Anchor width to the image */
.bbsuite2-gallery-slider--variablewidth .bbsuite2-slider-media > a {
	display: block;
	width: max-content;
	max-width: 100%;
}

.bbsuite2-gallery-slider--variablewidth .bbsuite2-slider-image {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
}

/* Caption constrained to media width */
.bbsuite2-gallery-slider--variablewidth .bbsuite2-slider-caption {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: normal;
}

/* ========================= */

.bbsuite2-slider-dots[aria-hidden="true"] {
	display: none;
}

.bbsuite2-slider-dot[aria-current="true"] {
	cursor: default;
}



/* Single Slide Mode - width-driven */
.bbsuite2-gallery-slider[data-slidestoshow="1"] .bbsuite2-slider-image { width: 100%; }
.bbsuite2-gallery-container--height-tall .bbsuite2-gallery-slider[data-slidestoshow="1"] .bbsuite2-slider-image { aspect-ratio: 1; }
.bbsuite2-gallery-container--height-medium .bbsuite2-gallery-slider[data-slidestoshow="1"] .bbsuite2-slider-image { aspect-ratio: 4/3; }
.bbsuite2-gallery-container--height-short .bbsuite2-gallery-slider[data-slidestoshow="1"] .bbsuite2-slider-image { aspect-ratio: 16/9; }
.bbsuite2-gallery-container--height-tiny .bbsuite2-gallery-slider[data-slidestoshow="1"] .bbsuite2-slider-image { aspect-ratio: 16/9; }

/* Multiple Slide Mode - height-driven */
.bbsuite2-gallery-slider:not([data-slidestoshow="1"])  .bbsuite2-slider-image { width: auto; }
.bbsuite2-gallery-container--height-tall .bbsuite2-gallery-slider:not([data-slidestoshow="1"]) .bbsuite2-slider-image { height: 500px; }
.bbsuite2-gallery-container--height-medium .bbsuite2-gallery-slider:not([data-slidestoshow="1"]) .bbsuite2-slider-image { height: 350px; }
.bbsuite2-gallery-container--height-short .bbsuite2-gallery-slider:not([data-slidestoshow="1"]) .bbsuite2-slider-image { height: 200px; }
.bbsuite2-gallery-container--height-tiny .bbsuite2-gallery-slider:not([data-slidestoshow="1"]) .bbsuite2-slider-image { height: 100px; }
@media (max-width: 480px) {
    .bbsuite2-gallery-container--height-tall .bbsuite2-gallery-slider:not([data-slidestoshow="1"]) .bbsuite2-slider-image { height: 400px; }
    .bbsuite2-gallery-container--height-medium .bbsuite2-gallery-slider:not([data-slidestoshow="1"]) .bbsuite2-slider-image { height: 300px; }
    .bbsuite2-gallery-container--height-short .bbsuite2-gallery-slider:not([data-slidestoshow="1"]) .bbsuite2-slider-image { height: 175px; }
    .bbsuite2-gallery-container--height-tiny .bbsuite2-gallery-slider:not([data-slidestoshow="1"]) .bbsuite2-slider-image { height: 100px; }
}

