/**
 * Variant CSS: gallery--captioned-cards
 *
 * A portfolio of named realizations — a grid of cards, each a 4:3 photo (hover
 * zoom) with a caption (project name / category). Unlike the caption-less grids
 * and mosaics: every image gets context, building "case study" credibility.
 * Text stays --ink (polarity-aware); kicker, em and the caption tick take
 * --accent. Image src are swapped by the photo system. Part of the `gallery` role.
 */

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

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

body.aibt-universal .universal-gallery--captioned-cards .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 auto var(--space-sm) auto !important;
}

body.aibt-universal .universal-gallery--captioned-cards .universal-gallery__headline {
	font-family: var(--font-display) !important;
	color: var(--ink) !important;
	margin: 0 !important;
}

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

/* Cards grid. */
body.aibt-universal .universal-gallery--captioned-cards .universal-gallery__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(1.2rem, 3vw, 2rem);
}

/* Media: 4:3, rounded, hover zoom. */
body.aibt-universal .universal-gallery--captioned-cards .universal-gallery__media {
	position: relative;
	border-radius: var(--decor-radius, 14px);
	overflow: hidden;
	aspect-ratio: 4 / 3;
}

body.aibt-universal .universal-gallery--captioned-cards .universal-gallery__img {
	margin: 0 !important;
	height: 100%;
}

body.aibt-universal .universal-gallery--captioned-cards .universal-gallery__img img {
	display: block;
	width: 100%;
	height: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	transition: transform 600ms var(--ease-default, ease);
}

body.aibt-universal .universal-gallery--captioned-cards .universal-gallery__card:hover .universal-gallery__img img {
	transform: scale(1.05);
}

/* Caption. */
body.aibt-universal .universal-gallery--captioned-cards .universal-gallery__caption {
	display: flex;
	align-items: baseline;
	gap: 0.55rem;
	font-family: var(--font-body) !important;
	font-size: var(--text-sm) !important;
	font-weight: 600 !important;
	color: var(--ink) !important;
	opacity: 0.82;
	margin: var(--space-sm) 0 0 0 !important;
}

body.aibt-universal .universal-gallery--captioned-cards .universal-gallery__caption::before {
	content: "";
	flex: 0 0 auto;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--accent);
	transform: translateY(-1px);
}

/* Tablet: 2 columns. */
@media (max-width: 860px) {
	body.aibt-universal .universal-gallery--captioned-cards .universal-gallery__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Mobile: single column. */
@media (max-width: 520px) {
	body.aibt-universal .universal-gallery--captioned-cards .universal-gallery__grid {
		grid-template-columns: 1fr;
		gap: clamp(1.4rem, 5vw, 2rem);
	}
}

/* A8/A9 left-shift fix (2026-06-08): centered intro element(s) were max-width-capped by
   WP constrained layout but pinned left by horizontal margin:0. Force margin-inline:auto.
   Section class doubled -> specificity (0,4,1) beats h2.__headline-style rules; harmless on
   already-centered elements (auto margins compute to 0). Only left/right are overridden. */
body.aibt-universal .universal-gallery--captioned-cards.universal-gallery--captioned-cards .universal-gallery__headline { margin-inline: auto !important; }
