/* Case Studies page, new layout (templates/case-studies-new.php, template-parts/case-studies/*).
 * Builds on the pricing page styles (pricing.css: .sbp colour tokens); everything here is
 * scoped under .scs / .scs-banner.
 * navy #191937 · accent #ff0055 · text #62748a · line #e4e6ef · placeholder #f39200
 */

/* ---------- Banner ---------- */

.scs-banner .scs-eyebrow {
	display: inline-block;
	margin-bottom: 14px;
	padding: 5px 14px;
	border-radius: 20px;
	background: #ff0055;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: #fff;
}

.scs-banner .subtitle {
	max-width: 680px;
	margin-left: auto;
	margin-right: auto;
}

/* ---------- Sections ---------- */

.scs {
	--scs-placeholder: #f39200;
	--scs-radius: 14px;
	--scs-ease: cubic-bezier(.2, .7, .2, 1);
}

.scs-section {
	padding: 40px 0;
	scroll-margin-top: 100px;
}

.scs-section:first-child {
	padding-top: 0;
}

.scs-section:last-of-type {
	padding-bottom: 80px;
}

/* ---------- Filters ---------- */

.scs-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 32px;
	margin-bottom: 36px;
	padding: 18px 22px;
	border: 1px solid var(--sbp-line);
	border-radius: var(--scs-radius);
	background: #fff;
}

.scs-filters[hidden] {
	display: none;
}

.scs-filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.scs-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.scs-filter-label {
	margin-right: 4px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--sbp-navy);
}

/* Every property set here: the theme styles buttons (uppercase, tall, wide letter-spacing) */
#site .scs-chip {
	flex: none;
	width: auto;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 7px 16px;
	border: 1px solid var(--sbp-line);
	border-radius: 999px;
	background: #fff;
	box-shadow: none;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	white-space: nowrap;
	color: var(--sbp-text);
	cursor: pointer;
	transition: background-color .2s, border-color .2s, color .2s;
}

#site .scs-chip:hover {
	border-color: var(--sbp-navy);
	color: var(--sbp-navy);
}

#site .scs-chip[aria-pressed="true"] {
	border-color: var(--sbp-navy);
	background: var(--sbp-navy);
	color: #fff;
}

#site .scs-chip:focus-visible {
	outline: 2px solid var(--sbp-accent);
	outline-offset: 2px;
}

.scs-count {
	margin: 0 0 0 auto;
	font-size: 14px;
}

.scs-empty {
	margin: 0;
	padding: 40px 0;
	text-align: center;
}

/* ---------- Project cards ---------- */

.scs-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px;
}

.scs-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: #fff;
	border: 1px solid #e9ebf3;
	border-radius: var(--scs-radius);
	box-shadow: 0 1px 2px rgba(25, 25, 55, .04), 0 8px 24px -12px rgba(25, 25, 55, .08);
	transition: box-shadow .35s var(--scs-ease), transform .35s var(--scs-ease), border-color .35s;
}

.scs-card[hidden] {
	display: none;
}

/* Accent line that draws across the top on hover */
.scs-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 3;
	height: 3px;
	background: var(--sbp-accent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .45s var(--scs-ease);
}

.scs-card:hover {
	border-color: transparent;
	box-shadow: 0 2px 4px rgba(25, 25, 55, .04), 0 28px 50px -16px rgba(25, 25, 55, .22);
	transform: translateY(-6px);
}

.scs-card:hover::before {
	transform: scaleX(1);
}

/* Header image, darkened towards the foot; a navy panel when there is no image */
.scs-media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: linear-gradient(135deg, #191937 0%, #2a2a5c 100%);
}

.scs-card.no-media .scs-media {
	aspect-ratio: 16 / 6;
}

.scs-media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(25, 25, 55, .35) 0%, rgba(25, 25, 55, 0) 35%, rgba(25, 25, 55, 0) 60%, rgba(25, 25, 55, .45) 100%);
	pointer-events: none;
}

#site .scs-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .7s var(--scs-ease);
}

.scs-card:hover .scs-media img {
	transform: scale(1.06);
}

.scs-badges {
	position: absolute;
	top: 16px;
	left: 16px;
	right: 16px;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.scs-badge {
	padding: 5px 11px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .92);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: .8px;
	text-transform: uppercase;
	color: var(--sbp-navy);
}

.scs-badge-client {
	background: var(--sbp-navy);
	color: #fff;
}

.scs-badge-product {
	background: var(--sbp-accent);
	color: #fff;
}

/* Body */
.scs-body {
	position: relative;
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 26px 28px 24px;
}

.scs-body.has-logo {
	padding-top: 50px;
}

.scs-logo {
	position: absolute;
	top: -30px;
	left: 28px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	padding: 10px;
	border: 1px solid #eef0f6;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 10px 24px -8px rgba(25, 25, 55, .25);
}

#site .scs-logo img {
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

#site .scs-title {
	margin: 0 0 8px;
	font-size: 1.3rem;
	font-weight: 700;
	line-height: 1.3em;
	color: var(--sbp-navy);
}

.scs-summary {
	display: -webkit-box;
	overflow: hidden;
	margin: 0 0 22px;
	font-size: 14px;
	line-height: 1.6;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

/* Problem, then what we did: two points on a short vertical line */
.scs-story {
	margin: 0;
}

.scs-step {
	position: relative;
	padding: 0 0 18px 26px;
}

.scs-step:last-child {
	padding-bottom: 0;
}

.scs-step::before {
	content: "";
	position: absolute;
	top: 4px;
	left: 0;
	box-sizing: border-box;
	width: 12px;
	height: 12px;
	border: 2px solid var(--sbp-accent);
	border-radius: 50%;
	background: #fff;
}

.scs-step-work::before {
	background: var(--sbp-accent);
}

.scs-step:not(:last-child)::after {
	content: "";
	position: absolute;
	top: 20px;
	bottom: 2px;
	left: 5px;
	width: 2px;
	border-radius: 2px;
	background: linear-gradient(var(--sbp-accent), rgba(255, 0, 85, .15));
}

.scs-story dt {
	margin-bottom: 4px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--sbp-navy);
}

.scs-story dd {
	margin: 0;
	font-size: 14.5px;
	line-height: 1.6;
}

.scs-services {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: auto 0 0;
	padding: 22px 0 0;
	list-style: none;
}

.scs-services li {
	margin: 0;
	padding: 4px 10px;
	border-radius: 6px;
	background: #f4f4f9;
	font-size: 12px;
	font-weight: 500;
	list-style: none;
	color: var(--sbp-navy);
}

/* Result band at the foot of the card; placeholders (editors only) in orange */
.scs-results {
	padding: 18px 28px 20px;
	background: var(--sbp-navy);
	background-image: radial-gradient(120% 140% at 100% 0%, rgba(255, 0, 85, .28) 0%, rgba(255, 0, 85, 0) 55%);
	color: rgba(255, 255, 255, .75);
}

.scs-results-label {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 8px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .6);
}

.scs-results-label::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--sbp-accent);
}

.scs-results ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.scs-results li {
	margin: 0;
	font-size: 13px;
	line-height: 1.4;
	list-style: none;
}

.scs-results li span {
	display: block;
	margin-top: 4px;
}

.scs-results strong {
	display: block;
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -.5px;
	color: #fff;
}

.scs-results.is-placeholder {
	border-top: 2px dashed var(--scs-placeholder);
	background: #fff6eb;
}

.scs-results.is-placeholder .scs-results-label,
.scs-results.is-placeholder strong,
.scs-results.is-placeholder span {
	color: var(--scs-placeholder);
}

.scs-results.is-placeholder .scs-results-label::before {
	background: var(--scs-placeholder);
}

/* ---------- Note to editors (logged-in only) ---------- */

.scs-editor-note {
	margin: 0 0 24px;
	padding: 10px 16px;
	border-left: 3px solid var(--scs-placeholder);
	background: #fff6eb;
	font-size: 13px;
	color: #8a5200;
}

@media (max-width: 1100px) {
	.scs-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 700px) {
	.scs-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 22px;
	}

	.scs-section {
		padding: 25px 0;
	}

	.scs-section:last-of-type {
		padding-bottom: 50px;
	}

	/* Filters: label on its own line, chips in one row that scrolls sideways */
	.scs-filters {
		display: block;
		padding: 16px 0 14px;
	}

	.scs-filter {
		display: block;
	}

	.scs-filter + .scs-filter {
		margin-top: 14px;
	}

	.scs-filter-label {
		display: block;
		margin: 0 16px 8px;
		font-size: 11px;
	}

	.scs-chips {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding: 0 16px 4px;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.scs-chips::-webkit-scrollbar {
		display: none;
	}

	.scs-count {
		margin: 12px 16px 0;
		font-size: 13px;
	}

	.scs-body {
		padding: 22px 22px 20px;
	}

	.scs-body.has-logo {
		padding-top: 46px;
	}

	.scs-logo {
		left: 22px;
	}

	.scs-results {
		padding: 16px 22px 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.scs-card,
	.scs-card::before,
	#site .scs-media img {
		transition: none;
	}

	.scs-card:hover,
	.scs-card:hover .scs-media img {
		transform: none;
	}
}
