/* ============================================================
   KODIF — CASE STUDY
   Tokens (--primary, --bg-reverse, …) are declared in css/style.css.
   Order: components → @media (breakpoints at the end of the file).
   ============================================================ */

/* ============ HERO ============ */
.section-title-hero {
	padding-top: 64px;
	padding-bottom: 64px;
	background: var(--bg-reverse);
}

/* Copy capped to a readable measure */
.cs-hero__content {
	max-width: 670px;
}

.section-title-hero .title {
	margin-bottom: 24px;
}

.cs-hero__lead {
	/* Track the body's responsive type scale (18 → 15 → 14px) */
	font-size: inherit;
	line-height: 1.55;
	color: var(--text-dim);
}

/* ============ LIST ============ */
.section-case-list {
	background: #fff;
	padding: 80px 0;
}

/* ============ FEATURE ============ */
/* Media left, story right; overlay link covers the whole card (matches .case-card) */
.case-feature {
	position: relative;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 48px;
	padding: 24px;
	border: 1px solid #ebebeb;
	background: #fff;
	transition: all ease 0.4s;
}

.case-feature:hover {
	border-color: #111;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.case-feature__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
}

.case-feature__media {
	position: relative;
	aspect-ratio: 16 / 11;
	overflow: hidden;
}

.case-feature__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ============ MEDIA SCRIM + BRAND LOGO ============ */
/* A 120px scrim fades the bottom of every thumb to black so the overlaid
   brand logo stays legible. Scoped to this page so the shared .case-card
   media on other pages is untouched. */
.case-card__media,
.case-feature__media {
	position: relative;
}

.case-card__media::after,
.case-feature__media::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 120px;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000 100%);
	pointer-events: none;
	z-index: 1;
}

/* Brand logo sits over the scrim, centred along the bottom edge. The
   compound selector outranks `.case-card__media img` so the logo keeps its
   natural width instead of being stretched to cover. */
.case-card__media img.case-card__logo,
.case-feature__media img.case-feature__logo {
	position: absolute;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%);
	width: auto;
	height: 40px;
	max-width: calc(100% - 48px);
	object-fit: contain;
	pointer-events: none;
	z-index: 2;
}

/* Card logos read as small brand marks, not full lockups */
.case-card__media img.case-card__logo {
	height: 32px;
}

/* Feature logo anchors to the bottom-left corner instead of centre */
.case-feature__media img.case-feature__logo {
	left: 24px;
	transform: none;
}

/* Orange "Feature" flag, top-left of the media */
.case-feature__badge {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 1;
	padding: 1px 12px;
	border-radius: 8px;
	background: var(--primary);
	line-height: 1.5;
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	color: #010101;
}

.case-feature__body {
	display: flex;
	flex-direction: column;
}

/* Tag spacing comes from its own margin; title sits flush */
.case-feature .case-card__tag {
	margin-bottom: 12px;
}

.case-feature__title {
	margin-top: 0;
	font-size: 32px;
	line-height: 1.25;
	color: var(--text-title);
}

/* Lead + CTA sink to the bottom, mirroring the reference layout */
.case-feature__desc {
	margin-top: auto;
	padding-top: 12px;
	font-size: 16px;
	line-height: 1.6;
	color: var(--text-mute);
}

.case-feature .case-card__cta {
	margin-top: 16px;
}

/* Arrow reveal is keyed to .case-card; mirror it for the feature card */
.case-feature:hover .case-card__arrow {
	opacity: 1;
	transform: translateX(0);
}

/* ============ FILTER ============ */
.case-filter {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin: 80px 0 24px;
}

.case-filter__label {
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #7a7a7a;
}

.case-filter__list {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

/* Rounded pills per the reference — intentional exception to the square-corner default */
.case-filter__pill {
	padding: 8px 18px;
	border: 1px solid #ebebeb;
	border-radius: 999px;
	background: #fff;
	font-size: 16px;
	color: #a3a3a3;
	cursor: pointer;
	transition: all ease 0.25s;
}

/* Hover/active adopt the pill's own --bg/--text; border follows --bg */
.case-filter__pill:hover,
.case-filter__pill--active {
	border-color: var(--bg);
	background: var(--bg);
	color: var(--text);
}

/* Toggled off by the industry filter */
.case-card.is-hidden {
	display: none;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1199px) {
	/* Track .case-card's padding step so feature + cards stay aligned */
	.case-feature {
		padding: 18px;
		gap: 16px;
	}
	.case-feature__title {
		font-size: 24px;
	}
	.case-feature__desc {
		font-size: 14px;
	}
	.case-card__media img.case-card__logo {
		bottom: 20px;
	}
	.case-feature__media img.case-feature__logo {
		left: 20px;
		bottom: 20px;
	}
}

@media (max-width: 991px) {
	.section-title-hero {
		padding-top: 48px;
		padding-bottom: 48px;
	}
	.section-title-hero .title {
		margin-bottom: 20px;
	}
	.section-case-list {
		padding: 56px 0;
	}
	/* Stack the feature: media on top, story below (padding/gap/type carry from ≤1199) */
	.case-feature {
		grid-template-columns: 1fr;
	}
	.case-feature__badge {
		top: 12px;
		left: 12px;
		border-radius: 4px;
		font-size: 14px;
	}
	/* Label sits above the scrolling pill row */
	.case-filter {
		flex-direction: column;
		align-items: flex-start;
		gap: 16px;
		margin: 56px 0 20px;
	}
	.case-filter__list {
		gap: 8px;
	}
	.case-filter__pill {
		padding: 6px 12px;
		font-size: 14px;
	}
	/* Scale the overlaid feature logo + scrim down with the smaller media */
	.case-feature__media img.case-feature__logo {
		height: 32px;
		left: 16px;
		bottom: 16px;
	}
	.case-card__media img.case-card__logo {
		bottom: 16px;
	}
	.case-card__media::after,
	.case-feature__media::after {
		height: 96px;
	}
}

@media (max-width: 767px) {
	.case-feature__title {
		font-size: 16px;
	}
}

@media (max-width: 539px) {
	.section-title-hero {
		padding-top: 40px;
		padding-bottom: 40px;
	}
	.section-title-hero .title {
		margin-bottom: 16px;
	}
	.section-case-list {
		padding: 44px 0;
	}
	.case-feature {
		padding: 16px;
	}
	.case-filter {
		margin: 40px 0 16px;
	}
	.case-card__media img.case-card__logo,
	.case-feature__media img.case-feature__logo {
		height: 30px;
		bottom: 16px;
	}
	.case-card__media::after,
	.case-feature__media::after {
		height: 84px;
	}
}
