.pceg-gallery {
	margin: 2em 0;
}

.pceg-gallery-title {
	margin-bottom: 0.75em;
}

.pceg-carousel {
	position: relative;
	background: #f7f7f7;
	border-radius: 8px;
	overflow: hidden;
}

.pceg-carousel-track {
	position: relative;
}

.pceg-carousel-slide {
	margin: 0;
	text-align: center;
}

/* Some themes style <figure> elements generically (e.g. `figure { display:
   block }`, sometimes with !important), which can outrank the browser's own
   default "[hidden] means invisible" rule since that default lives in the
   lowest-priority UA stylesheet. Restating it explicitly here, with
   !important as a safety margin, guarantees a hidden slide always actually
   stays hidden regardless of what else targets <figure> on a given site. */
.pceg-carousel-slide[hidden] {
	display: none !important;
}

.pceg-carousel-slide img {
	width: 100%;
	max-height: 70vh;
	object-fit: contain;
	display: block;
	background: #000;
}

.pceg-carousel-copyright {
	padding: 0.5em 1em;
	font-size: 0.85em;
	color: #555;
	text-align: right;
}

.pceg-carousel-prev,
.pceg-carousel-next,
.pceg-carousel-fullscreen,
.pceg-carousel-counter {
	transition: opacity 0.3s ease;
}

/* Controls fade out after a spell of no mouse movement/keyboard focus
   (added/removed on the carousel by gallery.js), like a video player's own
   controls — pointer-events is dropped too so a faded-out button can't
   still block a click/hover meant for the photo underneath it. */
.pceg-controls-hidden .pceg-carousel-prev,
.pceg-controls-hidden .pceg-carousel-next,
.pceg-controls-hidden .pceg-carousel-fullscreen,
.pceg-controls-hidden .pceg-carousel-counter {
	opacity: 0;
	pointer-events: none;
}

.pceg-carousel-prev,
.pceg-carousel-next {
	position: absolute;
	top: 50%;
	transform: translateY( -50% );
	background: rgba( 0, 0, 0, 0.45 );
	border: none;
	color: #fff;
	font-size: 2em;
	line-height: 1;
	width: 1.8em;
	height: 1.8em;
	border-radius: 50%;
	cursor: pointer;
}

.pceg-carousel-prev {
	left: 0.5em;
}

.pceg-carousel-next {
	right: 0.5em;
}

.pceg-carousel-prev:hover,
.pceg-carousel-next:hover {
	background: rgba( 0, 0, 0, 0.7 );
}

.pceg-carousel-fullscreen {
	position: absolute;
	top: 0.75em;
	left: 0.75em;
	background: rgba( 0, 0, 0, 0.45 );
	border: none;
	color: #fff;
	font-size: 1.1em;
	line-height: 1;
	width: 2em;
	height: 2em;
	border-radius: 50%;
	cursor: pointer;
}

.pceg-carousel-fullscreen:hover {
	background: rgba( 0, 0, 0, 0.7 );
}

.pceg-carousel-counter {
	position: absolute;
	top: 0.75em;
	right: 0.75em;
	background: rgba( 0, 0, 0, 0.45 );
	color: #fff;
	font-size: 0.8em;
	padding: 0.2em 0.6em;
	border-radius: 999px;
}

.pceg-carousel-is-fullscreen {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #000;
}

.pceg-carousel-is-fullscreen .pceg-carousel-track {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pceg-carousel-is-fullscreen .pceg-carousel-slide {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.pceg-carousel-is-fullscreen .pceg-carousel-slide img {
	width: auto;
	max-width: 100%;
	max-height: 88vh;
}

.pceg-carousel-is-fullscreen .pceg-carousel-copyright {
	color: #ccc;
}

@media ( prefers-color-scheme: dark ) {
	.pceg-carousel {
		background: #1e1e1e;
	}

	.pceg-carousel-copyright {
		color: #ccc;
	}
}
