/* ============================================================================
   EUX Blocks — Case Studies (themed section + 3-up card grid)
   ----------------------------------------------------------------------------
   Themed section wrapping a 3-column grid of editable case-study cards.
   Three theme variants — cream (default), light, dark. The theme modifier
   class lives on the outer .eux-block--case-studies--<theme> wrapper and
   cascades into the cards via descendant selectors.

   Motion follows ux-motion's SaaS/productivity profile: "efficient,
   minimal, informative · standard ease-out · 150-250ms · clarity".
     - Card hover: translateY(-3px) + border + shadow at 200ms ease-out
       (transform-only animation, GPU-friendly)
     - Card stagger entrance: 180ms per card via frontend.js
       CARD_SELECTOR, matching the rest of the page's card rhythm
     - Button hover: 180ms color/bg/border transitions
     - Reduced motion: all transitions disabled, state cues preserved
   ============================================================================ */

/* ==========================================================================
   1. Section shell + themed backgrounds
   ========================================================================== */
.eux-block--case-studies {
	padding-block: 96px;
	position: relative;
}
@media (max-width: 720px) {
	.eux-block--case-studies { padding-block: 64px; }
}

.eux-block--case-studies.eux-block--case-studies--cream { background: var(--eux-cream-100); }
.eux-block--case-studies.eux-block--case-studies--light { background: var(--eux-white); }
.eux-block--case-studies.eux-block--case-studies--dark  { background: #0a0a0a; color: #FFFFFF; }

/* ==========================================================================
   2. Section header (eyebrow + title + sub)
   ========================================================================== */
.eux-block--case-studies .eux-cs__hdr {
	margin-bottom: 48px;
	max-width: 64ch;
}

.eux-block--case-studies .eux-cs__title {
	font-family: var(--eux-font-display);
	font-weight: 400;
	font-size: clamp(36px, 4.5vw, 52px);
	line-height: 1.05;
	letter-spacing: -0.025em;
	margin: 0 0 14px;
	color: var(--eux-ink-900);
	text-wrap: balance;
	max-width: 22ch;
}
.eux-block--case-studies .eux-cs__title em {
	font-style: italic;
	font-weight: 300;
	color: var(--eux-woo-500);
}
.eux-block--case-studies--dark .eux-cs__title { color: #FFFFFF; }
.eux-block--case-studies--dark .eux-cs__title em { color: var(--eux-woo-300); }

.eux-block--case-studies .eux-cs__sub {
	font-family: var(--eux-font-body);
	font-size: 16px;
	line-height: 1.55;
	color: var(--eux-ink-700);
	margin: 0;
	max-width: 60ch;
}
.eux-block--case-studies--dark .eux-cs__sub { color: rgba(255, 255, 255, 0.72); }

/* Dark-theme eyebrow override — uses woo-200 for contrast against ink-black */
.eux-block--case-studies--dark .eux-eyebrow { color: var(--eux-woo-200); }
.eux-block--case-studies--dark .eux-eyebrow::before { background: var(--eux-woo-200); }

/* ==========================================================================
   3. 3-up grid — 3 cols desktop, 1 col on tablet+mobile
   --------------------------------------------------------------------------
   `align-items: stretch` is intentional here (the grid default) — all
   three cards in a row should equalise to the tallest card's height so
   their bottom edges (containing the CTA button) line up cleanly.
   This is the OPPOSITE choice from the FAQs grid which uses `start` to
   avoid open-accordion height matching. Different needs, different
   alignment.
   ========================================================================== */
.eux-block--case-studies .eux-cs__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	align-items: stretch;
}
@media (max-width: 980px) {
	.eux-block--case-studies .eux-cs__grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}
}

/* ==========================================================================
   4. Card — outer shell + theme variants
   ========================================================================== */
.eux-block--case-studies .eux-cs-card {
	background: var(--eux-white);
	border: 1px solid var(--eux-ink-100);
	border-radius: 16px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	/* Hover transitions — transform is GPU-friendly. Border-color and
	   shadow are also paint-only. No layout properties animated. */
	transition:
		transform 200ms var(--eux-ease-out, cubic-bezier(0.22, 1, 0.36, 1)),
		border-color 200ms ease,
		box-shadow 200ms ease;
}
.eux-block--case-studies .eux-cs-card:hover {
	transform: translateY(-3px);
	border-color: var(--eux-ink-300);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.06);
}
.eux-block--case-studies--dark .eux-cs-card {
	background: rgba(255, 255, 255, 0.04);
	border-color: rgba(255, 255, 255, 0.08);
}
.eux-block--case-studies--dark .eux-cs-card:hover {
	border-color: color-mix(in srgb, var(--eux-woo-500) 40%, transparent);
	box-shadow: 0 16px 40px color-mix(in srgb, var(--eux-woo-500) 10%, transparent);
}

/* ==========================================================================
   5. Card image area (with client pill + sticker overlays)
   --------------------------------------------------------------------------
   The image area uses aspect-ratio 4/3 so all three cards align even when
   only some have real images uploaded. When no media is set, a striped
   placeholder fills the slot — striped backdrop matches the project's
   draft/working aesthetic so it doesn't look broken.
   ========================================================================== */
.eux-block--case-studies .eux-cs-card__img {
	position: relative;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background:
		repeating-linear-gradient(135deg,
			rgba(0, 0, 0, 0.04) 0 1px,
			transparent 1px 14px
		),
		var(--eux-cream-200, #ECE6DF);
	color: rgba(0, 0, 0, 0.4);
	display: grid;
	place-items: center;
}
.eux-block--case-studies .eux-cs-card__img.has-image {
	background: var(--eux-cream-200, #ECE6DF);
}
.eux-block--case-studies .eux-cs-card__img-el {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.eux-block--case-studies--dark .eux-cs-card__img {
	background:
		repeating-linear-gradient(135deg,
			rgba(255, 255, 255, 0.04) 0 1px,
			transparent 1px 14px
		),
		rgba(255, 255, 255, 0.06);
	color: rgba(255, 255, 255, 0.4);
}
.eux-block--case-studies--dark .eux-cs-card__img.has-image {
	background: rgba(255, 255, 255, 0.06);
}

/* Client name pill — top-left over image */
.eux-block--case-studies .eux-cs-card__client {
	position: absolute;
	top: 14px;
	left: 14px;
	font-family: var(--eux-font-display);
	font-weight: 600;
	font-size: 10.5px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	padding: 5px 10px;
	background: rgba(255, 255, 255, 0.92);
	color: var(--eux-ink-900);
	border-radius: 99px;
	z-index: 2;
}

/* Sticker label — bottom-right over image */
.eux-block--case-studies .eux-cs-card__sticker {
	position: absolute;
	bottom: 14px;
	right: 14px;
	font-family: var(--eux-font-mono);
	font-size: 9.5px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	padding: 4px 9px;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.92);
	color: var(--eux-ink-900);
	border: 1px solid rgba(0, 0, 0, 0.06);
	z-index: 2;
}

/* Editor-only hint for empty image slot */
.eux-block--case-studies .eux-cs-card__img-hint {
	font-family: var(--eux-font-mono);
	font-size: 11px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: rgba(0, 0, 0, 0.4);
	pointer-events: none;
}
.eux-block--case-studies--dark .eux-cs-card__img-hint {
	color: rgba(255, 255, 255, 0.4);
}

/* ==========================================================================
   6. Card body — title, description, tags, footer
   ========================================================================== */
.eux-block--case-studies .eux-cs-card__body {
	padding: 22px 22px 24px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex: 1;
}

.eux-block--case-studies .eux-cs-card__title {
	font-family: var(--eux-font-display);
	font-weight: 500;
	font-size: 20px;
	line-height: 1.25;
	letter-spacing: -0.01em;
	color: var(--eux-ink-900);
	margin: 0;
	text-wrap: balance;
	/* Salient defence — word-break: break-word leaks down to all column
	   children otherwise, breaking words mid-letter. */
	word-break: normal;
	overflow-wrap: normal;
}
.eux-block--case-studies--dark .eux-cs-card__title { color: #FFFFFF; }

.eux-block--case-studies .eux-cs-card__desc {
	font-family: var(--eux-font-body);
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--eux-ink-700);
	margin: 0;
	flex: 1;
}
.eux-block--case-studies--dark .eux-cs-card__desc { color: rgba(255, 255, 255, 0.78); }

/* ==========================================================================
   7. Tag chips
   ========================================================================== */
.eux-block--case-studies .eux-cs-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.eux-block--case-studies .eux-cs-card__tag {
	display: inline-block;
	padding: 4px 10px;
	font-family: var(--eux-font-mono);
	font-size: 10.5px;
	letter-spacing: 0.06em;
	color: var(--eux-ink-700);
	background: var(--eux-cream-50);
	border: 1px solid var(--eux-ink-100);
	border-radius: 99px;
	/* Tags can be empty during editing — give them at least a visible
	   pill outline so authors don't lose track of them. */
	min-width: 14px;
	min-height: 14px;
}
.eux-block--case-studies .eux-cs-card__tag--accent {
	background: var(--eux-woo-500);
	color: #fff;
	border-color: var(--eux-woo-500);
}
.eux-block--case-studies--dark .eux-cs-card__tag {
	background: rgba(255, 255, 255, 0.05);
	border-color: rgba(255, 255, 255, 0.10);
	color: rgba(255, 255, 255, 0.78);
}
.eux-block--case-studies--dark .eux-cs-card__tag--accent {
	background: var(--eux-woo-500);
	color: #fff;
	border-color: var(--eux-woo-500);
}

/* ==========================================================================
   8. Card footer + "View case study" button
   ========================================================================== */
.eux-block--case-studies .eux-cs-card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin-top: 6px;
}

.eux-block--case-studies .eux-cs-card__btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 10px 16px;
	font-family: var(--eux-font-display);
	font-size: 13px;
	font-weight: 500;
	color: var(--eux-ink-900);
	background: transparent;
	border: 1px solid var(--eux-ink-300);
	border-radius: 99px;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
	/* Three properties animated together — ux-motion: "Never animate more
	   than 2-3 properties simultaneously". 180ms is the dropdown/tooltip
	   feedback bucket — instant-feeling for a hover state. */
	transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}
.eux-block--case-studies .eux-cs-card__btn:hover {
	background: var(--eux-ink-900);
	color: var(--eux-white);
	border-color: var(--eux-ink-900);
}
.eux-block--case-studies .eux-cs-card__btn-arr {
	font-family: var(--eux-font-mono);
	font-weight: 400;
}
.eux-block--case-studies--dark .eux-cs-card__btn {
	color: #FFFFFF;
	border-color: rgba(255, 255, 255, 0.25);
}
.eux-block--case-studies--dark .eux-cs-card__btn:hover {
	background: #FFFFFF;
	color: var(--eux-ink-900);
	border-color: #FFFFFF;
}
/* Salient defence — strip the underline that leaks onto all <a> in
   content areas. */
.eux-block--case-studies .eux-cs-card__btn,
.eux-block--case-studies .eux-cs-card__btn:hover {
	border-bottom-width: 1px;
}

/* ==========================================================================
   9. Editor canvas — image picker shows a click cursor and the hint
   --------------------------------------------------------------------------
   In the editor the image slot is a button; we make that obvious so
   authors don't miss the affordance. The placeholder striped background
   stays for empty slots; once an image is picked, the hint disappears.
   ========================================================================== */
.eux-block--case-studies .eux-cs-card--editor .eux-cs-card__img {
	cursor: pointer;
}
.eux-block--case-studies .eux-cs-card--editor .eux-cs-card__img.has-image .eux-cs-card__img-hint {
	display: none;
}
.eux-block--case-studies .eux-cs-card--editor .eux-cs-card__client,
.eux-block--case-studies .eux-cs-card--editor .eux-cs-card__sticker {
	cursor: text;
}

/* ==========================================================================
   10. Reduced motion
   --------------------------------------------------------------------------
   ux-motion principle: provide thoughtful alternatives per component,
   not a global animation kill. Here:
     - Card transitions off (hover state still applies, just instant)
     - Button transitions off
     - Reveal stagger handled in shared.css's prefers-reduced-motion rule
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	.eux-block--case-studies .eux-cs-card,
	.eux-block--case-studies .eux-cs-card__btn {
		transition: none !important;
	}
}
