/* LCM reusable CTA card — angled red panel + photo with a diagonal split.
 * Used by [lcm_cta] (single) and [lcm_homepage_ctas] (ACF repeater grid). */

.lcm-cta-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr); /* desktop: 3 across */
	gap: 24px;
	width: 100%;
	max-width: 1200px; /* keep aligned to page content if the section is full-bleed */
	margin-inline: auto;
	padding-inline: 16px;
	box-sizing: border-box;
}

/* Tablet: 2 across */
@media (max-width: 1024px) {
	.lcm-cta-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* Mobile: 1 across */
@media (max-width: 640px) {
	.lcm-cta-grid {
		grid-template-columns: 1fr;
	}
}

.lcm-cta {
	--lcm-cta-red: #cc2229;
	container-type: inline-size; /* card adapts its internals to its own width */
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 16px;
	min-height: 260px;
	text-decoration: none;
	color: #fff;
	box-shadow: 0 2px 10px rgba(40, 48, 111, 0.18);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.lcm-cta:hover,
.lcm-cta:focus-visible {
	box-shadow: 0 10px 28px rgba(40, 48, 111, 0.28);
	transform: translateY(-2px);
}

/* Photo fills the whole card; the red panel sits over its left portion. */
.lcm-cta__media {
	display: block;
	position: absolute;
	inset: 0;
	background-image: var(--lcm-cta-img);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	background-color: #28306f;
	z-index: 0;
}

/* Solid red angled panel. Diagonal cut on its inner edge via clip-path:
 * wider at the top, narrower at the bottom (matches the reference). */
.lcm-cta__panel {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 62%;
	background: var(--lcm-cta-red);
	clip-path: polygon(0 0, 100% 0, calc(100% - 74px) 100%, 0 100%);
	z-index: 2;
	display: flex;
	align-items: center;
}

.lcm-cta__inner {
	position: relative;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 22px;
	padding: 36px 82px 36px 46px;
	box-sizing: border-box;
	width: 100%;
}

.lcm-cta__heading {
	margin: 0;
	font-size: clamp(1.55rem, 2.4vw, 2.3rem);
	line-height: 1.08;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #fff;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}

/* Ghost / outline button: white border + white text, fills white on hover. */
.lcm-cta__btn {
	display: inline-block;
	padding: 13px 30px;
	border: 2px solid #fff;
	border-radius: 4px;
	background: transparent;
	color: #fff;
	font-weight: 700;
	font-size: 0.95rem;
	text-transform: uppercase;
	letter-spacing: 1px;
	line-height: 1;
	transition: background 0.15s ease, color 0.15s ease;
}

.lcm-cta:hover .lcm-cta__btn,
.lcm-cta:focus-visible .lcm-cta__btn {
	background: #fff;
	color: var(--lcm-cta-red);
}

/* Mirror variant: red panel on the right, slant reversed, text right-aligned. */
.lcm-cta--right .lcm-cta__panel {
	left: auto;
	right: 0;
	clip-path: polygon(0 0, 100% 0, 100% 100%, 74px 100%);
}

.lcm-cta--right .lcm-cta__inner {
	align-items: flex-end;
	text-align: right;
	padding: 36px 46px 36px 82px;
}

/* Narrow card (e.g. 3-up on desktop): widen the panel, trim the diagonal and
 * padding, and shrink the heading/button so nothing spills onto the photo.
 * Container query = keyed to the CARD's width, so it fires at whatever column
 * count makes the card narrow, not at a fixed viewport width. */
@container (max-width: 460px) {
	.lcm-cta__panel {
		width: 56%; /* slimmer panel so more of the photo shows at 3-up */
		clip-path: polygon(0 0, 100% 0, calc(100% - 42px) 100%, 0 100%);
	}

	.lcm-cta--right .lcm-cta__panel {
		clip-path: polygon(0 0, 100% 0, 100% 100%, 42px 100%);
	}

	.lcm-cta__inner {
		gap: 14px;
		padding: 24px 40px 24px 24px;
	}

	.lcm-cta--right .lcm-cta__inner {
		padding: 24px 24px 24px 40px;
	}

	.lcm-cta__heading {
		font-size: 1.3rem;
	}

	.lcm-cta__btn {
		padding: 10px 16px;
		font-size: 0.8rem;
		letter-spacing: 0.3px;
	}
}

/* Stack on mobile: photo on top, full-width red panel (no diagonal) below. */
@media (max-width: 640px) {
	.lcm-cta {
		min-height: 0;
	}

	.lcm-cta__media {
		position: relative;
		inset: auto;
		height: 190px;
	}

	.lcm-cta__panel,
	.lcm-cta--right .lcm-cta__panel {
		position: relative;
		top: auto;
		bottom: auto;
		left: auto;
		right: auto;
		width: 100%;
		clip-path: none;
	}

	.lcm-cta__inner,
	.lcm-cta--right .lcm-cta__inner {
		align-items: flex-start;
		text-align: left;
		padding: 26px 28px;
	}
}
