/**
 * Variant CSS: before-after--quad-split-rows
 * Layer 2 — Path B before-after role (before-after count-4 expansion 2026-06-10).
 * FOUR full-width rows. Each row = a slim left rail (big ordinal over the bound
 * project title) followed by an edge-to-edge "Przed | Po" split whose two halves
 * kiss on a labelled centre seam (a thin divider carrying a small "→" marker).
 * Distinct from register-rows-quad (small index + title-left + a plain compact
 * pair on the right, no seam) and quad-grid-cards (a 2x2 of bordered cards):
 * here the four cases read as a wide, cinematic register of seam-splits.
 */

body.aibt-universal .universal-before-after--quad-split-rows {
	background: var(--background);
	color: var(--text-primary);
}

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

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

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

/* Rows — vertical list of full-width register rows. */
body.aibt-universal .universal-before-after--quad-split-rows .universal-before-after__rows {
	display: flex;
	flex-direction: column;
	gap: var(--space-lg);
}

/* Row — left rail + split; a hairline rule under each row separates the register.
   align-items:stretch so the rail divider matches the split height. */
body.aibt-universal .universal-before-after--quad-split-rows .universal-before-after__row {
	gap: var(--space-lg) !important;
	align-items: stretch !important;
}

body.aibt-universal .universal-before-after--quad-split-rows .universal-before-after__row + .universal-before-after__row {
	border-top: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
	padding-top: var(--space-lg);
}

/* Left rail — pinned narrow; ordinal stacked over the title.
   flex:0 0 22% + overflow-wrap:normal keeps Polish titles from breaking mid-word
   when the rail is starved (register-rows-quad trap, 2026-06-10). */
body.aibt-universal .universal-before-after--quad-split-rows .universal-before-after__rail {
	flex: 0 0 22%;
	max-width: 220px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: var(--space-xs);
	overflow-wrap: normal;
}

body.aibt-universal .universal-before-after--quad-split-rows .universal-before-after__num {
	font-family: var(--font-display) !important;
	font-size: var(--text-4xl) !important;
	font-weight: 700 !important;
	line-height: 0.9 !important;
	letter-spacing: var(--tracking-tight) !important;
	color: var(--accent) !important;
	margin: 0 !important;
}

body.aibt-universal .universal-before-after--quad-split-rows .universal-before-after__row-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;
	overflow-wrap: normal;
}

/* Split — before half | after half, kissing on a centre seam.
   flex:1 1 auto so the split eats the remaining row width; gap:0 so the photos
   meet; the seam + marker are painted over the join. */
body.aibt-universal .universal-before-after--quad-split-rows .universal-before-after__split {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	gap: 0 !important;
	border-radius: var(--decor-radius);
	overflow: hidden;
}

/* Centre seam line between the two halves. */
body.aibt-universal .universal-before-after--quad-split-rows .universal-before-after__split::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 3px;
	transform: translateX(-50%);
	background: var(--background, #fff);
	z-index: 2;
}

/* Centre "→" marker chip sitting on the seam — signals before → after.
   Accent CTA chip; fixed rgba shadow lifts it off either photo. */
body.aibt-universal .universal-before-after--quad-split-rows .universal-before-after__split::after {
	content: "→";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 3;
	display: grid;
	place-items: center;
	width: 2.4em;
	height: 2.4em;
	font-family: var(--font-body);
	font-size: var(--text-base);
	font-weight: 700;
	line-height: 1;
	color: var(--cta-text-primary);
	background: var(--cta-bg-primary);
	border-radius: var(--decor-radius-pill);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.24);
	pointer-events: none;
}

body.aibt-universal .universal-before-after--quad-split-rows .universal-before-after__half {
	position: relative;
	flex: 1 1 50%;
	min-width: 0;
	overflow: hidden;
}

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

body.aibt-universal .universal-before-after--quad-split-rows .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 row's photos on hover — tactile result cue
   (reduced-motion handled globally by the skeleton). */
body.aibt-universal .universal-before-after--quad-split-rows .universal-before-after__row: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-split-rows .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-split-rows .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-split-rows .universal-before-after__tag--after {
	right: var(--space-xs);
	background: var(--cta-bg-primary);
	color: var(--cta-text-primary) !important;
}

/* Tablet — rail drops above the split; centre marker stays on the seam. */
@media (max-width: 781px) {
	body.aibt-universal .universal-before-after--quad-split-rows .universal-before-after__row {
		flex-wrap: wrap !important;
		gap: var(--space-md) !important;
	}
	body.aibt-universal .universal-before-after--quad-split-rows .universal-before-after__rail {
		flex: 1 1 100%;
		max-width: none;
		flex-direction: row;
		align-items: baseline;
		gap: var(--space-sm);
	}
	body.aibt-universal .universal-before-after--quad-split-rows .universal-before-after__num {
		font-size: var(--text-2xl) !important;
	}
	body.aibt-universal .universal-before-after--quad-split-rows .universal-before-after__split {
		flex: 1 1 100%;
	}
}

/* Phone — stack the split's two halves (before over after) so nothing clips;
   re-orient the seam to a horizontal rule and cap wide tracking (A5). */
@media (max-width: 640px) {
	body.aibt-universal .universal-before-after--quad-split-rows .universal-before-after__split {
		flex-direction: column !important;
	}
	body.aibt-universal .universal-before-after--quad-split-rows .universal-before-after__split::before {
		top: 50%;
		bottom: auto;
		left: 0;
		right: 0;
		width: auto;
		height: 3px;
		transform: translateY(-50%);
	}
	body.aibt-universal .universal-before-after--quad-split-rows .universal-before-after__tag--after {
		right: auto;
		left: var(--space-xs);
	}
	body.aibt-universal .universal-before-after--quad-split-rows .universal-before-after__kicker,
	body.aibt-universal .universal-before-after--quad-split-rows .universal-before-after__tag {
		letter-spacing: 0 !important;
	}
}

/* Keyboard affordance — row focus-within outline + image focus-visible. */
body.aibt-universal .universal-before-after--quad-split-rows .universal-before-after__row:focus-within {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}

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

/* 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-split-rows.universal-before-after--quad-split-rows .universal-before-after__kicker,
body.aibt-universal .universal-before-after--quad-split-rows.universal-before-after--quad-split-rows .universal-before-after__headline { margin-inline: auto !important; }
