/* =========================================================
   GALLERY STYLES — Ethereal Canvas
   ========================================================= */

/* Masonry Grid */
.masonry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 32px;
  padding-bottom: 80px;
}

.gallery-item {
  background: rgba(20, 20, 25, 0.6);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
  cursor: pointer;
  position: relative;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeUp 0.8s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
}

.gallery-item:hover {
  transform: translateY(-8px);
  border-color: #D4AF37;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.gallery-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/5;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.gallery-item:hover .gallery-img {
  transform: scale(1.05);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  padding: 24px;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-title {
  font-family: "Fraunces", serif;
  font-size: 1.2rem;
  color: #fff;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-title {
  transform: translateY(0);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(2, 2, 3, 0.95);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 48px;
  max-width: 1200px;
  width: 90%;
  max-height: 90vh;
  background: #020203;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  padding: 40px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

.lightbox-media img {
  width: 100%;
  height: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.lightbox-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.lightbox-info h2 {
  font-size: 2.5rem;
  margin-bottom: 24px;
  color: #D4AF37;
}

.lightbox-meta p {
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 2001;
}

.lightbox-close:hover {
  color: #D4AF37;
}

@media (max-width: 900px) {
  .lightbox-content {
    grid-template-columns: 1fr;
    overflow-y: auto;
    padding: 24px;
  }

  .lightbox-media img {
    max-height: 40vh;
  }

  .lightbox-info h2 {
    font-size: 1.8rem;
  }
}