/* =====================================================================
   components/service-card.css — the shared service card
   (template-parts/global/service-card.php).

   Two treatments: the default dark teal panel used by the homepage Services
   grid and the Solar Services archive, and .service-card--light used by the
   Electrical Services archive. See the bottom of this file for the latter.
   ===================================================================== */

.service-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	background-color: var(--secondary-color);
	border-radius: var(--radius-lg);
	transition: transform .3s ease, box-shadow .3s ease;
}

.service-card:hover {
	transform: translateY(-6px);
	box-shadow: var(--shadow-lg);
}

.service-card__media {
	position: relative;
	aspect-ratio: 16 / 6;
	overflow: hidden;
}

.service-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s ease;
}

.service-card:hover .service-card__media img {
	transform: scale(1.04);
}

/* Soft fade from the photo into the card body, as in the design. */
.service-card__media::after {
	content: "";
	position: absolute;
	inset: auto 0 0;
	height: 45%;
	background: linear-gradient(180deg, rgba(22, 48, 60, 0) 0%, rgba(22, 48, 60, .85) 100%);
}

.service-card__body {
	padding: 1.75rem 1.75rem 2.25rem;
}

.service-card__title {
	margin-bottom: .875rem;
	font-size: clamp(1.25rem, 1.16rem + 0.39vw, 1.5rem);
	color: #fff;
}

.service-card__text {
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 500;
	line-height: 1.75;
	color: var(--text-on-dark);
}

/* ---------------------------------------------------------------
   Light treatment — Electrical Service-Listing-Page.png
   Measured from the export: card 535.5 x 314 with a 14px radius and a
   hairline #E4DFD4 border, photo 1071 x 378, and a 56px gradient icon tile
   inset 12px / 21px over the photo's top-left.
   --------------------------------------------------------------- */
.service-card--light {
	background-color: var(--surface);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
}

.service-card--light .service-card__media {
	aspect-ratio: 1071 / 378;
}

/* The dark card fades its photo into the panel; the light one butts straight
   up against the white body, so the fade is removed rather than restyled. */
.service-card--light .service-card__media::after {
	content: none;
}

.service-card--light .service-card__icon {
	position: absolute;
	top: .75rem;
	left: 1.3125rem;
	z-index: 1;
	width: 3.5rem;
	height: 3.5rem;
}

.service-card--light .service-card__icon svg {
	width: 1.5rem;
	height: 1.5rem;
}

/* The title sits hard against the summary in the export — no gap between the
   two line boxes — so the body padding carries all the vertical rhythm. */
.service-card--light .service-card__body {
	padding: 2.3125rem 1.75rem;
}

/* 20px / 15px, not the dark card's 24/17: measured by lowercase x-height against
   the rendered page (11.0 against 13.5, and 7.0 against 8.0). At 17px the summary
   wraps to a second line and the card grows 13px past the design's 314. */
.service-card--light .service-card__title {
	margin-bottom: 0;
	font-size: clamp(1.125rem, 1.08rem + 0.20vw, 1.25rem);
	line-height: 1.25;
	color: var(--heading-color);
}

.service-card--light .service-card__text {
	font-size: .9375rem;
	font-weight: 400;
	color: var(--text-color);
}

.service-card--light:hover,
.service-card--light:focus-visible {
	border-color: rgba(255, 158, 69, .45);
	box-shadow: var(--shadow-md);
}
