.gallery {
	display: block;
	columns: var(--tcge-gallery-column-count, auto) var(--tcge-gallery-column-width, 190px);
	column-gap: var(--tcge-gallery-gap, 14px);
	margin: 1.5rem 0 2rem;
}

.gallery.tcge-even-grid,
.gallery[data-tcge-layout="grid"] {
	display: grid;
	grid-template-columns: repeat(var(--tcge-gallery-columns, auto-fit), minmax(min(100%, 160px), 1fr));
	gap: var(--tcge-gallery-gap, 14px);
	columns: auto;
}

.gallery.tcge-compact-gallery {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: center;
	max-width: min(100%, 720px);
	gap: clamp(16px, 3vw, 28px);
	columns: auto;
	margin: 1.35rem auto 2.25rem;
}

.gallery .gallery-item {
	display: block;
	break-inside: avoid;
	float: none;
	width: auto !important;
	max-width: none;
	margin: 0 0 var(--tcge-gallery-gap, 14px);
	page-break-inside: avoid;
	-webkit-column-break-inside: avoid;
}

.gallery.tcge-compact-gallery .gallery-item {
	flex: 0 1 clamp(170px, 24vw, 230px);
	margin: 0;
}

.gallery.tcge-count-1 {
	max-width: min(100%, 320px);
}

.gallery.tcge-count-1 .gallery-item {
	flex-basis: min(100%, 250px);
}

.gallery.tcge-even-grid .gallery-item,
.gallery[data-tcge-layout="grid"] .gallery-item {
	margin: 0;
}

.gallery br {
	display: none;
}

.gallery .gallery-icon {
	position: relative;
	overflow: hidden;
	border-radius: var(--tcge-gallery-radius, 8px);
	background: #ffffff;
	box-shadow: var(--tcge-gallery-shadow, 0 12px 30px rgba(0, 0, 0, 0.16));
	outline: 1px solid rgba(0, 0, 0, 0.04);
}

.gallery .gallery-icon a,
.gallery .gallery-icon img {
	display: block;
	width: 100%;
}

.gallery .gallery-icon a {
	color: inherit;
	cursor: zoom-in;
}

.gallery .gallery-icon img {
	height: auto;
	object-fit: cover;
	transition: transform 180ms ease, filter 180ms ease;
}

.gallery.tcge-compact-gallery .gallery-icon img {
	min-height: 150px;
}

.gallery.tcge-even-grid .gallery-icon,
.gallery[data-tcge-layout="grid"] .gallery-icon {
	aspect-ratio: 1 / 1;
}

.gallery.tcge-even-grid .gallery-icon img,
.gallery[data-tcge-layout="grid"] .gallery-icon img {
	height: 100%;
}

.gallery .gallery-icon a:hover img,
.gallery .gallery-icon a:focus img {
	filter: saturate(1.08) contrast(1.03);
	transform: scale(1.035);
}

.gallery .gallery-caption {
	display: var(--tcge-captions-display, block);
	margin: 0.45rem 0 0;
	color: inherit;
	font-size: 0.9rem;
	line-height: 1.35;
	text-align: left;
}

.tcge-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0, 0, 0, 0.88);
	color: #ffffff;
}

.tcge-lightbox.is-open {
	display: flex;
}

.tcge-lightbox__figure {
	max-width: min(1100px, 100%);
	max-height: 100%;
	margin: 0;
}

.tcge-lightbox__image {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 112px);
	margin: 0 auto;
	border-radius: 4px;
	box-shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
}

.tcge-lightbox__caption {
	max-width: 780px;
	margin: 14px auto 0;
	font-size: 0.95rem;
	line-height: 1.45;
	text-align: center;
}

.tcge-lightbox__button {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 1px solid rgba(255, 255, 255, 0.34);
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.35);
	color: #ffffff;
	cursor: pointer;
	font-size: 28px;
	line-height: 1;
}

.tcge-lightbox__button:hover,
.tcge-lightbox__button:focus {
	background: rgba(255, 255, 255, 0.18);
	outline: 2px solid #9BDDC1;
	outline-offset: 2px;
}

.tcge-lightbox__close {
	top: 18px;
	right: 18px;
}

.tcge-lightbox__prev {
	left: 18px;
}

.tcge-lightbox__next {
	right: 18px;
}

body.tcge-lightbox-open {
	overflow: hidden;
}

@media (max-width: 680px) {
	.gallery {
		columns: 2 auto;
	}

	.gallery.tcge-compact-gallery {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		max-width: 100%;
		gap: 14px;
	}

	.gallery.tcge-count-1 {
		grid-template-columns: minmax(0, min(250px, 100%));
		justify-content: center;
	}

	.gallery.tcge-even-grid,
	.gallery[data-tcge-layout="grid"] {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.tcge-lightbox {
		padding: 16px;
	}

	.tcge-lightbox__image {
		max-height: calc(100vh - 96px);
	}

	.tcge-lightbox__button {
		width: 40px;
		height: 40px;
		font-size: 24px;
	}
}
