.justified-gallery {
	--jg-gap: 6px;
	--jg-row-height: 220px;
	--jg-max-row-height: 340px;

	box-sizing: border-box;
	display: flex;
	flex-wrap: wrap;
	gap: var(--jg-gap);
	max-width: 1100px;
	margin: 0 auto;
}
.justified-gallery,
.justified-gallery *,
.justified-gallery *::before,
.justified-gallery *::after {
	box-sizing: inherit;
}

.jg-row {
	display: flex;
	width: 100%;
	gap: var(--jg-gap);
}
.jg-item {
	position: relative;
	overflow: hidden;
	cursor: pointer;
	background: #222;
}
.jg-item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .35s ease, filter .35s ease;
}
.jg-item:hover img {
	transform: scale(1.04);
	filter: brightness(1.05);
}
.jg-item::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(transparent 60%, rgba(0,0,0,.25));
	opacity: 0;
	transition: opacity .35s ease;
	pointer-events: none;
}
.jg-item:hover::after { opacity: 1; }

/* Schmalere Bildschirme: Zeilenhöhe pro Galerie-Instanz anpassen
	(überschreibt nur die lokale Variable auf .justified-gallery,
	keine globalen Media-Query-Effekte) */
@media (max-width: 640px) {
	.justified-gallery {
	--jg-row-height: 130px;
	--jg-max-row-height: 220px;
	}
}

/* ---- Lightbox / Großbildansicht (wird per JS erzeugt) ---- */
.jg-lightbox {
	box-sizing: border-box;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.92);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 1000;
}
.jg-lightbox,
.jg-lightbox * {
	box-sizing: inherit;
}
.jg-lightbox.jg-open { display: flex; }
.jg-lightbox img {
	max-width: 92vw;
	max-height: 88vh;
	box-shadow: 0 10px 40px rgba(0,0,0,.6);
	border-radius: 2px;
}
.jg-lightbox button {
	position: absolute;
	background: rgba(255,255,255,.08);
	border: none;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 12px 16px;
	border-radius: 50%;
	transition: background .2s ease;
}
.jg-lightbox button:hover { background: rgba(255,255,255,.2); }
.jg-lightbox .jg-close { top: 20px; right: 20px; }
.jg-lightbox .jg-prev   { left: 20px; top: 50%; transform: translateY(-50%); }
.jg-lightbox .jg-next   { right: 20px; top: 50%; transform: translateY(-50%); }
.jg-lightbox .jg-counter {
	position: absolute;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	color: #ccc;
	font-size: 13px;
	letter-spacing: .5px;
}

@media (max-width: 640px) {
	.jg-lightbox button { padding: 10px 14px; font-size: 18px; }
}
