.cag-gallery{
  position:relative;
  max-width:100%;
  border-radius:22px !important;
  overflow:hidden !important;
  /* isolate from theme masks */
  transform: translateZ(0);
}

/* NUCLEAR RESET against Salient/other themes applying masks/clip-path to images/wrappers */
.cag-gallery, .cag-gallery *{
  clip-path:none !important;
  -webkit-clip-path:none !important;
  mask:none !important;
  -webkit-mask:none !important;
  mask-image:none !important;
  -webkit-mask-image:none !important;
  filter:none !important;
}

/* Main stage */
.cag-main{
  position:relative;
  width:100%;
  border-radius:22px !important;
  overflow:hidden !important;
  background:#0000;
}

/* We force a consistent stage height with aspect-ratio set via JS (from data-ratio) */
.cag-main{
  aspect-ratio: 16 / 9;
}

/* Slides use opacity (not display none) to prevent layout jumps and bleed */
.cag-slide{
  position:absolute !important;
  inset:0 !important;
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
  opacity:0;
  transition: opacity .35s ease;
  border-radius:0 !important;
  background:#0000;
}

.cag-slide.active{
  opacity:1;
}

/* Thumbnails (re-apply circle after reset) */
.cag-thumbs{
  position:absolute;
  bottom:18px;
  right:18px;
  display:flex;
  gap:10px;
  z-index:10;
}

.cag-thumbs img{
  width:54px;
  height:54px;
  border-radius:50% !important;
  cursor:pointer;
  opacity:0.65;
  border:2px solid rgba(255,255,255,0.95);
  object-fit:cover;
  background:#fff;
}

.cag-thumbs img.active{
  opacity:1;
}

@media (max-width: 480px){
  .cag-thumbs img{width:44px;height:44px;}
  .cag-thumbs{bottom:12px;right:12px;gap:8px;}
}
