.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 20px;
}
@media (max-width: 860px) {
    .gallery {grid-template-columns: repeat(3, 1fr);}
}
@media (max-width: 680px) {
    .gallery {grid-template-columns: repeat(2, 1fr);}
}

.gallery-item {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3/2;
  background: var(--highlight-color-dark);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.3s ease;
  transform: scale(1);
}

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





.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding-top: 71px;
  background: rgba(255,255,255,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  z-index: 500;
}

.lightbox.open {
  display: flex;
}



.lightbox img {
  width: 80vw;
  height: calc(92vh - 71px);
  object-fit: contain;
  object-position: center;
  touch-action: pan-y;
}


.lightbox button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--highlight-color-dark);
  position: absolute;
  padding: 0;
  margin: 0;
}
.lightbox button:hover {
  color: var(--highlight-color);
}

.close { 
  top: calc(71px + 4vh); 
  right: 30px; 
  font-size: 1rem;
}
.prev { 
  left: calc(5vw - 24px + 7px);
  font-size: 1.5rem;
}
.next { 
  right: calc(5vw - 24px + 7px); 
  font-size: 1.5rem;
}


@media (max-width: 560px) {
  .lightbox img {
    width: 95vw;
    height: calc(80vh - 71px);
  }
  .close { 
  right: 2.5vw; 
}
  .prev { 
    left: calc(40vw - 24px + 7px);
    bottom: 10px;
  }
  .next { 
    right: calc(40vw - 24px + 7px);
    bottom: 10px;
  }
}
