/* ==========================================================================
   Immobilien Hero-Galerie
   Desktop: 1 großes Hauptbild links, rechts 2 Bilder gestapelt
   Mobil:   horizontales Swipe-Karussell
   ========================================================================== */

.imm-gallery-hero {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 6px;
}

.imm-gallery-hero__grid {
	display: grid;
	grid-template-columns: 2fr 1fr;
	grid-template-rows: 1fr 1fr;
	gap: 8px;
	width: 100%;
	height: 100%;
}

.imm-gallery-hero__item {
	position: relative;
	overflow: hidden;
	cursor: pointer;
	background: #eee;
}

.imm-gallery-hero__item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.imm-gallery-hero__item:hover img {
	transform: scale(1.04);
}

.imm-gallery-hero__item--main {
	grid-column: 1;
	grid-row: 1 / span 2;
}

.imm-gallery-hero__item--side-1 {
	grid-column: 2;
	grid-row: 1;
}

.imm-gallery-hero__item--side-2 {
	grid-column: 2;
	grid-row: 2;
}

.imm-gallery-hero__more {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	font-weight: 600;
}

/* Fallback, wenn weniger als 3 Bilder vorhanden sind */
.imm-gallery-hero[data-count="1"] .imm-gallery-hero__grid {
	grid-template-columns: 1fr;
}
.imm-gallery-hero[data-count="2"] .imm-gallery-hero__item--side-2 {
	display: none;
}

/* Mobile: horizontales Swipe-Karussell statt Grid */
.imm-gallery-hero__mobile {
	display: none;
}

@media (max-width: 767px) {
	.imm-gallery-hero__grid {
		display: none;
	}

	.imm-gallery-hero__mobile {
		display: block;
		position: relative;
	}

	.imm-gallery-hero__track {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		border-radius: 6px;
		aspect-ratio: 4 / 3;
		scrollbar-width: none;
	}

	.imm-gallery-hero__track::-webkit-scrollbar {
		display: none;
	}

	.imm-gallery-hero__slide {
		flex: 0 0 100%;
		scroll-snap-align: start;
		cursor: pointer;
	}

	.imm-gallery-hero__slide img {
		width: 100%;
		height: 100%;
		object-fit: cover;
		display: block;
	}

	.imm-gallery-hero__counter {
		position: absolute;
		bottom: 10px;
		right: 12px;
		background: rgba(0, 0, 0, 0.55);
		color: #fff;
		font-size: 12px;
		padding: 3px 8px;
		border-radius: 12px;
	}
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.imm-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(0, 0, 0, 0.92);
	display: none;
	align-items: center;
	justify-content: center;
}

.imm-lightbox.is-open {
	display: flex;
}

.imm-lightbox__stage {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	touch-action: pan-y;
}

.imm-lightbox__image {
	max-width: 90vw;
	max-height: 85vh;
	object-fit: contain;
	user-select: none;
}

.imm-lightbox__close,
.imm-lightbox__prev,
.imm-lightbox__next {
	position: absolute;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	border: none;
	cursor: pointer;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	font-size: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.imm-lightbox__close:hover,
.imm-lightbox__prev:hover,
.imm-lightbox__next:hover {
	background: rgba(255, 255, 255, 0.25);
}

.imm-lightbox__close {
	top: 16px;
	right: 16px;
}

.imm-lightbox__prev {
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
}

.imm-lightbox__next {
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
}

.imm-lightbox__counter {
	position: absolute;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	color: #fff;
	font-size: 14px;
	background: rgba(255, 255, 255, 0.12);
	padding: 4px 12px;
	border-radius: 12px;
}

@media (max-width: 767px) {
	.imm-lightbox__prev,
	.imm-lightbox__next {
		display: none;
	}
}
