/* =============================================
   GALLERY
   ============================================= */
.gallery {
  padding: 100px 0 80px;
  background: var(--bg);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin-top: 48px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1/1;
}

.gi-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-color: var(--bg3);
  transition: transform .5s ease;
}

.gi-overlay {
  position: absolute;
  inset: 0;
  background: rgba(14,12,10,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .3s ease;
}

.gi-icon {
  font-size: 40px;
  font-weight: 200;
  color: var(--white);
  line-height: 1;
}

.gallery-item:hover .gi-img {
  transform: scale(1.06);
}

.gallery-item:hover .gi-overlay {
  opacity: 1;
}

/* =============================================
   LIGHTBOX
   ============================================= */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(14,12,10,.96);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lb-inner {
  max-width: 90vw;
  max-height: 90vh;
}

.lb-inner img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--r);
}

.lb-close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: none;
  border: none;
  color: var(--white);
  font-size: 48px;
  font-weight: 200;
  cursor: pointer;
  line-height: 1;
  opacity: .7;
  transition: opacity .2s;
}

.lb-close:hover { opacity: 1; }

.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--white);
  font-size: 64px;
  font-weight: 200;
  cursor: pointer;
  opacity: .7;
  transition: opacity .2s;
  padding: 0 24px;
  line-height: 1;
}

.lb-prev { left: 0; }
.lb-next { right: 0; }
.lb-prev:hover, .lb-next:hover { opacity: 1; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
