/* ==========================================================================
   Case Study v4 - editorial layout, part 2: delivered, story, quote, gallery, CTA.
   Loaded after case-study-v4.css (base vars, resets, hero, results).
   ========================================================================== */

/* Shared two-column split: heading left, content right (delivered + story chapters). */

.cs4-split {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px 32px;
}

.cs4-split__head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
}

@media (min-width: 992px) {
	.cs4-split {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		column-gap: clamp(48px, 6vw, 112px);
	}
}

/* 3. What we delivered ---------------------------------------------------- */

.cs4-delivered .cs4-split {
	row-gap: 40px;
}

@media (min-width: 992px) {
	.cs4-delivered .cs4-split__head {
		position: sticky;
		top: 120px;
		align-self: start;
	}
}

.cs4-delivered__title {
	font-family: var(--cs4-serif);
	font-weight: 600;
	font-size: clamp(34px, 3.6vw, 56px);
	line-height: 1.02;
	letter-spacing: -0.01em;
}

.cs4-delivered__intro {
	max-width: 46ch;
	font-size: clamp(16px, 1.25vw, 18px);
	line-height: 1.65;
	color: var(--cs4-muted);
}

.cs4-deliverables {
	border-top: 2px solid var(--cs4-ink);
}

.cs4-deliverable {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr) auto;
	align-items: center;
	gap: 20px;
	padding: clamp(16px, 1.6vw, 22px) 0;
	border-bottom: 1px solid var(--cs4-line);
	font-size: clamp(17px, 1.4vw, 20px);
	font-weight: 500;
	line-height: 1.35;
}

.cs4-deliverable__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--cs4-card);
	color: var(--cs4-brand-ink);
}

.cs4-deliverable__icon svg,
.cs4-deliverable__icon img {
	width: 24px;
	height: 24px;
	object-fit: contain;
}

.cs4-deliverable__num {
	font-family: var(--cs4-serif);
	font-style: italic;
	font-size: 20px;
	line-height: 1;
	color: var(--cs4-muted);
}

@media (max-width: 575px) {
	.cs4-deliverable {
		grid-template-columns: 40px minmax(0, 1fr) auto;
		gap: 14px;
	}

	.cs4-deliverable__icon {
		width: 40px;
		height: 40px;
	}

	.cs4-deliverable__icon svg,
	.cs4-deliverable__icon img {
		width: 20px;
		height: 20px;
	}
}

/* 5. Story ---------------------------------------------------------------- */

.cs4-story__label {
	margin-bottom: clamp(24px, 3vw, 40px);
}

.cs4-chapter {
	padding: clamp(28px, 3.4vw, 48px) 0;
	border-top: 1px solid var(--cs4-line);
}

.cs4-chapter:last-child {
	border-bottom: 1px solid var(--cs4-line);
}

.cs4-chapter .cs4-split__head {
	gap: 10px;
}

.cs4-chapter__num {
	font-family: var(--cs4-serif);
	font-style: italic;
	font-weight: 500;
	font-size: 22px;
	line-height: 1;
	color: var(--cs4-brand-ink);
}

.cs4-chapter__title {
	font-family: var(--cs4-serif);
	font-weight: 600;
	font-size: clamp(30px, 3vw, 44px);
	line-height: 1.05;
}

.cs4-chapter__body {
	font-size: clamp(16px, 1.25vw, 18px);
	line-height: 1.75;
	color: var(--cs4-ink-2);
}

.cs4-chapter__body p {
	margin: 0 0 1em;
}

.cs4-chapter__body p:last-child {
	margin-bottom: 0;
}

.cs4-chapter__body a {
	color: var(--cs4-brand-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cs4-chapter__body ul,
.cs4-chapter__body ol {
	margin: 0 0 1em 1.2em;
	list-style: disc;
}

.cs4-chapter__body ol {
	list-style: decimal;
}

.cs4-chapter__body {
	max-width: 680px;
}

/* 6. Client quote: centred brand band -------------------------------------- */

.cs4-band {
	background: var(--cs4-brand);
	color: var(--cs4-on-brand);
}

.cs4-quote__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 28px;
	max-width: 1000px;
	margin: 0 auto;
	text-align: center;
}

.cs4-quote__mark {
	color: var(--cs4-on-brand-soft);
}

.cs4-quote__text {
	font-family: var(--cs4-serif);
	font-style: italic;
	font-weight: 500;
	font-size: clamp(28px, 3.4vw, 52px);
	line-height: 1.2;
}

.cs4-quote__cite {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	border: 0;
	font-size: 15px;
	line-height: 1.5;
	color: var(--cs4-on-brand-soft);
}

.cs4-quote__cite strong {
	font-weight: 600;
	color: var(--cs4-on-brand);
}

@media (max-width: 575px) {
	.cs4-quote__inner {
		gap: 20px;
	}
}

/* Quote band straight into the CTA band (no gallery between): keep them visually separate. */
.cs4-band + .cs4-cta {
	border-top: 1px solid var(--cs4-on-brand-line);
}

/* 4 + 7. Gallery: bento ---------------------------------------------------- */

.cs4-gallery__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(10px, 1.6vw, 20px);
}

.cs4-gallery__item {
	display: block;
	overflow: hidden;
	border-radius: var(--cs4-radius);
	background: var(--cs4-card);
	aspect-ratio: 1 / 1;
}

.cs4-gallery__item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.cs4-gallery__item:hover img {
	transform: scale(1.03);
}

/* Phone: first image full width, then pairs; a trailing single image goes full width. */
.cs4-gallery__item:first-child,
.cs4-gallery__item:last-child:nth-child(even) {
	grid-column: 1 / -1;
	aspect-ratio: 16 / 10;
}

.cs4-gallery__grid--1,
.cs4-gallery__grid--2 {
	grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 768px) {
	.cs4-gallery__item,
	.cs4-gallery__item:first-child,
	.cs4-gallery__item:last-child:nth-child(even) {
		grid-column: auto;
		aspect-ratio: 4 / 3;
	}

	.cs4-gallery__grid--1 .cs4-gallery__item {
		aspect-ratio: 16 / 9;
	}

	.cs4-gallery__grid--2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	/* 3 images: one large on the left, two stacked on the right. */
	.cs4-gallery__grid--3 {
		grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
		grid-template-rows: repeat(2, clamp(180px, 22vw, 320px));
	}

	.cs4-gallery__grid--3 .cs4-gallery__item {
		aspect-ratio: auto;
		height: 100%;
	}

	.cs4-gallery__grid--3 .cs4-gallery__item:first-child {
		grid-row: 1 / span 2;
	}

	/* 4+ images: first one full width, the rest in threes. */
	.cs4-gallery__grid--many {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.cs4-gallery__grid--many .cs4-gallery__item:first-child {
		grid-column: 1 / -1;
		aspect-ratio: 21 / 9;
	}
}

/* 5. CTA ------------------------------------------------------------------ */

.cs4-cta {
	padding: clamp(64px, 8vw, 128px) 0;
	background: var(--cs4-brand);
	color: var(--cs4-on-brand);
}

.cs4-cta__inner {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 32px;
}

.cs4-cta__text {
	display: flex;
	flex-direction: column;
	gap: 16px;
	max-width: 760px;
}

.cs4-cta__title {
	font-family: var(--cs4-serif);
	font-weight: 600;
	font-size: clamp(38px, 4.8vw, 72px);
	line-height: 1.02;
	color: var(--cs4-on-brand);
}

.cs4-cta__text p {
	font-size: clamp(16px, 1.3vw, 19px);
	color: var(--cs4-on-brand-soft);
}

.cs4-btn {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 60px;
	padding: 0 32px;
	border-radius: 999px;
	background: var(--cs4-button);
	color: var(--cs4-button-text);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	position: relative;
	overflow: hidden;
	z-index: 1;
	transition: color 0.3s ease-in-out;
}

/* Same left-to-right fill as the site-wide .cmn-btn. */
.cs4-btn::before {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	width: 0;
	height: 100%;
	border-radius: inherit;
	background: var(--cs4-button-hover, #037ec7);
	transform: scale(1.03);
	transition: width 0.3s ease-in-out;
	z-index: -1;
}

.cs4-btn svg {
	transition: transform 0.2s ease;
}

.cs4-btn:hover,
.cs4-btn:focus-visible {
	color: var(--cs4-button-hover-text, #fff);
}

.cs4-btn:hover::before,
.cs4-btn:focus-visible::before {
	right: auto;
	left: 0;
	width: 100%;
}

.cs4-btn:hover svg,
.cs4-btn:focus-visible svg {
	transform: translateX(3px);
}

@media (min-width: 768px) {
	.cs4-cta__inner {
		flex-direction: row;
		justify-content: space-between;
		align-items: flex-end;
		gap: 48px;
	}
}

@media (max-width: 575px) {
	.cs4-btn {
		width: 100%;
	}
}
