/* =========================================
   GALLERY
   ========================================= */
.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 3rem;
}
.gallery-sub {
  color: var(--gray-500);
  font-style: italic;
  display: none;
}
@media (min-width: 640px) { .gallery-sub { display: block; } }

.gallery-grid {
  columns: 1;
  column-gap: 1.5rem;
}
@media (min-width: 640px) { .gallery-grid { columns: 2; } }
@media (min-width: 768px) { .gallery-grid { columns: 3; } }

.gallery-item {
  display: block;
  width: 100%;
  margin-bottom: 1.5rem;
  break-inside: avoid;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
}

.gallery-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 300ms ease;
  z-index: 1;
}
.gallery-item::after {
  content: 'VIEW';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--white);
  opacity: 0;
  transition: opacity 300ms ease;
  z-index: 2;
}
.gallery-item:hover::before { background: rgba(0, 0, 0, 0.12); }
.gallery-item:hover::after  { opacity: 1; }

/* =========================================
   LIGHTBOX
   ========================================= */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.93);
  align-items: center;
  justify-content: center;
}
#lightbox.lb-open {
  display: flex;
  animation: lbFadeIn 200ms ease both;
}
@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lb-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 90vh;
}

.lb-img {
  display: block;
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  user-select: none;
  opacity: 0;
  transition: opacity 200ms ease;
}
.lb-img.lb-visible { opacity: 1; }

.lb-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  padding: 0.5rem;
  transition: color 150ms ease;
  line-height: 0;
}
.lb-close:hover { color: #fff; }

.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 1rem;
  transition: color 150ms ease;
  line-height: 0;
}
.lb-prev { left: 0.5rem; }
.lb-next { right: 0.5rem; }
.lb-prev:hover,
.lb-next:hover { color: #fff; }

@media (max-width: 640px) {
  .lb-prev, .lb-next { padding: 0.5rem; }
}
