#wrapper .frame-bildergallerie .ce-intext.ce-right .ce-gallery {
	margin: 0px;
}

#wrapper .container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
}

#wrapper .frame-bildergallerie .container-content > div {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 20px;
	max-width: 1200px;
}

@media (min-width: 1200px) {
	#wrapper .frame-bildergallerie .container-content > div {
		grid-template-columns: repeat(4, 1fr);
	}
}

#wrapper [class*="child-"] img {
	overflow: hidden;
	transition: all 0.2s ease;
}

#wrapper [class*="child-"]:hover img {
	overflow: hidden;
	transform: scale(1.1);
	transform-origin: center;
	transition: all 0.2s ease;
}

#wrapper .frame-bildergallerie .ce-textpic {
	display: flex;
	flex-direction: column;
	height: 100%;
	position: relative;
}

#wrapper .frame-bildergallerie .ce-gallery {
	order: 2;
	flex: 1;
}

#wrapper .frame-bildergallerie .ce-gallery figcaption {
	position: absolute;
	color: #fff;
}

#wrapper .frame-bildergallerie .ce-bodytext {
	order: 1;
	padding: 0px;
	flex: 0 0 auto;
	position: absolute;
	width: 100%;
}

/* Hide paragraph text in preview */
.frame-bildergallerie .ce-bodytext p {
	display: none;
}

.frame-bildergallerie .ce-bodytext h3 {
	font-size: 100%;
	color: #000;
	background: rgba(255,255,255,0.6);
	width: 100%;
	padding: 3px;
}

/* Thumbnail styles - applied by jQuery */
.thumbnail-container {
	cursor: pointer;
	transition: transform 0.2s ease;
	height: 100%;
	display: flex;
	flex-direction: column;
}
.thumbnail-container:hover {
	transform: translateY(-2px);
}
.thumbnail-container figure {
	flex: 1;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	flex-wrap: wrap;
}
.thumbnail-image {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	object-position: center;
	display: block;
}

/* Lightbox styles */
.lightbox-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.9);
	z-index: 9999;
	cursor: pointer;
}
.lightbox-container {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	max-width: 90%;
	max-height: 90%;
	text-align: center;
}
.lightbox-image {
	max-width: 100%;
	max-height: 80vh;
	object-fit: contain;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.lightbox-caption {
	color: white;
	margin-top: 20px;
	font-size: 16px;
	max-width: 600px;
	margin-left: auto;
	margin-right: auto;
}
.lightbox-caption a {
	color: #fff;
	text-decoration: underline;
}

.lightbox-close {
	position: absolute;
	top: 20px;
	right: 30px;
	color: white;
	font-size: 40px;
	font-weight: bold;
	cursor: pointer;
	z-index: 10000;
	width: 50px;
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(0,0,0,0.5);
	transition: background 0.2s ease;
}
.lightbox-close:hover {
	background: rgba(0,0,0,0.8);
}
.lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	color: white;
	font-size: 24px;
	font-weight: bold;
	cursor: pointer;
	background: rgba(0,0,0,0.6);
	width: 60px;
	height: 60px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: all 0.2s ease;
	border: 2px solid rgba(255,255,255,0.3);
	user-select: none;
}
.lightbox-nav:hover {
	background: rgba(0,0,0,0.8);
	border-color: rgba(255,255,255,0.6);
	transform: translateY(-50%) scale(1.1);
}
.lightbox-prev {
	top: 10px;
	left: 30px;
	position: absolute;
}
 .lightbox-prev::after {
	content: '‹';
	font-size: 50px;
	line-height: 1;
	color: #fff;
}
.lightbox-next {
	top: 10px;
	left: 60px;
	position: absolute;
}
.lightbox-next::after {
	content: '›';
	font-size: 50px;
	line-height: 1;
	color: #fff;
}
.lightbox-counter {
	position: absolute;
	top: 10px;
	left: 50%;
	transform: translateX(-50%);
	color: white;
	font-size: 14px;
	background: rgba(0,0,0,0.5);
	padding: 4px 12px;
	border-radius: 10px;
}