/**
 * Variant CSS: gallery--quad-passepartout-frames
 *
 * Four photos as gallery prints set in thick passe-partout mats, arranged 2×2
 * like an exhibition wall. Each frame is a neutral, ink-tinted mat with generous
 * padding, a thin inner keyline (inset box-shadow) holding the photo off the
 * edge, and a soft outer frame shadow — calm, premium, "matted print" feel.
 * Unlike framed-quad-captions (thin border + numbered label): here the mat is
 * much heavier and the keyline gives the photo museum breathing room. An optional
 * centered caption sits below each print. Text stays --ink / --text-secondary
 * (polarity aware); kicker + the em take --accent; the mat is an ink-tint of the
 * background so it reads on both light and dark themes; 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--quad-passepartout-frames {
	padding-block: calc(clamp(var(--space-2xl), 7vw, var(--space-3xl)) * var(--density, 1));
	background: var(--background);
	color: var(--text-primary);
}

/* Intro. */
body.aibt-universal .universal-gallery--quad-passepartout-frames .universal-gallery__intro {
	margin-bottom: clamp(var(--space-xl), 4vw, var(--space-2xl));
}

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

body.aibt-universal .universal-gallery--quad-passepartout-frames .universal-gallery__headline em {
	color: var(--accent) !important;
	font-style: italic;
}

body.aibt-universal .universal-gallery--quad-passepartout-frames .universal-gallery__deck {
	font-family: var(--font-body) !important;
	font-size: var(--text-md) !important;
	line-height: var(--leading-relaxed, 1.6) !important;
	color: var(--text-secondary) !important;
	margin: var(--space-sm) 0 0 0 !important;
}

/* The 2×2 quad: two even columns of matted prints. */
body.aibt-universal .universal-gallery--quad-passepartout-frames .universal-gallery__quad {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(var(--space-lg), 3vw, var(--space-xl));
}

/* Frame = the passe-partout mat: a generous ink-tinted board with a thin inner
   keyline and a soft outer frame shadow. The wide padding IS the passe-partout. */
body.aibt-universal .universal-gallery--quad-passepartout-frames .universal-gallery__frame {
	margin: 0 !important;
	background: color-mix(in srgb, var(--text-primary) 4%, var(--background));
	border-radius: var(--decor-radius, 14px);
	/* Generous mat padding (the passe-partout) — extra room under the print
	   so the optional caption sits inside the board like a museum label. */
	padding: clamp(var(--space-lg), 3vw, var(--space-xl));
	padding-bottom: calc(clamp(var(--space-md), 2.4vw, var(--space-lg)) * var(--density, 1));
	/* Thin inner keyline (accent-tinted) + soft outer frame shadow. */
	box-shadow:
		inset 0 0 0 1px color-mix(in srgb, var(--accent) 15%, transparent),
		var(--decor-shadow-soft, var(--decor-shadow, none));
	transition:
		box-shadow var(--duration-medium, 320ms) var(--ease-default, ease),
		transform var(--duration-medium, 320ms) var(--ease-default, ease);
}

body.aibt-universal .universal-gallery--quad-passepartout-frames .universal-gallery__frame:hover,
body.aibt-universal .universal-gallery--quad-passepartout-frames .universal-gallery__frame:focus-within {
	box-shadow:
		inset 0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent),
		var(--decor-shadow-elevated, var(--decor-shadow-soft, var(--decor-shadow, none)));
	transform: translateY(-3px);
}

/* The print: a second, tighter keyline hugs the photo (the inner mat line),
   then the image fills it with object-fit cover. */
body.aibt-universal .universal-gallery--quad-passepartout-frames .universal-gallery__item {
	margin: 0 !important;
	overflow: hidden;
	border-radius: calc(var(--decor-radius, 14px) - 8px);
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--text-primary) 12%, transparent);
}

body.aibt-universal .universal-gallery--quad-passepartout-frames .universal-gallery__item 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);
}

/* Subtle hover: a gentle zoom inside the clipped print. */
body.aibt-universal .universal-gallery--quad-passepartout-frames .universal-gallery__frame:hover .universal-gallery__item img,
body.aibt-universal .universal-gallery--quad-passepartout-frames .universal-gallery__frame:focus-within .universal-gallery__item img {
	transform: scale(1.04);
}

/* Caption: a small centered museum label under the print. Centered descendant of
   a constrained section → must keep horizontal auto margins (A8/A9). */
body.aibt-universal .universal-gallery--quad-passepartout-frames .universal-gallery__cap {
	font-family: var(--font-body) !important;
	font-size: var(--text-sm) !important;
	line-height: var(--leading-snug, 1.4) !important;
	letter-spacing: var(--tracking-wide) !important;
	text-align: center !important;
	color: var(--text-secondary) !important;
	margin: var(--space-md) auto 0 auto !important;
}

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

/* Tablet: keep the 2×2, trim the gap a touch. */
@media (min-width: 641px) and (max-width: 959px) {
	body.aibt-universal .universal-gallery--quad-passepartout-frames .universal-gallery__quad {
		gap: clamp(var(--space-md), 2.4vw, var(--space-lg));
	}
}

/* Mobile: a single column lets the heavy mats + captions breathe (no cramped 2×2). */
@media (max-width: 640px) {
	body.aibt-universal .universal-gallery--quad-passepartout-frames .universal-gallery__quad {
		grid-template-columns: 1fr;
		gap: clamp(var(--space-lg), 5vw, var(--space-xl));
	}
	body.aibt-universal .universal-gallery--quad-passepartout-frames .universal-gallery__kicker {
		letter-spacing: var(--tracking-wide) !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.aibt-universal .universal-gallery--quad-passepartout-frames .universal-gallery__frame,
	body.aibt-universal .universal-gallery--quad-passepartout-frames .universal-gallery__item img {
		transition: none;
	}
	body.aibt-universal .universal-gallery--quad-passepartout-frames .universal-gallery__frame:hover,
	body.aibt-universal .universal-gallery--quad-passepartout-frames .universal-gallery__frame:focus-within {
		transform: none;
	}
	body.aibt-universal .universal-gallery--quad-passepartout-frames .universal-gallery__frame:hover .universal-gallery__item img,
	body.aibt-universal .universal-gallery--quad-passepartout-frames .universal-gallery__frame:focus-within .universal-gallery__item img {
		transform: none;
	}
}
