/* ======================
   NAVIGATION BUTTON
   ====================== */

.nav-button {
  position: fixed;
  top: 15px;
  right: 15px;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.2s ease, background 0.2s ease;
  z-index: 1000;
}

.nav-button:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.8);
}

/* ======================
   BASE STYLES
   ====================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #0a0a0a;
  min-height: 100vh;
}

/* ======================
   GALLERY GRID
   ====================== */

.gallery {
  width: 100%;
  padding: 5px;
}

.gallery-sizer,
.gallery-item {
  width: 250px; /* Fallback, JS calculates and overrides */
}

.gallery-item {
  padding: 5px;
}

.gallery-item a {
  display: block;
  cursor: pointer;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gallery-item img.loaded {
  opacity: 1;
}

/* Hide failed images */
.gallery-item.hidden {
  display: none;
}

/* ======================
   GLIGHTBOX OVERRIDES
   ====================== */

/* Solid black background */
.glightbox-container .goverlay {
  background: #000 !important;
}

/* Navigation arrows with dark circular background for visibility */
.glightbox-container .gnext,
.glightbox-container .gprev {
  opacity: 0.7;
  transition: opacity 0.2s ease, background 0.2s ease;
  background: rgba(0, 0, 0, 0.5) !important;
  border-radius: 50%;
  top: 50% !important;
  transform: translateY(-50%);
}

.glightbox-container .gnext:hover,
.glightbox-container .gprev:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.8) !important;
}

/* Close button - ensure top-right */
.glightbox-container .gclose {
  top: 20px;
  right: 20px;
}

/* Custom image counter - bottom center */
.glightbox-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  z-index: 9999999; /* Must be higher than GLightbox container (999999) */
  pointer-events: none;
}

/* Custom pulsing loading indicator */
.gloader {
  display: none !important;
}

.glightbox-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* ======================
   RESPONSIVE BEHAVIOR
   ====================== */

/* Column widths are now calculated dynamically by JavaScript
   to ensure images fill the full width with no gaps.
   Minimum column width is ~250px, columns expand to fill viewport. */
