:root {
  --overlap: 60px;
  --row-height: 260px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: var(--row-height);
}

.gallery-item {
  position: relative;
  overflow: hidden; /*  zoom no dsale del contenedor */
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover; 
  display: block;
  transition: transform 0.45s ease;
  background: #000; /* opcional */
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.special {
  transform: translateY(calc(var(--overlap) * -1));
  height: calc(100% + var(--overlap));
  z-index: 3;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1050;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  border-radius: 6px;
}

.lightbox .close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  color: white;
  cursor: pointer;
}

.lightbox .prev,
.lightbox .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 50px;
  color: white;
  cursor: pointer;
  user-select: none;
  padding: 10px;
}

.lightbox .prev { left: 20px; }
.lightbox .next { right: 20px; }
