/* 
=================================================================
HUGOCIB - GALLERY COMPONENT
=================================================================
Responsive photo gallery preserving image aspect ratios
- Desktop: 5 columns, landscape images span 2 columns
- Tablet: 3 columns, landscape images span 2 columns  
- Mobile: 2 columns, all images span full width
=================================================================
*/

/* Gallery section container */
.gallery-section {
  margin-top: 3rem;
}

/* Main gallery grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  margin: 4rem 0 2rem 0;
  max-width: 100%;
}

/* =================================================================
   GALLERY ITEMS & IMAGES
   ================================================================= */

/* Gallery item container - preserves image intrinsic aspect ratio */
.gallery-item {
  position: relative;
  display: block;
  background: #000;
  width: 100%;
  box-shadow: 0 4px 8px var(--shadow-color);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Gallery item link wrapper */
.gallery-item a {
  display: block;
  text-decoration: none;
  color: inherit;
  width: 100%;
  height: 100%;
}

/* Gallery images - preserve intrinsic aspect ratio */
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  object-position: center;
  transition: transform 0.3s ease;
}

/* Landscape images need specific handling for proper fill */
.gallery-item.landscape img {
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Hover effects */
.gallery-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px var(--shadow-color);
}

/* Spacer visibility control */
.gallery-spacer {
    /* Desktop: spacer visibile */
    height: 100%;
    width: 100%;
    /* oppure se usi padding-bottom per aspect ratio */
    /* padding-bottom: 100%; */
}

/* =================================================================
   RESPONSIVE LAYOUT
   ================================================================= */

/* Tablet - 3 columns */
@media (max-width: 768px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
  
  .gallery-item {
    grid-column: span 1;
  }
  
  .gallery-item.landscape {
    grid-column: span 2;
  }
}

/* Mobile: spacer nascosto */
@media (max-width: 768px) {
    .gallery-spacer {
        display: none;
    }
}

/* Mobile - 2 columns, all items full width */
@media (max-width: 480px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .gallery-item,
  .gallery-item.landscape {
    grid-column: span 2;
  }
}

