/* Emailwish Case Studies — portfolio layout */

.ew-cs {
	--ew-cs-bg: #f3f3f1;
	--ew-cs-ink: #111111;
	--ew-cs-muted: #6b6b6b;
	--ew-cs-card: #ffffff;
	--ew-cs-line: #e6e6e3;
	--ew-cs-radius: 22px;
	--ew-cs-pill: 999px;
	font-family: Afacad, "Segoe UI", sans-serif;
	color: var(--ew-cs-ink);
	background: var(--ew-cs-bg);
}

.ew-cs *,
.ew-cs *::before,
.ew-cs *::after {
	box-sizing: border-box;
}

.ew-cs a {
	color: inherit;
}

.ew-cs-wrap {
	width: min(1120px, calc(100% - 40px));
	margin: 0 auto;
}

/* —— Archive hub —— */
.ew-cs-hub {
	padding: 72px 0 96px;
	background: var(--ew-cs-bg);
}

.ew-cs-hub {
	--ew-cs-bg: #f6f5f3;
	--ew-cs-panel: #fbfaf8;
	--ew-cs-line: #ebe8e4;
}

.ew-cs-hub .ew-cs-wrap {
	width: min(1240px, calc(100% - 40px));
}

.ew-cs-hub__hero {
	display: grid;
	grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.9fr) minmax(0, 1fr);
	gap: 22px;
	align-items: stretch;
	padding: 34px 22px 34px 40px;
	margin-bottom: 26px;
	overflow: hidden;
	background: var(--ew-cs-panel);
	border: 1px solid var(--ew-cs-line);
	border-radius: var(--ew-cs-radius);
}

.ew-cs-hub__intro {
	align-self: center;
	padding: 18px 8px 18px 0;
}

.ew-cs-hub__eyebrow {
	display: inline-block;
	margin: 0 0 22px;
	padding: 6px 14px;
	border-radius: var(--ew-cs-pill);
	background: #f1e6de;
	color: #3d3530;
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-weight: 600;
}

.ew-cs-hub__title {
	margin: 0 0 18px;
	font-size: clamp(2.1rem, 3.5vw, 3rem);
	line-height: 1.06;
	letter-spacing: -0.035em;
	font-weight: 700;
}

.ew-cs-hub__lede {
	margin: 0 0 26px;
	max-width: 26em;
	font-size: 1.06rem;
	line-height: 1.5;
	color: var(--ew-cs-muted);
}

.ew-cs-hub__trust {
	display: flex;
	align-items: center;
	gap: 14px;
	font-size: 0.95rem;
	color: var(--ew-cs-muted);
}

.ew-cs-hub__trust img {
	width: 117px;
	height: auto;
	flex: none;
}

.ew-cs-hub__photo {
	position: relative;
	min-height: 300px;
}

.ew-cs-hub__photo > img {
	position: absolute;
	inset: 4% 6% 9% 8%;
	width: 86%;
	height: 87%;
	object-fit: cover;
	object-position: 58% 30%;
	border-radius: 18px;
	box-shadow: 0 18px 40px rgba(40, 30, 20, 0.14);
	transform: rotate(4deg);
}

.ew-cs-hub__notice {
	position: absolute;
	left: -70px;
	top: 50%;
	width: 196px;
	padding: 12px;
	transform: translateY(-30%) rotate(-5deg);
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 14px 36px rgba(40, 30, 20, 0.14);
	font-size: 12px;
	line-height: 1.35;
	color: #222;
}

.ew-cs-hub__notice-top {
	display: flex;
	align-items: center;
	gap: 7px;
	margin-bottom: 10px;
	font-weight: 600;
	color: #111;
}

.ew-cs-hub__notice-top svg:first-child {
	color: #6d4cd8;
}

.ew-cs-hub__notice-top i {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #22b55f;
}

.ew-cs-hub__chev {
	margin-left: auto;
	color: #888;
}

.ew-cs-hub__notice-item {
	display: flex;
	gap: 10px;
	margin-bottom: 10px;
	color: var(--ew-cs-muted);
}

.ew-cs-hub__notice-item strong {
	display: block;
	margin-bottom: 2px;
	color: #111;
	font-weight: 600;
}

.ew-cs-hub__thumb {
	display: grid;
	place-items: center;
	flex: none;
	width: 40px;
	height: 44px;
	border-radius: 8px;
	background: #f6e9df;
}

.ew-cs-hub__notice-btn {
	display: block;
	padding: 8px 0;
	border-radius: 8px;
	background: #111;
	color: #fff;
	text-align: center;
	font-weight: 600;
}

.ew-cs-hub__chart {
	align-self: center;
	margin-right: -48px;
	padding: 10px 6px 10px 12px;
	background: #fff;
	border: 1px solid var(--ew-cs-line);
	border-radius: 18px;
	box-shadow: 0 18px 40px rgba(40, 30, 20, 0.08);
}

.ew-cs-hub__chart img {
	display: block;
	width: 100%;
	height: auto;
}

.ew-cs-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 26px;
}

.ew-cs-card {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
	gap: 16px;
	min-height: 300px;
	padding: 14px;
	background: var(--ew-cs-card);
	border: 1px solid var(--ew-cs-line);
	border-radius: var(--ew-cs-radius);
	text-decoration: none;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ew-cs-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 14px 34px rgba(0, 0, 0, 0.06);
}

.ew-cs-grid > .ew-cs-card:last-child:nth-child(odd) {
	grid-column: 1 / -1;
	grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}

.ew-cs-card__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding: 18px 4px 12px 18px;
}

.ew-cs-card__client {
	margin-bottom: 18px;
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #3d3530;
	font-weight: 600;
}

.ew-cs-card__title {
	margin: 0 0 12px;
	font-size: clamp(1.6rem, 2.3vw, 1.95rem);
	line-height: 1.12;
	letter-spacing: -0.03em;
	font-weight: 700;
}

.ew-cs-card__result {
	margin: 0 0 24px;
	font-size: 0.98rem;
	line-height: 1.5;
	color: var(--ew-cs-muted);
}

.ew-cs-card__btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: auto;
	padding: 11px 20px;
	border-radius: 8px;
	background: #111;
	color: #fff;
	font-size: 0.95rem;
	font-weight: 600;
	transition: opacity 0.2s ease;
}

.ew-cs-card:hover .ew-cs-card__btn {
	opacity: 0.88;
}

.ew-cs-card__media {
	position: relative;
	min-height: 240px;
	border-radius: 16px;
	background: #ecece8;
	overflow: hidden;
}

.ew-cs-card__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* —— Single —— */
.ew-cs-single {
	background: var(--ew-cs-bg);
	padding: 56px 0 88px;
}

.ew-cs-hero {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
	gap: 48px;
	align-items: center;
	margin-bottom: 36px;
}

.ew-cs-hero__title {
	margin: 0 0 16px;
	font-size: clamp(2rem, 4.2vw, 3.25rem);
	line-height: 1.08;
	letter-spacing: -0.035em;
	font-weight: 700;
}

.ew-cs-hero__summary {
	margin: 0 0 28px;
	font-size: 1.05rem;
	line-height: 1.55;
	color: var(--ew-cs-muted);
	max-width: 36em;
}

.ew-cs-meta {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px;
	margin: 0 0 28px;
}

.ew-cs-meta__label {
	display: block;
	margin-bottom: 6px;
	font-size: 12px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ew-cs-muted);
	font-weight: 700;
}

.ew-cs-meta__value {
	margin: 0;
	font-size: 0.98rem;
	line-height: 1.4;
	font-weight: 600;
}

.ew-cs-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.ew-cs-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 22px;
	border-radius: var(--ew-cs-pill);
	background: #111;
	color: #fff !important;
	text-decoration: none !important;
	font-size: 0.95rem;
	font-weight: 600;
	border: none;
	transition: opacity 0.2s ease;
}

.ew-cs-cta:hover {
	opacity: 0.88;
}

.ew-cs-share {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 10px;
	border-radius: var(--ew-cs-pill);
	background: #fff;
	border: 1px solid var(--ew-cs-line);
}

.ew-cs-share a {
	display: inline-flex;
	width: 34px;
	height: 34px;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: #222;
	text-decoration: none;
}

.ew-cs-share a:hover {
	background: #f0f0ee;
}

.ew-cs-share svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

.ew-cs-hero__visual {
	background: var(--ew-cs-card);
	border-radius: var(--ew-cs-radius);
	padding: 18px;
	border: 1px solid var(--ew-cs-line);
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.04);
}

.ew-cs-hero__visual-inner {
	border-radius: 14px;
	overflow: hidden;
	background: #ecece8;
	aspect-ratio: 1 / 1;
}

.ew-cs-hero__visual img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 35%;
	display: block;
}

.ew-cs-panel {
	background: var(--ew-cs-card);
	border-radius: var(--ew-cs-radius);
	border: 1px solid var(--ew-cs-line);
	padding: clamp(28px, 4vw, 48px);
	margin-top: 22px;
}

.ew-cs-panel__top {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 18px;
	margin-bottom: 22px;
	font-size: 12px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ew-cs-muted);
	font-weight: 700;
}

.ew-cs-content {
	font-size: 1.05rem;
	line-height: 1.65;
	color: #222;
}

.ew-cs-content > *:first-child {
	margin-top: 0;
}

.ew-cs-content h2,
.ew-cs-content h3 {
	letter-spacing: -0.02em;
	line-height: 1.2;
	margin: 1.6em 0 0.55em;
}

.ew-cs-content p {
	margin: 0 0 1em;
}

.ew-cs-content img {
	max-width: 100%;
	height: auto;
	border-radius: 14px;
}

.ew-cs-content ul,
.ew-cs-content ol {
	padding-left: 1.2em;
	margin: 0 0 1em;
}

.ew-cs-back {
	display: inline-flex;
	margin-bottom: 28px;
	font-size: 0.95rem;
	color: var(--ew-cs-muted);
	text-decoration: none;
}

.ew-cs-back:hover {
	color: var(--ew-cs-ink);
	text-decoration: underline;
}

@media (max-width: 1080px) {
	.ew-cs-hub__hero {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		padding: 32px;
	}

	.ew-cs-hub__intro {
		grid-column: 1 / -1;
		padding: 0;
	}

	.ew-cs-hub__photo {
		min-height: 340px;
	}

	.ew-cs-hub__notice {
		left: 6px;
		top: auto;
		bottom: 18px;
		transform: rotate(-5deg);
	}
}

@media (max-width: 900px) {
	.ew-cs-hero {
		grid-template-columns: 1fr;
		gap: 28px;
	}

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

	.ew-cs-grid > .ew-cs-card:last-child:nth-child(odd) {
		grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
	}
}

@media (max-width: 640px) {
	.ew-cs-hub {
		padding: 32px 0 64px;
	}

	.ew-cs-hub__hero {
		grid-template-columns: 1fr;
		padding: 24px 18px 18px;
	}

	.ew-cs-hub__photo {
		min-height: 380px;
	}

	.ew-cs-hub__chart {
		margin-right: 0;
	}

	.ew-cs-card,
	.ew-cs-grid > .ew-cs-card:last-child:nth-child(odd) {
		grid-template-columns: 1fr;
	}

	.ew-cs-card__body {
		padding: 12px 6px 4px;
	}

	.ew-cs-card__media {
		min-height: 0;
		aspect-ratio: 4 / 3;
	}

	.ew-cs-meta {
		grid-template-columns: 1fr 1fr;
		gap: 14px;
	}

	.ew-cs-hero__visual {
		padding: 12px;
	}
}

/* Soften theme chrome on these pages */
body.ew-case-studies-archive .keydesign-page-title,
body.ew-case-study-single .keydesign-page-title,
body.ew-case-studies-archive .entry-header,
body.ew-case-study-single .entry-header {
	display: none !important;
}

body.ew-case-studies-archive #content,
body.ew-case-study-single #content,
body.ew-case-studies-archive .site-content,
body.ew-case-study-single .site-content {
	padding-top: 0;
}
