/**
 * Variant CSS: before-after--three-case-grid
 * Layer 2 — Path B before-after role (2026-06-06).
 * Three "case study" cards in a row. Each card = title + a VERTICAL stacked
 * pair (before on top, after below), every frame carrying a corner tag.
 * Distinct from gallery-pairs (side-by-side mini frames + single caption):
 * here each transformation is its own framed, titled card like a project list.
 */

body.aibt-universal .universal-before-after--three-case-grid {
	background: var(--background-alt);
	color: var(--text-primary);
}

/* Intro — centred block, A8-safe. */
body.aibt-universal .universal-before-after--three-case-grid .universal-before-after__intro {
	margin-bottom: var(--space-xl);
	text-align: center;
}

body.aibt-universal .universal-before-after--three-case-grid .universal-before-after__intro > * {
	margin-inline: auto !important;
}

body.aibt-universal .universal-before-after--three-case-grid .universal-before-after__kicker {
	font-family: var(--font-body) !important;
	font-size: var(--text-xs) !important;
	font-weight: 600 !important;
	letter-spacing: var(--tracking-widest) !important;
	text-transform: uppercase !important;
	color: var(--accent) !important;
	margin: 0 0 var(--space-sm) 0 !important;
}

body.aibt-universal .universal-before-after--three-case-grid h2.universal-before-after__headline,
body.aibt-universal .universal-before-after--three-case-grid .universal-before-after__headline {
	font-family: var(--font-display) !important;
	color: var(--text-primary) !important;
	margin: 0 !important;
}

/* Grid — 3 equal cases, no flex shrink quirks. */
body.aibt-universal .universal-before-after--three-case-grid .universal-before-after__grid {
	align-items: stretch;
}

/* Case card — bordered container holding title + stacked pair. */
body.aibt-universal .universal-before-after--three-case-grid .universal-before-after__case {
	display: flex;
	flex-direction: column;
	padding: var(--space-sm) !important;
	background: var(--background, #fff);
	border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
	border-radius: var(--decor-radius);
	transition: transform var(--duration-fast, 240ms) var(--ease-default, ease),
		box-shadow var(--duration-fast, 240ms) var(--ease-default, ease);
}

/* Lift the case card on hover — reads as a tappable portfolio entry
   (reduced-motion is handled globally by the skeleton). */
body.aibt-universal .universal-before-after--three-case-grid .universal-before-after__case:hover {
	transform: translateY(-3px);
	box-shadow: 0 16px 40px -24px color-mix(in srgb, var(--ink) 45%, transparent);
}

body.aibt-universal .universal-before-after--three-case-grid .universal-before-after__case-title {
	font-family: var(--font-display) !important;
	font-size: var(--text-lg) !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	color: var(--text-primary) !important;
	margin: 0 0 var(--space-sm) 0 !important;
}

/* Stacked pair — before frame above after frame, joined by a thin divider gap. */
body.aibt-universal .universal-before-after--three-case-grid .universal-before-after__stack {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs) !important;
}

body.aibt-universal .universal-before-after--three-case-grid .universal-before-after__shot {
	position: relative;
	overflow: hidden;
	border-radius: var(--decor-radius);
}

body.aibt-universal .universal-before-after--three-case-grid .universal-before-after__img {
	margin: 0 !important;
	display: block;
}

body.aibt-universal .universal-before-after--three-case-grid .universal-before-after__img img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	filter: var(--photo-filter, none);
	transition: transform var(--duration-slow, 900ms) var(--ease-elegant, ease);
}

/* Gentle paired zoom on the case's photos on hover — tactile result cue. */
body.aibt-universal .universal-before-after--three-case-grid .universal-before-after__case:hover .universal-before-after__img img {
	transform: scale(1.04);
}

/* Corner tags — sit on each frame.
   Fixed rgba drop-shadow lifts the chip off any photo (theme-independent,
   correct text-on-photo pattern) so light chips stay crisp on bright shots. */
body.aibt-universal .universal-before-after--three-case-grid .universal-before-after__tag {
	position: absolute;
	top: var(--space-xs);
	left: var(--space-xs);
	z-index: 2;
	font-family: var(--font-body) !important;
	font-size: var(--text-xs) !important;
	font-weight: 700 !important;
	letter-spacing: var(--tracking-wide) !important;
	text-transform: uppercase !important;
	margin: 0 !important;
	padding: 0.35em 0.8em !important;
	border-radius: var(--decor-radius-pill);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28), 0 1px 2px rgba(0, 0, 0, 0.22);
}

/* "Przed" — neutral dark chip (text-on-dark). */
body.aibt-universal .universal-before-after--three-case-grid .universal-before-after__tag--before {
	background: var(--background-dark, #141414);
	color: var(--text-on-dark, #fff) !important;
}

/* "Po" — accent CTA chip to signal the win. */
body.aibt-universal .universal-before-after--three-case-grid .universal-before-after__tag--after {
	background: var(--cta-bg-primary);
	color: var(--cta-text-primary) !important;
}

/* Tablet — drop to 2-up then 1-up. */
@media (max-width: 781px) {
	body.aibt-universal .universal-before-after--three-case-grid .universal-before-after__grid {
		flex-wrap: wrap !important;
	}
	body.aibt-universal .universal-before-after--three-case-grid .universal-before-after__case {
		flex-basis: 100% !important;
		width: 100% !important;
	}
}

/* Cap uppercase tracking on small screens (A5). */
@media (max-width: 640px) {
	body.aibt-universal .universal-before-after--three-case-grid .universal-before-after__kicker,
	body.aibt-universal .universal-before-after--three-case-grid .universal-before-after__tag {
		letter-spacing: 0 !important;
	}
}

/* A8/A9 left-shift fix (2026-06-08): centered intro element(s) were max-width-capped by
   WP constrained layout but pinned left by horizontal margin:0. Force margin-inline:auto.
   Section class doubled -> specificity (0,4,1) beats h2.__headline-style rules; harmless on
   already-centered elements (auto margins compute to 0). Only left/right are overridden. */
body.aibt-universal .universal-before-after--three-case-grid.universal-before-after--three-case-grid .universal-before-after__kicker,
body.aibt-universal .universal-before-after--three-case-grid.universal-before-after--three-case-grid .universal-before-after__headline { margin-inline: auto !important; }
