/**
 * Variant CSS: before-after--scalable-masonry-pairs
 * Layer 2 — Path B before-after role (2026-06-10).
 * A SCALABLE masonry flow of VERTICAL before/after pairs. Pairs pack into balanced
 * vertical columns via CSS multi-column (column-count) with break-inside:avoid, so
 * varied pair heights (alternating 4:3 and 4:5 frames) yield an irregular, justified
 * wall. Each pair = "Przed" photo stacked OVER "Po" photo, with label pills on the
 * shots and a num + title beneath. Pair count flows to the client's project count
 * (clone/trim case-N-* pairs; 6 demo baked). Distinct from dense-duo-grid /
 * thumb-pair-grid (horizontal pairs in an even grid) and results-card-trio (framed
 * 3-up cards): here pairs are vertical and masonry-packed at varied heights.
 */

body.aibt-universal .universal-before-after--scalable-masonry-pairs {
	background: var(--background-alt);
	color: var(--text-primary);
}

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

body.aibt-universal .universal-before-after--scalable-masonry-pairs .universal-before-after__intro > * {
	margin-inline: auto !important;
}

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

/* Masonry — CSS multi-column packs pairs into balanced vertical columns.
   column-count scales by viewport; break-inside:avoid keeps a pair whole.
   This naturally flows for any N (extra pairs just extend the columns). */
body.aibt-universal .universal-before-after--scalable-masonry-pairs .universal-before-after__masonry {
	column-count: 3;
	column-gap: var(--space-lg);
}

@media (max-width: 959px) {
	body.aibt-universal .universal-before-after--scalable-masonry-pairs .universal-before-after__masonry {
		column-count: 2;
	}
}

/* Pair — a masonry item: vertical before-over-after stack + footer. */
body.aibt-universal .universal-before-after--scalable-masonry-pairs .universal-before-after__pair {
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
	margin: 0 0 var(--space-lg) 0;
	display: flex;
	flex-direction: column;
	gap: var(--space-xs) !important;
}

/* Shots — each photo a rounded frame; before sits above after. */
body.aibt-universal .universal-before-after--scalable-masonry-pairs .universal-before-after__shot {
	position: relative;
	overflow: hidden;
	border-radius: var(--decor-radius);
}

/* Seam: a slim accent rule between the stacked before/after frames. */
body.aibt-universal .universal-before-after--scalable-masonry-pairs .universal-before-after__shot--after {
	margin-top: 4px;
}

body.aibt-universal .universal-before-after--scalable-masonry-pairs .universal-before-after__img {
	margin: 0 !important;
	display: block;
}

body.aibt-universal .universal-before-after--scalable-masonry-pairs .universal-before-after__img img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
	filter: var(--photo-filter, none);
	transition: transform var(--duration-slow, 900ms) var(--ease-elegant, ease);
}

/* Gentle paired zoom on hover — tactile result cue. */
body.aibt-universal .universal-before-after--scalable-masonry-pairs .universal-before-after__pair:hover .universal-before-after__img img {
	transform: scale(1.04);
}

/* Label pills — sit on each shot.
   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--scalable-masonry-pairs .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.3em 0.75em !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--scalable-masonry-pairs .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--scalable-masonry-pairs .universal-before-after__tag--after {
	background: var(--cta-bg-primary);
	color: var(--cta-text-primary) !important;
}

/* Footer — ordinal + project title beneath the stacked pair. */
body.aibt-universal .universal-before-after--scalable-masonry-pairs .universal-before-after__foot {
	gap: var(--space-sm) !important;
	padding-top: 2px;
}

body.aibt-universal .universal-before-after--scalable-masonry-pairs .universal-before-after__num {
	flex: 0 0 auto;
	font-family: var(--font-display) !important;
	font-size: var(--text-lg) !important;
	font-weight: 700 !important;
	line-height: 1 !important;
	color: var(--accent) !important;
	margin: 0 !important;
	/* Numeric — keep intact, never break. */
	overflow-wrap: normal;
}

body.aibt-universal .universal-before-after--scalable-masonry-pairs .universal-before-after__caption {
	font-family: var(--font-body) !important;
	font-size: var(--text-sm) !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	color: var(--text-primary) !important;
	margin: 0 !important;
	min-width: 0;
	/* Narrow column — wrap on spaces, do not break PL mid-word. */
	overflow-wrap: normal;
}

/* Phone — single column; cap wide tracking (A5). */
@media (max-width: 600px) {
	body.aibt-universal .universal-before-after--scalable-masonry-pairs .universal-before-after__masonry {
		column-count: 1;
	}
	body.aibt-universal .universal-before-after--scalable-masonry-pairs .universal-before-after__kicker,
	body.aibt-universal .universal-before-after--scalable-masonry-pairs .universal-before-after__tag {
		letter-spacing: 0 !important;
	}
}

/* Keyboard affordance — pair focus-within outline + image focus-visible. */
body.aibt-universal .universal-before-after--scalable-masonry-pairs .universal-before-after__pair:focus-within {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}

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

/* Respect reduced-motion — drop the hover zoom transition. */
@media (prefers-reduced-motion: reduce) {
	body.aibt-universal .universal-before-after--scalable-masonry-pairs .universal-before-after__img img {
		transition: none !important;
	}
	body.aibt-universal .universal-before-after--scalable-masonry-pairs .universal-before-after__pair:hover .universal-before-after__img img {
		transform: none;
	}
}

/* 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. Section class doubled -> specificity (0,4,1)
   beats element-tag-qualified rules like h2.__headline; harmless on already-centered
   elements (auto margins compute to 0). Only left/right are overridden. */
body.aibt-universal .universal-before-after--scalable-masonry-pairs.universal-before-after--scalable-masonry-pairs .universal-before-after__kicker,
body.aibt-universal .universal-before-after--scalable-masonry-pairs.universal-before-after--scalable-masonry-pairs .universal-before-after__headline { margin-inline: auto !important; }
