/* BixGrow Customers - shortcode [bixgrow_customers] */

.bgc-wrap {
	--bgc-gap: 24px;
	--bgc-radius: 12px;
	--bgc-columns: 3;
	--bgc-text: #1f2937;
	--bgc-muted: #6b7280;
	--bgc-accent: #2563eb;
	--bgc-surface: #ffffff;
	--bgc-border: #e5e7eb;

	color: var(--bgc-text);
	margin: 0 0 var(--bgc-gap);

	/*
	 * Keep the block inside its own stacking context AND its own layout box.
	 *
	 * `position: relative` + `z-index: 0` + `isolation` fix paint order: inner arrows and
	 * dots can no longer paint over a sticky header.
	 *
	 * `contain: layout` fixes position: it makes this element the containing block for
	 * every absolutely positioned descendant, so an inner image or arrow can never
	 * resolve its offsets against the page and slide up into a header or a widget
	 * sitting above the block, whatever the theme does to the elements in between.
	 */
	position: relative;
	z-index: 0;
	isolation: isolate;
	contain: layout;

	/* Stay inside the column the shortcode was dropped into. */
	display: block;
	clear: both;
	width: 100%;
	max-width: 100%;
	overflow-wrap: break-word;
}

.bgc-wrap *,
.bgc-wrap *::before,
.bgc-wrap *::after {
	box-sizing: border-box;
}

/* ---------- Slider ---------- */

.bgc-slider {
	position: relative;
	margin-bottom: calc(var(--bgc-gap) * 1.5);
	border-radius: var(--bgc-radius);
	background: var(--bgc-surface);
	border: 1px solid var(--bgc-border);
}

.bgc-slider__viewport {
	overflow: hidden;
	border-radius: var(--bgc-radius);
}

.bgc-slider__track {
	display: flex;
	transition: transform 0.45s ease;
	will-change: transform;
}

.bgc-slider__slide {
	flex: 0 0 100%;
	min-width: 100%;
	position: relative;
}

/* Slide: text on the left, image on the right */
.bgc-slide__link {
	display: flex;
	align-items: stretch;
	min-height: 340px;
	text-decoration: none;
	color: inherit;
}

.bgc-slider--img-left .bgc-slide__link {
	flex-direction: row-reverse;
}

.bgc-slide__body {
	flex: 1 1 50%;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 10px;
	padding: 40px 56px;
}

.bgc-slide__media {
	flex: 1 1 50%;
	position: relative;
	min-width: 0;
	overflow: hidden;
	/* No fill here: a short or transparent image must blend into the slide, not sit on a grey box. */
	background: transparent;
}

/*
 * Selectors are deliberately specific: themes and Elementor ship rules like
 * `.elementor img { height: auto }` that outrank a single class and would leave the
 * image shorter than its box, exposing the surface behind it.
 */
.bgc-wrap .bgc-slide__media img.bgc-slide__img,
.bgc-wrap .bgc-slide__media .bgc-placeholder {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.bgc-slide__link:hover .bgc-slide__img {
	transform: scale(1.03);
}

.bgc-slide__title {
	margin: 0;
	font-size: clamp(20px, 2.2vw, 30px);
	line-height: 1.3;
	color: var(--bgc-text);
}

.bgc-slide__link:hover .bgc-slide__title {
	color: var(--bgc-accent);
}

.bgc-slide__date {
	display: block;
	font-size: 13px;
	color: var(--bgc-muted);
}

.bgc-slide__excerpt {
	margin: 0;
	font-size: 15px;
	line-height: 1.7;
	color: var(--bgc-muted);
}

.bgc-slide__more {
	display: inline-block;
	margin-top: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--bgc-accent);
}

.bgc-slide__more::after {
	content: " \2192";
}

.bgc-slider__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 40px;
	height: 40px;
	border: 1px solid var(--bgc-border);
	border-radius: 50%;
	background: #fff;
	color: #111827;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
	transition: background 0.2s ease, color 0.2s ease;
	z-index: 2;
}

.bgc-slider__nav:hover,
.bgc-slider__nav:focus-visible {
	background: var(--bgc-accent);
	color: #fff;
}

.bgc-slider__nav--prev {
	left: 10px;
}

.bgc-slider__nav--next {
	right: 10px;
}

.bgc-slider__dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	padding: 14px 0 18px;
}

.bgc-slider__dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #cbd5e1;
	cursor: pointer;
	transition: background 0.2s ease, width 0.2s ease;
}

.bgc-slider__dot.is-active {
	background: var(--bgc-accent);
	width: 22px;
	border-radius: 6px;
}

.bgc-slider--single .bgc-slider__nav,
.bgc-slider--single .bgc-slider__dots {
	display: none;
}

/* ---------- Grid ---------- */

.bgc-grid {
	display: grid;
	grid-template-columns: repeat(var(--bgc-columns), minmax(0, 1fr));
	gap: var(--bgc-gap);
}

.bgc-card {
	background: var(--bgc-surface);
	border: 1px solid var(--bgc-border);
	border-radius: var(--bgc-radius);
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bgc-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

.bgc-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

.bgc-card__media {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	/* Same as the slide: no grey box behind the thumbnail. */
	background: transparent;
}

@supports not (aspect-ratio: 16 / 9) {
	.bgc-card__media {
		height: 0;
		padding-bottom: 56.25%;
	}
}

.bgc-wrap .bgc-card__media img.bgc-card__img,
.bgc-wrap .bgc-card__media .bgc-placeholder {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.bgc-card__link:hover .bgc-card__img {
	transform: scale(1.04);
}

.bgc-card__body {
	padding: 16px 18px 20px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.bgc-card__date {
	font-size: 12px;
	color: var(--bgc-muted);
}

.bgc-card__title {
	margin: 0;
	font-size: 17px;
	line-height: 1.4;
}

.bgc-card__link:hover .bgc-card__title {
	color: var(--bgc-accent);
}

.bgc-card__excerpt {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	color: var(--bgc-muted);
}

/* Only used when a post has no featured image at all. */
.bgc-placeholder {
	background: #f7f8fa;
}

/* ---------- Empty state ---------- */

.bgc-wrap .bgc-empty {
	margin: 0;
	padding: 40px 24px;
	text-align: center;
	font-size: 15px;
	line-height: 1.6;
	color: var(--bgc-muted);
	background: var(--bgc-surface);
	border: 1px dashed var(--bgc-border);
	border-radius: var(--bgc-radius);
}

/* ---------- Load more ---------- */

.bgc-loadmore {
	display: flex;
	justify-content: center;
	margin-top: calc(var(--bgc-gap) * 1.25);
}

.bgc-loadmore__btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 32px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--bgc-accent);
	background: transparent;
	border: 1px solid var(--bgc-accent);
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.bgc-loadmore__btn:hover,
.bgc-loadmore__btn:focus-visible {
	background: var(--bgc-accent);
	color: #fff;
}

.bgc-loadmore__btn.is-loading {
	opacity: 0.7;
	cursor: default;
	pointer-events: none;
}

.bgc-loadmore__btn.is-loading::before {
	content: "";
	width: 15px;
	height: 15px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: bgc-spin 0.7s linear infinite;
}

.bgc-loadmore__btn.is-error {
	color: #b91c1c;
	border-color: #b91c1c;
}

@keyframes bgc-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Newly loaded cards fade in instead of popping */
.bgc-card.is-new {
	animation: bgc-fade-in 0.35s ease both;
}

@keyframes bgc-fade-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
	.bgc-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.bgc-slide__body {
		padding: 32px 40px;
	}

	.bgc-slide__link {
		min-height: 280px;
	}
}

@media (max-width: 700px) {
	/* Image on top, text underneath */
	.bgc-slide__link,
	.bgc-slider--img-left .bgc-slide__link {
		flex-direction: column;
		min-height: 0;
	}

	.bgc-slide__media {
		flex: 0 0 auto;
		width: 100%;
		aspect-ratio: 16 / 9;
		order: -1;
	}

	@supports not (aspect-ratio: 16 / 9) {
		.bgc-slide__media {
			height: 200px;
		}
	}

	.bgc-slide__body {
		padding: 20px 18px 22px;
	}
}

@media (max-width: 600px) {
	.bgc-wrap {
		--bgc-gap: 16px;
	}

	.bgc-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.bgc-slider__nav {
		width: 34px;
		height: 34px;
		font-size: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bgc-slider__track,
	.bgc-slide__img,
	.bgc-card,
	.bgc-card__img {
		transition: none !important;
	}

	.bgc-card.is-new {
		animation: none;
	}
}

/* ---------- Layout hardening ---------- */

/*
 * Every absolutely positioned element in this block must resolve against a box that
 * belongs to the block. These selectors restate the anchors with enough specificity to
 * survive theme and page-builder resets - if any of them lost `position: relative`, the
 * image or arrow inside it would fall back to the page as its containing block and be
 * drawn at the top of the document, on top of the header or of any widget above.
 */
.bgc-wrap .bgc-slider,
.bgc-wrap .bgc-slider__slide,
.bgc-wrap .bgc-slide__media,
.bgc-wrap .bgc-card,
.bgc-wrap .bgc-card__media {
	position: relative;
}

/* The block never pulls itself upwards, whatever the theme sets on generic wrappers. */
.bgc-wrap,
.bgc-wrap .bgc-slider,
.bgc-wrap .bgc-grid-wrap {
	top: auto;
	bottom: auto;
	margin-top: 0;
	float: none;
	transform: none;
}

/* Slides stay side by side even if the theme forces links or divs to another display. */
.bgc-wrap .bgc-slider__track {
	display: flex;
}

.bgc-wrap .bgc-slide__link {
	display: flex;
	align-items: stretch;
}

.bgc-wrap .bgc-slider__slide {
	flex: 0 0 100%;
	min-width: 100%;
}
