#gallery-wrap {
  background: #080f1a;
  padding-bottom: 3px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}
@media (max-width: 1024px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }

.gallery-item {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: #111827;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.06); }

.gallery-zoom {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.22);
  opacity: 0;
  transition: opacity .22s;
}
.gallery-item:hover .gallery-zoom { opacity: 1; }
.gallery-zoom svg { width: 56px; height: 56px; filter: drop-shadow(0 2px 8px rgba(0,0,0,.55)); }

/* Slideshow */
#gallery-slideshow {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.97);
  align-items: center;
  justify-content: center;
}
#gallery-slideshow.open { display: flex; }

.slideshow-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: none;
}
.slideshow-stage.ss-active { cursor: default; }

.slideshow-img {
  position: absolute;
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  opacity: 1;
  transition: opacity 1.5s ease;
  user-select: none;
  pointer-events: none;
}
.slideshow-img.ss-hidden { opacity: 0; }

/* UI elements — fade out when idle */
.ss-ui {
  transition: opacity .5s ease;
}
.slideshow-stage.ss-idle .ss-ui {
  opacity: 0 !important;
  pointer-events: none !important;
}

.ss-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, opacity .5s ease;
  z-index: 10;
}
.ss-btn:hover { background: rgba(255,255,255,.25); }
#ss-prev { left: 1.25rem; }
#ss-next { right: 1.25rem; }

/* Autoplay buttons — stacked below next button */
#ss-autoplay-group {
  position: absolute;
  right: 1.25rem;
  top: calc(50% + 38px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}
.ss-ap-btn {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.8);
  width: 52px;
  height: 28px;
  border-radius: 4px;
  font-size: .72rem;
  font-family: 'Inter', sans-serif;
  letter-spacing: .04em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: background .2s, border-color .2s, color .2s;
}
.ss-ap-btn:hover { background: rgba(255,255,255,.2); }
.ss-ap-btn.active {
  background: rgba(14,165,233,.35);
  border-color: rgba(14,165,233,.6);
  color: #fff;
}

@media (max-width: 600px) {
  #ss-prev { left: .5rem; }
  #ss-next { right: .5rem; }
  .ss-btn { width: 40px; height: 40px; font-size: 1rem; }
  #ss-autoplay-group { right: .5rem; top: calc(50% + 30px); }
  .ss-ap-btn { width: 40px; }
}

#ss-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  transition: color .15s, opacity .5s ease;
  padding: .25rem .5rem;
}
#ss-close:hover { color: #fff; }

#ss-counter {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.55);
  font-size: .82rem;
  letter-spacing: .1em;
  z-index: 10;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  transition: opacity .5s ease;
}

.gallery-empty {
  text-align: center;
  padding: 5rem 1.5rem;
  color: rgba(255,255,255,.4);
  font-family: 'Inter', sans-serif;
}
