/**
 * LFBC Hero pattern
 *
 * Mobile (default): image stacks above the gold card, both edge-to-edge.
 * Desktop (.lfbc-hero >= 1024px wide): image becomes the full-bleed background
 * and the gold card floats over the bottom-right corner.
 *
 * Uses a container query so the editor canvas switches to the desktop layout
 * based on the block's own width, not the iframe viewport (which is often
 * narrower than the desktop breakpoint because of the editor sidebar).
 */

.lfbc-hero {
	container-type: inline-size;
	position: relative;
}

.lfbc-hero__image {
	margin: 0;
}

.lfbc-hero__image img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
}

.lfbc-hero__card {
	/* Mobile: square corners edge-to-edge, sits below the image. */
	border-radius: 0 !important;
	margin-top: -1px; /* kill any sub-pixel gap between image and card */
}

.lfbc-hero__title {
	line-height: 0.96;
	letter-spacing: -0.01em;
}

.lfbc-hero__intro {
	margin-bottom: 1.5rem;
}

/* Mobile (card stacked below the image): drop the teaser text and center the
 * title. Scoped with a max-width container query — mirrors the desktop
 * min-width query below — so desktop keeps the intro and left-aligned title. */
@container (max-width: 1023.98px) {
	.lfbc-hero__intro {
		display: none;
	}

	.lfbc-hero__title {
		text-align: center;
	}

	.lfbc-hero__card .wp-block-buttons {
		justify-content: center;
	}
}

/* Desktop layout: image as background, card floating bottom-right.
 *
 * Uses CSS Grid with image, gradient, and card all occupying the same grid
 * cell so they overlap naturally — no position: absolute, no dependence on
 * positioning ancestry. Robust against any extra wrapping the block editor
 * adds around individual child blocks. */
@container (min-width: 1024px) {

	.lfbc-hero__stage {
		max-height: 587px;
		display: grid;
		grid-template-columns: 1fr;
		grid-template-rows: 1fr;
		overflow: hidden;
	}

	.lfbc-hero__stage > * {
		grid-column: 1;
		grid-row: 1;
		min-height: 0; /* let grid items shrink below content so the image
		                  can't push the row beyond the stage's min-height */
		min-width: 0;
	}

	.lfbc-hero__stage::after {
		/* subtle top-to-bottom dark gradient over the image, per the design */
		content: "";
		grid-column: 1;
		grid-row: 1;
		background: linear-gradient(
			to bottom,
			rgba(0, 0, 0, 0.2) 11%,
			rgba(0, 0, 0, 0) 31%
		);
		pointer-events: none;
		z-index: 1;
	}

	.lfbc-hero__image {
		z-index: 0;
		align-self: stretch;
		justify-self: stretch;
	}

	.lfbc-hero__image img {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	.lfbc-hero__card {
		z-index: 2;
		width: 555px;
		max-width: 100%;
		justify-self: end;
		align-self: center;
		margin: 18px 40px 40px 40px !important;
		border-radius: 80px !important;
	}

	.lfbc-hero__card p {
		margin-top: .5rem;
	}
}

/* -------------------------------------------------------------------------
 * Inverted button style — used inside the gold hero card.
 * Registered via register_block_style() in inc/patterns.php.
 * ------------------------------------------------------------------------- */

.wp-block-button.is-style-inverted .wp-block-button__link {
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--poppy-900);
	border-color: var(--wp--preset--color--white);
}

/* Hover/focus matches the Ghost button variant (buttons.css): Poppy 500 fill,
 * white text, white border. */
.wp-block-button.is-style-inverted .wp-block-button__link:hover,
.wp-block-button.is-style-inverted .wp-block-button__link:focus {
	background-color: var(--wp--preset--color--poppy-500);
	color: var(--wp--preset--color--white);
	border-color: var(--wp--preset--color--white);
}
