/* JP Gallery - frontend */

.jp-gallery-wrap {
	position: relative;
	width: 100%;
	margin: 1.5rem 0;
}

.jp-gallery-swiper {
	width: 100%;
	overflow: hidden;
}

.jp-gallery-slide {
	overflow: hidden;
	background: #f2f2f2;
	transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.jp-gallery-layout-coverflow .swiper-slide {
	width: 70%;
	max-width: 520px;
}

.jp-gallery-link {
	display: block;
	position: relative;
	width: 100%;
	height: 100%;
	text-decoration: none;
}

.jp-gallery-img {
	display: block;
	width: 100%;
	height: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.jp-gallery-link:hover .jp-gallery-img {
	transform: scale(1.06);
}

.jp-gallery-caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 1.4em 0.9em 0.7em;
	color: #fff;
	font-size: 0.85rem;
	line-height: 1.3;
	background: linear-gradient( to top, rgba( 0, 0, 0, 0.72 ), transparent );
	opacity: 0;
	transform: translateY( 8px );
	transition: opacity 0.35s ease, transform 0.35s ease;
}

.jp-gallery-link:hover .jp-gallery-caption {
	opacity: 1;
	transform: translateY( 0 );
}

/* ---- Arrows ---- */
.jp-gallery-arrow {
	position: absolute;
	top: 50%;
	transform: translateY( -50% );
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border: none;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.92 );
	color: #1a1a1a;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba( 0, 0, 0, 0.18 );
	transition: background 0.2s ease, transform 0.2s ease;
}

.jp-gallery-arrow:hover {
	background: #fff;
	transform: translateY( -50% ) scale( 1.08 );
}

.jp-gallery-prev {
	left: 8px;
}

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

.jp-gallery-arrow.swiper-button-disabled {
	opacity: 0.35;
	cursor: default;
}

/* ---- Pagination ---- */
.jp-gallery-pagination {
	position: relative;
	margin-top: 0.9rem;
	text-align: center;
}

.jp-gallery-pagination .swiper-pagination-bullet-active {
	background: #1a1a1a;
}

/* ---- Empty ---- */
.jp-gallery-empty {
	padding: 1.2rem;
	border: 1px dashed #c9c9c9;
	border-radius: 8px;
	color: #777;
	text-align: center;
	font-size: 0.9rem;
}

/* ---- Lightbox ---- */
.jp-gallery-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba( 0, 0, 0, 0.92 );
	padding: 2rem;
}

.jp-gallery-lightbox.is-open {
	display: flex;
	animation: jpgFade 0.25s ease;
}

@keyframes jpgFade {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.jp-gallery-lb-swiper {
	width: 100%;
	height: 100%;
	max-width: 1200px;
}

.jp-gallery-lb-slide {
	display: flex;
	align-items: center;
	justify-content: center;
}

.jp-gallery-lb-slide img {
	max-width: 100%;
	max-height: 82vh;
	object-fit: contain;
	border-radius: 4px;
}

.jp-gallery-lb-caption {
	position: absolute;
	bottom: 1rem;
	left: 0;
	right: 0;
	text-align: center;
	color: #eee;
	font-size: 0.9rem;
	padding: 0 1rem;
}

.jp-gallery-lb-close {
	position: absolute;
	top: 1rem;
	right: 1.2rem;
	z-index: 10;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.12 );
	color: #fff;
	font-size: 1.8rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
}

.jp-gallery-lb-close:hover {
	background: rgba( 255, 255, 255, 0.25 );
}

.jp-gallery-lb-prev,
.jp-gallery-lb-next {
	color: #fff;
}

.jp-gallery-lb-pagination {
	color: #fff;
	bottom: 0.3rem !important;
}

/* reduced motion */
@media ( prefers-reduced-motion: reduce ) {
	.jp-gallery-img,
	.jp-gallery-slide,
	.jp-gallery-caption,
	.jp-gallery-arrow {
		transition: none !important;
	}
}
