/* =========================================================
   Fotogalerie + lightbox
   ========================================================= */

/* Klasická [gallery] → responzivní mřížka čtvercových dlaždic. */
.gallery {
	display: grid;
	grid-template-columns: repeat(3, 1fr); /* výchozí; přepíšou .gallery-columns-N */
	gap: 10px;
	margin: 1.75rem 0 2rem;
}
.gallery-columns-1 { grid-template-columns: 1fr; }
.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
.gallery-columns-5 { grid-template-columns: repeat(5, 1fr); }
.gallery-columns-6 { grid-template-columns: repeat(6, 1fr); }
.gallery-columns-7 { grid-template-columns: repeat(7, 1fr); }
.gallery-columns-8 { grid-template-columns: repeat(8, 1fr); }
.gallery-columns-9 { grid-template-columns: repeat(9, 1fr); }

/* Jedna dlaždice. */
.gallery .gallery-item {
	width: auto !important;   /* přebít případnou inline šířku dlaždice */
	margin: 0 !important;
	float: none !important;
}
.gallery .gallery-icon {
	margin: 0 !important;
}
.gallery .gallery-icon a {
	display: block;
	aspect-ratio: 1 / 1;      /* čtvercové výřezy */
	overflow: hidden;
	border-radius: 8px;
	background: #ececef;
}

/* Obrázek v dlaždici – PŘEBÍT inline width/height/max-width z TT1 filtru. */
.gallery .gallery-icon img {
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	border: none !important;
	object-fit: cover;
	display: block;
	cursor: zoom-in;
	transition: transform .35s ease;
}
.gallery .gallery-icon a:hover img {
	transform: scale(1.06);
}

.gallery .gallery-caption {
	margin: .4rem 0 0;
	font-size: .8rem;
	line-height: 1.3;
	text-align: center;
	color: #555;
}

/* Blokový editor / vlastní třída – ať fotky mají „lupu". */
.wp-block-gallery img,
.fotogalerie a img {
	cursor: zoom-in;
}

/* Responsivita: méně sloupců na užších obrazovkách. */
@media (max-width: 782px) {
	.gallery[class*="gallery-columns-"] { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 460px) {
	.gallery[class*="gallery-columns-"] { grid-template-columns: 1fr !important; }
}

/* ===== Lightbox overlay ===== */
html.anv-lb-lock {
	overflow: hidden;
}

.anv-lb {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 3rem 1rem;
	background: rgba(15, 15, 25, .93);
	opacity: 0;
	transition: opacity .2s ease;
	-webkit-tap-highlight-color: transparent;
}
.anv-lb.is-open {
	display: flex;
	opacity: 1;
}

.anv-lb__figure {
	margin: 0;
	max-width: 92vw;
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .75rem;
}

.anv-lb__img {
	max-width: 92vw;
	max-height: 82vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 12px 44px rgba(0, 0, 0, .55);
}

.anv-lb__caption {
	max-width: 80vw;
	color: #fff;
	font-size: .95rem;
	line-height: 1.4;
	text-align: center;
}

.anv-lb__close,
.anv-lb__nav {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	color: #fff;
	background: rgba(255, 255, 255, .12);
	border: none;
	border-radius: 50%;
	cursor: pointer;
	line-height: 1;
	transition: background .15s ease;
}
.anv-lb__close:hover,
.anv-lb__nav:hover {
	background: rgba(249, 56, 92, .85); /* --focus-color */
}

.anv-lb__close {
	top: 1rem;
	right: 1rem;
	width: 44px;
	height: 44px;
	font-size: 30px;
}

.anv-lb__nav {
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	font-size: 38px;
}
.anv-lb__prev { left: 1rem; }
.anv-lb__next { right: 1rem; }

.anv-lb__counter {
	position: absolute;
	bottom: 1rem;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, .85);
	font-size: .9rem;
	letter-spacing: .03em;
}

@media (max-width: 600px) {
	.anv-lb { padding: 2rem .5rem; }
	.anv-lb__nav { width: 42px; height: 42px; font-size: 30px; }
	.anv-lb__close { width: 40px; height: 40px; font-size: 26px; }
	.anv-lb__prev { left: .4rem; }
	.anv-lb__next { right: .4rem; }
}
