/* ============================================
   VASCO FIGUEIREDO — MODERN PHOTO GALLERY
   35mm Film Aesthetic + Masonry + Lightbox
   ============================================ */

/* Gallery link wrapper */
.gallery-link {
  text-decoration: none;
  display: block;
  cursor: pointer;
}

/* Reset for gallery page — wider for bigger photos */
.gallery-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0.5rem;
}

.gallery-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1rem 0;
}

.gallery-header h1 {
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #333;
  margin: 0;
}

.gallery-header .subtitle {
  font-size: 0.9rem;
  color: #888;
  margin-top: 0.5rem;
  font-style: italic;
}

/* ============================================
   MASONRY GRID — Bigger photos, tighter gaps
   ============================================ */
.gallery-grid {
  column-count: 3;
  column-gap: 8px;
  padding: 0;
}

@media (max-width: 1200px) {
  .gallery-grid {
    column-count: 2;
    column-gap: 6px;
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    column-count: 1;
    column-gap: 6px;
  }
  
  /* Mobile: more breathing room */
  .gallery-container {
    padding: 1rem 0.75rem;
  }
  
  .gallery-header {
    margin-bottom: 1.5rem;
    padding: 1.5rem 0;
  }
  
  .gallery-header h1 {
    font-size: 1.2rem;
    letter-spacing: 0.2em;
  }
  
  .gallery-header .subtitle {
    font-size: 0.8rem;
    margin-top: 0.75rem;
  }
  
  /* Mobile: bigger spacing between photos */
  .gallery-item {
    margin-bottom: 20px;
  }
  
  /* Mobile: always show overlay (no hover on touch) */
  .gallery-item .overlay {
    transform: translateY(0);
    background: linear-gradient(transparent 0%, rgba(0,0,0,0.7) 100%);
    padding: 3rem 1rem 1rem;
  }
  
  /* Mobile: white date text */
  .gallery-item .overlay .date {
    color: #fff !important;
  }
  
  .gallery-item .overlay h3 {
    color: #fff !important;
  }
  
  /* Mobile: back button styling */
  .gallery-back-btn {
    margin: 0 0 1rem 0;
  }
}

/* ============================================
   GALLERY ITEM — Not clickable, bigger zoom
   ============================================ */
.gallery-item {
  break-inside: avoid;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
  background: #111;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.08);
}

/* Title overlay - hidden by default, shows on hover */
.gallery-item .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  padding: 2rem 1rem 1rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.gallery-item:hover .overlay {
  transform: translateY(0);
}

.gallery-item .overlay h3 {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 400;
  margin: 0 0 0.3rem;
  letter-spacing: 0.05em;
}

.gallery-item .overlay .date {
  color: rgba(255,255,255,0.6);
  font-size: 0.75rem;
  font-family: monospace;
}

.gallery-item .overlay .author-link {
  display: inline-block;
  margin-top: 0.4rem;
  color: rgba(255,255,255,0.8);
  font-size: 0.7rem;
  text-decoration: none;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  transition: color 0.2s, border-color 0.2s;
}

.gallery-item .overlay .author-link:hover {
  color: #fff;
  border-color: #fff;
}

/* Film sprocket holes - decorative */
.gallery-item::before,
.gallery-item::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 40px;
  background: rgba(0,0,0,0.3);
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.gallery-item::before { left: 4px; }
.gallery-item::after { right: 4px; }

.gallery-item:hover::before,
.gallery-item:hover::after {
  opacity: 0.5;
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.97);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  animation: lightboxZoom 0.3s ease;
}

@keyframes lightboxZoom {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-caption {
  position: absolute;
  bottom: -50px;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
}

.lightbox-caption h3 {
  font-size: 1.1rem;
  font-weight: 400;
  margin: 0 0 0.3rem;
  letter-spacing: 0.1em;
}

.lightbox-caption .date {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  font-family: monospace;
}

/* Close button */
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 10000;
  line-height: 1;
  font-weight: 200;
}

.lightbox-close:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Navigation arrows */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  color: #fff;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  padding: 1rem;
  user-select: none;
}

.lightbox-nav:hover {
  opacity: 1;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* Counter */
.lightbox-counter {
  position: absolute;
  top: 25px;
  left: 30px;
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
  font-family: monospace;
}

/* ============================================
   BACK LINK
   ============================================ */
.gallery-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: #666;
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  transition: color 0.2s;
}

.gallery-back:hover {
  color: #000;
}

.gallery-back::before {
  content: '← ';
}

/* ============================================
   PAGINATION
   ============================================ */
.gallery-pagination {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 3rem;
  padding: 2rem 0;
}

.gallery-pagination a {
  padding: 0.7rem 1.5rem;
  background: #111;
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  transition: background 0.2s;
}

.gallery-pagination a:hover {
  background: #333;
}

/* ============================================
   LOADING STATE (disabled - was causing black boxes)
   ============================================ */
.gallery-item img {
  opacity: 1;
}

.gallery-item.loaded img {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0.7; }
  to { opacity: 1; }
}
