.jno-eg-gallery {
	position: relative;
	margin: 0 0 1.5em;
}

.jno-eg-item {
	display: block;
	position: relative;
	text-decoration: none;
	color: inherit;
}

.jno-eg-item img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 4px;
}

/* Grid */
.jno-eg-layout--grid {
	display: grid;
	grid-template-columns: repeat(var(--jno-eg-cols, 3), 1fr);
	gap: 16px;
}

/* Masonry - native CSS columns give true variable-height masonry without JS. */
.jno-eg-layout--masonry {
	columns: var(--jno-eg-cols, 3);
	column-gap: 16px;
}

.jno-eg-layout--masonry .jno-eg-item {
	break-inside: avoid;
	margin-bottom: 16px;
}

/* Carousel - overflow-x:auto (Scroll-Container) lebt bewusst auf .jno-eg-track, nicht auf
   .jno-eg-gallery: sonst würden die absolut positionierten Prev/Next-Buttons (Containing
   Block = nächstes position:relative-Element) mit dem Scroll-Inhalt mitwandern statt fix
   an den Rändern zu bleiben. */
.jno-eg-layout--carousel {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	gap: 16px;
	padding-bottom: 4px;
}

.jno-eg-layout--carousel .jno-eg-item {
	flex: 0 0 auto;
	width: calc((100% - (var(--jno-eg-cols, 3) - 1) * 16px) / var(--jno-eg-cols, 3));
	scroll-snap-align: start;
}

.jno-eg-track.jno-eg-layout--carousel {
	cursor: grab;
}

.jno-eg-track.jno-eg-layout--carousel.is-dragging {
	cursor: grabbing;
	scroll-snap-type: none;
	user-select: none;
}

/* box-sizing/padding/min-width/min-height werden explizit zurückgesetzt, weil Theme-weite
   Button-Regeln (z.B. Touch-Target-Mindestmaße) sonst die feste 40x40px-Kreisfläche zu einem
   Oval verzerren können. display:flex zentriert das ‹/›-Zeichen exakt statt sich auf
   Font-Metriken (line-height) zu verlassen. */
.jno-eg-carousel__prev,
.jno-eg-carousel__next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 40px;
	height: 40px;
	min-width: 0;
	min-height: 0;
	padding: 0;
	margin: 0;
	border-radius: 50%;
	border: none;
	background-color: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

/* !important gezielt nur hier: die Buttons sind eine in sich geschlossene, theme-unabhängige
   Widget-Komponente - ohne das kann Theme-CSS (button:hover/:focus) die Hover-Farbe nach einem
   Klick "hängen" lassen, weil der Button bis zum nächsten Blur den Fokus behält. */
.jno-eg-carousel__prev:hover,
.jno-eg-carousel__next:hover,
.jno-eg-carousel__prev:focus-visible,
.jno-eg-carousel__next:focus-visible {
	background-color: rgba(0, 0, 0, 0.6) !important;
}

.jno-eg-carousel__prev:focus,
.jno-eg-carousel__next:focus {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.jno-eg-carousel__prev {
	left: 8px;
}

.jno-eg-carousel__next {
	right: 8px;
}

/* Portfolio grid card titles */
.jno-eg-portfolio .jno-eg-item {
	overflow: hidden;
	border-radius: 6px;
}

.jno-eg-item__title {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 10px 12px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
}

/* Lightbox */
.jno-eg-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.9);
	padding: 40px;
}

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

.jno-eg-lightbox__figure {
	max-width: 100%;
	max-height: 100%;
	text-align: center;
}

.jno-eg-lightbox__image {
	max-width: 100%;
	max-height: 80vh;
	display: block;
	margin: 0 auto;
}

.jno-eg-lightbox__caption {
	color: #fff;
	margin-top: 12px;
	font-size: 14px;
}

.jno-eg-lightbox__close,
.jno-eg-lightbox__prev,
.jno-eg-lightbox__next {
	position: fixed;
	background: none;
	border: none;
	color: #fff;
	cursor: pointer;
}

/* !important gezielt hier, wie schon bei den Karussell-Buttons: Theme-CSS stylt oft
   button:hover/:focus gemeinsam - da der Button nach einem Klick den Fokus behält, sieht
   das sonst wie eine dauerhaft "hängende" Hover-Farbe aus, obwohl die Maus längst weg ist. */
.jno-eg-lightbox__close:hover,
.jno-eg-lightbox__prev:hover,
.jno-eg-lightbox__next:hover,
.jno-eg-lightbox__close:focus-visible,
.jno-eg-lightbox__prev:focus-visible,
.jno-eg-lightbox__next:focus-visible {
	background: none !important;
	color: #fff !important;
}

.jno-eg-lightbox__close:focus,
.jno-eg-lightbox__prev:focus,
.jno-eg-lightbox__next:focus {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.jno-eg-lightbox__close {
	top: 16px;
	right: 24px;
	font-size: 32px;
}

.jno-eg-lightbox__prev,
.jno-eg-lightbox__next {
	top: 50%;
	transform: translateY(-50%);
	font-size: 40px;
}

.jno-eg-lightbox__prev {
	left: 16px;
}

.jno-eg-lightbox__next {
	right: 16px;
}

.jno-eg-lightbox__prev[hidden],
.jno-eg-lightbox__next[hidden] {
	display: none;
}

@media (max-width: 782px) {
	.jno-eg-layout--grid,
	.jno-eg-layout--carousel .jno-eg-item {
		--jno-eg-cols: 2;
	}
}
