/* =========================
   GALERIA – CLEAN MASONRY
========================= */

.section--gallery {
  padding-top: 60px;
}

.gallery {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;

  grid-auto-flow: dense; /* ⭐ usuwa dziury */
}

/* BAZOWY KAFEL */
.gallery__item {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  cursor: pointer;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery__item:hover img {
  transform: scale(1.05);
}

/* WYSOKIE – PORTRET */
.gallery__item--tall {
  grid-row: span 2;
}

/* SZEROKIE – POZIOM */
.gallery__item--wide {
  grid-column: span 2;
  aspect-ratio: 4 / 3;
}

/* =========================
   MOBILE – BEZ KOMBINACJI
========================= */

@media (max-width: 767px) {
  .gallery {
    grid-template-columns: 1fr;
  }

  .gallery__item,
  .gallery__item--tall,
  .gallery__item--wide {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 3 / 4;
  }
}

/* =========================
   LIGHTBOX
========================= */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 999;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
}
/* =========================
   SMOOTH REVEAL – GALERIA
========================= */

.gallery__item {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.gallery__item.is-visible {
  opacity: 1;
  transform: translateY(0);
}
/* =========================
   LIGHTBOX – PRZYCISK ZAMKNIĘCIA
========================= */

.lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;

  background: none;
  border: none;
  color: white;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;

  padding: 8px;
  -webkit-tap-highlight-color: transparent;
}

.lightbox__close:focus {
  outline: none;
}
