/* Universal ACF Gallery — base styles (static)
   Dynamic styles (colors/typography/borders) are handled by Elementor selectors. */

/* Aspect helpers */
.acf-aspect-16-9 .acf-gallery-image-wrap,
.acf-aspect-4-3 .acf-gallery-image-wrap,
.acf-aspect-1-1 .acf-gallery-image-wrap,
.acf-aspect-3-4 .acf-gallery-image-wrap,
.acf-aspect-9-16 .acf-gallery-image-wrap { display:block; width:100%; position:relative; overflow:hidden; }
.acf-aspect-16-9 .acf-gallery-image-wrap:before { content:""; display:block; padding-top:56.25%; }
.acf-aspect-4-3  .acf-gallery-image-wrap:before { content:""; display:block; padding-top:75%; }
.acf-aspect-1-1  .acf-gallery-image-wrap:before { content:""; display:block; padding-top:100%; }
.acf-aspect-3-4  .acf-gallery-image-wrap:before { content:""; display:block; padding-top:133.33%; }
.acf-aspect-9-16 .acf-gallery-image-wrap:before { content:""; display:block; padding-top:177.78%; }
.acf-aspect-16-9 img, .acf-aspect-4-3 img, .acf-aspect-1-1 img, .acf-aspect-3-4 img, .acf-aspect-9-16 img {
  position:absolute; left:0; top:0; width:100%; height:100%; object-fit:cover;
}

/* Shared image/overlay + hover effects */
.acf-gallery-img { position:relative; overflow:hidden; margin:0; background:#f7f7f7; }
.acf-gallery-img img { display:block; width:100%; height:auto; border-radius:inherit; transition: transform .35s cubic-bezier(.4,0,.2,1), filter .3s; backface-visibility:hidden; }
.hover-zoom .acf-gallery-img:hover img      { transform: scale(1.06); }
.hover-grayscale .acf-gallery-img:hover img { filter: grayscale(100%); }
.hover-blur .acf-gallery-img:hover img      { filter: blur(2px); }
.acf-gallery-image-wrap { display:block; position:relative; width:100%; overflow:hidden; }
.acf-gallery-overlay {
  display:flex; align-items:center; justify-content:center;
  position:absolute; inset:0; opacity:0; transition:opacity .25s;
  background: rgba(0,0,0,0.35); border-radius:inherit; pointer-events:none; z-index:2;
}
.acf-gallery-img:hover .acf-gallery-overlay { opacity:1; }
.acf-gallery-img .acf-gallery-overlay i { font-size:2em; line-height:1; color:#fff; }
.acf-gallery-img figcaption {
  font-size:.95em; padding:4px 10px 6px;
  border-radius:0 0 10px 10px;
  background: rgba(255,255,255,.95);
  text-align:center;
  margin-top:-8px;
  position:relative; z-index:1;
}

/* Baseline layout scaffolding */
.universal-acf-gallery-grid,
.universal-acf-gallery-justified { display:grid; width:100%; box-sizing:border-box; }
.universal-acf-gallery-masonry { column-count:3; column-gap:16px; width:100%; }
.universal-acf-gallery-masonry .acf-gallery-img { display:inline-block; width:100%; margin:0 0 var(--uacfg-masonry-gap, 16px); }

/* ===== Carousel (no spill; ready-reveal) ===== */
.universal-acf-gallery-carousel { position: relative; width:100%; overflow:hidden; visibility:hidden; }
.universal-acf-gallery-carousel.uacfg-ready { visibility: visible; }
.universal-acf-gallery-carousel .swiper-wrapper { display:flex; z-index:0; will-change: transform; }
.universal-acf-gallery-carousel .swiper-slide { box-sizing:border-box; height:auto; }

/* Safe grid fallback if Swiper isn't ready */
.universal-acf-gallery-carousel.uacfg-editor-fallback .swiper-wrapper{
  display:grid !important;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.universal-acf-gallery-carousel.uacfg-editor-fallback .swiper-slide{
  width:auto !important;
}

/* Custom arrow buttons (SVG inside) */
.universal-acf-gallery-carousel .swiper-button-prev,
.universal-acf-gallery-carousel .swiper-button-next{
  position:absolute;
  top: calc(50% + var(--uacfg-arrow-offset-y, 0px));
  transform: translateY(-50%);
  width: var(--uacfg-arrow-btn, 44px); height: var(--uacfg-arrow-btn, 44px);
  border-radius: var(--uacfg-arrow-radius, 999px);
  background-color: var(--uacfg-arrow-bg, rgba(0,0,0,.5));
  color: var(--uacfg-arrow-color, #fff);
  display:flex; align-items:center; justify-content:center;
  z-index: 6; cursor: pointer; user-select: none;
  transition: opacity .18s ease, transform .18s ease, background-color .18s ease;
  opacity: .92;
}
.universal-acf-gallery-carousel .swiper-button-prev{ left: calc(10px + var(--uacfg-arrow-offset-x, 0px)); }
.universal-acf-gallery-carousel .swiper-button-next{ right: calc(10px + var(--uacfg-arrow-offset-x, 0px)); }
.universal-acf-gallery-carousel .swiper-button-prev:after,
.universal-acf-gallery-carousel .swiper-button-next:after { display:none; }
.universal-acf-gallery-carousel .uacfg-arrow-icon { width: 1.25em; height: 1.25em; fill: currentColor; }
.universal-acf-gallery-carousel .swiper-button-prev:hover,
.universal-acf-gallery-carousel .swiper-button-next:hover{ opacity:1; transform: translateY(-50%) scale(1.03); }
.universal-acf-gallery-carousel .swiper-button-disabled { opacity:.4; cursor: default; }

/* Dots */
.universal-acf-gallery-carousel .swiper-pagination{
  position: absolute; z-index: 5;
  left:0; right:0; width:100%;
  display:flex; align-items:center; justify-content: center;
  gap: var(--uacfg-dots-spacing, 8px);
  bottom: 10px; transform: translateY(var(--uacfg-dots-offset-y, 0px));
  text-align: initial; pointer-events: auto;
}
.universal-acf-gallery-carousel .swiper-pagination-bullet{
  width: var(--uacfg-dots-size, 8px); height: var(--uacfg-dots-size, 8px);
  background: var(--uacfg-dots-color, rgba(255,255,255,.6)); opacity: 1;
}
.universal-acf-gallery-carousel .swiper-pagination-bullet-active{ background: var(--uacfg-dots-active, #fff); }
