/* =========================================================
   CHIEF SPA - Gallery overlay patch (isolated to gallery.php)
   - Adds prev/next navigation inside gallery modal
   - Keeps existing template and other pages untouched
========================================================= */

#galleryModal .gallery-modal-panel{
  position: relative;
  width: min(980px, 92vw);
  margin: 5vh auto;
  display: grid;
  place-items: center;
}

#galleryModalImg{
  max-width: 92vw;
  max-height: 86vh;
  width: auto;
  height: auto;
  border-radius: 16px;
  display: block;
}

#galleryModal .g-nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(0,0,0,0.45);
  color: rgba(255,255,255,0.95);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 3;
  backdrop-filter: blur(8px);
}

#galleryModal .g-nav:hover{
  background: rgba(0,0,0,0.60);
}

#galleryModal .g-prev{ left: 10px; }
#galleryModal .g-next{ right: 10px; }

#galleryModal .modal-x{
  position: absolute;
  top: -14px;
  right: -14px;
  z-index: 4;
}

@media (max-width: 520px){
  #galleryModal .g-nav{
    width: 42px;
    height: 42px;
    font-size: 24px;
  }
  #galleryModal .g-prev{ left: 6px; }
  #galleryModal .g-next{ right: 6px; }
}
