/**
 * Gallery — split / centered families + arrangement + grid / carousel / bento recipes.
 * Companion to app.css; input.css is root-owned on this host.
 * Split paints mosaics inside the panel. Carousel chrome lives in theme-carousel.css.
 * Forbidden: Splide; CSS overflow-x / snap marketed as a carousel.
 */
.tw-gallery-split,
.tw-gallery-split__copy,
.tw-gallery-split__panel,
.tw-gallery-centered,
.tw-gallery-centered__panel,
.tw-gallery-grid,
.tw-gallery-bento-grid,
.tw-gallery-carousel {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: var(--tw-content-gap, 1rem);
}

.tw-gallery-split,
.tw-gallery-centered {
	gap: var(--tw-intro-panel-gap, calc(var(--tw-content-gap, 1rem) * 2));
}

.tw-gallery-split {
	display: flex;
	flex-direction: column;
}

.tw-gallery-centered {
	display: flex;
	flex-direction: column;
	width: 100%;
}

.tw-gallery-split__panel,
.tw-gallery-centered__panel {
	gap: var(--tw-content-gap, 1rem);
}

.tw-gallery-split .tw-section-intro,
.tw-gallery-centered .tw-section-intro {
	display: flex;
	flex-direction: column;
	gap: var(--tw-content-gap, 1rem);
}

.tw-gallery-grid,
.tw-gallery-bento-grid {
	display: grid;
	gap: var(--tw-content-gap, 1rem);
	grid-template-columns: minmax(0, 1fr);
}

.tw-gallery-grid[data-tw-gallery-masonry] {
	display: block;
	column-count: 2;
	column-gap: var(--tw-content-gap, 1rem);
}

.tw-gallery-grid[data-tw-gallery-masonry] > [role="listitem"] {
	break-inside: avoid;
	margin-block-end: var(--tw-content-gap, 1rem);
}

.tw-gallery-grid[data-tw-gallery-stacked] {
	display: flex;
	flex-direction: column;
	gap: var(--tw-content-gap, 1rem);
}

.tw-gallery-grid[data-tw-gallery-grid-style="dark"] [data-tw-gallery-glass] {
	background-color: color-mix(in srgb, var(--tw-color-page, #fff) 10%, var(--tw-color-text, #0f172a));
	color: var(--tw-color-page, #fff);
	box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
}

.tw-gallery-grid[data-tw-gallery-grid-style="bordered"] [data-tw-gallery-frame] {
	border: 2px solid var(--tw-color-border, #cbd5e1);
	background-color: var(--tw-color-surface, #fff);
}

@media (max-width: 1023.98px) {
	[data-tw-gallery-mobile-stack="above"] .tw-gallery-split__panel {
		order: -1;
	}
}

@media (min-width: 640px) {
	.tw-gallery-grid[data-tw-gallery-grid-style="uniform"] {
		grid-template-columns: repeat(var(--tw-gallery-per-row, 3), minmax(0, 1fr));
	}

	.tw-gallery-grid[data-tw-gallery-grid-style="featured"][data-tw-gallery-lead="start"] {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.tw-gallery-grid[data-tw-gallery-grid-style="featured"][data-tw-gallery-lead="start"] > .tw-gallery-grid__lead {
		grid-column: span 2;
		grid-row: span 2;
	}

	.tw-gallery-grid[data-tw-gallery-grid-style="featured"][data-tw-gallery-lead="center"] {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.tw-gallery-grid[data-tw-gallery-grid-style="featured"][data-tw-gallery-lead="center"] > .tw-gallery-grid__lead {
		grid-column: 1 / -1;
	}

	.tw-gallery-grid[data-tw-gallery-grid-style="bordered"],
	.tw-gallery-grid[data-tw-gallery-grid-style="dark"] {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.tw-gallery-bento-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.tw-gallery-bento-grid[data-tw-gallery-bento="spotlight"] > [role="listitem"]:first-child,
	.tw-gallery-bento-grid[data-tw-gallery-bento="banner"] > [role="listitem"]:first-child {
		grid-column: 1 / -1;
	}
}

@media (min-width: 1024px) {
	.tw-gallery-split {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		align-items: stretch;
	}

	.tw-gallery-split[data-tw-gallery-split-ratio="60_40"] {
		grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	}

	.tw-gallery-split[data-tw-gallery-split-ratio="75_25"] {
		grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
	}

	.tw-gallery-split[data-tw-gallery-panel-side="start"][data-tw-gallery-split-ratio="60_40"] {
		grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	}

	.tw-gallery-split[data-tw-gallery-panel-side="start"][data-tw-gallery-split-ratio="75_25"] {
		grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
	}

	.tw-gallery-split[data-tw-gallery-panel-side="start"] .tw-gallery-split__panel {
		order: -1;
	}

	.tw-gallery-grid[data-tw-gallery-masonry="3"] {
		column-count: 3;
	}

	.tw-gallery-grid[data-tw-gallery-grid-style="bordered"],
	.tw-gallery-grid[data-tw-gallery-grid-style="dark"] {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.tw-gallery-bento-grid[data-tw-gallery-bento="spotlight"] {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		grid-auto-rows: minmax(11rem, auto);
	}

	.tw-gallery-bento-grid[data-tw-gallery-bento="spotlight"] > [role="listitem"]:first-child {
		grid-column: span 2;
		grid-row: span 2;
		min-height: 22rem;
	}

	.tw-gallery-bento-grid[data-tw-gallery-bento="banner"] {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		grid-auto-rows: minmax(10rem, auto);
	}

	.tw-gallery-bento-grid[data-tw-gallery-bento="banner"] > [role="listitem"]:first-child {
		grid-column: 1 / -1;
		min-height: 12rem;
	}

	.tw-gallery-bento-grid[data-tw-gallery-bento="stagger"] {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		grid-auto-rows: minmax(11rem, auto);
	}

	.tw-gallery-bento-grid[data-tw-gallery-bento="stagger"] > [role="listitem"]:nth-child(4n + 1),
	.tw-gallery-bento-grid[data-tw-gallery-bento="stagger"] > [role="listitem"]:nth-child(4n + 4) {
		grid-column: span 2;
	}
}

/* Isolated count tracks — never a forced 3-col when N is 2 or 4. */
@media (min-width: 640px) {
	.tw-gallery-grid[data-tw-gallery-count="2"][data-tw-gallery-grid-style="uniform"] {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.tw-gallery-grid[data-tw-gallery-width="theme"],
.tw-gallery-carousel[data-tw-gallery-width="theme"] {
	width: 100%;
	max-width: var(--tw-container-max-width, 80rem);
	margin-inline: auto;
}

.tw-gallery-grid[data-tw-gallery-width="sm"],
.tw-gallery-carousel[data-tw-gallery-width="sm"] {
	width: 100%;
	max-width: 42rem;
	margin-inline: auto;
}

.tw-gallery-grid[data-tw-gallery-width="md"],
.tw-gallery-carousel[data-tw-gallery-width="md"] {
	width: 100%;
	max-width: 48rem;
	margin-inline: auto;
}

.tw-gallery-grid[data-tw-gallery-width="lg"],
.tw-gallery-carousel[data-tw-gallery-width="lg"] {
	width: 100%;
	max-width: 56rem;
	margin-inline: auto;
}

.tw-gallery-grid[data-tw-gallery-width="full"],
.tw-gallery-carousel[data-tw-gallery-width="full"] {
	width: 100%;
	max-width: none;
}

.tw-gallery-lightbox__trigger {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: inherit;
	cursor: zoom-in;
}

.tw-gallery-lightbox__trigger img {
	display: block;
	width: 100%;
}

.tw-gallery-lightbox {
	direction: ltr;
	position: fixed;
	inset: 0;
	z-index: 80;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
	border: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	background: transparent;
	color: #fff;
}

.tw-gallery-lightbox[open] {
	display: flex;
}

.tw-gallery-lightbox::backdrop {
	background: rgb(15 23 42 / 0.88);
}

.tw-gallery-lightbox__backdrop {
	position: absolute;
	inset: 0;
	z-index: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgb(15 23 42 / 0.88);
	cursor: default;
}

.tw-gallery-lightbox__stage {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: min(72rem, 100%);
	max-height: 100%;
	gap: 0.75rem;
	pointer-events: none;
	touch-action: pan-y;
}

.tw-gallery-lightbox__frame {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-height: min(80vh, 52rem);
}

.tw-gallery-lightbox__img {
	display: block;
	max-width: 100%;
	max-height: min(80vh, 52rem);
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 0.75rem;
	user-select: none;
	-webkit-user-drag: none;
}

.tw-gallery-lightbox__meta {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.25rem;
	max-width: 40rem;
	text-align: center;
}

.tw-gallery-lightbox__caption {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.5;
	color: rgb(255 255 255 / 0.88);
}

.tw-gallery-lightbox__counter {
	margin: 0;
	font-size: 0.8rem;
	letter-spacing: 0.04em;
	color: rgb(255 255 255 / 0.62);
}

.tw-gallery-lightbox__close,
.tw-gallery-lightbox__prev,
.tw-gallery-lightbox__next,
.tw-gallery-lightbox__frame,
.tw-gallery-lightbox__meta {
	pointer-events: auto;
}

.tw-gallery-lightbox__close,
.tw-gallery-lightbox__prev,
.tw-gallery-lightbox__next {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 1px solid rgb(255 255 255 / 0.22);
	border-radius: 999px;
	background: rgb(15 23 42 / 0.45);
	color: #fff;
	cursor: pointer;
}

.tw-gallery-lightbox__close {
	top: 0.25rem;
	right: 0.25rem;
	left: auto;
}

.tw-gallery-lightbox__prev,
.tw-gallery-lightbox__next {
	top: 50%;
	transform: translateY(-50%);
}

.tw-gallery-lightbox__prev {
	left: 0.25rem;
	right: auto;
}

.tw-gallery-lightbox__next {
	right: 0.25rem;
	left: auto;
}

.tw-gallery-lightbox__close:hover,
.tw-gallery-lightbox__prev:hover,
.tw-gallery-lightbox__next:hover {
	background: rgb(15 23 42 / 0.72);
}

.tw-gallery-lightbox[data-tw-gallery-lightbox-count="1"] .tw-gallery-lightbox__prev,
.tw-gallery-lightbox[data-tw-gallery-lightbox-count="1"] .tw-gallery-lightbox__next {
	display: none;
}

body.tw-gallery-lightbox-open {
	overflow: hidden;
}

.tw-gallery-carousel [data-tw-gallery-tween] {
	will-change: transform;
	transform: translate3d(0, 0, 0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
	.tw-gallery-carousel [data-tw-gallery-tween] {
		transform: none !important;
		will-change: auto;
	}
}
