/* Vanilla masonry — vanilla port of the React Bits component.
 * No GSAP; uses CSS transitions on transform + width/height + opacity/filter.
 * JS computes column packing and writes inline transform/width/height; CSS
 * animates the transitions, including a staggered blur-to-focus on first load.
 */
.masonry {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
}
.masonry-item {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(45, 34, 24, 0.14);
  /* Default state on first load — items fade and unblur in via .loaded class */
  opacity: 0;
  filter: blur(10px);
  transform: translate3d(0, 30px, 0);
  transition:
    transform 0.7s cubic-bezier(0.2, 0.8, 0.25, 1),
    width  0.4s cubic-bezier(0.2, 0.8, 0.25, 1),
    height 0.4s cubic-bezier(0.2, 0.8, 0.25, 1),
    opacity 0.7s ease,
    filter  0.7s ease;
  cursor: zoom-in;
  text-decoration: none;
}
.masonry.loaded .masonry-item {
  opacity: 1;
  filter: blur(0);
}
.masonry-item picture,
.masonry-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.masonry-item img {
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.25, 1);
}
.masonry-item:hover img {
  transform: scale(1.06);
}

/* Section wrapper styling */
.about-gallery-section {
  padding: var(--sp-3xl) 0 var(--sp-4xl);
  background: var(--bg);
}

/* Lightbox — fullscreen overlay shown when a masonry tile is clicked. */
html.masonry-lightbox-open { overflow: hidden; }
.masonry-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 6vmin;
  cursor: zoom-out;
}
.masonry-lightbox.open { opacity: 1; }
.masonry-lightbox-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 10, 6, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.masonry-lightbox img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 18px 80px rgba(0, 0, 0, 0.5);
  cursor: default;
  transform: scale(0.96);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.25, 1);
}
.masonry-lightbox.open img { transform: scale(1); }
.masonry-lightbox-close {
  position: absolute;
  top: 1.5vmin;
  right: 2vmin;
  z-index: 2;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease;
}
.masonry-lightbox-close:hover { color: var(--gold-light); }
