/*
 Theme Name:   Bricks Child Theme
 Theme URI:    https://bricksbuilder.io/
 Description:  Use this child theme to extend Bricks.
 Author:       Bricks
 Author URI:   https://bricksbuilder.io/
 Template:     bricks
 Version:      1.1
 Text Domain:  bricks
*/

/* HappyFiles Pro Lightbox Fixes */
/* Fix for centered body text causing lightbox misalignment */
.lg-outer {
  text-align: left !important;
}

/* Ensure lightbox images are properly displayed */
.happyfiles-lightbox .lg-img-wrap img {
  max-width: 100%;
  height: auto;
}

/* Fix for lightbox not appearing due to z-index issues */
.lg-backdrop,
.lg-outer {
  z-index: 999999 !important;
}

/* Ensure lightbox elements are clickable */
[data-happyfiles-lightbox] .happyfiles-gallery-item,
.happyfiles-gallery-item {
  cursor: pointer !important;
  pointer-events: auto !important;
}

/* Fix for any potential conflicts with Bricks animations */
.happyfiles-gallery-item,
[data-happyfiles-lightbox],
[data-lightgallery] {
  -webkit-transition: none !important;
  -moz-transition: none !important;
  -ms-transition: none !important;
  -o-transition: none !important;
  transition: none !important;
}

/* Ensure lightbox works after AJAX navigation */
.lg-container,
.lg-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 999999 !important;
}

/* Fix for navigation buttons and submenu items */
.bricks-nav-menu .menu-item a,
.bricks-mobile-menu .menu-item a {
  pointer-events: auto !important;
}

/* Ensure gallery items remain interactive after page transitions */
.happyfiles-gallery {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Fix for any overlay issues */
.lg-outer .lg-img-wrap {
  position: relative !important;
  z-index: 1000000 !important;
}

/* Force lightbox to work after AJAX navigation */
.happyfiles-gallery-item,
[data-happyfiles-lightbox] .happyfiles-gallery-item {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Debug styles - remove in production */
/* Uncomment to see gallery containers */
/*
[data-happyfiles-lightbox] {
  border: 2px solid red !important;
}

.happyfiles-gallery {
  border: 2px solid blue !important;
}

.happyfiles-gallery-item {
  border: 1px solid green !important;
}
*/

/* Ensure lightbox scripts can attach to elements */
[data-happyfiles-lightbox],
.happyfiles-gallery {
  pointer-events: auto !important;
}

/* Fix for Bricks AJAX navigation conflicts */
.bricks-ajax-loading .happyfiles-gallery-item {
  pointer-events: none !important;
}

.bricks-ajax-loading .happyfiles-gallery-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  z-index: 10;
}