/* ── Art Gallery: Masonry Grid ── */

.masonry-grid {
  margin: 1rem 0;
}

/* Sizer and items share the same width for Masonry's percentPosition */
.masonry-sizer,
.masonry-item {
  width: 100%;
}

@media (min-width: 600px) {
  .masonry-sizer,
  .masonry-item {
    width: calc((100% - 20px) / 2);
  }

  .masonry-item--wide {
    width: 100%;
  }
}

@media (min-width: 960px) {
  .masonry-sizer,
  .masonry-item {
    width: calc((100% - 40px) / 3);
  }

  .masonry-item--wide {
    width: calc((100% - 40px) / 3 * 2 + 20px);
  }
}

.masonry-item {
  margin-bottom: 20px;
}

.masonry-item figure {
  margin: 0;
}

.masonry-item img {
  display: block;
  width: 100%;
  height: auto;
}

.masonry-item figcaption {
  font-family: "Crimson Text", Georgia, serif;
  font-size: clamp(16px, calc(14px + 0.4vw), 18px);
  font-weight: 700;
  color: var(--black-rgb);
  padding: 0.25rem 0 0;
}

.art-meta {
  opacity: 0.45;
}

/* Subtle entrance animation */
.masonry-item {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s cubic-bezier(0.25, 0.1, 0.25, 1),
    transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.masonry-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .masonry-item {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
