.wpsg-widget {
	width: 100%;
}

/* Tabs */
.wpsg-tabs-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 24px;
}
.wpsg-tab-btn {
	background: #f0f0f1;
	border: none;
	padding: 10px 22px;
	border-radius: 30px;
	cursor: pointer;
	font-weight: 600;
	font-size: 15px;
	transition: background .25s ease, color .25s ease, transform .2s ease;
}
.wpsg-tab-btn:hover {
	transform: translateY(-1px);
}
.wpsg-tab-btn.active {
	background: #1d2327;
	color: #fff;
}

/* Panels */
.wpsg-panel {
	display: none;
}
.wpsg-panel.active {
	display: block;
}

/* Masonry-style grid: keeps each image's natural aspect ratio */
.wpsg-grid {
	--wpsg-columns: 4;
	--wpsg-gap: 16px;
	column-count: var(--wpsg-columns);
	column-gap: var(--wpsg-gap);
}
.wpsg-item {
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
	page-break-inside: avoid;
	margin: 0 0 var(--wpsg-gap);
	overflow: hidden;
	display: block;
	border-radius: 8px;
	background: #eee;
}
.wpsg-item a {
	display: block;
	line-height: 0;
}
.wpsg-item img {
	width: 100%;
	height: auto;
	display: block;
	transition: transform .45s ease, filter .45s ease, opacity .45s ease;
}

/* Hover effects */
.hover-zoom .wpsg-item { overflow: hidden; }
.hover-zoom .wpsg-item img:hover { transform: scale(1.08); }

.hover-fade .wpsg-item img { opacity: .88; }
.hover-fade .wpsg-item img:hover { opacity: 1; }

.hover-grayscale .wpsg-item img { filter: grayscale(100%); }
.hover-grayscale .wpsg-item img:hover { filter: grayscale(0%); }

/* Bottom actions: Load More + optional Custom CTA button */
.wpsg-bottom-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin-top: 38px;
}
.wpsg-load-more-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #1D2327;
	color: #ffffff;
	border: none;
	padding: 14px 36px;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 700;
	font-size: 15px;
	letter-spacing: .02em;
	box-shadow: 0 2px 4px rgba(0, 0, 0, .12);
	transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.wpsg-load-more-btn:hover {
	background: #33383D;
	transform: translateY(-2px);
	box-shadow: 0 4px 10px rgba(0, 0, 0, .18);
}
.wpsg-load-more-btn:active {
	transform: translateY(0);
	box-shadow: 0 2px 4px rgba(0, 0, 0, .12);
}
.wpsg-cta-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #E10613;
	color: #ffffff;
	border: none;
	padding: 14px 36px;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 700;
	font-size: 15px;
	letter-spacing: .02em;
	text-decoration: none;
	box-shadow: 0 2px 4px rgba(0, 0, 0, .12);
	transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.wpsg-cta-btn:hover {
	background: #B80510;
	color: #ffffff;
	transform: translateY(-2px);
	box-shadow: 0 4px 10px rgba(0, 0, 0, .18);
}
.wpsg-cta-btn:active {
	transform: translateY(0);
	box-shadow: 0 2px 4px rgba(0, 0, 0, .12);
}

/* ================= Lightbox ================= */
.wpsg-lightbox-overlay {
	position: fixed !important;
	inset: 0 !important;
	height: 100vh;
	height: 100dvh;
	background: rgba(6, 6, 8, .97);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	z-index: 999999 !important;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s ease;
	touch-action: pan-y;
	overscroll-behavior: contain;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
}
.wpsg-lightbox-overlay.open {
	opacity: 1;
	visibility: visible;
}
.wpsg-lightbox-overlay * {
	box-sizing: border-box;
}

/* The stage is a fixed-size "frame": its dimensions stay the same no
   matter which photo (or aspect ratio) is loaded into it. That's what
   stops the whole lightbox jumping around as you move between images. */
.wpsg-lightbox-stage {
	position: relative;
	width: min(92vw, 1400px);
	height: min(80dvh, 900px);
	display: flex;
	align-items: center;
	justify-content: center;
}

.wpsg-lightbox-figure {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wpsg-lightbox-overlay img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 12px;
	box-shadow: 0 25px 70px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06);
	background: #111;
	opacity: 0;
	transform: scale(.96);
	transition: opacity .25s ease, transform .25s ease;
}
.wpsg-lightbox-overlay img.wpsg-img-visible {
	opacity: 1;
	transform: scale(1);
}

/* Loading spinner shown while the next image decodes */
.wpsg-lightbox-spinner {
	position: absolute;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 3px solid rgba(255, 255, 255, .25);
	border-top-color: #fff;
	animation: wpsg-spin .7s linear infinite;
	opacity: 0;
	pointer-events: none;
	transition: opacity .15s ease;
}
.wpsg-lightbox-spinner.show { opacity: 1; }
@keyframes wpsg-spin { to { transform: rotate(360deg); } }

.wpsg-lightbox-counter {
	position: fixed !important;
	top: max(18px, env(safe-area-inset-top)) !important;
	left: 50% !important;
	right: auto !important;
	bottom: auto !important;
	transform: translateX(-50%) !important;
	margin: 0 !important;
	color: #fff !important;
	font-size: 13px !important;
	letter-spacing: .05em;
	background: rgba(255, 255, 255, .14) !important;
	padding: 6px 16px !important;
	border-radius: 20px !important;
	font-weight: 600 !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
	white-space: nowrap;
	z-index: 1000001 !important;
	border: 0 !important;
	box-shadow: none !important;
	line-height: 1.4 !important;
	pointer-events: none;
}

/* Nav / close buttons are pinned to the viewport itself (not to the
   photo), so their position is 100% fixed and never shifts between
   images. Every visual property is locked with !important so the host
   theme's global button/icon styles can never leak in and turn these
   into plain white boxes. */
.wpsg-lightbox-overlay button.wpsg-lightbox-close,
.wpsg-lightbox-overlay button.wpsg-lightbox-prev,
.wpsg-lightbox-overlay button.wpsg-lightbox-next {
	all: unset;
	position: fixed !important;
	box-sizing: border-box !important;
	top: 50% !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 46px !important;
	height: 46px !important;
	min-width: 46px !important;
	min-height: 46px !important;
	max-width: 46px !important;
	max-height: 46px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 1px solid rgba(255, 255, 255, .2) !important;
	border-radius: 50% !important;
	background-color: rgba(20, 20, 22, .55) !important;
	background-image: none !important;
	box-shadow: 0 4px 18px rgba(0, 0, 0, .35) !important;
	color: #fff !important;
	cursor: pointer !important;
	line-height: 0 !important;
	font-size: 0 !important;
	text-indent: 0 !important;
	-webkit-tap-highlight-color: transparent;
	transition: background-color .2s ease, border-color .2s ease, transform .2s ease !important;
	z-index: 1000002 !important;
}
.wpsg-lightbox-overlay button.wpsg-lightbox-close svg,
.wpsg-lightbox-overlay button.wpsg-lightbox-prev svg,
.wpsg-lightbox-overlay button.wpsg-lightbox-next svg {
	display: block !important;
	width: 20px !important;
	height: 20px !important;
	fill: none !important;
	stroke: #ffffff !important;
	stroke-width: 2 !important;
	pointer-events: none !important;
}
.wpsg-lightbox-overlay button.wpsg-lightbox-close:hover,
.wpsg-lightbox-overlay button.wpsg-lightbox-prev:hover,
.wpsg-lightbox-overlay button.wpsg-lightbox-next:hover {
	background-color: rgba(255, 255, 255, .22) !important;
	border-color: rgba(255, 255, 255, .4) !important;
}
.wpsg-lightbox-overlay button.wpsg-lightbox-close:active,
.wpsg-lightbox-overlay button.wpsg-lightbox-prev:active,
.wpsg-lightbox-overlay button.wpsg-lightbox-next:active {
	transform: scale(.92) !important;
}
.wpsg-lightbox-overlay button.wpsg-lightbox-prev:hover,
.wpsg-lightbox-overlay button.wpsg-lightbox-next:hover {
	transform: translateY(-50%) scale(1.08) !important;
}
.wpsg-lightbox-overlay button.wpsg-lightbox-prev:active,
.wpsg-lightbox-overlay button.wpsg-lightbox-next:active {
	transform: translateY(-50%) scale(.9) !important;
}

.wpsg-lightbox-overlay button.wpsg-lightbox-close {
	top: max(24px, calc(env(safe-area-inset-top) + 14px)) !important;
	right: max(24px, calc(env(safe-area-inset-right) + 14px)) !important;
	transform: none !important;
}
.wpsg-lightbox-overlay button.wpsg-lightbox-prev {
	left: max(16px, calc(env(safe-area-inset-left) + 8px)) !important;
	transform: translateY(-50%) !important;
}
.wpsg-lightbox-overlay button.wpsg-lightbox-next {
	right: max(16px, calc(env(safe-area-inset-right) + 8px)) !important;
	transform: translateY(-50%) !important;
}

.wpsg-lightbox-prev.wpsg-hide,
.wpsg-lightbox-next.wpsg-hide {
	display: none !important;
}

/* Tablet */
@media (max-width: 1024px) {
	.wpsg-lightbox-stage { width: min(90vw, 1100px); height: min(78dvh, 800px); }
}

/* Mobile: same fixed-frame approach, just a smaller, edge-anchored frame
   and slightly smaller controls — nothing changes position between
   photos, so there's no more "jumping" alignment. */
@media (max-width: 767px) {
	.wpsg-lightbox-stage {
		width: calc(100vw - 24px);
		height: min(70dvh, 620px);
	}
	.wpsg-lightbox-overlay img {
		border-radius: 10px;
	}
	.wpsg-lightbox-overlay button.wpsg-lightbox-close {
		top: max(16px, calc(env(safe-area-inset-top) + 10px)) !important;
		right: max(16px, calc(env(safe-area-inset-right) + 10px)) !important;
		width: 40px !important;
		height: 40px !important;
		min-width: 40px !important;
		min-height: 40px !important;
		max-width: 40px !important;
		max-height: 40px !important;
	}
	.wpsg-lightbox-overlay button.wpsg-lightbox-close svg { width: 18px !important; height: 18px !important; }
	.wpsg-lightbox-counter {
		top: max(16px, env(safe-area-inset-top)) !important;
		font-size: 12px !important;
		padding: 5px 14px !important;
	}
	.wpsg-lightbox-overlay button.wpsg-lightbox-prev,
	.wpsg-lightbox-overlay button.wpsg-lightbox-next {
		top: auto !important;
		bottom: max(28px, calc(env(safe-area-inset-bottom) + 16px)) !important;
		transform: none !important;
		width: 44px !important;
		height: 44px !important;
		min-width: 44px !important;
		min-height: 44px !important;
		max-width: 44px !important;
		max-height: 44px !important;
	}
	.wpsg-lightbox-overlay button.wpsg-lightbox-prev { left: 50% !important; right: auto !important; margin-left: -58px !important; }
	.wpsg-lightbox-overlay button.wpsg-lightbox-next { left: 50% !important; right: auto !important; margin-left: 14px !important; }
	.wpsg-lightbox-overlay button.wpsg-lightbox-prev:hover,
	.wpsg-lightbox-overlay button.wpsg-lightbox-next:hover { transform: none !important; }
	.wpsg-lightbox-overlay button.wpsg-lightbox-prev:active,
	.wpsg-lightbox-overlay button.wpsg-lightbox-next:active { transform: scale(.92) !important; }
}
