/*
 * Case Study (Full Story) template (single-case-study-story.php).
 * Loaded only on posts that use the template.
 */

.cs-story {
	--cs-surface: #f5f7fb;
	--cs-surface-2: #e6f2ff;
	--cs-fg: #292929;
	--cs-muted: #53585f;
	--cs-faint: #74767c;
	--cs-border: #dfe3e5;
	--cs-accent: #0050ef;
	--cs-accent-ink: #003ec0;
	--cs-hero-1: #001039;
	--cs-hero-2: #0a3fd0;
	--cs-on-hero-muted: #b9c6ea;
	--cs-card-shadow: 0 8px 24px rgba(0, 20, 70, .08);
	color: var(--cs-fg);
	line-height: 1.6;
}
.cs-story h1,
.cs-story h2,
.cs-story h3 { text-wrap: balance; margin: 0; line-height: 1.12; color: inherit; }
.cs-story p { margin: 0; }

.cs-story-wrap {
	width: 100%;
	max-width: 1060px;
	margin-inline: auto;
	padding-inline: 20px;
}
.cs-story-read { max-width: 760px; }
.cs-story-eyebrow {
	font-size: .74rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
}

/* Buttons */
.cs-story-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--cs-accent);
	color: #fff;
	font-weight: 700;
	font-size: .95rem;
	text-decoration: none;
	border: 0;
	border-radius: 10px;
	padding: 13px 24px;
	box-shadow: 0 10px 24px rgba(0, 80, 239, .28);
}
/* Hover: the site's slide-in fill. Solid fills #0000df; ghost fills white and its text turns blue. */
.cs-story-btn {
	position: relative;
	z-index: 1;
	overflow: hidden;
	transition: color .3s ease, border-color .3s ease;
}
.cs-story-btn::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	width: 0;
	height: 100%;
	background-color: #0000df;
	transition: width .5s;
	z-index: -1;
}
.cs-story-btn:hover::before,
.cs-story-btn:focus-visible::before { width: 100%; }
.cs-story-btn:hover,
.cs-story-btn:focus { color: #fff; }
.cs-story-btn.ghost {
	background: transparent;
	border: 1.5px solid rgba(255, 255, 255, .5);
	box-shadow: none;
}
.cs-story-btn.ghost::before { background-color: #fff; }
.cs-story-btn.ghost:hover,
.cs-story-btn.ghost:focus-visible { color: var(--cs-accent); border-color: #fff; }
@media (prefers-reduced-motion: reduce) {
	.cs-story-btn::before { transition: none; }
}

/* Hero */
.cs-story-hero {
	position: relative;
	overflow: hidden;
	color: #fff;
	background: linear-gradient(104deg, var(--cs-hero-1) 0%, var(--cs-hero-2) 118%);
}
.cs-story-hero-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
}
/* With a featured image, the banner is that one graphic (the overlay and shapes
   are part of the artwork), as on the other pages. No image: the gradient alone. */
.cs-story-hero .cs-story-wrap {
	position: relative;
	z-index: 3;
	padding-block: 58px 118px;
}
.cs-story-hero .cs-story-eyebrow { color: var(--cs-on-hero-muted); }
.cs-story-hero h1 {
	font-weight: 900;
	font-size: clamp(2rem, 5.2vw, 3.35rem);
	letter-spacing: -.015em;
	margin-top: 16px;
	max-width: 17ch;
	color: #fff;
}
.cs-story-sub {
	color: var(--cs-on-hero-muted);
	font-size: clamp(1.02rem, 2.4vw, 1.2rem);
	margin-top: 18px !important;
	max-width: 52ch;
}
.cs-story-client {
	margin-top: 26px;
	font-size: .86rem;
	color: var(--cs-on-hero-muted);
}
.cs-story-client b { color: #fff; font-weight: 700; }
.cs-story-acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* Stat cards overlapping the hero + at a glance */
.cs-story-stats { margin-top: -78px; position: relative; z-index: 5; }
.cs-story-stats.no-stats { margin-top: 30px; }
.cs-story-stat-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}
.cs-story-count-3 { grid-template-columns: repeat(3, 1fr); }
.cs-story-count-2 { grid-template-columns: repeat(2, 1fr); }
.cs-story-count-1 { grid-template-columns: 1fr; }
.cs-story-stat {
	background: #fff;
	border: 1px solid var(--cs-border);
	border-radius: 14px;
	padding: 22px 20px;
	box-shadow: var(--cs-card-shadow);
}
.cs-story-stat .n {
	font-weight: 900;
	font-size: clamp(1.9rem, 4vw, 2.5rem);
	color: var(--cs-accent);
	line-height: 1;
	letter-spacing: -.02em;
	font-variant-numeric: tabular-nums;
}
.cs-story-stat .l { margin-top: 9px; font-size: .84rem; color: var(--cs-muted); line-height: 1.35; }

.cs-story-glance {
	margin: 30px 0 0;
	background: var(--cs-surface);
	border: 1px solid var(--cs-border);
	border-radius: 14px;
	padding: 20px 22px;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px 26px;
}
.cs-story-glance dt {
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--cs-faint);
}
.cs-story-glance dd { margin: 5px 0 0; font-size: .95rem; font-weight: 700; }

.cs-story-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
.cs-story-chips.spaced { margin-top: 20px; }
.cs-story-chip {
	font-size: .78rem;
	font-weight: 700;
	background: var(--cs-surface-2);
	color: var(--cs-accent);
	border-radius: 7px;
	padding: 4px 9px;
}

/* Story sections */
.cs-story-block { padding-block: 40px; }
.cs-story-stats + .cs-story-block { padding-top: 56px; }
.cs-story-block.tint {
	background: var(--cs-surface);
	border-block: 1px solid var(--cs-border);
}
.cs-story-kicker { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cs-story-bar { width: 30px; height: 4px; background: var(--cs-accent); border-radius: 2px; }
.cs-story-kicker .cs-story-eyebrow { color: var(--cs-accent); }
.cs-story-block h2 {
	font-weight: 900;
	font-size: clamp(1.5rem, 3.4vw, 2rem);
	letter-spacing: -.01em;
}
.cs-story-block p,
.cs-story-text,
.cs-story-content .cs-story-read {
	color: var(--cs-muted);
	font-size: 1.06rem;
}
.cs-story-block > .cs-story-wrap > p,
.cs-story-text { margin-top: 16px; }
.cs-story-text p + p,
.cs-story-content p + p { margin-top: 16px; }
.cs-story-text strong,
.cs-story-block p strong { color: var(--cs-fg); font-weight: 700; }
.cs-story-text ul,
.cs-story-text ol { margin: 16px 0 0; }

.cs-story-outcomes {
	list-style: none;
	padding: 0;
	margin: 20px 0 0;
	display: grid;
	gap: 12px;
}
.cs-story-outcomes li {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	color: var(--cs-muted);
	font-size: 1.02rem;
}
.cs-story-outcomes strong { color: var(--cs-fg); }
.cs-story-outcomes .tick {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border-radius: 6px;
	background: var(--cs-surface-2);
	color: var(--cs-accent);
	display: grid;
	place-items: center;
	font-weight: 900;
	font-size: .8rem;
	margin-top: 2px;
}

/* Quote */
.cs-story-quote {
	background: var(--cs-surface);
	border-block: 1px solid var(--cs-border);
}
.cs-story-quote .cs-story-wrap { padding-block: 46px; }
.cs-story-quote figure { margin: 0; max-width: 760px; }
.cs-story-quote blockquote { margin: 0; }
.cs-story-quote blockquote::before {
	content: "\201C";
	display: block;
	font-family: Georgia, serif;
	font-size: 3.4rem;
	line-height: .6;
	color: var(--cs-accent);
}
.cs-story-quote blockquote p {
	font-size: clamp(1.25rem, 3vw, 1.6rem);
	font-weight: 700;
	letter-spacing: -.01em;
	line-height: 1.38;
	margin-top: 14px;
	color: var(--cs-fg);
}
.cs-story-quote figcaption {
	margin-top: 24px;
	color: var(--cs-muted);
	font-size: .95rem;
	display: flex;
	align-items: center;
	gap: 14px;
}
/* Avatar placeholder: a soft blue circle with a dot, as in the design. */
.cs-story-quote figcaption::before {
	content: "";
	flex: none;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: radial-gradient(circle, var(--cs-accent) 0 6px, var(--cs-surface-2) 7px);
}
.cs-story-quote figcaption strong { color: var(--cs-fg); }

/* CTA band */
.cs-story-cta {
	/* Deep navy on the left easing into a softer royal blue, as in the design. */
	background: linear-gradient(90deg, #030f3b 0%, #08195a 30%, #0f2a86 62%, #1b40c2 100%);
	color: #fff;
	position: relative;
	overflow: hidden;
}
.cs-story-cta .cs-story-chev {
	position: absolute;
	left: -40px;
	bottom: -120px;
	width: 400px;
	height: 400px;
	opacity: .13;
	pointer-events: none;
}
.cs-story-cta .cs-story-wrap {
	position: relative;
	padding-block: 50px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 22px;
	justify-content: space-between;
}
.cs-story-cta h2 {
	font-weight: 900;
	font-size: clamp(1.5rem, 3.6vw, 2.1rem);
	max-width: 18ch;
	color: #fff;
}
.cs-story-cta p { color: var(--cs-on-hero-muted); margin-top: 10px; max-width: 42ch; }

/* Trust band */
.cs-story-trust {
	background: var(--cs-surface);
	border-block: 1px solid var(--cs-border);
}
.cs-story-cta + .cs-story-trust { border-top: 0; }
.cs-story-trust .cs-story-wrap { padding-block: 40px; }
.cs-story-trust .nums {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	text-align: center;
}
.cs-story-trust .n {
	font-weight: 900;
	font-size: clamp(1.6rem, 4vw, 2.3rem);
	color: var(--cs-accent);
	letter-spacing: -.02em;
}
.cs-story-trust .l { font-size: .85rem; color: var(--cs-muted); margin-top: 6px; }

/* Related */
.cs-story-related .cs-story-wrap { padding-block: 44px; }
.cs-story-related h2 { font-weight: 900; font-size: 1.5rem; }
.cs-story-related .cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 18px;
	margin-top: 22px;
}
.cs-story-related .rcard {
	border: 1px solid var(--cs-border);
	border-radius: 14px;
	overflow: hidden;
	background: #fff;
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	transition: box-shadow .2s ease, translate .2s ease;
}
.cs-story-related .top {
	aspect-ratio: 16 / 9;
	background: linear-gradient(120deg, var(--cs-hero-1), var(--cs-hero-2));
	position: relative;
	overflow: hidden;
}
.cs-story-related .rimg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.cs-story-related .tag {
	position: absolute;
	left: 12px;
	top: 12px;
	z-index: 2;
	font-size: .64rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #fff;
	background: rgba(0, 16, 57, .55);
	border-radius: 6px;
	padding: 4px 9px;
}
.cs-story-related .bd { padding: 16px 16px 18px; }
.cs-story-related .bd h3 { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.cs-story-related .m { margin-top: 10px; font-size: .8rem; font-weight: 700; color: var(--cs-accent); }

@media (max-width: 860px) {
	/* Three or more stats go two per row; one or two keep their own layout. */
	.cs-story-stat-grid:not(.cs-story-count-1):not(.cs-story-count-2) { grid-template-columns: repeat(2, 1fr); }
	.cs-story-glance { grid-template-columns: repeat(2, 1fr); }
	.cs-story-related .cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
	.cs-story-wrap { padding-inline: 16px; }
	.cs-story-hero .cs-story-wrap { padding-block: 44px 104px; }
	.cs-story-trust .nums { grid-template-columns: 1fr; }
	.cs-story-related .cards { grid-template-columns: 1fr; }
}
.cs-story :focus-visible { outline: 2px solid var(--cs-accent); outline-offset: 2px; border-radius: 4px; }

/*
 * Card hover: stat cards and related cards slide up. The lift uses `translate`,
 * not `transform`, so it never fights the scroll reveal's transform; the reveal
 * keeps its fade and stagger delay while the hover runs at once.
 */
.cs-story-stat { transition: box-shadow .25s ease, translate .25s ease, border-color .25s ease; }
.sr-ready .cs-story-stat.sr,
.sr-ready .cs-story-related .rcard.sr {
	transition-property: opacity, transform, translate, box-shadow, border-color;
	transition-duration: .8s, .8s, .25s, .25s, .25s;
	transition-timing-function: cubic-bezier(.22, 1, .36, 1), cubic-bezier(.22, 1, .36, 1), ease, ease, ease;
	transition-delay: var(--sr-delay, 0ms), var(--sr-delay, 0ms), 0s, 0s, 0s;
}
.cs-story-stat:hover {
	translate: 0 -6px;
	border-color: var(--cs-accent);
	box-shadow: 0 16px 36px rgba(0, 20, 70, .14);
}
.cs-story-related .rcard:hover,
.cs-story-related .rcard:focus-visible {
	translate: 0 -6px;
	box-shadow: var(--cs-card-shadow);
}
@media (prefers-reduced-motion: reduce) {
	.cs-story-stat,
	.cs-story-related .rcard { transition: none; }
	.cs-story-stat:hover,
	.cs-story-related .rcard:hover,
	.cs-story-related .rcard:focus-visible { translate: none; }
}
