/* CSA Card Grid — responsive grid of image + title + description + button cards. */

.csa-card-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 32px;
}

.csa-card-grid__card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.csa-card-grid__media {
	display: block;
	overflow: hidden;
}

/*
 * The aspect ratio lives on the <img> itself (a replaced element), not on the
 * wrapper. An in-flow image sized from width + aspect-ratio gives the media box
 * real intrinsic height, so the media never collapses. The previous approach —
 * aspect-ratio on the wrapper with an absolutely-positioned image — reserved no
 * height on iOS Safari / Android WebView (a box whose only child is absolute has
 * no in-flow content), so the last card was clipped on mobile.
 *
 * Selector nested under the media element to outrank Elementor's
 * `.elementor img { height: auto }` (0,1,1) so width/object-fit stick. The
 * aspect-ratio default below is overridden inline by the Aspect Ratio control.
 */
.csa-card-grid__media .csa-card-grid__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.csa-card-grid__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding: 16px 0 0;
}

.csa-card-grid__title {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	color: #1b2a56;
}

.csa-card-grid__desc {
	margin: 0 0 16px;
	font-size: 15px;
	line-height: 1.5;
	color: #5a6276;
}

.csa-card-grid__button {
	display: inline-block;
	margin-top: auto;
	padding: 8px 16px;
	border-radius: 6px;
	background-color: #eef1f6;
	color: #1b2a56;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

@media (max-width: 1024px) {
	.csa-card-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.csa-card-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}
