#gallery {
	width: 100%;
}

.gallery-group {
	margin-bottom: 40px;
}

.gallery-group-title {
	margin: 40px 0 20px 0;
	color: rgb(64,116,172);
	text-decoration: underline;
	cursor: pointer;
	user-select: none;
}

.gallery-group-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 20px;
}
.gallery-item {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 10;
	background: #eee;
	border-radius: 8px;
}
.gallery-item img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	cursor: pointer;
}
.gallery-filename {
	position: absolute;
	left: 50%;
	bottom: 10px;
	transform: translateX(-50%);
	color: white;
	text-align: center;
	text-shadow:
		-1px -1px 2px #000,
		 1px -1px 2px #000,
		-1px  1px 2px #000,
		 1px  1px 2px #000;
	font-size: 15px;
	line-height: 1.2;
	max-width: calc(100% - 110px);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	pointer-events: none;
}
.gallery-download,
.gallery-select {
	position: absolute;
	bottom: 10px;
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 50%;
	background: rgba(0,0,200, 0.65);
	color: white;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	text-decoration: none;
	cursor: pointer;
}
.gallery-download {
	right: 10px;
}
.gallery-select {
	left: 10px;
}
.gallery-download:hover,
.gallery-select:hover
{
	text-decoration: none;
	background: rgba(0, 0, 0, 0.9);
}
.gallery-item.selected {
	outline: 4px solid #555;
	outline-offset: -4px;
}
.lightbox-select.selected {
	background: #333;
}
.gallery-item.selected .gallery-select {
	background: rgba(0,200,0,0.65);
}
.gallery-selection {
	display: none;
	position: sticky;
	bottom: 20px;
	margin-top: 20px;
	padding: 12px 16px;
	background: rgba(0, 0, 0, 0.85);
	color: white;
	border-radius: 8px;
	align-items: center;
	gap: 15px;
}
.gallery-selection.visible {
	display: flex;
}
.gallery-selection button {
	border: 0;
	padding: 8px 12px;
	cursor: pointer;
}
/* Lightbox */
.lightbox {
	display: none;
	position: fixed;
	z-index: 1000;
	inset: 0;
	background: rgba(0, 0, 0, 0.9);
	align-items: center;
	justify-content: center;
}
.lightbox.visible {
	display: flex;
}
.lightbox-content {
	position: relative;
	max-width: 90vw;
	max-height: 90vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

#lightbox-image {
	display: block;
	max-width: 90vw;
	max-height: 90vh;
	width: auto;
	height: auto;
	object-fit: contain;
}
/* Lightbox close */
.lightbox-close {
	position: absolute;
	top: 20px;
	right: 25px;
	z-index: 1002;
	width: 45px;
	height: 45px;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6);
	color: white;
	font-size: 32px;
	line-height: 40px;
	cursor: pointer;
}
/* Navigationspfeile */
.lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 1002;
	width: 55px;
	height: 70px;
	border: 0;
	background: rgba(0, 0, 0, 0.5);
	color: white;
	font-size: 40px;
	cursor: pointer;
}
.lightbox-prev {
	left: 20px;
}
.lightbox-next {
	right: 20px;
}
/* Button Download */
.lightbox-download {
	position: absolute;
	right: 15px;
	bottom: 15px;
	width: 45px;
	height: 45px;
	border-radius: 50%;
	background: rgba(0,0,200,0.65);
	color: white;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 25px;
	text-decoration: none;
	cursor: pointer;
}
body.lightbox-open {
	overflow: hidden;
}
/* CSS fix for touch devices */
#lightbox-image {
	touch-action: pan-y;
}

/* Auswahbutton für Lightbox */
.lightbox-select {
	position: absolute;
	right: 70px;
	bottom: 15px;
	width: 45px;
	height: 45px;
	border: 0;
	border-radius: 50%;
	background: rgba(0,0,200,0.65);
	color: white;
	font-size: 23px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
/* Lightbox Counter */
.lightbox-counter {
	position: absolute;
	top: 20px;
	left: 25px;
	z-index: 1002;
	padding: 7px 12px;
	border-radius: 5px;
	background: rgba(0, 0, 0, 0.6);
	color: white;
	font-size: 16px;
}
/* Mouseover für Pfeile */
.lightbox-nav:hover,
.lightbox-close:hover,
.lightbox-select:hover,
.lightbox-download:hover {
	background: rgba(0, 0, 0, 0.9);
	text-decoration: none;
}
.lightbox-select.selected {
	background: rgba(0,200,0, 0.65);
}
/* Pfeile für Gruppen-Accordion */
.gallery-group-toggle {
	display: inline-block;
	width: 0;
	height: 0;
	margin-right: 8px;
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
	border-left: 8px solid currentColor;
	transition: transform 0.2s ease;
}
.gallery-group-toggle.open {
	transform: rotate(90deg);
}
/* Pfeile ausblenden, wenn kein Accordion gewünscht */
#gallery.no-accordion .gallery-group-toggle {
	display: none;
}

#gallery.no-accordion .gallery-group-title {
	cursor: default;
}

/* Positionierungen etc. für Smartphones */
@media (max-width: 600px) {
	.lightbox-content {
		max-width: 100vw;
		max-height: 100vh;
	}
	#lightbox-image {
		max-width: 100vw;
		max-height: 85vh;
	}
	.lightbox-nav {
		width: 42px;
		height: 55px;
		font-size: 30px;
	}
	.lightbox-prev {
		left: 5px;
	}
	.lightbox-next {
		right: 5px;
	}
	.lightbox-close {
		top: 10px;
		right: 10px;
		width: 40px;
		height: 40px;
		font-size: 28px;
	}
	.lightbox-counter {
		top: 15px;
		left: 10px;
		font-size: 14px;
	}
	.lightbox-select,
	.lightbox-download {
		bottom: 10px;
		width: 40px;
		height: 40px;
	}
	.lightbox-select {
		right: 60px;
	}
	.lightbox-download {
		right: 10px;
	}
}