/**
 * Services Grid widget + the shared service card component
 * (.manvan-service-card is also used by the Area Services widget).
 *
 * Builds on core.css (.manvan-grid, .manvan-card, .manvan-icon-badge,
 * .manvan-media, .manvan-btn--ghost).
 *
 * @package ManVan
 */

/* ---- Grid ---------------------------------------------------------------- */

.manvan-services-grid__grid {
	margin: 0;
	padding: 0;
	list-style: none;
}

.manvan-services-grid__item {
	display: flex;
	min-width: 0;
	margin: 0;
}

/* ---- Service card (shared component) ------------------------------------- */

.manvan-service-card {
	flex: 1 1 auto;
	width: 100%;
	overflow: hidden;
}

.manvan-service-card__body {
	gap: 0.75rem;
	padding: clamp(1.5rem, 1.2rem + 0.9vw, 2rem);
}

.manvan-service-card__icon {
	width: 3.25rem;
	height: 3.25rem;
	margin-bottom: 0.5rem;
	border-radius: 14px;
	transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s var(--manvan-ease);
}

.manvan-service-card__icon svg,
.manvan-service-card__icon i {
	width: 1.5rem;
	height: 1.5rem;
}

.manvan-service-card__icon svg:not([fill]) {
	fill: none;
}

/* Font Awesome / uploaded SVG icons from the Elementor icon picker. */
.manvan-service-card__icon svg[class*="e-font-icon-svg"] {
	fill: currentColor;
	stroke: none;
}

.manvan-service-card__title {
	margin: 0;
	text-wrap: balance;
}

.manvan-service-card__link {
	color: inherit;
	text-decoration: none;
}

/* Stretch the title link over the whole card: one link, whole card clickable. */
.manvan-service-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: inherit;
}

.manvan-service-card--link {
	cursor: pointer;
}

.manvan-block .manvan-service-card__link:focus-visible {
	outline: none; /* The whole card shows the focus ring instead. */
}

.manvan-service-card:focus-within {
	outline: 2px solid var(--manvan-brand);
	outline-offset: 3px;
}

.manvan-service-card:has(.manvan-service-card__link:focus:not(:focus-visible)) {
	outline: none;
}

.manvan-service-card__desc {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var(--manvan-muted);
	text-wrap: pretty;
}

.manvan-service-card__more {
	align-self: flex-start;
	margin-top: auto;
	padding-top: 0.5rem;
	font-size: 0.9375rem;
}

.manvan-service-card--link:hover .manvan-service-card__title {
	color: var(--manvan-brand);
}

.manvan-service-card--link:hover .manvan-service-card__icon {
	background-color: var(--manvan-brand);
	color: var(--manvan-on-brand);
}

.manvan-service-card--link:hover .manvan-service-card__more svg {
	transform: translateX(4px);
}

/* ---- Photo variant --------------------------------------------------------- */

.manvan-service-card__media {
	--manvan-media-ratio: 16 / 10;
	flex: none;
	border-radius: 0;
}

.manvan-service-card__image {
	transition: transform 0.6s var(--manvan-ease);
}

.manvan-service-card--link:hover .manvan-service-card__image {
	transform: scale(1.04);
}

/* The icon badge sits on the photo's bottom edge as a solid brand tile. */
.manvan-service-card--has-image .manvan-service-card__icon {
	--manvan-card-ring: #ffffff;
	position: relative;
	z-index: 2;
	margin-top: calc(-1 * clamp(1.5rem, 1.2rem + 0.9vw, 2rem) - 1.625rem);
	background-color: var(--manvan-brand);
	color: var(--manvan-on-brand);
	box-shadow: 0 0 0 4px var(--manvan-card-ring), var(--manvan-shadow);
	pointer-events: none;
}

.manvan-scheme-dark .manvan-service-card--has-image .manvan-service-card__icon,
.manvan-block--dark .manvan-service-card--has-image .manvan-service-card__icon {
	--manvan-card-ring: var(--manvan-ink-2);
}

.manvan-scheme-brand .manvan-service-card--has-image .manvan-service-card__icon {
	--manvan-card-ring: var(--manvan-brand-hover);
	background-color: #ffffff;
	color: var(--manvan-brand);
}

/* ---- Footer ---------------------------------------------------------------- */

.manvan-services-grid__all svg {
	transition: transform 0.2s var(--manvan-ease);
}

.manvan-services-grid__all:hover svg {
	transform: translateX(3px);
}

@media (max-width: 767px) {
	.manvan-services-grid__all {
		width: 100%;
	}
}
