/* ═══════════════════════════════════════════════════════════════════════════
   CASE STUDY — SINGLE PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

/* Hide stray wpautop <p> injected between block template parts */
.wp-site-blocks > p {
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
	height: 0 !important;
}

.wp-block-shortcode {
	display: block;
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* Remove WP's auto padding-top (added for sticky headers) so the hero sits
   flush against the nav bar for all visitors, logged in or out. */
.single-case-studies .wp-site-blocks,
.single-case-studies .wp-site-blocks > .wp-block-template-part,
.single-case-studies .wp-block-shortcode,
.single-case-studies .wp-block-shortcode > p:first-child {
	padding-top: 0 !important;
	margin-top: 0 !important;
}

.single-case-studies .wp-site-blocks {
	gap: 0 !important;
}

/* Pull the hero up to cover any remaining gap from WP's sticky-header offset */
.single-case-studies .ci-cs-hero {
	margin-top: -55px;
}

.admin-bar.single-case-studies .ci-cs-hero {
	margin-top: calc(-55px + 32px);
}

@media (max-width: 1089px) {
	.single-case-studies .ci-cs-hero {
		margin-top: -64px;
	}

	.admin-bar.single-case-studies .ci-cs-hero {
		margin-top: calc(-64px + 46px);
	}
}

/* ── Hero (photo only) ───────────────────────────────────────────────────── */

.ci-cs-hero {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 5.25;
	overflow: visible; /* badge hangs below into title bar */
	background-color: #253d47;
	margin-top: 0;
}

/* Clip wrapper — image + overlay stay inside the photo bounds */
/* border-bottom creates the 0.3rem white gap consistent with split sections */
.ci-cs-hero__clip {
	position: absolute;
	inset: 0;
	overflow: hidden;
	border-bottom: 0.3rem solid #ffffff;
}

.ci-cs-hero__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	display: block;
}

.ci-cs-hero__placeholder {
	position: absolute;
	inset: 0;
	background-color: #d8d8d8;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ci-cs-hero__placeholder::after {
	content: 'Image coming soon';
	font-family: var(--ci-font-primary);
	font-size: 1rem;
	font-weight: 600;
	color: #999999;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

/* Subtle vignette — keeps tags readable, not a title-holding gradient */
.ci-cs-hero__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to bottom,
		transparent            0%,
		rgba(10, 20, 30, 0.15) 60%,
		rgba(10, 20, 30, 0.45) 100%
	);
}

/* Tag pills — sit in the navy title bar (rendered there in PHP) */
.ci-cs-hero__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1rem;
}

.ci-cs-hero__tag {
	display: inline-block;
	padding: 0.4rem 1.1rem;
	border-radius: 9999px;
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.35);
	color: #ffffff;
	font-family: var(--ci-font-primary);
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1;
}

/* Badge wrap — sits at the hero bottom, badge straddles into title bar */
.ci-cs-hero__badge-wrap {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	transform: translateY(50%);
	z-index: 3;
}

.ci-cs-hero__badge {
	width: 260px;
	height: 260px;
	border-radius: 50%;
	overflow: hidden;
	background: #ffffff;
	border: 0.3rem solid #ffffff;
	box-shadow: 0 6px 28px rgba(0, 0, 0, 0.3);
	display: flex;
	align-items: center;
	justify-content: center;
}

.ci-cs-hero__badge img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.ci-cs-hero__badge--empty {
	background: #e0e0e0;
}

/* ── Title bar (dark navy, below hero) ───────────────────────────────────── */

.ci-cs-title-bar {
	background-color: #253d47;
	/* Top padding: half badge height (260/2 = 130px) + breathing room */
	padding: calc(130px + 1.25rem) 0 2.5rem;
	position: relative;
}

.ci-cs-title-bar__title {
	font-family: var(--ci-font-primary);
	font-size: clamp(1.75rem, 3.5vw, 3rem);
	font-weight: 700;
	line-height: 1.15;
	color: #ffffff;
	margin: 0;
}

/* Container needs relative positioning so tags align to its right edge */
.ci-cs-title-bar .site-container {
	position: relative;
}

/* Tags — top-right of the container, at badge level */
.ci-cs-title-bar .ci-cs-hero__tags {
	position: absolute;
	top: calc(-130px / 2 - 1rem); /* up from the content area, at badge mid-line */
	right: 0;
	margin-top: 0;
	justify-content: flex-end;
}

.ci-cs-title-bar .ci-cs-hero__tag {
	font-size: 1rem;
	padding: 0.6rem 1.5rem;
	background: rgba(255, 255, 255, 0.12);
	border-color: rgba(255, 255, 255, 0.3);
}

/* Cycle through brand-accent colours matching the mockup */
.ci-cs-title-bar .ci-cs-hero__tag:nth-child(1) {
	background: #7B6FBE;
	border-color: #7B6FBE;
}

.ci-cs-title-bar .ci-cs-hero__tag:nth-child(2) {
	background: #2E8B6E;
	border-color: #2E8B6E;
}

.ci-cs-title-bar .ci-cs-hero__tag:nth-child(3) {
	background: #c6a54e;
	border-color: #c6a54e;
}

.ci-cs-title-bar .ci-cs-hero__tag:nth-child(n+4) {
	background: rgba(255, 255, 255, 0.15);
	border-color: rgba(255, 255, 255, 0.35);
}

/* ── Intro body ──────────────────────────────────────────────────────────── */

.ci-cs-intro {
	background-color: #253d47;
	padding: 0 0 2.75rem;
}

.ci-cs-intro__body {
	font-family: var(--ci-font-primary);
	font-size: 1.0625rem;
	line-height: 1.8;
	color: rgba(255, 255, 255, 0.85);
}

.ci-cs-intro__body p {
	margin: 0 0 1rem;
}

.ci-cs-intro__body strong {
	color: #ffffff;
}

/* ── Content sections ────────────────────────────────────────────────────── */

.ci-cs-section {
	padding: 3rem 0;
	background-color: var(--ci-color-white);
	border-top: 1px solid #e8e8e8;
}

.ci-cs-section__inner {
	width: 100%;
}

.ci-cs-section__title {
	font-family: var(--ci-font-primary);
	font-size: clamp(1.6rem, 2.4vw, 2.4rem);
	font-weight: 700;
	color: #c6a54e;
	margin: 0 0 1rem;
	line-height: 1.25;
}

.ci-cs-section__body {
	font-family: var(--ci-font-primary);
	font-size: 1.0625rem;
	line-height: 1.8;
	color: #333333;
}

.ci-cs-section__body p {
	margin: 0 0 1.25rem;
}

.ci-cs-section__body ul,
.ci-cs-section__body ol {
	margin: 0 0 1.25rem 1.5rem;
	padding: 0;
}

.ci-cs-section__body li {
	margin-bottom: 0.4rem;
}

.ci-cs-section__body strong {
	font-weight: 700;
	color: #253d47;
}

/* ── Full width mid-page image ───────────────────────────────────────────── */

.ci-cs-mid-image {
	width: 100%;
	aspect-ratio: 16 / 4;
	overflow: hidden;
}

.ci-cs-mid-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ci-cs-mid-image--placeholder {
	background: linear-gradient(135deg, #d8d8d8 0%, #e8e8e8 100%);
}

/* ── CTA block ───────────────────────────────────────────────────────────── */

.ci-cs-cta {
	background-color: #751a3b;
	padding: 3.5rem 0;
	text-align: center;
}

.ci-cs-cta__title {
	font-family: var(--ci-font-primary);
	font-size: clamp(1.5rem, 2.5vw, 2.2rem);
	font-weight: 700;
	line-height: 1.25;
	color: #ffffff;
	margin: 0 auto 1rem;
	max-width: 680px;
}

.ci-cs-cta__body {
	font-family: var(--ci-font-primary);
	font-size: 1.0625rem;
	line-height: 1.7;
	color: rgba(255, 255, 255, 0.8);
	margin: 0 auto 2rem;
	max-width: 600px;
}

.ci-cs-cta__buttons {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1.5rem;
	flex-wrap: wrap;
}

.ci-cs-cta__btn {
	background-color: #ffffff;
	color: #751a3b;
}

.ci-cs-cta__btn:hover {
	background-color: rgba(255, 255, 255, 0.9);
	color: #751a3b;
}

.ci-cs-cta__link {
	font-family: var(--ci-font-primary);
	font-size: 0.9375rem;
	color: rgba(255, 255, 255, 0.7);
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.15s ease;
}

.ci-cs-cta__link:hover {
	color: #ffffff;
}

/* ── Testimonials ────────────────────────────────────────────────────────── */

.ci-cs-testimonials {
	padding: 3.5rem 0;
	background-color: #253d47;
}

.ci-cs-testimonials__heading {
	font-family: var(--ci-font-primary);
	font-size: clamp(1.3rem, 2vw, 1.75rem);
	font-weight: 700;
	color: #c6a54e;
	text-align: center;
	margin: 0 0 2.25rem;
	line-height: 1.2;
}

/* wpautop injects a <br> between name and school spans — suppress it */
.ci-cs-testimonials__attribution br {
	display: none;
}

.ci-cs-testimonials__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 1.5rem;
}

.ci-cs-testimonials__card {
	position: relative;
	overflow: hidden;
	border-radius: 24px;
	padding: 1.75rem;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;

	/* Same grey frosted glass as home page */
	background: rgba(180, 180, 180, 0.22);
	backdrop-filter: blur(24px) saturate(80%) brightness(0.95);
	-webkit-backdrop-filter: blur(24px) saturate(80%) brightness(0.95);
	border: 1px solid rgba(255, 255, 255, 0.18);
	box-shadow:
		0 8px 32px rgba(0, 0, 0, 0.30),
		inset 0 1px 0 rgba(255, 255, 255, 0.40);
}

.ci-cs-testimonials__card::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(
		145deg,
		rgba(255, 255, 255, 0.08) 0%,
		rgba(255, 255, 255, 0.00) 50%
	);
	pointer-events: none;
	z-index: 0;
}

.ci-cs-testimonials__card > * {
	position: relative;
	z-index: 1;
}

.ci-cs-testimonials__header {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.ci-cs-testimonials__logo {
	flex-shrink: 0;
	width: 68px;
	height: 68px;
	border-radius: 10px;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid rgba(255, 255, 255, 0.35);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.80);
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}

.ci-cs-testimonials__logo img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

.ci-cs-testimonials__attribution {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	align-self: center;
}

.ci-cs-testimonials__name {
	font-family: var(--ci-font-primary);
	font-size: 0.875rem;
	font-weight: 700;
	color: #ffffff;
	line-height: 1.3;
}

.ci-cs-testimonials__school {
	font-family: var(--ci-font-primary);
	font-size: 0.8rem;
	font-weight: 400;
	color: rgba(255, 255, 255, 0.60);
	line-height: 1.3;
}

.ci-cs-testimonials__quote {
	font-family: var(--ci-font-primary);
	font-size: 0.95rem;
	font-style: normal;
	line-height: 1.75;
	color: rgba(255, 255, 255, 0.90);
	margin: 0;
	padding-top: 1.25rem;
	border-top: 1px solid rgba(255, 255, 255, 0.14);
}

/* ── Pull quote panel ────────────────────────────────────────────────────── */

.ci-cs-pull-quote {
	background-color: #253d47;
	padding: 3.5rem 0;
}

.ci-cs-pull-quote__inner {
	max-width: 780px;
	margin: 0 auto;
	padding: 0 1.5rem;
	text-align: center;
}

.ci-cs-pull-quote__mark {
	font-family: Georgia, serif;
	font-size: 5rem;
	line-height: 0.8;
	color: #c6a54e;
	margin-bottom: 1rem;
	display: block;
	opacity: 0.9;
}

.ci-cs-pull-quote__text {
	font-family: var(--ci-font-primary);
	font-size: clamp(1.1rem, 2vw, 1.4rem);
	font-style: italic;
	font-weight: 400;
	line-height: 1.75;
	color: rgba(255, 255, 255, 0.92);
	margin: 0 0 1.25rem;
	border: none;
	padding: 0;
	background: none;
}

.ci-cs-pull-quote__attr {
	font-family: var(--ci-font-primary);
	font-size: 0.9375rem;
	color: rgba(255, 255, 255, 0.5);
	margin: 0;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 767px) {

	.ci-cs-hero {
		aspect-ratio: 4 / 2.25;
	}

	.ci-cs-hero__badge {
		width: 160px;
		height: 160px;
	}

	.ci-cs-title-bar {
		padding-top: calc(80px + 1rem); /* half of 160px badge */
	}

	.ci-cs-title-bar__title {
		font-size: clamp(1.5rem, 5vw, 2.2rem);
	}

	.ci-cs-title-bar .ci-cs-hero__tags {
		top: calc(-80px / 2 - 0.75rem);
		right: 0;
	}

	.ci-cs-title-bar .ci-cs-hero__tag {
		font-size: 0.875rem;
		padding: 0.5rem 1.1rem;
	}

	.ci-cs-section {
		padding: 2rem 0;
	}

	.ci-cs-section__body {
		font-size: 1rem;
	}

	.ci-cs-mid-image {
		aspect-ratio: 16 / 7;
	}

	.ci-cs-testimonials {
		padding: 2.5rem 0;
	}

	.ci-cs-testimonials__grid {
		grid-template-columns: 1fr;
	}

	.ci-cs-testimonials__card {
		padding: 1.25rem;
	}

	.ci-cs-testimonials__logo {
		width: 52px;
		height: 52px;
	}

	.ci-cs-pull-quote {
		padding: 2.5rem 0;
	}

	.ci-cs-pull-quote__mark {
		font-size: 3.5rem;
	}

	.ci-cs-cta {
		padding: 2.5rem 0;
		text-align: left;
	}

	.ci-cs-cta__title {
		font-size: clamp(1.3rem, 5vw, 1.8rem);
		margin-left: 0;
		margin-right: 0;
	}

	.ci-cs-cta__body {
		margin-left: 0;
		margin-right: 0;
	}

	.ci-cs-cta__buttons {
		justify-content: flex-start;
	}
}
