/* Style for Animated Gallery */
.mse-animated-gallery{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(180px,1fr));
  grid-auto-rows:180px;
  grid-auto-flow:dense;
  gap:12px;
  max-width:100%;
  margin:0 auto;
  align-items:stretch;
}
.mse-animated-gallery-item{
  position:relative;
  overflow:hidden;
  border-radius:8px;
  box-shadow:0 2px 8px rgba(0,0,0,0.15);
  height:100%;
  display:flex;
  opacity:0;
  transform:translateY(20px);
  transition:opacity .6s ease,transform .6s ease;
}
.mse-animated-gallery-item.visible{
  opacity:1;
  transform:translateY(0);
}
.mse-animated-gallery-item img{
  width:100%;
  height:100%;
  display:block;
  flex:1 0 100%;
  transition:transform .3s ease;
  object-fit:inherit;
}

/* Object-fit variations */
.mse-animated-gallery-item.mse-fit-fill img{object-fit:fill;}
.mse-animated-gallery-item.mse-fit-contain img{object-fit:contain;}
.mse-animated-gallery-item.mse-fit-cover img{object-fit:cover;}
.mse-animated-gallery-item.mse-fit-none img{object-fit:none;}
.mse-animated-gallery-item.mse-fit-scale-down img{object-fit:scale-down;}
.mse-animated-gallery-item:hover img{
  transform:scale(1.05);
}

/* Lightbox overlay */
.mse-animated-gallery-lightbox{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(0,0,0,0.8);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
  cursor:pointer;
  visibility:hidden;
  opacity:0;
  pointer-events:none;
  transition:opacity .4s ease;
}
.mse-animated-gallery-lightbox.open{
  visibility:visible;
  opacity:1;
  pointer-events:auto;
}
.mse-lightbox-track{
  display:flex;
  width:80vw;
  max-width:900px;
  height:80vh;
  max-height:90vh;
  cursor:auto;
  transition:transform .4s ease;
}
.mse-lightbox-slide{
  flex:0 0 100%;
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  transition:opacity .4s ease;
}
.mse-lightbox-slide.active{opacity:1;}
.mse-lightbox-slide img{
  width:100%;
  height:100%;
  object-fit:contain;
}
.mse-lightbox-prev,.mse-lightbox-next,.mse-lightbox-close{
  position:absolute;
  background:rgba(0,0,0,0.5);
  color:#fff;
  border:none;
  padding:0.5rem 0.75rem;
  cursor:pointer;
  z-index:10000;
}
.mse-lightbox-prev{top:50%;left:5%;transform:translateY(-50%);}
.mse-lightbox-next{top:50%;right:5%;transform:translateY(-50%);}
.mse-lightbox-close{top:20px;right:20px;}

/* Lightbox overlay */
.mse-animated-gallery-lightbox{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(0,0,0,0.8);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9999;
  cursor:pointer;
}
.mse-animated-gallery-lightbox.open{display:flex;}
.mse-lightbox-track{
  display:flex;
  width:90%;
  max-width:900px;
  height:auto;
  max-height:90%;
  cursor:auto;
  transition:transform .3s ease;
}
.mse-lightbox-slide{flex:0 0 100%;display:flex;align-items:center;justify-content:center;}
.mse-lightbox-slide img{max-width:100%;max-height:100%;object-fit:contain;}
.mse-lightbox-prev,.mse-lightbox-next,.mse-lightbox-close{
  position:absolute;
  background:rgba(0,0,0,0.5);
  color:#fff;
  border:none;
  padding:0.5rem 0.75rem;
  cursor:pointer;
  z-index:10000;
}
.mse-lightbox-prev{top:50%;left:5%;transform:translateY(-50%);}
.mse-lightbox-next{top:50%;right:5%;transform:translateY(-50%);}
.mse-lightbox-close{top:20px;right:20px;}
