/* Gallery specific styles */
.page {
  padding: 130px 0 80px;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 76px 76px;
}

.crumb {
  margin-bottom: 20px;
  color: var(--ink-2);
}

.crumb a {
  color: var(--accent);
}

.lede {
  max-width: 50ch;
  margin: 24px 0 32px;
  color: var(--ink-2);
}

.gallery-tabs {
  display: flex;
  gap: 12px;
  margin: 32px 0 40px;
}

.tab-btn {
  padding: 10px 20px;
  font-family: var(--fm);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  background: var(--paper);
  border: 1px solid var(--ink);
  color: var(--ink);
  cursor: pointer;
  transition: 0.25s;
}

.tab-btn:hover {
  background: var(--ink);
  color: var(--paper);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--accent);
}

.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}



.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--paper-2);
  cursor: pointer;
  transition: 0.3s;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 8px 8px 0 var(--accent);
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.3s;
}

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

.gallery-item.video-item::after {
  content: "▶";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: var(--paper);
  background: rgba(24, 21, 16, 0.7);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  z-index: 2;
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(24, 21, 16, 0.9));
  color: var(--paper);
  padding: 20px 16px 16px;
  transform: translateY(100%);
  transition: 0.3s;
}

.gallery-item:hover .gallery-caption {
  transform: translateY(0);
}

.gallery-caption h3 {
  font-family: var(--fd);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.gallery-caption p {
  font-size: 0.8rem;
  opacity: 0.8;
  font-family: var(--fm);
}

.gallery-item.hidden {
  display: none;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(24, 21, 16, 0.95);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
}

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

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

.lightbox-content img,
.lightbox-content video {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--paper);
  border: 1px solid var(--ink);
  color: var(--ink);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fm);
  font-size: 1.2rem;
  cursor: pointer;
  transition: 0.25s;
}

.lightbox-close:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--paper);
  border: 1px solid var(--ink);
  color: var(--ink);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fm);
  font-size: 1.2rem;
  cursor: pointer;
  transition: 0.25s;
}

.lightbox-nav:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 12px 20px;
  max-width: 80vw;
  text-align: center;
}

.lightbox-caption h3 {
  font-family: var(--fd);
  font-size: 1rem;
  margin-bottom: 4px;
}

.lightbox-caption p {
  font-family: var(--fm);
  font-size: 0.7rem;
  color: var(--ink-2);
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
  }
  
  .gallery-tabs {
    flex-wrap: wrap;
  }
  
  .lightbox-close,
  .lightbox-nav {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
}