.gallery-shell {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto 4rem;
  padding-top: 2rem;
}

.gallery-intro {
  max-width: 720px;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.gallery-intro p {
  opacity: 0.82;
}

#gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.gallery-card {
  overflow: hidden;
  border-radius: 16px;
  background: #111;
  cursor: pointer;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
  opacity: 0.96;
}

.gallery-card img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.96);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 2rem;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  display: block;
}

.lightbox-btn {
  position: fixed;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox-close {
  top: 20px;
  right: 20px;
}

.lightbox-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 0.95rem;
  opacity: 0.85;
  z-index: 100000;
}

@media (max-width: 900px) {
  #gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-card img {
    height: 320px;
  }
}

@media (max-width: 640px) {
  .gallery-shell {
    width: min(100%, calc(100% - 1rem));
  }

  #gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-card img {
    height: auto;
    max-height: 520px;
  }

  .lightbox-btn {
    width: 46px;
    height: 46px;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
  }
}
