/**
 * Variant CSS: gallery--filmstrip-four-col
 *
 * Four tall portrait frames (3:4) in a single row like the cells of a film strip
 * — each with an auto-numbered 01–04 index below it (CSS counter, no binding).
 * Unlike the 2×2 quad or the hero-plus-thumbs: four equal, slender columns make
 * a storyboard-like rhythm. Text stays --ink (polarity aware); kicker, the em and
 * the index take --accent; frames use --decor-radius and images carry
 * --photo-filter. Image src are swapped by the photo system. Dedicated to exactly
 * four photos. Part of the `gallery` role.
 */

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

/* Intro. */
body.aibt-universal .universal-gallery--filmstrip-four-col .universal-gallery__intro {
	margin-bottom: clamp(2rem, 4vw, 3rem);
}

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

body.aibt-universal .universal-gallery--filmstrip-four-col .universal-gallery__headline em {
	color: var(--accent) !important;
	font-style: italic;
}

/* The filmstrip: four even columns, reset the counter on the track. */
body.aibt-universal .universal-gallery--filmstrip-four-col .universal-gallery__film {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(0.6rem, 1.5vw, 1.1rem);
	counter-reset: film-frame;
	align-items: start;
}

/* Each frame: increment the counter; reserve room below the image for the index. */
body.aibt-universal .universal-gallery--filmstrip-four-col .universal-gallery__frame {
	position: relative;
	margin: 0 !important;
	counter-increment: film-frame;
}

body.aibt-universal .universal-gallery--filmstrip-four-col .universal-gallery__frame img {
	display: block;
	width: 100%;
	height: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	border-radius: var(--decor-radius, 14px);
	filter: var(--photo-filter, none);
	transition: transform var(--duration-slow, 500ms) var(--ease-default, ease);
}

body.aibt-universal .universal-gallery--filmstrip-four-col .universal-gallery__frame:hover img,
body.aibt-universal .universal-gallery--filmstrip-four-col .universal-gallery__frame:focus-within img {
	transform: scale(1.04);
}

/* Numeric index rendered from the counter — sits under each frame, hairline above. */
body.aibt-universal .universal-gallery--filmstrip-four-col .universal-gallery__frame::after {
	content: counter(film-frame, decimal-leading-zero);
	display: block;
	margin-top: var(--space-sm);
	padding-top: 0.45rem;
	border-top: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
	font-family: var(--font-display);
	font-size: var(--text-sm);
	font-weight: 700;
	letter-spacing: var(--tracking-wide);
	line-height: 1;
	color: var(--accent);
}

/* Keyboard focus parity with hover (image becomes focusable when a client links it). */
body.aibt-universal .universal-gallery--filmstrip-four-col .universal-gallery__frame a:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 3px;
	border-radius: var(--decor-radius, 14px);
}

/* Tablet: four slender columns get cramped — drop to a 2×2 of taller frames. */
@media (min-width: 641px) and (max-width: 959px) {
	body.aibt-universal .universal-gallery--filmstrip-four-col .universal-gallery__film {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: clamp(0.8rem, 2.4vw, 1.4rem);
	}
}

/* Mobile: two columns; the index stays under each frame. */
@media (max-width: 640px) {
	body.aibt-universal .universal-gallery--filmstrip-four-col .universal-gallery__film {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.6rem;
	}
	body.aibt-universal .universal-gallery--filmstrip-four-col .universal-gallery__kicker {
		letter-spacing: var(--tracking-wide) !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.aibt-universal .universal-gallery--filmstrip-four-col .universal-gallery__frame img {
		transition: none;
	}
	body.aibt-universal .universal-gallery--filmstrip-four-col .universal-gallery__frame:hover img,
	body.aibt-universal .universal-gallery--filmstrip-four-col .universal-gallery__frame:focus-within img {
		transform: none;
	}
}
