/* =========================================================
   Hyplux Gallery — osnovni styli
   Gap, border radius, obroba/senca se urejajo prek Elementor
   Style taba (glej selectors v class-hyplux-gallery-widget.php).
   Tu je le struktura in layout za vse tri tipe (grid/masonry/justified).
========================================================= */

.hyplux-gallery {
	--hplx-gallery-cols: 3;
	--hplx-gallery-gap: 16px;
	width: 100%;
}

.hyplux-gallery-item {
	position: relative;
	overflow: hidden;
	display: block;
}

.hyplux-gallery-item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease, filter 0.4s ease;
}

.hyplux-gallery-item a {
	display: block;
	width: 100%;
	height: 100%;
	line-height: 0;
}

/* ---------------------------------------------------------
   Grid — enakomerna mreža, vrstice po želji fiksne višine
--------------------------------------------------------- */
.hyplux-gallery-grid {
	display: grid;
	grid-template-columns: repeat(var(--hplx-gallery-cols), 1fr);
	gap: var(--hplx-gallery-gap);
}

.hyplux-gallery-grid .hyplux-gallery-item {
	/* Če "Fiksna višina vrstice" ni vklopljena, ohrani naravno razmerje slike */
	aspect-ratio: 1 / 1;
}

.hyplux-gallery-grid.hyplux-gallery-natural .hyplux-gallery-item {
	aspect-ratio: auto;
	height: auto;
}

/* ---------------------------------------------------------
   Masonry — CSS columns, slike ohranijo naravno razmerje
--------------------------------------------------------- */
.hyplux-gallery-masonry {
	column-count: var(--hplx-gallery-cols);
	column-gap: var(--hplx-gallery-gap);
}

.hyplux-gallery-masonry .hyplux-gallery-item {
	break-inside: avoid;
	margin-bottom: var(--hplx-gallery-gap);
}

.hyplux-gallery-masonry .hyplux-gallery-item img {
	height: auto;
	object-fit: initial;
}

/* ---------------------------------------------------------
   Justified — vrstice sestavi JS (hyplux-gallery.js), tu le
   flex osnova preden se izračunajo širine/višine
--------------------------------------------------------- */
.hyplux-gallery-justified {
	display: flex;
	flex-wrap: wrap;
	gap: var(--hplx-gallery-gap);
}

.hyplux-gallery-justified .hyplux-gallery-item {
	flex-grow: 1;
	height: 260px; /* nadomesti JS glede na target-row-height, dokler se ne izračuna */
}

.hyplux-gallery-justified .hyplux-gallery-item img {
	height: 100%;
	width: 100%;
}

/* ---------------------------------------------------------
   Hover efekti (enako poimenovani kot pri Hyplux Sliderju)
--------------------------------------------------------- */
.hyplux-hover-zoom .hyplux-gallery-item:hover img {
	transform: scale(1.06);
}

.hyplux-hover-darken .hyplux-gallery-item:hover img {
	filter: brightness(0.75);
}

.hyplux-hover-lighten .hyplux-gallery-item:hover img {
	filter: brightness(1.2);
}

.hyplux-lightbox-enabled .hyplux-gallery-item {
	cursor: zoom-in;
}

/* ---------------------------------------------------------
   Lightbox
--------------------------------------------------------- */
.hyplux-lightbox-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease;
	padding: 40px;
}

.hyplux-lightbox-overlay.is-active {
	opacity: 1;
	visibility: visible;
}

.hyplux-lightbox-content {
	position: relative;
	max-width: 90vw;
	max-height: 90vh;
	text-align: center;
}

.hyplux-lightbox-content img {
	max-width: 100%;
	max-height: 80vh;
	display: block;
	margin: 0 auto;
	border-radius: 4px;
}

.hyplux-lightbox-caption {
	color: #fff;
	margin-top: 12px;
	font-size: 14px;
	opacity: 0.85;
}

.hyplux-lightbox-close,
.hyplux-lightbox-prev,
.hyplux-lightbox-next {
	position: absolute;
	background: transparent;
	border: none;
	color: #fff;
	font-size: 32px;
	cursor: pointer;
	line-height: 1;
	padding: 8px 14px;
}

.hyplux-lightbox-close {
	top: -50px;
	right: -10px;
}

.hyplux-lightbox-prev {
	left: -60px;
	top: 50%;
	transform: translateY(-50%);
}

.hyplux-lightbox-next {
	right: -60px;
	top: 50%;
	transform: translateY(-50%);
}

@media (max-width: 767px) {
	.hyplux-lightbox-prev {
		left: 4px;
	}
	.hyplux-lightbox-next {
		right: 4px;
	}
	.hyplux-lightbox-close {
		top: 4px;
		right: 4px;
	}
}
