/**
 * Variant CSS: gallery--overlap-float-pair
 *
 * One large base photo with a second, smaller photo floated over its bottom-right
 * corner with a soft shadow + a ring that lifts it off the base (hover lift) — a
 * layered composition, like a photo laid on a photo. Unlike a flat duo side by
 * side: the overlap builds depth and walks the eye from backdrop to detail. The
 * base is held below full width so there is room for the float to overlap inward
 * (it never crosses the section edge). On mobile the float drops to a normal
 * second tile. Text stays --ink (polarity aware); kicker + the em take --accent;
 * images carry --photo-filter; the float ring uses --background so it reads as a
 * cut-out on any theme. Image src are swapped by the photo system. Dedicated to
 * exactly two photos. Part of the `gallery` role.
 */

body.aibt-universal .universal-gallery--overlap-float-pair {
	padding-block: calc(clamp(3rem, 7vw, 5.5rem) * var(--density, 1));
	background: var(--background);
	color: var(--text-primary);
}

/* Intro. */
body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__intro {
	margin-bottom: clamp(1.8rem, 4vw, 3rem);
}

body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__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-gallery--overlap-float-pair .universal-gallery__headline {
	font-family: var(--font-display) !important;
	color: var(--ink) !important;
	margin: 0 !important;
}

body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__headline em {
	color: var(--accent) !important;
	font-style: italic;
}

/* The overlap stage. Right padding reserves the lane the float occupies, and
   bottom padding leaves room for the float's drop below the base — so nothing
   spills past the section box. */
body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__overlap {
	position: relative;
	padding-right: clamp(2.5rem, 14vw, 8rem);
	padding-bottom: calc(clamp(2.5rem, 8vw, 5rem) * var(--density, 1));
}

/* Base photo — capped below full width so the float overlaps inward, not off-edge. */
body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__img--base {
	margin: 0 !important;
	width: 86%;
	overflow: hidden;
	border-radius: var(--decor-radius, 16px);
	box-shadow: var(--decor-shadow, none);
}

body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__img--base img {
	display: block;
	width: 100%;
	height: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	filter: var(--photo-filter, none);
	transition: transform var(--duration-slow, 500ms) var(--ease-default, ease);
}

body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__img--base:hover img,
body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__img--base:focus-within img {
	transform: scale(1.04);
}

/* Float photo — sits over the base's bottom-right corner, ringed by the page
   background so it reads as a separate, lifted layer. */
body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__img--float {
	position: absolute;
	right: 0;
	bottom: 0;
	width: clamp(8rem, 30%, 16rem);
	margin: 0 !important;
	overflow: hidden;
	border-radius: var(--decor-radius, 16px);
	border: clamp(5px, 0.7vw, 9px) solid var(--background);
	box-shadow: var(--decor-shadow-elevated, 0 24px 60px color-mix(in srgb, var(--ink) 24%, transparent));
	transition: transform var(--duration-medium, 350ms) var(--ease-default, ease);
	z-index: 2;
}

body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__img--float img {
	display: block;
	width: 100%;
	height: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	filter: var(--photo-filter, none);
}

body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__img--float:hover,
body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__img--float:focus-within {
	transform: translateY(-4px);
}

/* Keyboard focus parity with hover (image becomes focusable when a client links it). */
body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__img a:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 3px;
	border-radius: var(--decor-radius, 16px);
}

/* Tablet: keep the overlap, ease the reserved lanes a little. */
@media (min-width: 641px) and (max-width: 959px) {
	body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__overlap {
		padding-right: clamp(2rem, 10vw, 5rem);
	}
	body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__img--base {
		width: 84%;
	}
	body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__img--float {
		width: clamp(7rem, 32%, 13rem);
	}
}

/* Mobile: drop the overlap. Both photos become full-width stacked tiles; the float
   loses its absolute positioning and reads as a normal second image. */
@media (max-width: 640px) {
	body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__overlap {
		padding-right: 0;
		padding-bottom: 0;
		display: flex;
		flex-direction: column;
		gap: clamp(1.2rem, 5vw, 1.8rem);
	}
	body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__img--base {
		width: 100%;
	}
	body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__img--float {
		position: static;
		width: 70%;
		margin-left: auto !important;
		border-width: clamp(4px, 1.4vw, 6px);
	}
	body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__kicker {
		letter-spacing: var(--tracking-wide) !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__img--base img,
	body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__img--float {
		transition: none;
	}
	body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__img--base:hover img,
	body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__img--base:focus-within img {
		transform: none;
	}
	body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__img--float:hover,
	body.aibt-universal .universal-gallery--overlap-float-pair .universal-gallery__img--float:focus-within {
		transform: none;
	}
}
