/**
 * Lightbox Gallery Styles
 *
 * @package Lightbox_Gallery_For_Avada_Builder
 */

/* Gallery Container */
.lgab-gallery-container {
	position: relative;
}

/* Alignment */
.lgab-gallery-container.alignleft {
	float: left;
	margin-right: 25px;
}

.lgab-gallery-container.alignright {
	float: right;
	margin-left: 25px;
}

.lgab-gallery-container.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

/* Frame Wrapper (Link) - Acts like Avada's awb-image-frame */
.lgab-frame-wrapper {
	display: inline-block;
	position: relative;
	cursor: pointer;
	line-height: 0;
	text-decoration: none;
	max-width: 100%;
}

.lgab-frame-wrapper:hover {
	text-decoration: none;
}

/* Accessibility Focus Outline */
.lgab-frame-wrapper.lgab-has-accessibility:focus {
	outline: var(--lgab-accessibility-outline, 2px solid #0073aa);
	outline-offset: 2px;
}

.lgab-frame-wrapper.lgab-has-accessibility:focus-visible {
	outline: var(--lgab-accessibility-outline, 2px solid #0073aa);
	outline-offset: 2px;
}

/* Main Image */
.lgab-main-image {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
}

/* Gallery Trigger - prevent any lightbox icon overlays */
.lgab-gallery-trigger::before,
.lgab-gallery-trigger::after {
	display: none !important;
}

/* Imageframe Wrapper */
.lgab-imageframe {
	display: inline-block;
	max-width: 100%;
	line-height: 0;
	position: relative;
	overflow: hidden;
}

/* Make sure image respects imageframe dimensions */
.lgab-imageframe img {
	display: block;
	width: 100%;
	height: auto;
}

/* Hover Effects - Following Avada's pattern */

/* Zoom In - Image scales up within imageframe span */
.lgab-imageframe.lgab-hover-zoomin {
	overflow: hidden;
}

.lgab-imageframe.lgab-hover-zoomin img {
	opacity: 1;
	transition: opacity 1s, transform 1s;
	transform: scale3d(1, 1, 1);
}

.lgab-imageframe.lgab-hover-zoomin:hover img {
	opacity: 1;
	transform: scale3d(1.1, 1.1, 1);
}

/* Zoom Out - Image starts scaled, returns to normal on hover */
.lgab-imageframe.lgab-hover-zoomout {
	overflow: hidden;
}

.lgab-imageframe.lgab-hover-zoomout img {
	opacity: 1;
	transition: opacity 1s, transform 1s;
	transform: scale3d(1.1, 1.1, 1);
}

.lgab-imageframe.lgab-hover-zoomout:hover img {
	opacity: 1;
	transform: scale3d(1, 1, 1);
}

/* Lift Up - Applied to frame wrapper (lifts entire element) */
.lgab-frame-wrapper.lgab-hover-liftup {
	transition: transform 0.3s ease;
}

.lgab-frame-wrapper.lgab-hover-liftup:hover {
	transform: translateY(-10px);
}

/* Bottom Shadow - Applied to imageframe */
.lgab-imageframe.lgab-style-bottomshadow {
	position: relative;
	display: inline-block;
	padding-bottom: 25px;
}

.lgab-imageframe.lgab-style-bottomshadow::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 5%;
	width: 90%;
	height: 20px;
	background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 70%);
	display: block !important;
}

/* Responsive images */
.lgab-main-image.img-responsive {
	max-width: 100%;
	height: auto;
	display: block;
}

/* Hidden Gallery Container - Screen reader accessible */
.lgab-hidden-gallery {
	position: absolute;
	left: -9999px;
	top: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
	visibility: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
}

/* Child Gallery Links - Hidden but accessible to lightbox */
.lgab-child-link {
	position: absolute;
	left: -9999px;
	top: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
}

/* Child Gallery Images - Hidden */
.lgab-child-image {
	display: none;
	visibility: hidden;
	width: 1px;
	height: 1px;
}

/* No Image State */
.lgab-no-image {
	padding: 40px 20px;
	text-align: center;
	background: #f5f5f5;
	border: 2px dashed #ddd;
	color: #666;
	font-size: 14px;
	border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
	.lgab-gallery-container {
		max-width: 100%;
	}
}

/* Live Builder Styles */
.fusion-builder-live .lgab-gallery-container {
	position: relative;
}

/* Keep hidden gallery items hidden even in live builder */
.fusion-builder-live .lgab-hidden-gallery {
	position: absolute;
	left: -9999px;
	top: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
	visibility: hidden;
}

/* Child items remain hidden in live builder preview */
.fusion-builder-live .lgab-child-link {
	position: absolute;
	left: -9999px;
	top: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
}

.fusion-builder-live .lgab-child-image {
	display: none;
	visibility: hidden;
	width: 1px;
	height: 1px;
}
