/*
 * Gallery lightbox and the three-across carousel.
 *
 * These rules also sit in the site's Additional CSS, where they were first
 * written. They are repeated here so the two features do not depend on a box
 * in the Site Editor that anyone can clear.
 */

/* --- Lightbox --- */
#custom-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.88);
	z-index: 99999;
	align-items: center;
	justify-content: center;
	flex-direction: column;
}
#custom-lightbox.active { display: flex; }
#custom-lightbox img {
	max-width: 90vw;
	max-height: 85vh;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}
#custom-lightbox button {
	background: none;
	border: 0;
	font: inherit;
	margin: 0;
}
#custom-lightbox .lb-close {
	position: absolute;
	top: 8px;
	right: 12px;
	min-width: 44px;
	min-height: 44px;
	font-size: 2rem;
	color: #fff;
	cursor: pointer;
	line-height: 1;
}
#custom-lightbox .lb-caption {
	color: #ddd;
	margin-top: 12px;
	font-size: 0.9rem;
	max-width: 80vw;
	text-align: center;
}
#custom-lightbox .lb-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	min-width: 44px;
	min-height: 44px;
	font-size: 2.5rem;
	color: rgba(255, 255, 255, 0.7);
	cursor: pointer;
	padding: 10px 16px;
	transition: color 0.2s;
}
#custom-lightbox .lb-nav:hover,
#custom-lightbox .lb-nav:focus-visible { color: #fff; }
#custom-lightbox .lb-prev { left: 4px; }
#custom-lightbox .lb-next { right: 4px; }
#custom-lightbox.is-single .lb-nav { display: none; }

/* --- Carousel --- */
.pahls-carousel-wrapper { position: relative; overflow: hidden; max-width: 100%; margin: 2rem 0; }
.pahls-carousel { display: flex; transition: transform 0.4s; will-change: transform; }
.pahls-slide { flex: 0 0 calc(33.333% - 16px); min-width: 0; margin: 0 8px; text-align: center; }
.pahls-slide a { display: block; text-decoration: none; color: inherit; }
.pahls-slide img {
	width: 100%;
	max-width: 150px;
	height: 150px;
	object-fit: cover;
	border-radius: 12px;
	display: block;
	margin: 0 auto 0.5rem;
	transition: transform 0.2s, box-shadow 0.2s;
}
.pahls-slide img:hover { transform: scale(1.05); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); }
.pahls-slide .slide-title { color: var(--wp--preset--color--primary); display: block; font-weight: 700; margin-bottom: 0.2rem; }
.pahls-slide .slide-sub { display: block; color: #666; }
.pahls-prev,
.pahls-next {
	position: absolute;
	top: 40%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid #ddd;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	font-size: 1rem;
	cursor: pointer;
	z-index: 10;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.pahls-prev { left: 0; }
.pahls-next { right: 0; }
.pahls-prev[disabled],
.pahls-next[disabled] { opacity: 0.35; cursor: default; }
.pahls-dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.pahls-dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; background: #ccc; cursor: pointer; padding: 0; }
.pahls-dots button.active { background: #3a6b1e; }

@media (max-width: 480px) {
	.pahls-slide { flex: 0 0 calc(100% - 16px); }
	.pahls-prev,
	.pahls-next { width: 44px; height: 44px; }
}
