/**
 * Variant CSS: before-after--quad-metric-result-cards
 * Layer 2 — Path B before-after role (2026-06-10).
 * A 2x2 grid of framed cards — exactly FOUR transformations. Each card =
 * a numbered badge + title + a HORIZONTAL before|after split pair AND a bound
 * result-metric chip beneath it. The metric row (e.g. "–40% czasu") quantifies
 * the win and is the distinguishing element vs quad-grid-cards (which stops at
 * the photo pair). Built on a real CSS grid (repeat(2, minmax(0,1fr))) so the
 * four landscape split frames read as a compact 2x2 outcome matrix.
 * Distinct from quad-grid-cards (no metric line), quad-diptych-band / seam-quad-board
 * (band/board seam layouts) and results-card-trio (only three cases).
 */

body.aibt-universal .universal-before-after--quad-metric-result-cards {
	background: var(--background-alt);
	color: var(--text-primary);
}

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

body.aibt-universal .universal-before-after--quad-metric-result-cards .universal-before-after__intro > * {
	margin-inline: auto !important;
}

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

/* Quad — real CSS grid: two equal columns, each cell auto-sized.
   minmax(0,1fr) lets columns shrink (prevents image overflow on narrow screens). */
body.aibt-universal .universal-before-after--quad-metric-result-cards .universal-before-after__quad {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-lg) !important;
	align-items: stretch;
}

/* Card — bordered container holding head + split pair + result chip. */
body.aibt-universal .universal-before-after--quad-metric-result-cards .universal-before-after__card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	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);
	box-shadow: var(--decor-shadow-soft);
	transition: transform var(--duration-fast, 220ms) var(--ease-default, ease),
		box-shadow var(--duration-fast, 220ms) var(--ease-default, ease);
}

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

/* Head row — numbered badge + title on one baseline. */
body.aibt-universal .universal-before-after--quad-metric-result-cards .universal-before-after__head {
	gap: var(--space-sm) !important;
	margin-bottom: var(--space-sm);
}

body.aibt-universal .universal-before-after--quad-metric-result-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--quad-metric-result-cards .universal-before-after__card-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;
}

/* Split — before half | after half, meeting on a centre seam.
   gap:0 so the two photos kiss; the seam is painted as a divider line.
   flex-wrap stays nowrap at desktop so both halves stay side by side. */
body.aibt-universal .universal-before-after--quad-metric-result-cards .universal-before-after__split {
	position: relative;
	gap: 0 !important;
	border-radius: var(--decor-radius);
	overflow: hidden;
}

/* Centre seam between the two halves. */
body.aibt-universal .universal-before-after--quad-metric-result-cards .universal-before-after__split::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 2px;
	transform: translateX(-50%);
	background: var(--divider-primary);
	z-index: 2;
}

body.aibt-universal .universal-before-after--quad-metric-result-cards .universal-before-after__half {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
	overflow: hidden;
}

body.aibt-universal .universal-before-after--quad-metric-result-cards .universal-before-after__img {
	margin: 0 !important;
	display: block;
	height: 100%;
}

body.aibt-universal .universal-before-after--quad-metric-result-cards .universal-before-after__img img {
	display: block;
	width: 100%;
	height: 100%;
	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 card's photos on hover — tactile result cue. */
body.aibt-universal .universal-before-after--quad-metric-result-cards .universal-before-after__card:hover .universal-before-after__img img {
	transform: scale(1.04);
}

/* Corner tags — sit on each half.
   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--quad-metric-result-cards .universal-before-after__tag {
	position: absolute;
	top: var(--space-xs);
	z-index: 3;
	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), pinned to the left half. */
body.aibt-universal .universal-before-after--quad-metric-result-cards .universal-before-after__tag--before {
	left: var(--space-xs);
	background: var(--background-dark, #141414);
	color: var(--text-on-dark, #fff) !important;
}

/* "Po" — accent CTA chip to signal the win, pinned to the right half. */
body.aibt-universal .universal-before-after--quad-metric-result-cards .universal-before-after__tag--after {
	right: var(--space-xs);
	background: var(--cta-bg-primary);
	color: var(--cta-text-primary) !important;
}

/* Result chip — the distinguishing element: an accent-tinted outcome line
   beneath the pair. Accent-tinted background (not solid accent) keeps the
   accent-coloured text readable on light AND dark themes (no on-accent gamble).
   overflow-wrap:normal so a tight metric like "–40%" never breaks mid-number. */
body.aibt-universal .universal-before-after--quad-metric-result-cards .universal-before-after__result {
	display: flex;
	align-items: center;
	gap: 0.5em;
	margin: var(--space-sm) 0 0 0 !important;
	padding: 0.55em 0.9em !important;
	font-family: var(--font-display) !important;
	font-size: var(--text-sm) !important;
	font-weight: 700 !important;
	line-height: var(--leading-snug, 1.3) !important;
	letter-spacing: var(--tracking-tight, -0.01em) !important;
	color: var(--accent) !important;
	background: color-mix(in srgb, var(--accent) 12%, transparent);
	border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
	border-radius: var(--decor-radius);
	overflow-wrap: normal;
}

/* Leading dot marker — small accent pip before the metric, drawn in CSS so the
   bound copy stays clean text. */
body.aibt-universal .universal-before-after--quad-metric-result-cards .universal-before-after__result::before {
	content: "";
	flex: 0 0 auto;
	width: 0.55em;
	height: 0.55em;
	border-radius: 50%;
	background: var(--accent);
}

/* Phone — single column of cards; keep the in-card before|after split but cap
   wide tracking (A5) and let the split stack only at the tightest widths. */
@media (max-width: 760px) {
	body.aibt-universal .universal-before-after--quad-metric-result-cards .universal-before-after__quad {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	body.aibt-universal .universal-before-after--quad-metric-result-cards .universal-before-after__kicker,
	body.aibt-universal .universal-before-after--quad-metric-result-cards .universal-before-after__tag {
		letter-spacing: 0 !important;
	}
}

/* Very narrow phones — let the split stack so each photo keeps a usable size. */
@media (max-width: 520px) {
	body.aibt-universal .universal-before-after--quad-metric-result-cards .universal-before-after__split {
		flex-wrap: wrap !important;
	}
	body.aibt-universal .universal-before-after--quad-metric-result-cards .universal-before-after__split::before {
		display: none;
	}
	body.aibt-universal .universal-before-after--quad-metric-result-cards .universal-before-after__half {
		flex: 1 1 100% !important;
	}
}

/* Keyboard affordance — card focus-within mirrors the hover lift, image focus-visible. */
body.aibt-universal .universal-before-after--quad-metric-result-cards .universal-before-after__card:focus-within {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}

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

body.aibt-universal .universal-before-after--quad-metric-result-cards a:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}

/* A8/A9 left-shift fix (2026-06-10): centered intro children (kicker/headline) were
   max-width-capped by WP constrained layout but had horizontal margin 0, pinning them
   to the 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 (0,3,2); harmless on already-centered elements (auto margins
   compute to 0). Only left/right are overridden, top/bottom margins are preserved. */
body.aibt-universal .universal-before-after--quad-metric-result-cards.universal-before-after--quad-metric-result-cards .universal-before-after__kicker,
body.aibt-universal .universal-before-after--quad-metric-result-cards.universal-before-after--quad-metric-result-cards .universal-before-after__headline { margin-inline: auto !important; }
