/* Public "Realizacje" gallery grid + lightbox
   (page-templates/realizacje.php). Loaded only on that page template —
   see hz_enqueue_assets() in functions.php. */

.gallery-empty { color: var(--fg-on-light-muted); }

.gallery-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}
@media (max-width: 900px) {
	.gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
	.gallery-grid { grid-template-columns: 1fr; }
}

.gallery-item {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: var(--radius);
	border: 1px solid var(--border-light);
	background: var(--bg-light-2);
	cursor: pointer;
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.gallery-item:hover {
	box-shadow: 0 14px 30px rgba(51, 81, 80, 0.18);
	transform: translateY(-3px);
}
.gallery-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}
.gallery-item:hover img { transform: scale(1.06); }

.gallery-item .expand-hint {
	color: rgba(255, 255, 255, 0.92);
	filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
	opacity: 0;
	transition: opacity 0.25s ease;
}
.gallery-item:hover .expand-hint,
.gallery-item:focus-visible .expand-hint { opacity: 1; }

/* ---- Lightbox ---- */

.gallery-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
.gallery-lightbox.is-open {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.25s ease, visibility 0s linear 0s;
}

.gallery-lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 32, 31, 0.94);
}

.gallery-lightbox-stage {
	position: relative;
	z-index: 1;
	max-width: min(88vw, 1200px);
	max-height: 82vh;
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
}
.gallery-lightbox-img {
	max-width: 100%;
	max-height: 76vh;
	border-radius: 8px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
	display: block;
	background: rgba(255, 255, 255, 0.04);
}
.gallery-lightbox-caption {
	margin: 14px 0 0;
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.9rem;
	text-align: center;
	max-width: 70ch;
}
.gallery-lightbox-caption:empty { display: none; }

.gallery-lightbox-close,
.gallery-lightbox-prev,
.gallery-lightbox-next {
	position: absolute;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.22);
	background: rgba(255, 255, 255, 0.08);
	color: var(--white);
	cursor: pointer;
	padding: 0;
	transition: background 0.2s ease, transform 0.2s ease;
}
.gallery-lightbox-close:hover,
.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
	background: rgba(255, 255, 255, 0.18);
}
.gallery-lightbox-close .icon,
.gallery-lightbox-prev .icon,
.gallery-lightbox-next .icon { width: 20px; height: 20px; }

.gallery-lightbox-close { top: 22px; right: 22px; }
/* the "chevron-down" icon (⌄) rotated to point left/right — see inc/icons.php */
.gallery-lightbox-prev { left: 22px; top: 50%; transform: translateY(-50%) rotate(90deg); }
.gallery-lightbox-next { right: 22px; top: 50%; transform: translateY(-50%) rotate(-90deg); }
.gallery-lightbox-prev:hover { transform: translateY(-50%) rotate(90deg) scale(1.08); }
.gallery-lightbox-next:hover { transform: translateY(-50%) rotate(-90deg) scale(1.08); }

.gallery-lightbox-count {
	position: absolute;
	z-index: 2;
	bottom: 22px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.65);
	font-family: 'IBM Plex Mono', ui-monospace, monospace;
	font-size: 0.78rem;
	letter-spacing: 0.05em;
}

body.gallery-lightbox-lock { overflow: hidden; }

@media (max-width: 560px) {
	.gallery-lightbox-prev,
	.gallery-lightbox-next { width: 40px; height: 40px; }
	.gallery-lightbox-prev { left: 8px; }
	.gallery-lightbox-next { right: 8px; }
	.gallery-lightbox-close { top: 12px; right: 12px; }
	.gallery-lightbox-count { bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
	.gallery-item,
	.gallery-item img,
	.gallery-item .expand-hint,
	.gallery-lightbox,
	.gallery-lightbox-close,
	.gallery-lightbox-prev,
	.gallery-lightbox-next { transition: none; }
}
