/**
 * Eruda Toolkit - Case Studies
 *
 * Sector chips and a grid of case cards: photo with the customer's logo on
 * it, the tag, then either the headline figure with its basis or the "Now
 * measuring" track, the heat flow, and the two actions. Chips are buttons,
 * and Hello Elementor paints buttons pink, so each chip state restates what it
 * relies on.
 */

.ecs {
	--ecs-navy: #0F3961;
	--ecs-muted: #0F3961B3;
	--ecs-green: #07864F;
	--ecs-green-bright: #00A55D;
	--ecs-green-light: #4DCF8D;
	--ecs-hover-line: #07864F4D;
	--ecs-line: #DDE2E6;
	--ecs-card: #fff;
	--ecs-dark: #1E2A33;
	--ecs-radius: 20px;
	--ecs-cols: 3;
	--ecs-gap: 16px;
	--ecs-ratio: 16 / 9;

	font-family: "Plus Jakarta Sans", system-ui, sans-serif;
	color: var(--ecs-navy);
}

.ecs *,
.ecs *::before,
.ecs *::after {
	box-sizing: border-box;
}

/* --------------------------------------------------------------- chips --- */

.ecs__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 18px;
}

.ecs .ecs__chip,
.ecs .ecs__chip:hover,
.ecs .ecs__chip:focus {
	flex: none;
	margin: 0;
	padding: 9px 16px;
	border: 1px solid var(--ecs-line);
	border-radius: 999px;
	background: #fff;
	box-shadow: none;
	color: var(--ecs-navy);
	font-family: "Plus Jakarta Sans", system-ui, sans-serif;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	transition: border-color .2s, background-color .2s, color .2s;
}

.ecs .ecs__chip:hover {
	border-color: var(--ecs-hover-line);
}

.ecs .ecs__chip[aria-pressed="true"] {
	border-color: var(--ecs-green);
	background: var(--ecs-green);
	color: #fff;
}

.ecs .ecs__chip:focus-visible {
	outline: 3px solid var(--ecs-green-light);
	outline-offset: 2px;
}

/* ---------------------------------------------------------------- grid --- */

.ecs__grid {
	display: grid;
	grid-template-columns: repeat(var(--ecs-cols), minmax(0, 1fr));
	gap: var(--ecs-gap);
}

.ecs .ecs__card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	margin: 0;
	overflow: hidden;
	border: 1px solid var(--ecs-line);
	border-radius: var(--ecs-radius);
	background: var(--ecs-card);
	transition: transform .2s cubic-bezier(.2, .7, .2, 1), box-shadow .2s;
}

.ecs .ecs__card[hidden] {
	display: none;
}

.ecs .ecs__card:hover,
.ecs .ecs__card:focus-within {
	transform: translateY(-3px);
	box-shadow: 0 14px 34px #0F39611F;
}

/* --------------------------------------------------------------- photo --- */

.ecs .ecs__img {
	position: relative;
	margin: 0;
}

.ecs .ecs__photo,
.ecs .ecs__photo:hover {
	display: block;
	width: 100%;
	max-width: none;
	height: auto;
	aspect-ratio: var(--ecs-ratio);
	object-fit: cover;
	opacity: 1;
}

.ecs__photo--none {
	background: linear-gradient(135deg, #E4EDF1, #F5F6F7);
}

.ecs .ecs__logo,
.ecs .ecs__logo:hover {
	position: absolute;
	bottom: 14px;
	left: 14px;
	width: auto;
	max-width: 96px;
	height: auto;
	max-height: 34px;
	padding: 7px 10px;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 4px 14px #0003;
	object-fit: contain;
	box-sizing: content-box;
	opacity: 1;
}

.ecs .ecs__logo--dark {
	background: var(--ecs-dark);
}

/* ---------------------------------------------------------------- body --- */

.ecs__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 10px;
	padding: 20px 22px 22px;
}

/* The customer's name, for screen readers and search; the logo says it to
   everyone else. */
.ecs__name,
.ecs__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.ecs__tag {
	font-family: "Urbanist", system-ui, sans-serif;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--ecs-green);
}

.ecs .ecs__big {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 4px 0 0;
}

.ecs__big b {
	font-family: "Bebas Neue", Impact, sans-serif;
	font-size: 60px;
	font-weight: 400;
	line-height: .85;
	color: var(--ecs-green);
}

.ecs__big span {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--ecs-navy);
}

.ecs__big small,
.ecs__status small {
	font-size: 11.5px;
	line-height: 1.45;
	color: #8A97A1;
}

.ecs .ecs__flow {
	margin: 0;
	padding-top: 10px;
	border-top: 1px solid var(--ecs-line);
	font-size: 13px;
	line-height: 1.45;
	color: var(--ecs-muted);
}

.ecs__flow i {
	font-style: normal;
	font-weight: 700;
	color: var(--ecs-green);
}

/* --------------------------------------------------------- ongoing --- */

.ecs__status {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 4px;
}

.ecs__now {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-family: "Bebas Neue", Impact, sans-serif;
	font-size: 40px;
	line-height: .9;
	color: var(--ecs-green);
}

.ecs__now i {
	flex: none;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--ecs-green-bright);
	box-shadow: 0 0 0 0 #00A55D66;
	animation: ecs-pulse 1.8s infinite;
}

@keyframes ecs-pulse {
	70% { box-shadow: 0 0 0 12px #00A55D00; }
	100% { box-shadow: 0 0 0 0 #00A55D00; }
}

.ecs .ecs__track {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ecs .ecs__track li {
	position: relative;
	margin: 0;
	padding-top: 12px;
	font-size: 12px;
	font-weight: 600;
	color: #8A97A1;
}

.ecs__track li::before {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	height: 5px;
	border-radius: 3px;
	background: var(--ecs-line);
}

.ecs .ecs__track li.is-done {
	color: var(--ecs-navy);
}

.ecs__track li.is-done::before {
	background: var(--ecs-green);
}

.ecs .ecs__track li.is-now {
	color: var(--ecs-green);
}

.ecs__track li.is-now::before {
	background: linear-gradient(90deg, var(--ecs-green) 50%, var(--ecs-line) 50%);
	background-size: 200% 100%;
	animation: ecs-fill 2.4s ease-in-out infinite alternate;
}

@keyframes ecs-fill {
	from { background-position: 100% 0; }
	to { background-position: 30% 0; }
}

/* ------------------------------------------------------------- actions --- */

/* Always stacked: side by side, a short link fits and a long one wraps, and
   a row of cards ends up with its buttons at three different heights. */
.ecs__acts {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	margin-top: auto;
	padding-top: 8px;
}

.ecs .ecs__go,
.ecs .ecs__go:hover {
	border-bottom: 1px solid var(--ecs-hover-line);
	color: var(--ecs-navy);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.5;
	text-decoration: none;
}

.ecs .ecs__go:hover {
	border-bottom-color: var(--ecs-green);
}

.ecs .ecs__est,
.ecs .ecs__est:hover,
.ecs .ecs__est:focus {
	padding: 8px 14px;
	border-radius: 999px;
	background: var(--ecs-green);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	transition: background-color .2s;
}

.ecs .ecs__est:hover {
	background: var(--ecs-green-bright);
}

.ecs__go:focus-visible,
.ecs__est:focus-visible {
	outline: 3px solid var(--ecs-green-light);
	outline-offset: 2px;
}

.ecs--empty p {
	margin: 0;
	padding: 24px;
	border: 1px dashed var(--ecs-line);
	border-radius: 14px;
	color: var(--ecs-muted);
	text-align: center;
}

/* -------------------------------------------------------------- motion --- */

@keyframes ecs-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
}

/* The script sets each card's delay as a chip is pressed. */
.ecs .ecs__card.is-fresh {
	animation: ecs-in .2s ease-out backwards;
}

/* ------------------------------------------------------------- tablet --- */

/* Fallbacks for a page without Elementor's generated CSS. The Columns control
   writes the same property with a more specific selector, so it wins. */
@media (max-width: 1024px) {
	.ecs {
		--ecs-cols: 2;
	}
}

/* -------------------------------------------------------------- phone --- */

@media (max-width: 767px) {
	.ecs {
		--ecs-cols: 1;
	}

	/* The one thing allowed to scroll sideways. */
	.ecs__chips {
		flex-wrap: nowrap;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scrollbar-width: none;
		margin-bottom: 14px;
		padding-bottom: 2px;
	}

	.ecs__chips::-webkit-scrollbar {
		display: none;
	}

	.ecs__big b {
		font-size: 52px;
	}
}

/* ------------------------------------------------------- less motion --- */

@media (prefers-reduced-motion: reduce) {
	.ecs .ecs__card,
	.ecs .ecs__card.is-fresh {
		animation: none;
		transition: box-shadow .2s;
	}

	.ecs .ecs__card:hover,
	.ecs .ecs__card:focus-within {
		transform: none;
	}

	.ecs__now i,
	.ecs__track li.is-now::before {
		animation: none;
	}
}
