/* ---------------------------
   GLOBAL STYLES
--------------------------- */
body {
  margin: 0;
  background: #111;
  color: #fff;
  font-family: system-ui, sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2vw;
  box-sizing: border-box;
}

.page-container {
  max-width: 1600px;
  margin: 0 auto;
}

/* ---------------------------
   GALLERY LAYOUT
--------------------------- */
.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2px;
  width: 100%;
  height: auto;
}

.gallery-item {
  position: relative;
  flex: 1 1 calc(25% - 4px); /* 4 per row desktop */
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 2px solid #fff;
  box-sizing: border-box;
  transition: transform 0.3s ease, opacity 0.3s ease;
  cursor: pointer;
}

.gallery img:hover {
  transform: scale(1.04);
  opacity: 0.9;
}

/* Captions for thumbnails */
.caption {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.8em;
  padding: 4px 6px;
  text-align: center;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gallery-item:hover .caption { opacity: 1; }

/* ---------------------------
   LIGHTBOX
--------------------------- */
.lightbox {
  display: none;
  position: fixed;
  z-index: 10;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 10px;
  box-sizing: border-box;
}

.lightbox.active { display: flex; }

.lightbox-img {
  max-width: 95%;
  max-height: 70vh;
  border: 2px solid #fff;*
  border-radius: 0;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.lightbox-caption {
  margin-top: 10px;
  text-align: center;
  font-size: 0.9em;
  padding: 5px;
  max-width: 90%;
  line-height: 1.3;
  /* ✅ Simplified style — no white frame */
  border: none;
  background: none; /* removes the darker box too */
}

/* Controls */
.close, .prev, .next {
  color: #fff;
  font-size: 2em;
  cursor: pointer;
  position: absolute;
  user-select: none;
  padding: 10px;
  background: rgba(0,0,0,0.4);
  border-radius: 50%;
}
.close { top: 20px; right: 20px; }
.prev { left: 10px; top: 50%; transform: translateY(-50%); }
.next { right: 10px; top: 50%; transform: translateY(-50%); }

.prev:hover, .next:hover, .close:hover { background: rgba(255,255,255,0.2); }

/* ---------------------------
   RESPONSIVE BREAKPOINTS
--------------------------- */
@media (max-width: 900px) {
  .gallery-item { flex: 1 1 calc(33.33% - 4px); } /* 3 per row */
  .lightbox-img { max-height: 65vh; }
}

@media (max-width: 600px) {
  body { padding: 4vw; }

  .gallery-item { flex: 1 1 calc(50% - 4px); } /* 2 per row */
  .caption { font-size: 0.7em; padding: 3px; }

  .lightbox-img {
    max-width: 100%;
    max-height: 60vh;
  }

  .lightbox-caption {
    font-size: 0.8em;
    padding: 5px 0;
  }

  .prev, .next, .close {
    font-size: 1.6em;
    padding: 8px;
  }
}
/* ---------------------------
   LIGHTBOX ANIMATIONS
--------------------------- */
@keyframes fadeSlideInFromRight {
  0% {
    opacity: 0;
    transform: translateX(40px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes fadeSlideInFromLeft {
  0% {
    opacity: 0;
    transform: translateX(-40px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}
.lightbox-img.fade-in-right {
  animation: fadeSlideInFromRight 0.35s ease;
}
.lightbox-img.fade-in-left {
  animation: fadeSlideInFromLeft 0.35s ease;
}
