/**
 * Hero stats section — theme hooks (.bnb-hero-stats__*) on core blocks.
 * Pattern: hero-stats-section
 *
 * Core outputs wp-block-* and preset classes; we layer BEM classNames for layout/branding.
 * Style via .bnb-hero-stats__* so you are not tied to generic .wp-block-* rules alone.
 */

.wp-site-blocks .bnb-hero-stats,
.editor-styles-wrapper .bnb-hero-stats {
	margin-top: 0;
	margin-bottom: 0;
}

.bnb-hero-stats {
	padding-top: 2.25rem;
	padding-bottom: 2.25rem;
	width: 100%;
	max-width: none;
}

/* Band: fixed height all breakpoints; horizontal padding + top padding. */
.bnb-hero-stats__band {
	padding-left: var(--wp--preset--spacing--50);
	padding-right: var(--wp--preset--spacing--50);
	height: 670px;
	box-sizing: border-box;
	background-color: var(--wp--preset--color--accent-secondary, #edeef6);
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/*
 * Core adds .has-global-padding on constrained groups (theme.json useRootPaddingAwareAlignments),
 * which applies root padding (~24px) — override so only our mobile rule adds horizontal padding.
 */
.bnb-hero-stats__inner,
.wp-site-blocks .bnb-hero-stats__inner.has-global-padding,
.editor-styles-wrapper .bnb-hero-stats__inner.has-global-padding {
	width: 100%;
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-left: auto;
	margin-right: auto;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* Main row (core/columns): flex, wrap, 50px gap, vertically centered */
.bnb-hero-stats__row.wp-block-columns {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: wrap !important;
	align-items: center !important;
	gap: 100px !important;
}

.bnb-hero-stats__row > .bnb-hero-stats__title-content {
	flex: 0 0 340px !important;
	width: 340px !important;
	max-width: 100% !important;
	height: auto !important;
	min-width: 0;
}

/* Visual column: flex row so direct children are media-image + cards (no wrapper). */
.bnb-hero-stats__row > .bnb-hero-stats__visual {
	flex: 1 1 0 !important;
	min-width: 0 !important;
	width: auto !important;
	max-width: 100%;
	position: relative;
	padding-right: 50px;
	box-sizing: border-box;
	display: flex !important;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: flex-start;
	gap: 50px;
}

.bnb-hero-stats__title {
	font-size: 58px !important;
	font-weight: 700 !important;
	color: #464646 !important;
	line-height: 1.15;
	margin: 0 0 20px 0 !important;
}

.bnb-hero-stats__subtitle {
	font-size: 14px !important;
	font-weight: 400 !important;
	color: #464646 !important;
	line-height: 1.5;
	margin: 0 0 22px 0 !important;
}

.bnb-hero-stats__actions {
	margin-block-start: 0 !important;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 0;
}

.bnb-hero-stats__cta .wp-block-button__link {
	width: 200px !important;
	height: 60px !important;
	min-height: 60px !important;
	box-sizing: border-box !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 0 1rem !important;
	background-color: #000000 !important;
	color: var(--wp--preset--color--accent, #ecc4c0) !important;
	border: none !important;
	outline: 3px solid var(--wp--preset--color--accent, #ecc4c0) !important;
	outline-offset: 0;
	border-radius: 2rem;
	font-size: 16px !important;
	font-weight: 600 !important;
	text-decoration: none !important;
	box-shadow: none !important;
}

.bnb-hero-stats__cta .wp-block-button__link:hover,
.bnb-hero-stats__cta .wp-block-button__link:focus {
	color: var(--wp--preset--color--accent, #ecc4c0) !important;
	background-color: #000000 !important;
}

.bnb-hero-stats__media-image {
	flex: 0 0 760px !important;
	width: 760px !important;
	height: 760px !important;
	max-width: 760px !important;
	box-sizing: border-box;
	margin: 0 !important;
	position: relative;
	overflow: hidden;
	border-radius: 4rem;
}

.bnb-hero-stats__media-image .wp-block-image {
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	margin: 0;
}

.bnb-hero-stats__media-image .wp-block-image img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	object-fit: cover;
	border-radius: 5rem;
}

.editor-styles-wrapper .bnb-hero-stats__media-image .wp-block-image {
	min-width: 0;
}

.bnb-hero-stats__visual > .bnb-hero-stats__cards {
	position: absolute;
	right: 0;
	display: flex !important;
	flex-direction: column;
	flex-wrap: nowrap;
	align-items: stretch;
	justify-content: center;
	gap: 9px;
	flex: 0 0 auto !important;
	width: 211px !important;
	max-width: 211px;
	margin: 0 !important;
	z-index: 2;
}

.bnb-hero-stats__card {
	box-sizing: border-box;
	width: 211px !important;
	height: 144px !important;
	min-height: 0;
	border-radius: 2rem;
	padding-top: 40px;
	padding-bottom: 40px;
	padding-left: 40px;
	padding-right: 50px;
	background-color: var(--wp--preset--color--brand);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.bnb-hero-stats__card__title {
	font-size: 44px !important;
	font-weight: 600 !important;
	color: #464646 !important;
	line-height: 1.1;
	margin: 0 !important;
}

.bnb-hero-stats__card__subtitle {
	font-size: 14px !important;
	font-weight: 400 !important;
	color: #464646 !important;
	line-height: 1.2;
	margin: 0 !important;
}

.bnb-hero-stats__card .bnb-hero-stats__card__title + .bnb-hero-stats__card__subtitle {
	margin-top: 0.25rem !important;
}

/*
 * 782px–1199px — tablet / small laptop: center the row, shrink flex bases so both columns share the width
 * (avoids a fixed 340px + 760px row hugging one side with empty space on the right).
 */
@media (min-width: 782px) and (max-width: 1199px) {
	.bnb-hero-stats__row.wp-block-columns {
		justify-content: center !important;
		align-items: center !important;
		gap: clamp(1.5rem, 4vw, 6.25rem) !important;
	}

	.bnb-hero-stats__row > .bnb-hero-stats__title-content {
		flex: 1 1 min(340px, 38%) !important;
		width: auto !important;
		min-width: 0 !important;
		max-width: min(340px, 42%) !important;
	}

	.bnb-hero-stats__row > .bnb-hero-stats__visual {
		flex: 1 1 min(400px, 52%) !important;
		min-width: 0 !important;
		max-width: 100% !important;
		justify-content: center !important;
		padding-right: 0 !important;
	}

	.bnb-hero-stats__media-image {
		flex: 0 1 auto !important;
		width: min(760px, 100%) !important;
		max-width: min(760px, 100%) !important;
		height: auto !important;
		aspect-ratio: 1 / 1;
		max-height: min(760px, 52vw);
	}

	.bnb-hero-stats__media-image .wp-block-image {
		flex: 1 1 auto !important;
		min-height: 0 !important;
		height: 100% !important;
	}

	.bnb-hero-stats__media-image .wp-block-image img {
		height: 100% !important;
		object-fit: cover;
	}
}

/*
 * 781px — band fills viewport stack; title + visual each ~50% row height; scaled type and media.
 */
@media (max-width: 781px) {
	.bnb-hero-stats__band {
		justify-content: flex-start;
		align-items: stretch;
		min-height: 670px;
	}

	.bnb-hero-stats__band > .bnb-hero-stats__inner {
		flex: 1 1 auto;
		display: flex;
		flex-direction: column;
		min-height: 0;
		height: 100%;
		width: 100%;
	}

	.bnb-hero-stats__inner .bnb-hero-stats__row.wp-block-columns {
		flex: 1 1 auto !important;
		min-height: 0 !important;
		height: 100% !important;
		flex-direction: column !important;
		flex-wrap: nowrap !important;
		align-items: stretch !important;
		align-content: stretch !important;
		gap: 0.75rem !important;
	}

	.bnb-hero-stats__row > .bnb-hero-stats__title-content {
		flex: 1 1 0 !important;
		min-height: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
		overflow: hidden;
		display: flex !important;
		flex-direction: column;
		justify-content: center;
	}

	.bnb-hero-stats__row > .bnb-hero-stats__visual {
		flex: 1 1 0 !important;
		min-height: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
		padding-right: 0;
		flex-direction: column !important;
		align-items: stretch !important;
		justify-content: flex-start;
		position: relative;
		overflow: hidden;
	}

	/* Copy block — fits upper half */
	.bnb-hero-stats__title {
		font-size: 40px !important;
		margin: 0 0 10px 0 !important;
		line-height: 1.2 !important;
	}

	.bnb-hero-stats__subtitle {
		font-size: 16px !important;
		line-height: 1.4 !important;
		margin: 0 0 10px 0 !important;
		display: -webkit-box;
		-webkit-line-clamp: 4;
		line-clamp: 4;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	.bnb-hero-stats__cta .wp-block-button__link {
		width: min(200px, 100%) !important;
		height: 48px !important;
		min-height: 48px !important;
		font-size: 16px !important;
	}

	/* Hero image hidden on mobile — was overlay target for cards; cards are in-flow below. */
	.bnb-hero-stats__visual > .bnb-hero-stats__media-image {
		display: none !important;
	}

	/* Stat cards — in-flow (no absolute overlay without image) */
	.bnb-hero-stats__visual > .bnb-hero-stats__cards {
		position: relative !important;
		inset: auto !important;
		width: 100% !important;
		max-width: 100% !important;
		height: auto !important;
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: wrap !important;
		align-items: center;
		align-content: center;
		justify-content: center;
		gap: 9px;
		margin: 0 !important;
		z-index: 2;
	}

	.bnb-hero-stats__visual > .bnb-hero-stats__cards .bnb-hero-stats__card {
		flex: 0 0 211px !important;
		width: 211px !important;
		min-width: 211px !important;
		max-width: 211px !important;
	}

	.bnb-hero-stats__card__title {
		font-size: clamp(1.25rem, 5vw, 1.75rem) !important;
	}

	.bnb-hero-stats__card__subtitle {
		font-size: 12px !important;
	}
}

/*
 * ≤500px — no horizontal padding on inner; image radius; stat cards 2×2 grid (no single-column stack).
 */
@media (max-width: 500px) {
	.bnb-hero-stats__inner.has-global-padding,
	.wp-site-blocks .bnb-hero-stats__inner.has-global-padding,
	.editor-styles-wrapper .bnb-hero-stats__inner.has-global-padding,
	.bnb-hero-stats__inner {
		padding-left: 0 !important;
		padding-right: 0 !important;
	}

	.bnb-hero-stats__visual > .bnb-hero-stats__cards {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-template-rows: repeat(2, auto);
		gap: 9px;
		align-content: center;
		justify-content: center;
		justify-items: stretch;
		align-items: stretch;
		flex-direction: unset !important;
		flex-wrap: unset !important;
	}

	.bnb-hero-stats__visual > .bnb-hero-stats__cards .bnb-hero-stats__card {
		width: 100% !important;
		min-width: 0 !important;
		max-width: none !important;
		flex: none !important;
		box-sizing: border-box;
	}
}
