.chaves-galeria {
	--chaves-accent: var(--gd-arrow-hover, #9f204c);
	position: relative;
	width: 100%;
	margin: 1.5rem 0;
	box-sizing: border-box;
}

.chaves-galeria *,
.chaves-lightbox * {
	box-sizing: border-box;
}

.chaves-galeria__items {
	display: grid;
	grid-template-columns: repeat(var(--chaves-columns, 3), minmax(0, 1fr));
	gap: 12px;
}

.chaves-galeria__item {
	position: relative;
	margin: 0;
	overflow: hidden;
	border-radius: 8px;
	background: #f2f4f7;
}

.chaves-galeria__link {
	display: block;
	height: 100%;
	cursor: zoom-in;
}

.chaves-galeria__image {
	display: block;
	width: 100%;
	height: 260px;
	object-fit: cover;
	transition: transform .25s ease, filter .25s ease;
}

.chaves-galeria__link:hover .chaves-galeria__image,
.chaves-galeria__link:focus-visible .chaves-galeria__image {
	transform: scale(1.035);
	filter: brightness(.9);
}

.chaves-galeria__link:focus-visible {
	outline: 3px solid var(--chaves-accent);
	outline-offset: -3px;
}

.chaves-galeria__caption {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	padding: 28px 12px 10px;
	color: #fff;
	font-size: 14px;
	line-height: 1.35;
	background: linear-gradient(transparent, rgba(0, 0, 0, .78));
	pointer-events: none;
}

.chaves-galeria--slider {
	padding: 0 52px 32px;
}

.chaves-galeria--slider .chaves-galeria__items {
	display: block;
}

.chaves-galeria--slider .chaves-galeria__item {
	display: none;
	width: 100%;
	max-height: 680px;
	background: var(--gd-image-bg, transparent);
}

.chaves-galeria--slider .chaves-galeria__item.is-active {
	display: block;
}

.chaves-galeria--slider .chaves-galeria__image {
	width: 100%;
	height: min(68vh, 680px);
	object-fit: contain;
	background: var(--gd-image-bg, transparent);
}

.chaves-galeria__nav {
	position: absolute;
	z-index: 2;
	top: 50%;
	width: 42px;
	height: 52px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	color: var(--gd-arrow-text, #fff);
	background: var(--gd-arrow-bg, #cc2f66);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	transform: translateY(-50%);
}

.chaves-galeria__nav:hover,
.chaves-galeria__nav:focus-visible {
	color: var(--gd-arrow-text, #fff);
	background: var(--gd-arrow-hover, #9f204c);
}

.chaves-galeria__prev { left: 0; }
.chaves-galeria__next { right: 0; }

.chaves-galeria__status {
	position: absolute;
	right: 0;
	bottom: 4px;
	left: 0;
	text-align: center;
	font-size: 14px;
}

.chaves-lightbox {
	position: fixed;
	z-index: 999999;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 62px 72px;
	background: rgba(0, 0, 0, .94);
}

.chaves-lightbox[hidden] { display: none; }

.chaves-lightbox__image {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 150px);
	object-fit: contain;
	box-shadow: 0 8px 38px rgba(0, 0, 0, .42);
}

.chaves-lightbox__stage {
	position: relative;
	display: inline-flex;
	max-width: 100%;
	max-height: calc(100vh - 150px);
}

.chaves-watermark {
	position: absolute;
	z-index: 4;
	display: block;
	width: var(--gd-watermark-size, 18%);
	max-width: 50%;
	max-height: 50%;
	opacity: .78;
	object-fit: contain;
	pointer-events: none;
	filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .4));
}

.chaves-watermark--top-left { top: 18px; left: 18px; }
.chaves-watermark--top-right { top: 18px; right: 18px; }
.chaves-watermark--bottom-left { bottom: 18px; left: 18px; }
.chaves-watermark--bottom-right { right: 18px; bottom: 18px; }
.chaves-watermark--center {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

.chaves-lightbox__caption {
	position: absolute;
	right: 72px;
	bottom: 20px;
	left: 72px;
	color: #fff;
	text-align: center;
}

.chaves-lightbox__close,
.chaves-lightbox__prev,
.chaves-lightbox__next {
	position: absolute;
	border: 0;
	color: var(--gd-arrow-text, #fff);
	background: var(--gd-arrow-bg, #cc2f66);
	cursor: pointer;
}

.chaves-lightbox__close {
	top: 42px;
	right: 48px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	font-size: 30px;
}

.chaves-lightbox__prev,
.chaves-lightbox__next {
	top: 50%;
	width: 48px;
	height: 64px;
	border-radius: 6px;
	font-size: 34px;
	transform: translateY(-50%);
}

.chaves-lightbox__prev { left: 60px; }
.chaves-lightbox__next { right: 60px; }

.chaves-lightbox button:hover,
.chaves-lightbox button:focus-visible {
	color: var(--gd-arrow-text, #fff);
	background: var(--gd-arrow-hover, #9f204c);
	outline: 2px solid #fff;
}

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

[data-chaves-native-gallery] a[href$=".jpg" i],
[data-chaves-native-gallery] a[href$=".jpeg" i],
[data-chaves-native-gallery] a[href$=".png" i],
[data-chaves-native-gallery] a[href$=".webp" i],
[data-chaves-native-gallery] a[href$=".gif" i] {
	cursor: zoom-in;
}

@media (max-width: 760px) {
	.chaves-galeria__items {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}

	.chaves-galeria__image { height: 190px; }
	.chaves-galeria--slider { padding: 0 38px 30px; }
	.chaves-galeria__nav { width: 34px; }
	.chaves-lightbox { padding: 58px 12px 76px; }
	.chaves-lightbox__caption { right: 14px; left: 14px; }
	.chaves-lightbox__prev,
	.chaves-lightbox__next { width: 40px; height: 56px; }
	.chaves-lightbox__prev { left: 24px; }
	.chaves-lightbox__next { right: 24px; }
	.chaves-lightbox__close { top: 24px; right: 24px; }
	.chaves-watermark--top-left { top: 10px; left: 10px; }
	.chaves-watermark--top-right { top: 10px; right: 10px; }
	.chaves-watermark--bottom-left { bottom: 10px; left: 10px; }
	.chaves-watermark--bottom-right { right: 10px; bottom: 10px; }
}

@media (max-width: 420px) {
	.chaves-galeria__items { grid-template-columns: 1fr; }
	.chaves-galeria__image { height: 230px; }
}
