/* ===== NAM Modern Gallery Strip (Divi 4) ===== */

.nam-modern-gallery{
  width: 100%;
}

/* Break out to edge-to-edge */
.nam-modern-gallery.is-fullbleed{
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

/* viewport */
.nam-gal-viewport{
  position: relative;
  width: 100%;
  height: var(--nam-gal-height, 300px);
  border-radius: var(--nam-gal-radius, 0px);
  overflow: hidden;
  background: rgba(0,0,0,.06);
  touch-action: pan-y; /* allow horizontal drag without blocking page scroll */
}

/* strip */
.nam-gal-track{
  height: 100%;
  display: flex;
  gap: var(--nam-gal-gap, 0px);
  transform: translate3d(0,0,0);
  transition: transform .35s ease;
  will-change: transform;
}

/* tile button reset */
.nam-gal-tile{
  display: block;
  flex: 0 0 auto;
  width: var(--nam-tile-width, 340px);
  height: 100%;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  cursor: zoom-in;
  line-height: 0 !important;
  font-size: 0 !important;
}

/* Divi often forces img{height:auto}; override so every image fills the strip height */
.nam-gal-tile img{
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* arrows */
.nam-gal-arrow{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(0,0,0,.55);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  pointer-events: auto;
}

.nam-gal-arrow span{
  font-size: 28px;
  line-height: 1;
  transform: translateY(-1px);
}

.nam-gal-prev{ left: 12px; }
.nam-gal-next{ right: 12px; }

.nam-gal-arrow:hover{ background: rgba(0,0,0,.72); }

.nam-gal-arrow:focus{
  outline: 3px solid rgba(255,255,255,.75);
  outline-offset: 2px;
}

/* dots (optional) */
.nam-gal-dots{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  gap: 8px;
  justify-content: center;
  z-index: 50;
  pointer-events: auto;
}

.nam-gal-dot{
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,.5);
  cursor: pointer;
}
.nam-gal-dot.is-active{
  background: rgba(255,255,255,.95);
}

/* ===== Lightbox ===== */
.nam-gal-lightbox{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.90);
  z-index: 999999;
  display: none;
}

.nam-gal-lightbox.is-open{
  display: grid;
  place-items: center;
}

.nam-gal-lightbox-inner{
  width: min(1200px, 94vw);
  height: min(82vh, 820px);
  position: relative;
  display: grid;
  place-items: center;
}

.nam-gal-lightbox img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
}

.nam-gal-lb-close{
  position: absolute;
  top: -54px;
  right: 0;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
  font-size: 26px;
}

.nam-gal-lb-arrow{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
  font-size: 34px;
}

.nam-gal-lb-prev{ left: -74px; }
.nam-gal-lb-next{ right: -74px; }

@media (max-width: 980px){
  .nam-gal-lb-prev{ left: 10px; }
  .nam-gal-lb-next{ right: 10px; }
  .nam-gal-lb-close{ top: 10px; right: 10px; }
}
