/* ─── Gallery grid ─── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  grid-auto-rows: 78px;
}

.gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  grid-row: span 4;
  grid-column: span 1;
  background: var(--card);
  cursor: zoom-in;
  position: relative;
}

.gallery-item.tall    { grid-row: span 7; }
.gallery-item.wide    { grid-column: span 2; }
.gallery-item.land    { grid-row: span 3; grid-column: span 2; }

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.42s ease;
}
.gallery-item:hover img { transform: scale(1.05); }

/* ─── Lightbox ─── */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.93);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.gallery-lightbox.open { opacity: 1; pointer-events: auto; }

.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.85);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.18); }

/* ─── Responsive ─── */
@media (max-width: 840px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 100px;
  }

  .gallery-item,
  .gallery-item.tall,
  .gallery-item.wide,
  .gallery-item.land {
    grid-column: span 1;
    grid-row: span 3;
  }

  .gallery-item.wide { grid-column: span 2; }
  .gallery-item.tall { grid-row: span 5; }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 80px; }
}
