/**
 * Lightbox Styles for Smart Gallery.
 */

:root {
	--sg-lb-bg: rgba(15, 23, 42, 0.95);
	--sg-lb-ctrl-color: #ffffff;
	--sg-lb-transition-speed: 300ms;
}

/* Overlay wrapper */
.sg-lightbox-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: var(--sg-lb-bg);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--sg-lb-transition-speed) ease,
		visibility var(--sg-lb-transition-speed) ease;
	user-select: none;
	-webkit-user-select: none;
}

.sg-lightbox-overlay.is-active {
	opacity: 1;
	visibility: visible;
}

/* Lightbox Container */
.sg-lightbox-container {
	position: relative;
	max-width: 90%;
	max-height: 85%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

/* Image */
.sg-lightbox-image {
	max-width: 100%;
	max-height: 80vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
	opacity: 0;
	transform: scale(0.95);
	transition: opacity var(--sg-lb-transition-speed) ease,
		transform var(--sg-lb-transition-speed) ease;
}

.sg-lightbox-image.is-loaded {
	opacity: 1;
	transform: scale(1);
}

/* Caption */
.sg-lightbox-caption {
	margin-top: 15px;
	color: #f1f5f9;
	font-size: 15px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		Helvetica, Arial, sans-serif;
	text-align: center;
	line-height: 1.5;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
	word-break: break-word;
	max-width: 600px;
}

/* Loader */
.sg-lightbox-loader {
	position: absolute;
	width: 40px;
	height: 40px;
	border: 3px solid rgba(255, 255, 255, 0.1);
	border-top: 3px solid #ffffff;
	border-radius: 50%;
	animation: sg-spin 0.8s linear infinite;
	z-index: 999990;
	display: none;
}

.sg-lightbox-overlay.is-loading .sg-lightbox-loader {
	display: block;
}

@keyframes sg-spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

/* Navigation & Close Buttons */
.sg-lightbox-btn {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	outline: none !important;
	color: var(--sg-lb-ctrl-color);
	font-size: 42px;
	line-height: 1;
	cursor: pointer;
	width: auto;
	height: auto;
	padding: 0;
	margin: 0;
	border-radius: 0;
	transition: none;
	z-index: 1000000;
}

/* Remove all hover/focus/active effects */
.sg-lightbox-btn:hover,
.sg-lightbox-btn:focus,
.sg-lightbox-btn:active {
	background: transparent !important;
	color: var(--sg-lb-ctrl-color) !important;
	box-shadow: none !important;
	outline: none !important;
	transform: none !important;
}

/* Close Button */
.sg-lightbox-close {
	top: 20px;
	right: 20px;
	font-size: 40px;
}

/* Previous Button */
.sg-lightbox-prev {
	left: 20px;
	top: 50%;
	transform: translateY(-50%);
}

/* Next Button */
.sg-lightbox-next {
	right: 20px;
	top: 50%;
	transform: translateY(-50%);
}

/* Hide arrows when only one image exists */
.sg-lightbox-overlay.has-single-image .sg-lightbox-prev,
.sg-lightbox-overlay.has-single-image .sg-lightbox-next {
	display: none;
}

/* Responsive */
@media (max-width: 768px) {
	.sg-lightbox-btn {
		font-size: 36px;
	}

	.sg-lightbox-prev {
		left: 10px;
	}

	.sg-lightbox-next {
		right: 10px;
	}

	.sg-lightbox-close {
		top: 10px;
		right: 10px;
	}

	.sg-lightbox-caption {
		font-size: 13px;
		max-width: 80%;
	}
}