/**
 * Homepage service cards.
 *
 * Keep this component scoped while the deploy plugin removes its legacy style
 * block from page content. Enqueued by inc/home-services.php on the front page.
 */

.ks-services-wrap .ks-card-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	margin-top: 8px;
}

.ks-services-wrap .ks-service-card {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	overflow: hidden;
	border-radius: 10px;
	background: #102694;
	box-shadow: 0 4px 14px rgba(16, 38, 148, 0.25);
}

/* Reserve square media space before the image loads. */
.ks-services-wrap .ks-card-media-wrap {
	box-sizing: border-box;
	width: 100%;
	aspect-ratio: 1 / 1;
	margin: 0;
	overflow: hidden;
}

.ks-services-wrap .ks-service-card img.ks-card-media {
	display: block;
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
}

.ks-services-wrap .ks-card-media-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	margin: 0;
}

.ks-services-wrap .ks-card-media-icon svg {
	width: 34px;
	height: 34px;
}

/* Decorative fallback for empty media slots; existing images/icons stay visible. */
.ks-services-wrap .ks-card-media-icon:empty {
	background: #edf2ff;
}

.ks-services-wrap .ks-card-media-icon:empty::before {
	display: block;
	width: 40%;
	max-width: 96px;
	aspect-ratio: 1 / 1;
	content: "";
	background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2096%2096%22%20fill%3D%22none%22%3E%3Cg%20stroke%3D%22%23102694%22%20stroke-width%3D%224%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%2082h56M20%2082V22a4%204%200%200%201%204-4h30a4%204%200%200%201%204%204v60M32%2082V66h14v16M30%2032h4m10%200h4M30%2044h4m10%200h4M30%2056h4m10%200h4%22%2F%3E%3Cpath%20d%3D%22M75%2034c-4%207-13%2016-13%2023a13%2013%200%200%200%2026%200c0-7-9-16-13-23Z%22%20fill%3D%22%23ffcc00%22%2F%3E%3Cpath%20d%3D%22M69%2057a6%206%200%200%200%206%206%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center / contain no-repeat;
}

.ks-services-wrap .ks-service-card h4 {
	box-sizing: border-box;
	margin: 0;
	padding: 14px 14px 6px;
	color: #fff;
	font-family: "Bricolage Grotesque", sans-serif;
	/* The legacy theme forces h4 sizes with !important on tablets. */
	font-size: 14px !important;
	font-weight: 700;
	line-height: 1.3;
	text-align: left;
}

/* Outrank the front-page template's later, generic paragraph rules. */
.ks-services-wrap .ks-card-grid .ks-service-card p {
	flex: 1;
	box-sizing: border-box;
	margin: 0;
	padding: 0 14px 14px;
	color: #fff;
	font-family: "Open Sans", sans-serif;
	/* The legacy theme forces entry-content paragraph sizes below 1024px. */
	font-size: 12px !important;
	line-height: 1.55;
	text-align: left;
}

.ks-services-wrap .ks-card-cta {
	box-sizing: border-box;
	margin: 0;
	padding: 0 14px 16px;
}

.ks-services-wrap .ks-view-more {
	display: inline-block;
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	color: #fc0;
	font-family: "Open Sans", sans-serif;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-align: left;
	text-transform: uppercase;
	text-decoration: none;
	/* Override the legacy theme's transition: all !important. */
	transition: color 0.2s ease-in !important;
}

.ks-services-wrap .ks-view-more:hover {
	color: #fff;
}

.ks-services-wrap .ks-view-services-wrap {
	display: flex;
	justify-content: center;
	margin: 32px 0 0;
}

.ks-services-wrap .ks-view-services-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 16px 44px;
	border-radius: 999px;
	background: #fc0;
	color: #102694;
	font-family: "Open Sans", sans-serif;
	font-size: 15px;
	font-weight: 800;
	letter-spacing: 0.02em;
	text-decoration: none;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
	/* Override the legacy theme's transition: all !important. */
	transition: background-color 0.2s ease, transform 0.15s ease !important;
}

.ks-services-wrap .ks-view-services-btn:hover {
	background: #ffd633;
	transform: translateY(-1px);
}

/* The legacy theme removes every anchor outline with !important. */
.ks-services-wrap .ks-view-more:focus-visible,
.ks-services-wrap .ks-view-services-btn:focus-visible {
	outline: 2px solid currentColor !important;
	outline-offset: 3px;
}


/* Responsive layout: 1 / 2 / 3 / 5 columns. */
/* Responsive layout: 1 / 2 / 3 / 6 columns. */
@media (min-width: 480px) {
	.ks-services-wrap .ks-card-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 760px) {
	.ks-services-wrap .ks-card-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1024px) {
	.ks-services-wrap .ks-card-grid {
		grid-template-columns: repeat(5, 1fr);
		grid-template-columns: repeat(6, 1fr);
		gap: 14px;
	}

	.ks-services-wrap .ks-row2-start {
		/* Ignore the old six-column row marker and keep natural grid placement. */
		grid-column: auto;
		margin-left: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ks-services-wrap .ks-view-more,
	.ks-services-wrap .ks-view-services-btn {
		transition: none !important;
	}

	.ks-services-wrap .ks-view-services-btn:hover {
		transform: none;
	}
}