/**
 * ACF Repeater Grid — base structural styles.
 *
 * Dynamic values (columns, gaps, colors, typography, etc.) are applied
 * by Elementor's style engine via the widget's CSS selectors.
 * This file only provides the structural foundation.
 */

/* Grid wrapper */
.bcw-repeater-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	column-gap: 24px;
	row-gap: 24px;
}

/* Individual card */
.bcw-repeater-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

/* Image container */
.bcw-repeater-card__image {
	overflow: hidden;
	flex-shrink: 0;
	align-self: stretch;  /* fills card height in row layout */
	width: 100%;          /* default for stack; overridden by Elementor image column width control */
}

.bcw-repeater-card__image img {
	display: block;
	width: 100%;
	height: 220px;
	object-fit: cover;
	object-position: center center;
}

/* Body */
.bcw-repeater-card__body {
	flex: 1 1 0;
	min-width: 0; /* prevents flex overflow in row layout */
	display: flex;
	flex-direction: column;
}

/* Title */
.bcw-repeater-card__title {
	margin: 0 0 0.5em;
}

/* Description - reset WYSIWYG margins */
.bcw-repeater-card__description > *:first-child {
	margin-top: 0;
}
.bcw-repeater-card__description li {
	margin-bottom: 0 !important;
}

.bcw-repeater-card__description li:last-child {
	margin-bottom: 0.75rem !important;
}

/* Button group wrapper — contains both CTA and secondary button */
.bcw-repeater-card__button-group {
	display: flex;
	flex-direction: column;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: auto; /* push group to bottom of card body */
}

/* CTA button */
.bcw-repeater-card__button {
	display: inline-block;
	text-decoration: none;
	cursor: pointer;
	transition: all 300ms ease;
}

/* Secondary button */
.bcw-repeater-card__button-secondary {
	display: inline-block;
	text-decoration: none;
	cursor: pointer;
	transition: all 300ms ease;
}

/* ── Image Gallery / Slideshow ──────────────────────────────────────────── */

/* Gallery wrapper — flex column so dots sit below the image.
   No explicit height; the gallery grows to fit the image (which is sized
   by the Elementor image_height control on the img element). */
.bcw-card-gallery {
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	min-width: 0;
	width: 100%;
	align-self: stretch;
}

/* Image viewport — position:relative so the buttons (which live inside this
   div) can be absolutely positioned relative to the image, not the dots. */
.bcw-card-gallery .bcw-repeater-card__image {
	position: relative;
	overflow: hidden;
	width: 100%;
	min-width: 0;
}

/* Prev/next buttons live inside .bcw-repeater-card__image and are absolutely
   positioned within it — top:50% is relative to the image, not the dots. */
.bcw-card-gallery__nav--prev,
.bcw-card-gallery__nav--next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
}

.bcw-card-gallery__nav--prev {
	left: 8px; /* default; overridden by Elementor gallery_nav_offset control */
}

.bcw-card-gallery__nav--next {
	right: 8px; /* default; overridden by Elementor gallery_nav_offset control */
}

/* Dots — fixed height below the image */
.bcw-card-gallery__dots {
	flex-shrink: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 6px;
	padding: 6px 0 4px;
}

/* Gallery slides: ALL hidden by default; only .is-active shown.
   Targets the slide class specifically so nav icon <img> elements (inside
   the same container) are not hidden by this rule. */
.bcw-card-gallery .bcw-repeater-card__image .bcw-card-gallery__slide {
	display: none;
}

.bcw-card-gallery .bcw-repeater-card__image .bcw-card-gallery__slide.is-active {
	display: block;
}

/* Prev / Next buttons — prefix with widget class (0,3,0) to beat any theme
   button resets. !important only for box-shadow and min-width which themes
   commonly hard-code even at higher specificities. */
.elementor-widget-bcw-acf-repeater-grid .bcw-card-gallery .bcw-card-gallery__nav {
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none !important;
	outline: none;
	min-width: 0 !important;
	max-width: none;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	border: none;
	cursor: pointer;
	padding: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	line-height: 1;
	border-radius: 4px;
	transition: background-color 200ms ease, color 200ms ease;
}

.elementor-widget-bcw-acf-repeater-grid .bcw-card-gallery .bcw-card-gallery__nav:hover,
.elementor-widget-bcw-acf-repeater-grid .bcw-card-gallery .bcw-card-gallery__nav:focus-visible {
	background: rgba(0, 0, 0, 0.7);
	outline: none;
}

/* Custom arrow images inside nav buttons.
   The more-specific gallery rules below are needed because the base
   .bcw-repeater-card__image img rule (specificity 0,1,1) would otherwise
   override these class-only rules (0,1,0). */
.bcw-nav-icon {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	flex-shrink: 0;
}

.bcw-nav-icon--hover {
	display: none;
}

/* Override .bcw-repeater-card__image img base rules for nav icons inside gallery */
.bcw-card-gallery .bcw-repeater-card__image .bcw-nav-icon {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.bcw-card-gallery .bcw-repeater-card__image .bcw-nav-icon--hover {
	display: none;
}

.bcw-card-gallery .bcw-card-gallery__nav:hover .bcw-nav-icon--normal,
.bcw-card-gallery .bcw-card-gallery__nav:focus-visible .bcw-nav-icon--normal {
	display: none;
}

.bcw-card-gallery .bcw-card-gallery__nav:hover .bcw-nav-icon--hover,
.bcw-card-gallery .bcw-card-gallery__nav:focus-visible .bcw-nav-icon--hover {
	display: block;
}

.bcw-card-gallery__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #ccc;
	cursor: pointer;
	transition: background-color 200ms ease;
	flex-shrink: 0;
}

.bcw-card-gallery__dot:hover,
.bcw-card-gallery__dot:focus-visible {
	background: #888;
	outline: none;
}

.bcw-card-gallery__dot.is-active {
	background: #555;
}

/* Responsive fallbacks (Elementor responsive controls override these) */
@media (max-width: 1024px) {
	.bcw-repeater-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 767px) {
	.bcw-repeater-grid {
		grid-template-columns: 1fr;
	}
}
