/* ── SCREENSHOT-GALERIE ── */
.screenshot-section {
	background: var(--green-pale);
	padding-top: 3rem;
	padding-bottom: 3rem;
}

.screenshot-img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--radius);
	border: 1px solid var(--border);
	box-shadow: 0 20px 50px rgba(26, 74, 46, 0.18);
}

.screenshot-caption {
	text-align: center;
	margin-top: 1rem;
	font-size: 0.85rem;
	color: var(--text-muted);
}

/* ohne JavaScript: alle Screenshots untereinander */
.gallery-slide {
	margin: 0;
}

.gallery-slide + .gallery-slide {
	margin-top: 3rem;
}

.gallery-tabs,
.gallery-arrow,
.gallery-meta,
.gallery-thumbs {
	display: none;
}

.gallery-zoom {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
	font: inherit;
}

/* mit JavaScript: Galerie */
.gallery.is-ready .gallery-tabs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
}

.gallery-tab {
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--green-dark);
	background: var(--white);
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 0.4rem 1rem;
	cursor: pointer;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.gallery-tab:hover {
	border-color: var(--green-light);
}

.gallery-tab[aria-selected="true"] {
	background: var(--green);
	border-color: var(--green);
	color: var(--white);
}

.gallery-stage {
	position: relative;
}

.gallery.is-ready .gallery-track {
	display: flex;
	align-items: flex-start;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	/* Platz für den Schatten der Screenshots (Spur seitlich und unten über den Container hinaus erweitert) */
	padding: 0 0 60px;
	margin: 0 -50px -60px;
}

.gallery.is-ready .gallery-track::-webkit-scrollbar {
	display: none;
}

.gallery.is-ready .gallery-slide {
	flex: 0 0 100%;
	scroll-snap-align: center;
	margin-top: 0;
	padding: 0 50px;
}

.gallery.is-ready .gallery-slide[hidden] {
	display: none;
}

.gallery.is-ready .gallery-slide .screenshot-caption {
	display: none;
}

.gallery.is-ready .gallery-arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid var(--border);
	background: var(--white);
	color: var(--green-dark);
	box-shadow: 0 4px 14px rgba(26, 74, 46, 0.18);
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
}

.gallery-arrow:hover {
	background: var(--green);
	color: var(--white);
}

.gallery-arrow svg {
	width: 20px;
	height: 20px;
}

.gallery-prev {
	left: -22px;
}

.gallery-next {
	right: -22px;
}

.gallery.is-ready .gallery-arrow[hidden] {
	display: none;
}

.gallery.is-ready .gallery-meta {
	display: flex;
	justify-content: center;
	align-items: baseline;
	gap: 0.75rem;
	margin-top: 1.25rem;
}

.gallery-caption {
	font-weight: 600;
	color: var(--green-dark);
}

.gallery-counter {
	font-size: 0.85rem;
	color: var(--text-muted);
	font-variant-numeric: tabular-nums;
}

.gallery.is-ready .gallery-thumbs {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.25rem;
}

.gallery-thumb {
	width: 120px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 8px;
	background: none;
	cursor: pointer;
	opacity: 0.65;
	transition: opacity 0.2s, border-color 0.2s;
}

.gallery-thumb img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 6px;
}

.gallery-thumb:hover {
	opacity: 1;
}

.gallery-thumb[aria-current="true"] {
	opacity: 1;
	border-color: var(--green);
}

.gallery-thumb[hidden] {
	display: none;
}

.gallery-tab:focus-visible,
.gallery-arrow:focus-visible,
.gallery-thumb:focus-visible,
.gallery-zoom:focus-visible,
.gallery-dialog-close:focus-visible {
	outline: 2px solid var(--green-light);
	outline-offset: 2px;
}

/* Vergrößerung */
.gallery-dialog {
	width: min(96vw, 1600px);
	max-width: none;
	max-height: 94vh;
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: var(--radius);
	background: var(--white);
	overflow: auto;
}

.gallery-dialog::backdrop {
	background: rgba(13, 37, 23, 0.8);
}

.gallery-dialog img {
	display: block;
	width: 100%;
	height: auto;
}

.gallery-dialog-close {
	position: sticky;
	top: 0.75rem;
	float: right;
	margin: 0.75rem 0.75rem -3.5rem 0;
	z-index: 1;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid var(--border);
	background: var(--white);
	color: var(--green-dark);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
}

@media (max-width: 1180px) {
	/* Spur höchstens bis zum Innenabstand des Abschnitts (2rem) erweitern */
	.gallery.is-ready .gallery-track {
		margin: 0 -2rem -60px;
	}

	.gallery.is-ready .gallery-slide {
		padding: 0 2rem;
	}

	.gallery-prev {
		left: 8px;
	}

	.gallery-next {
		right: 8px;
	}
}

@media (max-width: 640px) {
	.gallery.is-ready .gallery-arrow {
		display: none;
	}

	/* schmale Bildschirme: Spur nicht über den Rand hinaus erweitern, dafür kleinerer Schatten */
	.gallery.is-ready .gallery-track {
		margin: 0 0 -30px;
		padding: 0 0 30px;
	}

	.gallery.is-ready .gallery-slide {
		padding: 0 2px;
	}

	.gallery.is-ready .screenshot-img {
		box-shadow: 0 8px 20px rgba(26, 74, 46, 0.15);
	}

	.gallery-thumb {
		width: 72px;
	}
}
