/**
 * Variant CSS: before-after--trio-diagonal-split-cards
 * Layer 2 — Path B before-after role (2026-06-10).
 * Exactly THREE cards, each ONE frame cut by a diagonal: the "before" photo is the
 * base; the "after" photo sits on top, clip-pathed to the top-right triangle so the
 * two states meet on a corner-to-corner seam. Labels sit in OPPOSITE corners
 * (Przed bottom-left over the before half, Po top-right over the after half); a
 * numbered title bar sits beneath.
 * Distinct from three-case-grid (a vertical stack of TWO separate frames) and
 * trio-pair-cards-row (a horizontal seam, two photos side by side): here both
 * states share ONE frame split on the diagonal, like a single composited photo.
 */

body.aibt-universal .universal-before-after--trio-diagonal-split-cards {
	background: var(--background-alt);
	color: var(--text-primary);
}

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

body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__intro > * {
	margin-inline: auto !important;
}

body.aibt-universal .universal-before-after--trio-diagonal-split-cards .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--trio-diagonal-split-cards h2.universal-before-after__headline,
body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__headline {
	font-family: var(--font-display) !important;
	color: var(--text-primary) !important;
	margin: 0 !important;
}

/* Grid — 3 equal cases; force wrap so the 3-up degrades cleanly. */
body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__grid {
	flex-wrap: wrap !important;
	align-items: stretch;
}

body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__case {
	display: flex;
	flex-direction: column;
}

/* Frame — the single diagonally-split window. Both photos are layered here. */
body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__frame {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: var(--decor-radius);
	border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
}

/* Both images fill the frame; reset figure margins and stack them. */
body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__img {
	margin: 0 !important;
	display: block;
}

body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: var(--photo-filter, none);
}

/* "Before" — the base layer filling the whole frame. */
body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__img--before {
	position: absolute;
	inset: 0;
	z-index: 1;
}

/* "After" — laid over the before and clipped to the TOP-RIGHT triangle, so the
   diagonal seam runs from bottom-left to top-right. clip-path transitions on hover
   to reveal more of the result (tactile reveal; reduced-motion drops it). */
body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__img--after {
	position: absolute;
	inset: 0;
	z-index: 2;
	clip-path: polygon(100% 0, 100% 100%, 0 0);
	transition: clip-path var(--duration-slow, 900ms) var(--ease-elegant, ease);
}

body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__case:hover .universal-before-after__img--after {
	clip-path: polygon(100% 0, 100% 100%, 40% 100%, 0 0);
}

/* The seam itself — a thin accent rule drawn corner-to-corner over both halves
   via a rotated linear-gradient sliver. Pure decoration, ignores pointer. */
body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__frame::after {
	content: "";
	position: absolute;
	inset: -1px;
	z-index: 3;
	pointer-events: none;
	background: linear-gradient(to top right, transparent calc(50% - 1px), var(--accent) calc(50% - 1px), var(--accent) calc(50% + 1px), transparent calc(50% + 1px));
	opacity: 0.9;
}

/* Corner tags — opposite corners so each labels its own half. */
body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__tag {
	position: absolute;
	z-index: 4;
	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), bottom-left over the before triangle. */
body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__tag--before {
	left: var(--space-xs);
	bottom: var(--space-xs);
	background: var(--background-dark, #141414);
	color: var(--text-on-dark, #fff) !important;
}

/* "Po" — accent CTA chip to signal the win, top-right over the after triangle. */
body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__tag--after {
	right: var(--space-xs);
	top: var(--space-xs);
	background: var(--cta-bg-primary);
	color: var(--cta-text-primary) !important;
}

/* Footer bar — ordinal number + project title on one baseline, beneath the frame. */
body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__foot {
	gap: var(--space-sm) !important;
	margin-top: var(--space-sm);
}

body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__num {
	flex: 0 0 auto;
	font-family: var(--font-display) !important;
	font-size: var(--text-sm) !important;
	font-weight: 700 !important;
	line-height: 1 !important;
	letter-spacing: 0 !important;
	color: var(--accent) !important;
	background: color-mix(in srgb, var(--accent) 14%, transparent);
	border-radius: var(--decor-radius-pill);
	padding: 0.4em 0.7em !important;
	margin: 0 !important;
}

body.aibt-universal .universal-before-after--trio-diagonal-split-cards .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 !important;
	min-width: 0;
	overflow-wrap: break-word;
}

/* Tablet — 641-959: drop to a 2-up wrap, third card flows to a new line. */
@media (max-width: 959px) {
	body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__case {
		flex-basis: calc(50% - var(--space-md)) !important;
	}
}

/* Phone — ≤640: single column; cap wide tracking (A5). */
@media (max-width: 640px) {
	body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__case {
		flex-basis: 100% !important;
		width: 100% !important;
	}
	body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__kicker,
	body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__tag {
		letter-spacing: 0 !important;
	}
}

/* Keyboard affordance — card focus-within mirrors hover, image focus-visible ring. */
body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__case:focus-within .universal-before-after__img--after {
	clip-path: polygon(100% 0, 100% 100%, 40% 100%, 0 0);
}

body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__img img:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* Respect reduced-motion — freeze the clip-path reveal. */
@media (prefers-reduced-motion: reduce) {
	body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__img--after {
		transition: none !important;
	}
	body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__case:hover .universal-before-after__img--after,
	body.aibt-universal .universal-before-after--trio-diagonal-split-cards .universal-before-after__case:focus-within .universal-before-after__img--after {
		clip-path: polygon(100% 0, 100% 100%, 0 0);
	}
}

/* A8/A9 left-shift fix: centered intro children (kicker/headline) are max-width-capped
   by WP constrained layout but carry horizontal margin 0, pinning them left. Force
   margin-inline:auto. The section class is doubled to lift specificity to (0,4,1) so this
   beats element-tag-qualified rules like h2.__headline; harmless on already-centered
   elements (auto margins compute to 0). Only left/right are overridden; top/bottom kept. */
body.aibt-universal .universal-before-after--trio-diagonal-split-cards.universal-before-after--trio-diagonal-split-cards .universal-before-after__kicker,
body.aibt-universal .universal-before-after--trio-diagonal-split-cards.universal-before-after--trio-diagonal-split-cards .universal-before-after__headline { margin-inline: auto !important; }
