/**
 * Variant CSS: gallery--single-split-image-text
 * Layer 2 (Path B gallery role — count-1 expansion, 2026-06-10).
 *
 * Two-column layout: a text block (index number, kicker, headline, one caption) on a
 * gently tinted card panel LEFT, and one large landscape photo (4:3) RIGHT bleeding to
 * the panel edge. An editorial, "magazine" content+image split. Unlike
 * portrait-caption-aside (4:5 portrait LEFT, plain text right): the text sits on a
 * tinted panel LEFT and a landscape photo is RIGHT (reversed sides + card panel + index
 * number). All text is off-photo -> polarity-aware --ink / --text-secondary.
 *
 * Layout rule: the columns keep WP-core's flex nowrap at desktop (50/50 fits exactly);
 * flex-wrap:wrap is applied ONLY in the <=781px media query so the columns stack on
 * mobile. NOT a global flex-wrap (that + %-bases summing past 100% with the gap would
 * drop a column below at desktop and leave dead whitespace — known bug). Element Count
 * [1]. Part of the `gallery` role.
 */

body.aibt-universal .universal-gallery--single-split-image-text {
	padding-block: calc(clamp(3rem, 7vw, 5rem) * var(--density, 1));
}

/* Card shell: the panel + photo share one rounded, shadowed surface. */
body.aibt-universal .universal-gallery--single-split-image-text .universal-gallery__split {
	gap: 0 !important;
	border-radius: var(--radius-xl, 24px);
	overflow: hidden;
	box-shadow: 0 26px 64px -34px color-mix(in srgb, var(--ink) 40%, transparent);
	border: 1px solid var(--divider-primary, rgba(128, 128, 128, 0.22));
}

/* Text panel — tinted card surface, generous editorial padding. */
body.aibt-universal .universal-gallery--single-split-image-text .universal-gallery__text-col {
	background: var(--background-card);
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: clamp(2rem, 4.5vw, 3.5rem);
}

body.aibt-universal .universal-gallery--single-split-image-text .universal-gallery__index {
	font-family: var(--font-display) !important;
	font-size: var(--text-2xl) !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	color: var(--accent) !important;
	margin: 0 0 var(--space-md, 1.5rem) 0 !important;
	opacity: 0.55;
}

body.aibt-universal .universal-gallery--single-split-image-text .universal-gallery__kicker {
	font-family: var(--font-body) !important;
	font-size: var(--text-xs) !important;
	font-weight: 600 !important;
	letter-spacing: var(--tracking-widest, 0.24em) !important;
	text-transform: uppercase !important;
	color: var(--accent) !important;
	margin: 0 0 var(--space-sm, 1rem) 0 !important;
}

body.aibt-universal .universal-gallery--single-split-image-text .universal-gallery__headline {
	font-family: var(--font-display) !important;
	color: var(--ink) !important;
	margin: 0 !important;
	text-wrap: balance;
}

body.aibt-universal .universal-gallery--single-split-image-text .universal-gallery__headline em {
	color: var(--accent) !important;
	font-style: italic;
}

body.aibt-universal .universal-gallery--single-split-image-text .universal-gallery__caption {
	font-family: var(--font-body) !important;
	font-size: var(--text-md) !important;
	font-weight: 400 !important;
	color: var(--text-secondary) !important;
	max-width: 42ch;
	margin: var(--space-md, 1.5rem) 0 0 0 !important;
	line-height: var(--leading-relaxed, 1.65);
}

/* Media column — the photo fills the column height so the two sides stay flush. */
body.aibt-universal .universal-gallery--single-split-image-text .universal-gallery__media-col {
	position: relative;
	min-height: 22rem;
}

body.aibt-universal .universal-gallery--single-split-image-text .universal-gallery__img {
	margin: 0 !important;
	position: absolute;
	inset: 0;
	height: 100%;
}

body.aibt-universal .universal-gallery--single-split-image-text .universal-gallery__img img {
	display: block;
	width: 100%;
	height: 100%;
	aspect-ratio: auto;
	object-fit: cover;
	filter: var(--photo-filter, none);
	transition: transform var(--duration-slower, 700ms) var(--ease-expressive, ease);
}

body.aibt-universal .universal-gallery--single-split-image-text .universal-gallery__split:hover .universal-gallery__img img {
	transform: scale(1.03);
}

/* Mobile: stack the columns. flex-wrap:wrap fires ONLY here (not globally), columns
   go full width, the photo gets a fixed aspect again instead of filling height. */
@media (max-width: 781px) {
	body.aibt-universal .universal-gallery--single-split-image-text .universal-gallery__split {
		flex-wrap: wrap !important;
	}
	body.aibt-universal .universal-gallery--single-split-image-text .universal-gallery__text-col,
	body.aibt-universal .universal-gallery--single-split-image-text .universal-gallery__media-col {
		flex-basis: 100% !important;
		width: 100% !important;
	}
	/* Photo first on mobile so the image leads, text reads below it. */
	body.aibt-universal .universal-gallery--single-split-image-text .universal-gallery__media-col {
		order: -1;
		min-height: 0;
	}
	body.aibt-universal .universal-gallery--single-split-image-text .universal-gallery__img {
		position: relative;
		height: auto;
	}
	body.aibt-universal .universal-gallery--single-split-image-text .universal-gallery__img img {
		aspect-ratio: 4 / 3;
	}
}

@media (max-width: 480px) {
	body.aibt-universal .universal-gallery--single-split-image-text .universal-gallery__img img {
		aspect-ratio: 3 / 2;
	}
}

/* Keyboard focus parity with hover (image is the focusable target when a client
   links the photo). */
body.aibt-universal .universal-gallery--single-split-image-text .universal-gallery__img a:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: -4px;
}

@media (prefers-reduced-motion: reduce) {
	body.aibt-universal .universal-gallery--single-split-image-text .universal-gallery__split:hover .universal-gallery__img img {
		transform: none;
	}
}
