/**
 * Three Card Module — desktop: image + gray panel; mobile: background image + overlay.
 *
 * @package YaloFSE
 */

.kb-three-cards {
	box-sizing: border-box;
	padding: 48px 0 56px;
	background-color: transparent;
}

.kb-three-cards *,
.kb-three-cards *::before,
.kb-three-cards *::after {
	box-sizing: border-box;
}

.kb-three-cards__inner.container {
	width: 100%;
	max-width: 1170px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 15px;
	padding-right: 15px;
}

.kb-three-cards__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
}

.kb-three-cards__card {
	position: relative;
	overflow: hidden;
	border-radius: 8px;
	background-color: #ededed;
}

.kb-three-cards__card-inner {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
}

/* —— Desktop / tablet: stacked image + content panel —— */
.kb-three-cards__media {
	position: relative;
	width: 100%;
	flex-shrink: 0;
	aspect-ratio: 16 / 11;
	max-height: 280px;
	overflow: hidden;
	background-color: #e8e8e8;
}

.kb-three-cards__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.kb-three-cards__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	text-align: center;
	padding: 28px 20px 32px;
	background-color: #f2f2f2;
}

.kb-three-cards__title {
	margin: 0 0 12px;
	font-family: var(--font-secondary);
	font-size: 24px;
	font-weight: 400;
	font-style: normal;
	line-height: 1.2;
	color: #333333;
}

.kb-three-cards__desc {
	margin: 0 0 20px;
	font-family: var(--font-secondary);
	font-size: 16px;
	line-height: 1.5;
	font-weight: 400;
	color: #333333;
	max-width: 22rem;
}

.kb-three-cards__cta {
	margin-top: auto;
	min-width: 160px;
}

.kb-three-cards__empty {
	margin: 0;
	padding: 24px;
	text-align: center;
	font-family: var(--font-secondary);
	color: #666;
	border: 1px dashed #ccc;
	background: #f9f9f9;
	border-radius: 8px;
}

/* —— Mobile: full-card background image + dark overlay + white type —— */
@media (max-width: 991px) {
	.kb-three-cards {
		padding-top: 0;
		padding-bottom: 0;
		margin-top: 0 !important;
		margin-bottom: 0 !important;
		margin-block-start: 0 !important;
		margin-block-end: 0 !important;
		width: 100vw;
		max-width: none !important;
		margin-left: calc(50% - 50vw);
		margin-right: calc(50% - 50vw);
	}

	.kb-three-cards__inner.container {
		max-width: none;
		width: 100%;
		margin-left: 0;
		margin-right: 0;
		padding-left: 0;
		padding-right: 0;
	}

	.kb-three-cards__grid {
		gap: 0;
	}

	.kb-three-cards__card {
		display: flex;
		flex-direction: column;
		background-color: #333;
		background-image: var(--kb-tcm-bg);
		background-size: cover;
		background-position: center;
		border-radius: 0;
		min-height: 300px;
	}

	.kb-three-cards__card::before {
		content: "";
		position: absolute;
		inset: 0;
		background: rgba(0, 0, 0, 0.45);
		z-index: 0;
		pointer-events: none;
	}

	.kb-three-cards__card-inner {
		position: relative;
		z-index: 1;
		flex: 1;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		min-height: 0;
		width: 100%;
		padding: 32px 20px;
	}

	.kb-three-cards__media {
		display: none;
	}

	.kb-three-cards__body {
		flex: 0 1 auto;
		background-color: transparent;
		padding: 0;
		justify-content: center;
		align-items: center;
		gap: 8px;
	}

	.kb-three-cards__title,
	.kb-three-cards__desc {
		color: #ffffff;
	}

	.kb-three-cards__title {
		margin-bottom: 0;
	}

	.kb-three-cards__desc {
		margin-bottom: 0;
	}

	.kb-three-cards__cta {
		margin-top: 0;
	}
}

@media (min-width: 992px) {
	.kb-three-cards__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 24px;
	}

	.kb-three-cards__card {
		display: flex;
		flex-direction: column;
	}

	.kb-three-cards__title {
		font-size: 36px;
	}
}
