/*
 * Modular Banner Section – Styles
 * Custom ACF block for flexible multi-section banner layouts.
 */

/* ── Block Container ──────────────────────────────────────────────────────── */

.wdm-mb {
	--mb-gap: 24px;
	width: 100%;
}

.wdm-mb__grid {
	display: flex;
	gap: var(--mb-gap);
}

/* ── Single Column ────────────────────────────────────────────────────────── */

.wdm-mb--cols-1 .wdm-mb__section {
	flex: 0 0 100%;
}

/* ── Two Columns ──────────────────────────────────────────────────────────── */

.wdm-mb--cols-2 .wdm-mb__section {
	flex-grow: var(--mb-section-grow, 1);
	flex-shrink: 1;
	flex-basis: 0%;
	min-width: 0;
}

/* ── Section ──────────────────────────────────────────────────────────────── */

.wdm-mb__section {
	position: relative;
	overflow: hidden;
	border-radius: var(--mb-radius, 16px);
}

/* ── Slider ───────────────────────────────────────────────────────────────── */

.wdm-mb__slider {
	position: relative;
	width: 100%;
	height: 100%;
}

.wdm-mb__slides {
	position: relative;
	width: 100%;
	height: 100%;
}

/* ── Slide ────────────────────────────────────────────────────────────────── */

.wdm-mb__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.5s ease;
	display: flex;
	overflow: hidden;
	border-radius: inherit;
	min-height: var(--mb-min-h, 400px);
}

.wdm-mb__slide--active {
	position: relative;
	opacity: 1;
	z-index: 1;
}

/* ── Background Image ─────────────────────────────────────────────────────── */

.wdm-mb__bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}

/* ── Dark Overlay ─────────────────────────────────────────────────────────── */

.wdm-mb__overlay {
	position: absolute;
	inset: 0;
	background: #000;
	pointer-events: none;
	z-index: 1;
}

/* ── Content Area ─────────────────────────────────────────────────────────── */

.wdm-mb__content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	width: 100%;
	padding: var(--mb-padding, 32px);
	color: var(--mb-text-color, #fff);
}

/* Vertical alignment */
.wdm-mb__content--v-top      { justify-content: flex-start; }
.wdm-mb__content--v-center   { justify-content: center; }
.wdm-mb__content--v-bottom   { justify-content: flex-end; }
.wdm-mb__content--v-stretch  { justify-content: space-between; }

/* Horizontal alignment */
.wdm-mb__content--h-left     { align-items: flex-start; text-align: left; }
.wdm-mb__content--h-center   { align-items: center; text-align: center; }
.wdm-mb__content--h-right    { align-items: flex-end; text-align: right; }

/* Detached button layout – text at natural position, button at bottom */
.wdm-mb__content--btn-detached {
	justify-content: space-between !important;
}

.wdm-mb__btn--bottom-left  { align-self: flex-start; }
.wdm-mb__btn--bottom-right { align-self: flex-end; }

/* ── Text Group ───────────────────────────────────────────────────────────── */

.wdm-mb__text-group {
	max-width: var(--mb-content-max-w, none);
}

/* ── Typography ───────────────────────────────────────────────────────────── */

.wdm-mb__subtitle {
	display: block;
	font-size: var(--mb-subtitle-size, 14px);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--mb-subtitle-color, currentColor);
	margin-bottom: 8px;
}

.wdm-mb__title {
	font-size: var(--mb-title-size, 28px);
	font-weight: 800;
	line-height: 1.15;
	margin: 0 0 12px;
	color: inherit;
	text-transform: uppercase;
}

.wdm-mb__paragraph {
	font-size: var(--mb-paragraph-size, 14px);
	line-height: 1.5;
	margin: 0 0 16px;
	color: inherit;
	max-width: 480px;
}

.wdm-mb__content--h-center .wdm-mb__paragraph {
	max-width: 560px;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.wdm-mb__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 24px;
	font-size: var(--mb-btn-font-size, 14px);
	font-weight: 600;
	text-decoration: none;
	border-radius: var(--mb-btn-radius, 4px);
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
	cursor: pointer;
	white-space: nowrap;
	line-height: 1.4;
	margin-top: 4px;
}

.wdm-mb__btn--filled {
	background-color: var(--mb-btn-color, #005CA9);
	color: var(--mb-btn-text-color, #fff);
	border: 2px solid var(--mb-btn-color, #005CA9);
}

.wdm-mb__btn--filled:hover {
	filter: brightness(1.12);
}

.wdm-mb__btn--outline {
	background: transparent;
	color: var(--mb-btn-text-color, var(--mb-text-color, #fff));
	border: 2px solid currentColor;
}

.wdm-mb__btn--outline:hover {
	background: rgba(255, 255, 255, 0.12);
}

.wdm-mb__btn--ghost {
	background: transparent;
	color: var(--mb-btn-text-color, var(--mb-text-color, #fff));
	border: none;
	padding-left: 0;
	padding-right: 0;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.wdm-mb__btn--ghost:hover {
	opacity: 0.8;
}

/* ── Navigation Arrows ────────────────────────────────────────────────────── */

.wdm-mb__nav {
	position: absolute;
	bottom: 16px;
	right: 16px;
	z-index: 5;
	display: flex;
	gap: 6px;
}

.wdm-mb__prev,
.wdm-mb__next {
	width: 40px;
	height: 40px;
	border-radius: 4px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	background: rgba(255, 255, 255, 0.92);
	color: #323232;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease, box-shadow 0.2s ease;
	padding: 0;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.wdm-mb__prev:hover,
.wdm-mb__next:hover {
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ── Dots ─────────────────────────────────────────────────────────────────── */

.wdm-mb__dots {
	position: absolute;
	bottom: 16px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 5;
	display: flex;
	gap: 8px;
}

.wdm-mb__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.45);
	border: none;
	padding: 0;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.wdm-mb__dot--active {
	background: #fff;
	transform: scale(1.25);
}

.wdm-mb__dot:hover {
	background: rgba(255, 255, 255, 0.8);
}

/* ── Mobile Merged Slider (hidden on desktop) ─────────────────────────────── */

.wdm-mb__mobile-merged {
	display: none;
}

/* ── Desktop ──────────────────────────────────────────────────────────────── */

@media (min-width: 782px) {
	/* When both dots and nav present, offset dots left to avoid overlap */
	.wdm-mb__slider:has(.wdm-mb__nav) .wdm-mb__dots {
		left: calc(50% - 48px);
	}
}

/* ── Mobile (≤ 781px) ─────────────────────────────────────────────────────── */

@media (max-width: 781px) {
	.wdm-mb__grid {
		flex-direction: column;
		gap: 16px;
	}

	/* In 2-col mode on mobile: hide the desktop grid, show merged slider */
	.wdm-mb--cols-2 .wdm-mb__grid {
		display: none;
	}

	.wdm-mb--cols-2 .wdm-mb__mobile-merged {
		display: block;
	}

	/* In 1-col mode, sections still just stack normally */
	.wdm-mb--cols-1 .wdm-mb__section {
		flex: 0 0 auto !important;
	}

	/* Full-width breakout on mobile */
	.wdm-mb--full {
		width: 100vw;
		max-width: 100vw;
		position: relative;
		left: 50%;
		transform: translateX(-50%);
		margin-left: 0;
		margin-right: 0;
	}

	.wdm-mb--full .wdm-mb__section {
		border-radius: 0 !important;
	}

	/* Mobile min height support */
	.wdm-mb__slide {
		min-height: var(--mb-mobile-min-h, var(--mb-min-h, 300px));
	}

	/* Mobile nav arrows – 40×40, 16px from bottom & right edge */
	.wdm-mb__nav {
		bottom: 16px;
		right: 16px;
	}

	.wdm-mb__prev,
	.wdm-mb__next {
		width: 40px;
		height: 40px;
	}

	/* Hide dots on mobile – arrows are enough */
	.wdm-mb__dots {
		display: none;
	}

	/* Scale down title on mobile */
	.wdm-mb__title {
		font-size: calc(var(--mb-title-size, 28px) * 0.78);
	}

	.wdm-mb__paragraph {
		max-width: 100%;
	}

	.wdm-mb__content {
		padding: calc(var(--mb-padding, 32px) * 0.75);
	}
}
