/* =========================================
   1. BASE SETTINGS
   ========================================= */
/* Keeps the tight aura glows from being chopped off by hidden overflow */
.photo {
  overflow: visible !important;
}

/* =========================================
   2. LAYOUT: SMART 2-COLUMN GRID
   ========================================= */
.gallery {
  display: grid;
  grid-template-columns: 1fr; /* Mobile: 1 image per row */
  gap: 3vw 2vw;
  padding: 40px 0;
  max-width: 1400px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr); /* Desktop: Max 2 images per row */
  }
  
  /* 
     This class is dynamically added by the script below 
     whenever an image is wider than it is tall.
  */
  .photo.landscape {
    grid-column: span 2; 
  }
}

/* =========================================
   3. THE SUBTLE AURA GLOW
   ========================================= */
.gallery-image-button {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

/* Layer A: The Actual Image */
.gallery-image-button img {
  position: relative;
  z-index: 5; 
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08); /* Clean, standard shadow */
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Layer B: The Tight, Subtle Glow (Only behind the image) */
.gallery-image-button::before {
  content: "";
  position: absolute;
  top: -15px; left: -15px; right: -15px; bottom: -15px;
  background-image: var(--img-src);
  background-size: cover;
  background-position: center;
  filter: blur(20px) saturate(1.2);
  opacity: 0.35; /* Kept very subtle so it doesn't overwhelm the page */
  z-index: 1; /* Stays trapped immediately behind the image */
  transition: opacity 0.4s ease, filter 0.4s ease;
  border-radius: 8px;
}

/* Interactive Hover */
.gallery-image-button:hover::before {
  opacity: 0.6;
  filter: blur(25px) saturate(1.3);
}

.gallery-image-button:hover img {
  transform: scale(1.02);
}