/**
 * Service feature grid — pattern: service-feature-grid
 *
 * Full-bleed image with overlapping rounded text panel; 2-column checkerboard layout.
 */

.wp-site-blocks .bnb-service-feature,
.editor-styles-wrapper .bnb-service-feature {
	--bnb-sf-peach: #f9d9d1;
	--bnb-sf-lavender: #f0f0f8;
	--bnb-sf-radius-outer: clamp(1.25rem, 4vw, 2rem);
	--bnb-sf-radius-panel: clamp(0.875rem, 2.5vw, 1.25rem);
	margin-top: 0;
	margin-bottom: 0;
	padding-top: 0;
	padding-bottom: 0;
}

.bnb-service-feature__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--50);
	width: 100%;
	max-width: 100%;
	align-items: stretch;
}

.bnb-service-feature__card {
	position: relative;
	overflow: hidden;
	border-radius: var(--bnb-sf-radius-outer);
	height: 340px;
	min-height: 340px;
	box-sizing: border-box;
	margin-block-start: 0 !important;
}

.bnb-service-feature__card .bnb-service-feature__media {
	position: absolute;
	margin: 0 !important;
	width: 90%;
	height: 100%;
	max-width: none;
	z-index: 0;
}

/* Every other card: anchor the inset image to the right; alternate cards to the left. */
.bnb-service-feature__grid > .bnb-service-feature__card:nth-child(odd) .bnb-service-feature__media {
	right: auto;
	left: 0;
}

.bnb-service-feature__grid > .bnb-service-feature__card:nth-child(even) .bnb-service-feature__media {
	left: auto;
	right: 0;
}

.bnb-service-feature__card .bnb-service-feature__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: var(--bnb-sf-radius-outer);
}

.bnb-service-feature__panel {
	position: absolute;
	top: 50%;
	transform: translateY(-50%) scale(1);
	transform-origin: center center;
	z-index: 2;
	width: 265px;
	max-width: min(100%, 265px);
	box-sizing: border-box;
	padding: 45px 35px !important;
	border-radius: var(--bnb-sf-radius-panel);
	text-align: center;
	margin: 0 !important;
	height: 242px !important;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

@media (prefers-reduced-motion: no-preference) {
	.bnb-service-feature__panel {
		transition: transform 0.28s ease;
	}

	.bnb-service-feature__panel:hover,
	.bnb-service-feature__panel:focus-within {
		transform: translateY(-50%) scale(1.03);
		z-index: 3;
	}

	/* Let the scaled panel paint outside the card; image still clipped when panel is idle. */
	.bnb-service-feature__card:has(.bnb-service-feature__panel:hover),
	.bnb-service-feature__card:has(.bnb-service-feature__panel:focus-within) {
		overflow: visible;
		z-index: 2;
	}
}

.bnb-service-feature__card--media-left .bnb-service-feature__panel {
	right: 0;
	left: auto;
}

.bnb-service-feature__card--media-right .bnb-service-feature__panel {
	left: 0;
	right: auto;
}

.bnb-service-feature__card--tone-peach .bnb-service-feature__panel {
	background-color: var(--bnb-sf-peach);
}

.bnb-service-feature__card--tone-lavender .bnb-service-feature__panel {
	background-color: var(--bnb-sf-lavender);
}

.bnb-service-feature__title,
.bnb-service-feature__panel h3.bnb-service-feature__title {
	margin: 0 0 15px !important;
	font-size: 26px !important;
	font-weight: 700 !important;
	color: #464646 !important;
	line-height: 1.2 !important;
	max-width: 200px !important;
}

.bnb-service-feature__excerpt,
.bnb-service-feature__panel p.bnb-service-feature__excerpt {
	margin: 0 !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	color: #464646 !important;
	line-height: 1.5 !important;
}

@media (max-width: 781px) {
	.bnb-service-feature__grid {
		grid-template-columns: 1fr;
	}

	.bnb-service-feature__title,
	.bnb-service-feature__panel h3.bnb-service-feature__title {
		font-size: calc(26px * 0.9) !important;
	}

	.bnb-service-feature__excerpt,
	.bnb-service-feature__panel p.bnb-service-feature__excerpt {
		font-size: calc(14px * 0.9) !important;
	}
}
