/*
 * ESS Service Cards — reveal-on-hover image cards.
 * Default: title + short description at the bottom.
 * Hover: overlay fades in, the description/buttons reveal via a smooth
 * max-height transition (no line-clamp jump), and buttons fade in.
 */

/* Carousel shell. Extra bottom padding leaves room for the dots; side
   padding gives the arrows a place to sit without covering the cards. */
.ess-scards-carousel {
	position: relative;
	padding-bottom: 50px;
}

/* Swiper drives the flex layout via .swiper-wrapper; the grid is gone. */
.ess-scards {
	align-items: stretch;
}

.ess-scard {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	height: auto;
	min-height: 540px;
	border-radius: 18px;
	overflow: hidden;
	isolation: isolate;
}

.ess-scard__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	background-size: cover;
	background-position: center;
	transition: transform .8s cubic-bezier(.2, .7, .3, 1);
}
.ess-scard:hover .ess-scard__bg { transform: scale(1.06); }

/* Always-on bottom gradient for default readability; softens on hover. */
.ess-scard__grad {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(to top, rgba(10, 65, 99, .92) 0%, rgba(10, 65, 99, .5) 30%, rgba(10, 65, 99, 0) 60%);
	transition: opacity .6s ease;
}
.ess-scard:hover .ess-scard__grad { opacity: .35; }

/* Uniform overlay that fades in on hover (#0A4163 @ 49%). */
.ess-scard__overlay {
	position: absolute;
	inset: 0;
	z-index: 2;
	background-color: rgba(10, 65, 99, .49);
	opacity: 0;
	transition: opacity .6s ease;
}
.ess-scard:hover .ess-scard__overlay { opacity: 1; }

.ess-scard__content {
	position: relative;
	z-index: 3;
	padding: 34px;
	color: #fff;
}

.ess-scard__title {
	margin: 0 0 14px;
	font-family: var(--ess-font-heading, "Playfair Display", serif);
	font-weight: 700;
	font-size: clamp(24px, 2vw, 30px);
	line-height: 1.2;
	color: #fff;
}

/* Smooth height reveal: shows ~3 lines by default, expands on hover. */
.ess-scard__reveal {
	max-height: 78px;
	overflow: hidden;
	transition: max-height 1.1s cubic-bezier(.4, 0, .2, 1);
}
.ess-scard:hover .ess-scard__reveal { max-height: 400px; }

.ess-scard__desc {
	margin: 0;
	font-family: var(--ess-font-body, "Poppins", sans-serif);
	font-size: 15px;
	line-height: 1.6;
	color: #eef2f6;
}

.ess-scard__buttons {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-top: 26px;
	opacity: 0;
	transform: translateY(12px);
	transition: opacity .55s ease .4s, transform .55s ease .4s;
}
.ess-scard:hover .ess-scard__buttons {
	opacity: 1;
	transform: none;
}

.ess-scard .ess-scard__btn {
	position: relative;
	z-index: 1;
	display: block;
	padding: 16px 28px;
	background-color: rgba(76, 191, 234, .92);
	color: #fff;
	font-family: var(--ess-font-body, "Poppins", sans-serif);
	font-weight: 600;
	font-size: 17px;
	text-align: center;
	text-decoration: none;
	border: 2px solid transparent;
	border-radius: 40px;
	/* Hover colors are emitted by the widget's controls ({{WRAPPER}} .ess-scard__btn:hover)
	   so they out-specify Elementor's base color controls; only the transition lives here. */
	transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}

@media (prefers-reduced-motion: reduce) {
	.ess-scard__bg,
	.ess-scard__grad,
	.ess-scard__overlay,
	.ess-scard__reveal,
	.ess-scard__buttons { transition: none; }
}

/* --- Carousel navigation --- */
.ess-scards-carousel .swiper-button-prev,
.ess-scards-carousel .swiper-button-next {
	width: 46px;
	height: 46px;
	margin-top: -23px;
	border-radius: 50%;
	background: rgba(10, 65, 99, .82);
	color: #fff;
	transition: background-color .3s ease;
}
.ess-scards-carousel .swiper-button-prev:hover,
.ess-scards-carousel .swiper-button-next:hover {
	background: var(--ess-blue, #4cbfea);
}
.ess-scards-carousel .swiper-button-prev { left: 6px; }
.ess-scards-carousel .swiper-button-next { right: 6px; }
.ess-scards-carousel .swiper-button-prev::after,
.ess-scards-carousel .swiper-button-next::after {
	font-size: 18px;
	font-weight: 700;
}

.ess-scards-carousel .swiper-pagination.ess-scards__dots {
	bottom: 8px;
}
.ess-scards-carousel .swiper-pagination-bullet {
	width: 9px;
	height: 9px;
	background: #0a4163;
	opacity: .35;
	transition: opacity .3s ease, transform .3s ease;
}
.ess-scards-carousel .swiper-pagination-bullet-active {
	background: var(--ess-blue, #4cbfea);
	opacity: 1;
	transform: scale(1.2);
}

@media (max-width: 640px) {
	.ess-scard { min-height: 460px; }
	.ess-scards-carousel .swiper-button-prev,
	.ess-scards-carousel .swiper-button-next { display: none; }
}
