/**
 * Case Study Module
 * Left: manual image + title card (linking to the selected case-study post),
 * stretched via CSS Grid to match the full height of the right column.
 * Right: a row of up to 2 equal-height "Challenge" boxes, then a row of up
 * to 2 "Outcome" boxes (each with its own number/label stats).
 */

/* ===========================
   # Section
=========================== */

.case-study-module {
	padding: 80px 0;
	background: var(--nec-light-grey, #f5f5f6);
}

/* ===========================
   # Heading
=========================== */

.csm__heading {
	margin: 0 0 40px;
	color: var(--nec-grey);
	font-family: var(--nec-font);
	font-weight: 400;
	line-height: 1.15;
}

/* ===========================
   # Layout: image card + right column — grid stretches both to equal height
=========================== */

.csm__layout {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
	align-items: stretch;
}

/* ===========================
   # Left: image card
=========================== */

.csm__card {
	position: relative;
	display: block;
	overflow: hidden;
	min-height: 320px;
	text-decoration: none;
}

.csm__card-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.csm__card:hover .csm__card-img,
.csm__card:focus-visible .csm__card-img {
	transform: scale(1.03);
}

.csm__card-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 45%);
	pointer-events: none;
}

.csm__card-title {
	position: absolute;
	left: 28px;
	right: 88px;
	bottom: 28px;
	color: var(--nec-white, #fff);
	font-family: var(--nec-font);
	/* Fluid between 390px (22px) and 1440px (36px) viewports. */
	font-size: clamp(1.375rem, calc(1.05rem + 1.3333vw), 2.25rem);
	font-weight: 500;
	line-height: 1.3;
}

.csm__card-arrow {
	position: absolute;
	right: 24px;
	bottom: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	/*background: rgba(255, 255, 255, 0.92);*/
	color: var(--nec-orange);
	transition: transform 0.25s ease;
}

.csm__card:hover .csm__card-arrow,
.csm__card:focus-visible .csm__card-arrow {
	transform: translateX(5px);
}

.csm__card-arrow svg {
	width: 30px;
	height: 30px;
}

.csm__card:focus-visible {
	outline: 2px solid var(--nec-orange);
	outline-offset: 4px;
}

/* ===========================
   # Right column
=========================== */

.csm__right {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* ===========================
   # Rows — CSS Grid gives equal-height cells automatically
=========================== */

.csm__row {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
}

/* ===========================
   # Box — shared shell
=========================== */

.csm__box {
	background: var(--nec-white, #fff);
	padding: 28px 32px;
}

.csm__box-heading {
	margin: 0 0 16px;
	color: var(--nec-grey);
	font-family: var(--nec-font);
	font-size: 17px;
	font-weight: 500;
}

/* ===========================
   # Challenge box text
=========================== */

.csm__box-text {
	margin: 0;
	color: var(--nec-grey);

}

/* ===========================
   # Outcome box: horizontal stats with a vertical divider
=========================== */

.csm__stats {
	display: flex;
	align-items: stretch;
	gap: 24px;
}

.csm__stat {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding-left: 24px;
	border-left: 1px solid rgba(56, 66, 73, 0.15);
}

.csm__stat:first-child {
	padding-left: 0;
	border-left: none;
}

.csm__stat-number {
	font-family: var(--nec-font);
	font-size: clamp(1.75rem, calc(1.5rem + 1.2vw), 2.5rem);
	font-weight: 400;
	line-height: 1;
	color: var(--nec-orange);
}

.csm__stat-label {
	font-family: var(--nec-font);
	font-size: 15px;
	line-height: 1.4;
	color: var(--nec-grey);
}

/* ===========================
   # View all CTA
=========================== */

.csm__view-all-wrap {
	display: flex;
	justify-content: flex-end;
	margin-top: 32px;
}

.csm__view-all {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	color: var(--nec-grey);
	font-family: var(--nec-font);
	font-weight: 500;
	text-decoration: none;
}

.csm__view-all:hover,
.csm__view-all:focus-visible {
	color: var(--nec-grey);
	outline: none;
}

.csm__view-all-icon {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	transition: transform 0.25s ease;
}

.csm__view-all:hover .csm__view-all-icon,
.csm__view-all:focus-visible .csm__view-all-icon {
	transform: translateX(5px);
}

.csm__view-all-icon svg {
	width: 34px;
	height: 34px;
	color: var(--nec-orange);
}

/* ===========================
   # Responsive — 1280px
=========================== */

@media (max-width: 1280px) {
	.case-study-module {
		padding: 64px 0;
	}

	.csm__box {
		padding: 24px 28px;
	}
}

/* ===========================
   # Responsive — 991px
=========================== */

@media (max-width: 991px) {
	.case-study-module {
		padding: 48px 0;
	}

	.csm__heading {
		margin-bottom: 32px;
	}

	.csm__layout {
		grid-template-columns: 1fr;
	}

	.csm__card {
		min-height: 280px;
	}

	.csm__right {
		gap: 16px;
	}

	.csm__row {
		gap: 16px;
	}
}

/* ===========================
   # Responsive — 767px (stack everything to one column)
=========================== */

@media (max-width: 767px) {
	.case-study-module {
		padding: 40px 0;
	}

	.csm__row {
		grid-template-columns: 1fr;
	}

	.csm__box {
		padding: 20px 24px;
	}

	.csm__stats {
		flex-wrap: wrap;
		row-gap: 16px;
	}

	.csm__view-all-wrap {
		margin-top: 24px;
	}
}

@media (max-width: 574px) {
.csm__stat {
  padding-left: 0px;
  border-left: 0px solid rgba(56, 66, 73, 0.15);
}
}
