/**
 * Variant CSS: gallery--fullscreen-scroll-snap
 *
 * Full-bleed horizontal scroll-snap gallery: one cover frame per slide, each
 * slide is exactly one viewport-width (flex: 0 0 100%) with `scroll-snap-type:
 * x mandatory`, so photos advance one-at-a-time like a slideshow (zero JS,
 * drag / swipe). Distinct from the carousel (several narrow slides visible) and
 * the wide-strip (16:10 frames side by side). A bottom gradient scrim carries
 * the overlay caption — that surface is always dark, so the title uses
 * --text-on-dark and the meta line lifts via an accent mix (KI-020 — never bare
 * --accent on dark). A static row of dots hints the count. Image src are
 * swapped by the photo system. Part of the `gallery` role.
 */

body.aibt-universal .universal-gallery--fullscreen-scroll-snap {
	padding-block: calc(clamp(3rem, 7vw, 5rem) * var(--density, 1));
	background: var(--background);
	color: var(--text-primary);
	overflow: hidden;
}

/* Intro. */
body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__intro {
	margin-bottom: clamp(1.8rem, 4vw, 2.8rem);
}

body.aibt-universal .universal-gallery--fullscreen-scroll-snap .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;
	/* Centered child of the full-width constrained section — keep auto side
	   margins (A8/A9) so it does not left-pin. */
	margin: 0 auto var(--space-sm) auto !important;
}

body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__headline {
	font-family: var(--font-display) !important;
	color: var(--ink) !important;
	margin: 0 auto !important;
}

body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__headline em {
	color: var(--accent) !important;
	font-style: italic;
}

/* Full-bleed viewport: horizontal scroll-snap track, one slide per screen. */
body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__viewport {
	display: flex;
	flex-wrap: nowrap;
	gap: 0;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	margin-top: clamp(1.4rem, 3vw, 2.2rem);
}

body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__viewport::-webkit-scrollbar {
	display: none;
}

/* Each slide is one full viewport-width and snaps to the start. */
body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__slide {
	position: relative;
	flex: 0 0 100%;
	width: 100%;
	max-width: 100%;
	margin: 0 !important;
	scroll-snap-align: start;
	scroll-snap-stop: always;
	isolation: isolate;
	box-sizing: border-box;
}

body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__img {
	margin: 0 !important;
	display: block;
}

body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__img img {
	display: block;
	width: 100%;
	height: clamp(20rem, 62vh, 40rem);
	aspect-ratio: 16 / 9;
	object-fit: cover;
	filter: var(--photo-filter, none);
}

/* Overlay caption on a bottom gradient scrim (always-dark surface → KI-020). */
body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__caption {
	position: absolute;
	inset: auto 0 0 0;
	width: 100%;
	box-sizing: border-box;
	padding: clamp(3rem, 8vw, 5rem) clamp(1.4rem, 5vw, 4rem) clamp(1.4rem, 4vw, 2.4rem);
	background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.4) 55%, rgba(0, 0, 0, 0) 100%);
}

body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__cap-meta {
	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;
	/* Accent lift readable on the dark scrim (KI-020 — never bare --accent here). */
	color: color-mix(in srgb, var(--accent) 60%, var(--on-dark, #fff)) !important;
	margin: 0 0 0.4rem 0 !important;
}

body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__cap-title {
	font-family: var(--font-display) !important;
	font-size: clamp(1.4rem, 3.4vw, 2.2rem) !important;
	font-weight: 600 !important;
	line-height: 1.1 !important;
	color: var(--text-on-dark, #fff) !important;
	margin: 0 !important;
}

/* Dots + hint row below the strip. */
body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__dots {
	display: flex !important;
	flex-direction: column;
	align-items: center;
	gap: 0.7rem;
	margin-top: clamp(1.2rem, 3vw, 1.8rem);
}

body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: var(--decor-radius-pill, 999px);
	background: color-mix(in srgb, var(--ink) 22%, transparent);
	margin: 0 4px;
	vertical-align: middle;
	/* Animate width too so the active pill grows smoothly, not just the color. */
	transition: background var(--duration-fast, 200ms) var(--ease-default, ease),
		width var(--duration-fast, 200ms) var(--ease-default, ease);
}

body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__dot--active {
	background: var(--accent);
	width: 22px;
}

body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__hint-text {
	font-family: var(--font-body) !important;
	font-size: var(--text-xs) !important;
	font-weight: 500 !important;
	letter-spacing: var(--tracking-wide) !important;
	text-transform: uppercase !important;
	color: color-mix(in srgb, var(--ink) 55%, transparent) !important;
	/* Centered child — keep auto side margins (A8/A9). */
	margin: 0 auto !important;
	text-align: center;
}

/* Focus ring for the keyboard path (image link is the focus target). */
body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__slide:focus-within {
	outline: 2px solid var(--accent);
	outline-offset: -4px;
}

/* Mobile: shorter frames, tighter caption padding. */
@media (max-width: 781px) {
	body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__img img {
		height: clamp(15rem, 52vh, 26rem);
	}
}

/* Drop wide uppercase tracking on small screens (A5). */
@media (max-width: 640px) {
	body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__kicker,
	body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__cap-meta,
	body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__hint-text {
		letter-spacing: 0 !important;
	}
}

/* Respect reduced motion: no smooth scroll animation, no dot transition. */
@media (prefers-reduced-motion: reduce) {
	body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__viewport {
		scroll-behavior: auto;
	}
	body.aibt-universal .universal-gallery--fullscreen-scroll-snap .universal-gallery__dot {
		transition: none;
	}
}
