/* ==========================================================================
   EM3 Case Studies - index + single. Markup: inc/case-study.php.
   Loaded with resources.css. Uses brand.css tokens/components.
   ========================================================================== */

/* Filter chips (.em3-cs-chips / .em3-cs-chip) + .em3-cs-empty are shared - defined in resources.css.
   The case-studies archive uses the SECTOR TILE selector below instead (Sam, 2026-06-12). */

/* ---- Sector selector: equal tiles, 5 per row (All + the nine industries) ---- */
.em3-cs-sectors {
	display: grid;
	/* minmax(0,1fr): plain 1fr tracks cannot shrink below the longest sector
	   name's min-content, which overflowed the document horizontally. */
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 14px;
	margin-bottom: 44px;
}
.em3-cs-sector {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 104px;
	padding: 16px 14px;
	background: #fff;
	border: 1px solid var(--em3-line-onwhite);
	border-radius: var(--em3-radius-card);
	color: var(--em3-ink-navy);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	cursor: pointer;
	transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s, background 0.25s, color 0.25s;
}
.em3-cs-sector:hover,
.em3-cs-sector:focus,
.em3-cs-sector:focus-visible,
.em3-cs-sector:active {
	background: #fff;
	border-color: var(--em3-accent);
	color: var(--em3-accent);
	transform: translateY(-2px);
	box-shadow: 0 18px 36px -22px rgba(10, 24, 88, 0.3);
}
.em3-cs-sector:focus-visible {
	outline: 2px solid var(--em3-accent);
	outline-offset: 2px;
}
.em3-cs-sector.is-active,
.em3-cs-sector.is-active:hover,
.em3-cs-sector.is-active:focus {
	background: var(--em3-ink-navy);
	border-color: var(--em3-ink-navy);
	color: #fff;
}
.em3-cs-sector__icon {
	width: 26px;
	height: 26px;
}
.em3-cs-sector__name {
	display: block;
	/* The tile is a <button> (UA white-space:nowrap, inherited) inside a flex
	   COLUMN with align-items:center (children sized to max-content): long sector
	   names rendered on one line and overflowed the tile. Force wrapping + cap. */
	white-space: normal;
	max-width: 100%;
	overflow-wrap: break-word;
}
@media (max-width: 980px) {
	.em3-cs-sectors {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
@media (max-width: 600px) {
	.em3-cs-sectors {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}
	.em3-cs-sector {
		min-height: 92px;
		font-size: 13px;
	}
}
@media (prefers-reduced-motion: reduce) {
	.em3-cs-sector {
		transition: none;
	}
}

/* ---- Cards grid ---- */
.em3-cs-cards {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 28px;
}
.em3-cs-card {
	display: flex;
}
.em3-cs-card[hidden] {
	display: none;
}
.em3-cs-card__link {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--em3-line-onwhite);
	border-radius: var(--em3-radius-card);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
	width: 100%;
}
.em3-cs-card__link:hover,
.em3-cs-card__link:focus-visible {
	transform: translateY(-4px);
	border-color: rgba(46, 93, 255, 0.4);
	box-shadow: 0 30px 60px -28px rgba(10, 24, 88, 0.28);
}
.em3-cs-card__media {
	position: relative;
	margin: 0;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--em3-bg-deep);
}
.em3-cs-card__media .em3-cs-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s;
}
.em3-cs-card__link:hover .em3-cs-card__img {
	transform: scale(1.04);
}
.em3-cs-card__stat {
	position: absolute;
	left: 14px;
	bottom: 14px;
	display: flex;
	flex-direction: column;
	padding: 9px 13px;
	background: rgba(5, 13, 51, 0.82);
	backdrop-filter: blur(6px);
	border-radius: var(--em3-radius);
	color: #fff;
}
.em3-cs-card__statval {
	font-size: 22px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.02em;
}
.em3-cs-card__statlbl {
	font-size: 11px;
	color: var(--em3-ink-muted);
	margin-top: 3px;
	max-width: 180px;
}
.em3-cs-card__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 22px 22px 24px;
	flex: 1;
}
.em3-cs-card__sector {
	color: var(--em3-accent);
}
.em3-cs-card__title {
	font-size: 19px;
	line-height: 1.25;
	letter-spacing: -0.01em;
	color: var(--em3-ink-navy);
	margin: 0;
}
.em3-cs-card__sum {
	font-size: 14.5px;
	line-height: 1.55;
	color: var(--em3-charcoal);
	margin: 0;
}
.em3-cs-card__cta {
	margin-top: auto;
	padding-top: 6px;
}

/* dark related variant */
.em3-cs-cards--dark .em3-cs-card__link {
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
	border-color: var(--em3-line-soft);
}
.em3-cs-cards--dark .em3-cs-card__title {
	color: var(--em3-ink);
}
.em3-cs-cards--dark .em3-cs-card__sum {
	color: var(--em3-ink-dim);
}
.em3-cs-cards--dark .em3-cs-card__sector {
	color: var(--em3-accent-hot);
}

/* ---- Single hero ---- */
.em3-cs-hero {
	padding: calc(var(--em3-space-4) + 40px) 0 0;
}
.em3-cs-hero__inner {
	max-width: var(--em3-maxw);
}
.em3-cs-hero__sector {
	color: var(--em3-accent-hot);
}
.em3-cs-hero__title {
	margin: 14px 0 0;
	font-size: clamp(34px, 4.4vw, 60px);
	line-height: 1.05;
	letter-spacing: -0.025em;
	text-wrap: balance;
}
.em3-cs-hero__sub {
	margin: 20px 0 0;
	font-size: 19px;
	line-height: 1.5;
	color: var(--em3-ink-muted);
	/* Full-width hero intro: spans the headline width (the 720px sub cap left a
	   tight, half-empty hero). var(--em3-maxw) matches .em3-cs-hero__inner so the
	   lede fills the content column like the headline + stats. */
	max-width: var(--em3-maxw);
}
.em3-cs-hero__stats {
	margin-top: 40px;
	gap: 28px;
}
.em3-cs-stat .em3-stat-num {
	font-size: clamp(34px, 4vw, 56px);
}
.em3-cs-hero__media {
	margin-top: 56px;
}
.em3-cs-hero__figure {
	margin: 0;
	border-radius: var(--em3-radius-card);
	overflow: hidden;
	border: 1px solid var(--em3-line-soft);
}
.em3-cs-hero__figure .em3-cs-hero__img {
	display: block;
	width: 100%;
	height: auto;
}

/* ---- Single body (2-col) ---- */
.em3-cs-body__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 56px;
	align-items: start;
}
.em3-cs-body__media {
	margin: 0 0 32px;
	border-radius: var(--em3-radius-card);
	overflow: hidden;
}
.em3-cs-body__media .em3-cs-body__img {
	display: block;
	width: 100%;
	height: auto;
}
.em3-cs-end {
	margin-top: 36px;
	padding-top: 24px;
	border-top: 1px solid var(--em3-line-onwhite);
}
.em3-cs-aside {
	position: sticky;
	top: 110px;
}
.em3-cs-glance {
	background: #fff;
	border: 1px solid var(--em3-line-onwhite);
	border-radius: var(--em3-radius-card);
	padding: 24px 22px;
}
.em3-cs-glance__title {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: rgba(10, 24, 88, 0.6);
	margin: 0 0 16px;
}
.em3-cs-glance__list {
	margin: 0;
}
.em3-cs-glance__row {
	padding: 12px 0;
	border-top: 1px solid var(--em3-line-onwhite);
}
.em3-cs-glance__row:first-child {
	border-top: 0;
	padding-top: 0;
}
.em3-cs-glance__row dt {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(10, 24, 88, 0.55);
	margin-bottom: 4px;
}
.em3-cs-glance__row dd {
	margin: 0;
	font-size: 15px;
	color: var(--em3-ink-navy);
	font-weight: 600;
}
.em3-cs-glance__services {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.em3-cs-glance__services li {
	position: relative;
	padding-left: 18px;
	font-size: 14px;
	font-weight: 500;
	color: var(--em3-charcoal);
}
.em3-cs-glance__services li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.65em;
	width: 10px;
	height: 1px;
	background: var(--em3-accent);
}

/* ---- More ---- */
.em3-cs-more__head {
	max-width: 680px;
	margin-bottom: 40px;
}

/* ---- Responsive ---- */
@media (max-width: 980px) {
	.em3-cs-cards {
		grid-template-columns: repeat(2, 1fr);
	}
	.em3-cs-body__grid {
		grid-template-columns: 1fr;
		gap: 40px;
	}
	.em3-cs-aside {
		position: static;
	}
}
@media (max-width: 600px) {
	.em3-cs-cards {
		grid-template-columns: 1fr;
	}
}
@media (prefers-reduced-motion: reduce) {
	.em3-cs-card__link,
	.em3-cs-card__img {
		transition: none;
	}
}

/* Case-study body content headings: match the blog article scale. blog.css is
   NOT loaded on case studies, so without this the .em3-cs-prose H2/H3 fall back
   to the large global brand h2/h3 (41-56px). Blog parity = 25-33px H2. */
.em3-cs-prose h2 { font-size: clamp(25px, 2.4vw, 33px); line-height: 1.2; letter-spacing: -0.02em; margin: 52px 0 16px; padding-top: 6px; color: var(--em3-ink-navy); }
.em3-cs-prose h2:first-child { margin-top: 0; }
.em3-cs-prose h3 { font-size: clamp(19px, 1.6vw, 22px); line-height: 1.3; margin: 34px 0 12px; color: var(--em3-ink-navy); }
