/* ================================================
   GALLERY.CSS — Xtreme Fitness Studio
   Photo gallery with masonry-style grid
================================================ */

.gallery-section {
  background-color: var(--bg-primary);
  padding: 5rem 0;
}

.gallery-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---- Desktop Gallery Grid (4 col masonry) ---- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 260px);
  gap: 1.25rem;
}

/* Large featured image: 2×2 span */
.gallery-item-large {
  grid-column: span 2;
  grid-row: span 2;
}

/* ---- Gallery Item ---- */
.gallery-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease;
}

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

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

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

/* Red overlay on hover */
.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(230, 0, 0, 0.4), rgba(0, 0, 0, 0.25));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

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

/* ================================================
   BREAKPOINTS — Gallery
================================================ */

/* Laptop (1024px) — 3 columns */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 220px);
    gap: 1rem;
  }

  .gallery-item-large {
    grid-column: span 2;
    grid-row: span 2;
  }
}

/* Tablet (768px) — 2 columns equal, no span */
@media (max-width: 768px) {
  .gallery-section {
    padding: 3.5rem 0;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: none;
    grid-auto-rows: 180px;
    gap: 0.75rem;
  }

  .gallery-item-large,
  .gallery-item {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
  }
}

/* Mobile (480px) — single column */
@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 220px;
    gap: 0.75rem;
  }

  .gallery-item-large,
  .gallery-item {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
  }
}

/* Very small (375px) */
@media (max-width: 375px) {
  .gallery-container {
    padding: 0 0.75rem;
  }

  .gallery-grid {
    grid-auto-rows: 180px;
    gap: 0.5rem;
  }
}
