/**
 * CloudPe Case Studies — frontend stylesheet.
 *
 * Statically compiled utility CSS covering exactly the class names used in
 * templates/*.php and templates/partials/*.php (verified against the
 * source — see the plugin's dev notes). This replaces an earlier build
 * that loaded the Tailwind Play CDN at runtime; that CDN is explicitly
 * documented by Tailwind as unsuitable for production (it ships the full
 * JIT compiler to the browser and recompiles on every page load, plus an
 * external network dependency that becomes a single point of failure).
 * Shipping the compiled result as a small static file instead removes
 * that dependency, removes the runtime compile cost, and is fully
 * cacheable by a browser or CDN like any other static asset.
 *
 * Design tokens (CSS custom properties + @font-face) are a 1:1 copy of
 * cloudpe-astro's src/styles/global.css (light mode only — this plugin's
 * frontend has no theme dark-mode toggle to key off of).
 */

@font-face {
	font-family: 'GT-America';
	src: url('../fonts/GT-America-Regular.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'GT-America';
	src: url('../fonts/GT-America-Medium.woff2') format('woff2');
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'GT-America';
	src: url('../fonts/GT-America-Bold.woff2') format('woff2');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Aeonik Fono';
	src: url('../fonts/AeonikFono-Regular.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Aeonik Fono';
	src: url('../fonts/AeonikFono-Medium.woff2') format('woff2');
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Aeonik Fono';
	src: url('../fonts/AeonikFono-Bold.woff2') format('woff2');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

.ccs-page {
	--background: 0 0% 98%;
	--foreground: 231 68% 5%;
	--card: 0 0% 100%;
	--primary: 258 83% 63%;
	--primary-foreground: 0 0% 100%;
	--muted: 220 14% 96%;
	--muted-foreground: 220 10% 46%;
	--border: 220 13% 91%;

	background: hsl(var(--background));
	color: hsl(var(--foreground));
	font-family: 'Aeonik Fono', system-ui, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}
.ccs-page *,
.ccs-page *::before,
.ccs-page *::after {
	box-sizing: border-box;
	border-color: hsl(var(--border));
}
.ccs-page a {
	color: inherit;
	text-decoration: none;
}
.ccs-page svg {
	display: inline-block;
	vertical-align: middle;
}
.ccs-page button {
	font: inherit;
	cursor: pointer;
	background: none;
	border: none;
	padding: 0;
}
.ccs-page input {
	font: inherit;
}

/* ===================== Layout / box model ===================== */
.ccs-page .relative { position: relative; }
.ccs-page .absolute { position: absolute; }
.ccs-page .fixed { position: fixed; }
.ccs-page .inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.ccs-page .top-4 { top: 16px; }
.ccs-page .right-4 { right: 16px; }
.ccs-page .z-\[100\] { z-index: 100; }
.ccs-page .overflow-hidden { overflow: hidden; }
.ccs-page .block { display: block; }
.ccs-page .inline-flex { display: inline-flex; }
.ccs-page .flex { display: flex; }
.ccs-page .grid { display: grid; }
.ccs-page .hidden { display: none; }
.ccs-page .flex-col { flex-direction: column; }
.ccs-page .flex-wrap { flex-wrap: wrap; }
.ccs-page .flex-shrink-0 { flex-shrink: 0; }
.ccs-page .items-center { align-items: center; }
.ccs-page .justify-between { justify-content: space-between; }
.ccs-page .justify-center { justify-content: center; }
.ccs-page .min-w-0 { min-width: 0; }
.ccs-page .min-h-screen { min-height: 100vh; }
.ccs-page .w-full { width: 100%; }
.ccs-page .mx-auto { margin-left: auto; margin-right: auto; }
.ccs-page .mt-auto { margin-top: auto; }
.ccs-page .max-w-2xl { max-width: 42rem; }
.ccs-page .max-w-4xl { max-width: 56rem; }
.ccs-page .max-w-7xl { max-width: 80rem; }
.ccs-page .max-w-md { max-width: 28rem; }
.ccs-page .max-w-xl { max-width: 36rem; }
.ccs-page .max-w-none { max-width: none; }

.ccs-page .grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.ccs-page .grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 640px) {
	.ccs-page .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Gap / spacing (4px-grid + Tailwind's default 0.5 step scale) */
.ccs-page .gap-1\.5 { gap: 6px; }
.ccs-page .gap-2 { gap: 8px; }
.ccs-page .gap-3 { gap: 12px; }
.ccs-page .gap-4 { gap: 16px; }
.ccs-page .gap-6 { gap: 24px; }
.ccs-page .space-y-3 > * + * { margin-top: 12px; }

.ccs-page .p-4 { padding: 16px; }
.ccs-page .p-6 { padding: 24px; }
.ccs-page .p-8 { padding: 32px; }
.ccs-page .px-2\.5 { padding-left: 10px; padding-right: 10px; }
.ccs-page .px-3 { padding-left: 12px; padding-right: 12px; }
.ccs-page .px-4 { padding-left: 16px; padding-right: 16px; }
.ccs-page .px-5 { padding-left: 20px; padding-right: 20px; }
.ccs-page .px-6 { padding-left: 24px; padding-right: 24px; }
.ccs-page .py-1 { padding-top: 4px; padding-bottom: 4px; }
.ccs-page .py-1\.5 { padding-top: 6px; padding-bottom: 6px; }
.ccs-page .py-3 { padding-top: 12px; padding-bottom: 12px; }
.ccs-page .py-10 { padding-top: 40px; padding-bottom: 40px; }
.ccs-page .py-12 { padding-top: 48px; padding-bottom: 48px; }
.ccs-page .py-14 { padding-top: 56px; padding-bottom: 56px; }
.ccs-page .py-16 { padding-top: 64px; padding-bottom: 64px; }
.ccs-page .pt-5 { padding-top: 20px; }
.ccs-page .pt-6 { padding-top: 24px; }
.ccs-page .pt-8 { padding-top: 32px; }
.ccs-page .pr-8 { padding-right: 32px; }
.ccs-page .pb-2 { padding-bottom: 8px; }
@media (min-width: 640px) {
	.ccs-page .sm\:p-7 { padding: 28px; }
	.ccs-page .sm\:p-8 { padding: 32px; }
	.ccs-page .sm\:py-20 { padding-top: 80px; padding-bottom: 80px; }
}

.ccs-page .mb-2 { margin-bottom: 8px; }
.ccs-page .mb-4 { margin-bottom: 16px; }
.ccs-page .mb-5 { margin-bottom: 20px; }
.ccs-page .mt-1 { margin-top: 4px; }
.ccs-page .mt-1\.5 { margin-top: 6px; }
.ccs-page .mt-2 { margin-top: 8px; }
.ccs-page .mt-3 { margin-top: 12px; }
.ccs-page .mt-4 { margin-top: 16px; }
.ccs-page .mt-5 { margin-top: 20px; }
.ccs-page .mt-6 { margin-top: 24px; }
.ccs-page .mt-8 { margin-top: 32px; }
.ccs-page .mt-10 { margin-top: 40px; }
.ccs-page .mt-12 { margin-top: 48px; }
.ccs-page .mt-14 { margin-top: 56px; }

.ccs-page .w-3 { width: 12px; }
.ccs-page .w-3\.5 { width: 14px; }
.ccs-page .w-4 { width: 16px; }
.ccs-page .w-5 { width: 20px; }
.ccs-page .w-8 { width: 32px; }
.ccs-page .h-3 { height: 12px; }
.ccs-page .h-3\.5 { height: 14px; }
.ccs-page .h-4 { height: 16px; }
.ccs-page .h-5 { height: 20px; }
.ccs-page .h-8 { height: 32px; }

/* ===================== Borders / radius / shadow ===================== */
.ccs-page .border { border-width: 1px; border-style: solid; }
.ccs-page .border-t { border-top-width: 1px; border-top-style: solid; }
.ccs-page .border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.ccs-page .border-border { border-color: hsl(var(--border)); }
.ccs-page .border-primary\/20 { border-color: hsl(var(--primary) / 0.2); }

.ccs-page .rounded-full { border-radius: 9999px; }
.ccs-page .rounded-2xl { border-radius: 16px; }
.ccs-page .rounded-xl { border-radius: 12px; }
.ccs-page .rounded-lg { border-radius: 8px; }
.ccs-page .rounded-md { border-radius: 6px; }

.ccs-page .shadow-2xl { box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25); }
.ccs-page .backdrop-blur-sm { backdrop-filter: blur(4px); }

/* ===================== Colors ===================== */
.ccs-page .bg-background { background-color: hsl(var(--background)); }
.ccs-page .bg-card { background-color: hsl(var(--card)); }
.ccs-page .bg-muted { background-color: hsl(var(--muted)); }
.ccs-page .bg-muted\/20 { background-color: hsl(var(--muted) / 0.2); }
.ccs-page .bg-primary { background-color: hsl(var(--primary)); }
.ccs-page .bg-primary\/5 { background-color: hsl(var(--primary) / 0.05); }
.ccs-page .bg-primary\/10 { background-color: hsl(var(--primary) / 0.1); }
.ccs-page .bg-black\/70 { background-color: rgb(0 0 0 / 0.7); }

.ccs-page .text-foreground { color: hsl(var(--foreground)); }
.ccs-page .text-foreground\/80 { color: hsl(var(--foreground) / 0.8); }
.ccs-page .text-muted-foreground { color: hsl(var(--muted-foreground)); }
.ccs-page .text-muted-foreground\/80 { color: hsl(var(--muted-foreground) / 0.8); }
.ccs-page .text-primary { color: hsl(var(--primary)); }
.ccs-page .text-primary-foreground { color: hsl(var(--primary-foreground)); }
.ccs-page .text-red-500 { color: #ef4444; }

/* ===================== Typography ===================== */
.ccs-page .font-aeonik { font-family: 'Aeonik Fono', system-ui, sans-serif; }
.ccs-page .font-gt-america { font-family: 'GT-America', system-ui, sans-serif; }
.ccs-page .font-medium { font-weight: 500; }
.ccs-page .font-semibold { font-weight: 600; }
.ccs-page .font-bold { font-weight: 700; }

.ccs-page .text-center { text-align: center; }
.ccs-page .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccs-page .uppercase { text-transform: uppercase; }
.ccs-page .leading-none { line-height: 1; }
.ccs-page .leading-tight { line-height: 1.25; }
.ccs-page .leading-relaxed { line-height: 1.625; }
.ccs-page .tracking-tight { letter-spacing: -0.025em; }
.ccs-page .tracking-wider { letter-spacing: 0.05em; }
.ccs-page .text-\[11px\] { font-size: 11px; }

.ccs-page .line-clamp-3 {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* 4px-grid font-size scale (matches tailwind.config.ts fontSize.grid-*) */
.ccs-page .text-grid-xs { font-size: 12px; line-height: 16px; }
.ccs-page .text-grid-sm { font-size: 14px; line-height: 20px; }
.ccs-page .text-grid-base { font-size: 16px; line-height: 24px; }
.ccs-page .text-grid-lg { font-size: 20px; line-height: 28px; }
.ccs-page .text-grid-xl { font-size: 24px; line-height: 32px; }
.ccs-page .text-grid-2xl { font-size: 32px; line-height: 40px; }
.ccs-page .text-grid-3xl { font-size: 40px; line-height: 48px; }
.ccs-page .text-grid-5xl { font-size: 56px; line-height: 64px; }
@media (min-width: 640px) {
	.ccs-page .sm\:text-grid-lg { font-size: 20px; line-height: 28px; }
	.ccs-page .sm\:text-grid-2xl { font-size: 32px; line-height: 40px; }
}
@media (min-width: 768px) {
	.ccs-page .md\:text-grid-3xl { font-size: 40px; line-height: 48px; }
	.ccs-page .md\:text-grid-5xl { font-size: 56px; line-height: 64px; }
}

/* ===================== Transitions / interaction ===================== */
.ccs-page .transition-all { transition: all 0.15s ease; }
.ccs-page .transition-colors { transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; }
.ccs-page .transition-transform { transition: transform 0.15s ease; }

.ccs-page .hover\:bg-muted:hover { background-color: hsl(var(--muted)); }
.ccs-page .hover\:bg-primary\/5:hover { background-color: hsl(var(--primary) / 0.05); }
.ccs-page .hover\:border-primary\/30:hover { border-color: hsl(var(--primary) / 0.3); }
.ccs-page .hover\:border-primary\/40:hover { border-color: hsl(var(--primary) / 0.4); }
.ccs-page .hover\:shadow-lg:hover { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); }
.ccs-page .hover\:text-foreground:hover { color: hsl(var(--foreground)); }
.ccs-page .hover\:text-primary:hover { color: hsl(var(--primary)); }
.ccs-page .hover\:underline:hover { text-decoration: underline; }
.ccs-page .hover\:brightness-110:hover { filter: brightness(1.1); }

.ccs-page .group:hover .group-hover\:text-primary { color: hsl(var(--primary)); }
.ccs-page .group:hover .group-hover\:translate-x-0\.5 { transform: translateX(2px); }

.ccs-page .focus\:outline-none:focus { outline: none; }
.ccs-page .focus\:ring-2:focus { box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2); }
.ccs-page .focus\:ring-primary\/20:focus { box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2); }
.ccs-page .focus\:border-primary:focus { border-color: hsl(var(--primary)); }
.ccs-page .placeholder\:text-muted-foreground::placeholder { color: hsl(var(--muted-foreground)); }

/* ===================== Prose (long-form case-study body) =====================
   Static equivalent of the `prose prose-slate ... prose-h2:* ...` utility
   chain used in templates/single-case-study.php and
   templates/partials/single-content.php (Tailwind Typography subset actually
   used by this plugin — not a full typography-plugin reimplementation). */
.ccs-page .prose { color: hsl(var(--foreground) / 0.8); font-family: 'Aeonik Fono', system-ui, sans-serif; }
.ccs-page .prose :where(h1, h2, h3, h4, h5, h6) {
	font-family: 'GT-America', system-ui, sans-serif;
	font-weight: 700;
	color: hsl(var(--foreground));
	scroll-margin-top: 80px;
}
.ccs-page .prose h2 {
	font-size: 24px;
	line-height: 32px;
	margin-top: 40px;
	margin-bottom: 16px;
	padding-bottom: 8px;
	border-bottom: 1px solid hsl(var(--border));
}
.ccs-page .prose h3 {
	font-size: 20px;
	line-height: 28px;
	margin-top: 24px;
	margin-bottom: 12px;
}
.ccs-page .prose p {
	font-family: 'Aeonik Fono', system-ui, sans-serif;
	color: hsl(var(--foreground) / 0.8);
	line-height: 1.625;
	margin-top: 16px;
	margin-bottom: 16px;
}
.ccs-page .prose a {
	color: hsl(var(--primary));
	text-decoration: none;
}
.ccs-page .prose a:hover { text-decoration: underline; }
.ccs-page .prose strong { color: hsl(var(--foreground)); font-weight: 600; }
.ccs-page .prose li {
	font-family: 'Aeonik Fono', system-ui, sans-serif;
	color: hsl(var(--foreground) / 0.8);
	margin-top: 4px;
	margin-bottom: 4px;
}
.ccs-page .prose ul,
.ccs-page .prose ol { margin-top: 16px; margin-bottom: 16px; padding-left: 1.5em; }
.ccs-page .prose ul { list-style: disc; }
.ccs-page .prose ol { list-style: decimal; }
.ccs-page .prose blockquote {
	border-left: 4px solid hsl(var(--primary));
	background: hsl(var(--primary) / 0.05);
	border-radius: 0 8px 8px 0;
	padding: 4px 16px;
	font-style: normal;
	margin: 16px 0;
}
.ccs-page .prose table {
	font-size: 14px;
	border-collapse: collapse;
	width: 100%;
	margin: 16px 0;
}
.ccs-page .prose th,
.ccs-page .prose td {
	border: 1px solid hsl(var(--border));
	padding: 8px 12px;
	text-align: left;
}
.ccs-page .prose th {
	background: hsl(var(--muted));
	font-family: 'GT-America', system-ui, sans-serif;
}

/* ---------------------------------------------------------------------------
 * Customer success stories — alternating image/copy rows with an overlapping
 * white stats card.
 *
 * Geometry (the alternating row, the stats card overlapping the image via a
 * negative top margin) follows the reference layout at engati.ai/customers.
 * Everything else is CloudPe's own design system, not the reference's:
 *
 *   - colours are the `--primary` / `--foreground` / `--muted-foreground` /
 *     `--border` / `--card` tokens defined in :root above (a 1:1 copy of
 *     cloudpe-astro's src/styles/global.css), so the section retints with the
 *     brand instead of carrying the reference's hard-coded crimson;
 *   - type uses the `grid-*` scale from tailwind.config.ts verbatim
 *     (grid-sm 14/20, grid-base 16/24, grid-xl 24/32) rather than arbitrary
 *     px, with 'GT-America' for headings/figures and 'Aeonik Fono' for body
 *     copy — matching the font-gt-america / font-aeonik utilities the rest of
 *     the plugin's templates use;
 *   - stat figures get `tabular-nums`, which is what the Astro pages do
 *     everywhere they render numbers, so digits align across columns.
 *
 * Scoped to .ccs-page so these generic class names can't leak into a theme.
 * ------------------------------------------------------------------------- */

.ccs-page .case-studies {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5rem;
}

.ccs-page .case-study-card {
	width: 100%;
	max-width: 1232px; /* max-w-7xl (1280) - px-6 gutters, so card edges align with the CTA banner */
	margin-left: auto;
	margin-right: auto;
}

.ccs-page .case-study-card-image-body {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 4rem;
}

.ccs-page .case-study-card-left {
	width: 48%;
	flex: none;
}

.ccs-page .case-study-card-right {
	width: 52%;
	/* Leave room for the stats card that overlaps upward into this row, so
	   the copy never sits behind it. */
	padding-bottom: 2.5rem;
}

.ccs-page .case-study-image {
	width: 100%;
	height: 360px;
	object-fit: cover;
	border-radius: 1rem;
	border: 1px solid hsl(var(--border));
	box-shadow: 0 1px 3px 0 hsl(var(--foreground) / 0.06);
	display: block;
}

/* Company name — the section's sub-heading. grid-xl (24/32) in the heading
   face, primary-tinted like every other card title in the plugin. */
.ccs-page .case-study-card-title {
	margin: 0 0 0.75rem;
	font-family: 'GT-America', system-ui, sans-serif;
	font-size: 24px;
	line-height: 32px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: hsl(var(--primary));
}

.ccs-page .case-study-card-title-link {
	color: inherit;
	text-decoration: none;
	transition: opacity 0.15s ease;
}

.ccs-page .case-study-card-title-link:hover {
	opacity: 0.75;
}

/* Challenge / Solution copy — grid-base (16/24) body face. `foreground / 0.8`
   is the same softened body colour the card excerpt uses. */
.ccs-page .case-study-card-body {
	margin: 0;
	font-family: 'Aeonik Fono', system-ui, sans-serif;
	font-size: 16px;
	line-height: 24px;
	color: hsl(var(--foreground) / 0.8);
}

/* The "Challenge" / "Solution" kicker above each paragraph. Set in the
   heading face at grid-sm, uppercased and tracked out so it reads as a label
   rather than as part of the sentence. */
.ccs-page .case-study-span {
	display: inline-block;
	margin-bottom: 0.125rem;
	font-family: 'GT-America', system-ui, sans-serif;
	font-size: 14px;
	line-height: 20px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: hsl(var(--foreground));
}

/* Lead-in copy under the company name. Unlabelled, so it needs its own
   bottom margin to sit apart from the Challenge block — matched to the
   title's 0.75rem so the three blocks share one rhythm. */
.ccs-page .case-study-card-about {
	margin: 0 0 0.75rem;
}

.ccs-page .case-study-card-cta {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	margin-top: 1.25rem;
	font-family: 'Aeonik Fono', system-ui, sans-serif;
	font-size: 14px;
	line-height: 20px;
	font-weight: 500;
	color: hsl(var(--primary));
	text-decoration: none;
}

.ccs-page .case-study-card-cta svg {
	width: 1rem;
	height: 1rem;
	transition: transform 0.15s ease;
}

.ccs-page .case-study-card-cta:hover svg {
	transform: translateX(2px);
}

/* The card that overlaps the bottom of the image/copy row. The negative top
   margin produces the overlap; z-index lifts it above the image. */
.ccs-page .case-study-card-stats-div {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.5rem;
	align-items: start;
	width: 64%;
	margin: -4.5rem auto 0;
	padding: 1.5rem 2rem;
	background: hsl(var(--card));
	border: 1px solid hsl(var(--border));
	border-radius: 1rem;
	box-shadow: 0 10px 25px -5px hsl(var(--foreground) / 0.1), 0 4px 10px -6px hsl(var(--foreground) / 0.06);
}

.ccs-page .case-study-card-stats-div.two-cards {
	grid-template-columns: repeat(2, 1fr);
}

.ccs-page .case-study-card-stats-div.three-cards {
	grid-template-columns: repeat(3, 1fr);
}

.ccs-page .case-study-card-stats-div.four-cards {
	grid-template-columns: repeat(4, 1fr);
	gap: 1.25rem;
}

.ccs-page .case-study-stat {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.25rem;
	min-width: 0;
}

/* Figures: heading face, grid-xl, tabular-nums so the digits line up
   column-to-column even at different value widths. */
.ccs-page .case-study-stat-number {
	margin: 0;
	font-family: 'GT-America', system-ui, sans-serif;
	font-size: 24px;
	line-height: 32px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.01em;
	color: hsl(var(--primary));
}

.ccs-page .case-study-stat-description {
	margin: 0;
	font-family: 'Aeonik Fono', system-ui, sans-serif;
	font-size: 14px;
	line-height: 20px;
	color: hsl(var(--muted-foreground));
	text-wrap: pretty;
}

.ccs-page .ccs-empty {
	padding: 3rem 0;
	text-align: center;
	font-family: 'Aeonik Fono', system-ui, sans-serif;
	font-size: 14px;
	line-height: 20px;
	color: hsl(var(--muted-foreground));
}

@media screen and (max-width: 1024px) {
	.ccs-page .case-study-card-image-body {
		gap: 2rem;
	}
	.ccs-page .case-study-image {
		height: 300px;
	}
	.ccs-page .case-study-card-stats-div {
		width: 84%;
		padding: 1.25rem 1.5rem;
	}
	.ccs-page .case-study-image {
		height: 260px;
	}
}

/* Below 768px the row stacks. `reverse-column` sits on the rows whose image
   is emitted last in the source — flipping to column-reverse keeps the image
   above the copy on every row, so the stack reads consistently instead of
   alternating. The stats card stops overlapping and just sits below. */
@media screen and (max-width: 768px) {
	.ccs-page .case-studies {
		gap: 3.5rem;
	}
	.ccs-page .case-study-card-image-body {
		flex-direction: column;
		align-items: stretch;
		gap: 1.5rem;
	}
	.ccs-page .case-study-card-image-body.reverse-column {
		flex-direction: column-reverse;
	}
	.ccs-page .case-study-card-left,
	.ccs-page .case-study-card-right {
		width: 100%;
	}
	.ccs-page .case-study-card-right {
		padding-bottom: 0;
	}
	.ccs-page .case-study-image {
		height: 240px;
	}
	.ccs-page .case-study-card-stats-div {
		width: 100%;
		margin-top: 1.5rem;
		gap: 1.25rem;
	}
}

@media screen and (max-width: 480px) {
	/* grid-lg (20/28) for the title, grid-sm (14/20) for body — one step down
	   the same scale rather than arbitrary shrink values. */
	.ccs-page .case-study-card-title {
		font-size: 20px;
		line-height: 28px;
	}
	.ccs-page .case-study-card-body {
		font-size: 14px;
		line-height: 20px;
	}
	.ccs-page .case-study-image {
		height: 200px;
	}
	.ccs-page .case-study-card-stats-div,
	.ccs-page .case-study-card-stats-div.two-cards,
	.ccs-page .case-study-card-stats-div.three-cards,
	.ccs-page .case-study-card-stats-div.four-cards {
		grid-template-columns: repeat(2, 1fr);
		gap: 1.25rem 1rem;
		padding: 1.25rem;
	}
	.ccs-page .case-study-stat-number {
		font-size: 20px;
		line-height: 28px;
	}
	.ccs-page .case-study-stat-description {
		font-size: 12px;
		line-height: 16px;
	}
}

/* ---------------------------------------------------------------------------
 * Email-gate dialog (templates/archive-case-study.php + assets/js/archive.js)
 *
 * Dedicated classes rather than utilities: this component needs hover, focus,
 * invalid, loading and success states plus enter/exit transitions, which the
 * statically-compiled utility set above can't express. Colours and type come
 * from the same tokens and grid-* scale as the rest of the plugin.
 * ------------------------------------------------------------------------- */

/* The `hidden` attribute only works while nothing sets `display`. Every rule
   below (and on .ccs-field__error / .ccs-modal__context) does, and an author
   `display` beats the UA sheet's `[hidden] { display: none }` — which left the
   modal permanently laid out at opacity 0, a full-viewport sheet on z-index
   100 that swallowed every click on the page, the card CTAs included. Restore
   the attribute's meaning for the modal and everything inside it. */
.ccs-modal[hidden],
.ccs-modal [hidden] {
	display: none;
}

.ccs-modal {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.ccs-modal.is-open {
	opacity: 1;
}

.ccs-modal__overlay {
	position: absolute;
	inset: 0;
	background: hsl(231 40% 4% / 0.6);
	-webkit-backdrop-filter: blur(6px) saturate(120%);
	backdrop-filter: blur(6px) saturate(120%);
}

.ccs-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 27rem;
	max-height: calc(100vh - 2rem);
	overflow-y: auto;
	padding: 1.75rem;
	background: hsl(var(--card));
	border: 1px solid hsl(var(--border));
	border-radius: 1.25rem;
	box-shadow: 0 25px 50px -12px hsl(231 40% 4% / 0.35), 0 0 0 1px hsl(0 0% 100% / 0.04) inset;
	/* Rises and settles as it fades in. */
	transform: translateY(12px) scale(0.98);
	opacity: 0;
	transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.24s ease;
}

.ccs-modal.is-open .ccs-modal__dialog {
	transform: translateY(0) scale(1);
	opacity: 1;
}

/* A hairline of brand colour along the top edge — reads as "this is a
   CloudPe surface" without adding another coloured block. */
.ccs-modal__dialog::before {
	content: '';
	position: absolute;
	top: 0;
	left: 1.25rem;
	right: 1.25rem;
	height: 2px;
	border-radius: 0 0 2px 2px;
	background: linear-gradient(90deg, transparent, hsl(var(--primary)), transparent);
}

.ccs-modal__close {
	position: absolute;
	top: 0.875rem;
	right: 0.875rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0.5rem;
	color: hsl(var(--muted-foreground));
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.ccs-modal__close svg {
	width: 1.125rem;
	height: 1.125rem;
}

.ccs-modal__close:hover {
	background: hsl(var(--muted));
	color: hsl(var(--foreground));
}

/* Context strip — which case study is being unlocked. */
.ccs-modal__context {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	margin: 0 2rem 1.125rem 0;
	padding: 0.5rem 0.75rem;
	background: hsl(var(--muted));
	border: 1px solid hsl(var(--border));
	border-radius: 0.625rem;
}

.ccs-modal__context-thumb {
	flex: none;
	width: 2rem;
	height: 2rem;
	border-radius: 0.375rem;
	background-color: hsl(var(--border));
	background-size: cover;
	background-position: center;
}

.ccs-modal__context-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.ccs-modal__context-label {
	font-family: 'Aeonik Fono', system-ui, sans-serif;
	font-size: 11px;
	line-height: 14px;
	color: hsl(var(--muted-foreground));
}

.ccs-modal__context-name {
	font-family: 'GT-America', system-ui, sans-serif;
	font-size: 14px;
	line-height: 20px;
	font-weight: 600;
	color: hsl(var(--foreground));
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ccs-modal__head {
	margin-bottom: 1.25rem;
	padding-right: 2rem;
}

.ccs-modal__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	margin-bottom: 0.875rem;
	background: hsl(var(--primary) / 0.1);
	border: 1px solid hsl(var(--primary) / 0.2);
	border-radius: 0.75rem;
	color: hsl(var(--primary));
}

.ccs-modal__icon svg {
	width: 1.25rem;
	height: 1.25rem;
}

.ccs-modal__title {
	margin: 0 0 0.375rem;
	font-family: 'GT-America', system-ui, sans-serif;
	font-size: 20px;
	line-height: 28px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: hsl(var(--foreground));
}

.ccs-modal__desc {
	margin: 0;
	font-family: 'Aeonik Fono', system-ui, sans-serif;
	font-size: 14px;
	line-height: 21px;
	color: hsl(var(--muted-foreground));
}

.ccs-modal__form {
	display: flex;
	flex-direction: column;
	gap: 0.875rem;
}

.ccs-field__label {
	display: block;
	margin-bottom: 0.375rem;
	font-family: 'GT-America', system-ui, sans-serif;
	font-size: 12px;
	line-height: 16px;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: hsl(var(--foreground));
}

.ccs-field__wrap {
	position: relative;
	display: flex;
	align-items: center;
}

.ccs-field__icon {
	position: absolute;
	left: 0.75rem;
	width: 1.125rem;
	height: 1.125rem;
	color: hsl(var(--muted-foreground));
	pointer-events: none;
	transition: color 0.15s ease;
}

.ccs-field__input {
	width: 100%;
	padding: 0.75rem 2.5rem 0.75rem 2.375rem;
	font-family: 'Aeonik Fono', system-ui, sans-serif;
	font-size: 15px;
	line-height: 22px;
	color: hsl(var(--foreground));
	background: hsl(var(--background));
	border: 1px solid hsl(var(--border));
	border-radius: 0.625rem;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.ccs-field__input::placeholder {
	color: hsl(var(--muted-foreground) / 0.7);
}

.ccs-field__input:focus {
	background: hsl(var(--card));
	border-color: hsl(var(--primary));
	box-shadow: 0 0 0 3px hsl(var(--primary) / 0.15);
}

.ccs-field__wrap:focus-within .ccs-field__icon {
	color: hsl(var(--primary));
}

/* Inline confirmation tick, revealed once the address parses. */
.ccs-field__check {
	position: absolute;
	right: 0.75rem;
	width: 1.125rem;
	height: 1.125rem;
	color: #16a34a;
	opacity: 0;
	transform: scale(0.6);
	pointer-events: none;
	transition: opacity 0.15s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ccs-modal.is-valid .ccs-field__check {
	opacity: 1;
	transform: scale(1);
}

.ccs-modal.is-invalid .ccs-field__input {
	border-color: #dc2626;
}

.ccs-modal.is-invalid .ccs-field__input:focus {
	box-shadow: 0 0 0 3px hsl(0 72% 51% / 0.15);
}

.ccs-field__error {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	margin: 0.375rem 0 0;
	font-family: 'Aeonik Fono', system-ui, sans-serif;
	font-size: 12px;
	line-height: 16px;
	color: #dc2626;
}

.ccs-modal__submit {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.375rem;
	width: 100%;
	padding: 0.8125rem 1.25rem;
	font-family: 'GT-America', system-ui, sans-serif;
	font-size: 15px;
	line-height: 20px;
	font-weight: 600;
	color: hsl(var(--primary-foreground));
	background: hsl(var(--primary));
	border: 0;
	border-radius: 0.625rem;
	cursor: pointer;
	overflow: hidden;
	transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.15s ease;
	box-shadow: 0 1px 2px hsl(var(--primary) / 0.3), 0 8px 20px -8px hsl(var(--primary) / 0.5);
}

.ccs-modal__submit:hover:not(:disabled) {
	filter: brightness(1.08);
	box-shadow: 0 1px 2px hsl(var(--primary) / 0.3), 0 12px 26px -8px hsl(var(--primary) / 0.6);
}

.ccs-modal__submit:active:not(:disabled) {
	transform: translateY(1px);
}

.ccs-modal__submit:focus-visible {
	outline: 2px solid hsl(var(--primary));
	outline-offset: 2px;
}

.ccs-modal__submit:disabled {
	cursor: default;
}

.ccs-modal__submit-arrow {
	width: 1rem;
	height: 1rem;
	transition: transform 0.15s ease;
}

.ccs-modal__submit:hover:not(:disabled) .ccs-modal__submit-arrow {
	transform: translateX(3px);
}

/* Loading: label and arrow swap out for a spinner in place, so the button
   doesn't change size mid-submit. */
.ccs-modal__spinner {
	position: absolute;
	width: 1.125rem;
	height: 1.125rem;
	border: 2px solid hsl(0 0% 100% / 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	opacity: 0;
	animation: ccs-spin 0.65s linear infinite;
}

.ccs-modal.is-loading .ccs-modal__submit-label,
.ccs-modal.is-loading .ccs-modal__submit-arrow {
	opacity: 0;
}

.ccs-modal.is-loading .ccs-modal__spinner {
	opacity: 1;
}

@keyframes ccs-spin {
	to {
		transform: rotate(360deg);
	}
}

.ccs-modal__trust {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	margin: 1.125rem 0 0;
	padding: 0.875rem 0 0;
	list-style: none;
	border-top: 1px solid hsl(var(--border));
}

.ccs-modal__trust li {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	font-family: 'Aeonik Fono', system-ui, sans-serif;
	font-size: 12px;
	line-height: 16px;
	color: hsl(var(--muted-foreground));
}

.ccs-modal__trust svg {
	width: 0.875rem;
	height: 0.875rem;
	color: #16a34a;
	flex: none;
}

.ccs-modal.is-success .ccs-modal__trust,
.ccs-modal.is-success .ccs-modal__context {
	display: none;
}

/* Success state, swapped in for the form after submit. */
.ccs-modal__success {
	text-align: center;
	padding: 0.5rem 0 0.25rem;
}

.ccs-modal__success-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	margin-bottom: 0.875rem;
	color: #16a34a;
	background: hsl(142 71% 45% / 0.12);
	border: 1px solid hsl(142 71% 45% / 0.3);
	border-radius: 50%;
	animation: ccs-pop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.ccs-modal__success-mark svg {
	width: 1.5rem;
	height: 1.5rem;
}

@keyframes ccs-pop {
	from {
		transform: scale(0.5);
		opacity: 0;
	}
	to {
		transform: scale(1);
		opacity: 1;
	}
}

.ccs-modal__success-title {
	margin: 0 0 0.25rem;
	font-family: 'GT-America', system-ui, sans-serif;
	font-size: 18px;
	line-height: 26px;
	font-weight: 700;
	color: hsl(var(--foreground));
}

.ccs-modal__success-desc {
	margin: 0;
	font-family: 'Aeonik Fono', system-ui, sans-serif;
	font-size: 14px;
	line-height: 21px;
	color: hsl(var(--muted-foreground));
	word-break: break-word;
}

@media screen and (max-width: 480px) {
	.ccs-modal {
		/* Sit the sheet at the bottom on phones — closer to the thumb than a
		   vertically centred dialog. */
		align-items: flex-end;
		padding: 0;
	}
	.ccs-modal__dialog {
		max-width: none;
		padding: 1.5rem 1.25rem 1.75rem;
		border-radius: 1.25rem 1.25rem 0 0;
		border-bottom: 0;
		transform: translateY(100%);
	}
	.ccs-modal.is-open .ccs-modal__dialog {
		transform: translateY(0);
	}
	.ccs-modal__trust {
		gap: 0.375rem 0.875rem;
	}
}

/* Respect a reduced-motion preference: keep the state changes, drop the
   movement (the spinner still turns — it communicates progress). */
@media (prefers-reduced-motion: reduce) {
	.ccs-modal,
	.ccs-modal__dialog,
	.ccs-modal__submit,
	.ccs-modal__submit-arrow,
	.ccs-field__check {
		transition-duration: 0.01ms;
	}
	.ccs-modal__dialog,
	.ccs-modal.is-open .ccs-modal__dialog {
		transform: none;
	}
	.ccs-modal__success-mark {
		animation: none;
	}
}
