/*
  Gallery Page Styles
  Masonry grid layout with PhotoSwipe lightbox
*/

/* ========================================
   GALLERY GRID - MASONRY LAYOUT
   ======================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-xl);
  grid-auto-rows: 250px;
  grid-auto-flow: dense;
}

/* Gallery Item */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: block;
  background: var(--color-light-grey);
  transition: all var(--transition-base);
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Tall items - span 2 rows */
.gallery-item--tall {
  grid-row: span 2;
}

/* Wide items - span 2 columns */
.gallery-item--wide {
  grid-column: span 2;
}

/* Gallery Image */
.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.gallery-item:hover .gallery-image {
  transform: scale(1.05);
}

/* Gallery Caption Overlay */
.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-md);
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: white;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.gallery-item:hover .gallery-caption {
  opacity: 1;
}

.gallery-caption p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

/* ========================================
   PHOTOSWIPE CUSTOMIZATION
   ======================================== */
   
/* Customize PhotoSwipe UI to match site */
.pswp {
  --pswp-bg: rgba(0, 0, 0, 0.95);
  --pswp-placeholder-bg: #222;
}

.pswp__button {
  background-color: rgba(255, 255, 255, 0.1);
}

.pswp__button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: 220px;
  }
  
  .gallery-item--wide {
    grid-column: span 1; /* Reset wide on tablets */
  }
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 200px;
    gap: var(--space-sm);
  }
  
  .gallery-item--wide {
    grid-column: span 2; /* Full width on mobile */
  }
  
  .gallery-item--tall {
    grid-row: span 2;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 250px;
  }
  
  .gallery-item--wide,
  .gallery-item--tall {
    grid-column: span 1;
    grid-row: span 1;
  }
}
