/* Media grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 32px 0;
}

@media (max-width: 640px) {
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

.gallery-item {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
  background: var(--bg-panel);
  cursor: pointer;
  border: none;
  padding: 0;
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

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

.gallery-item.is-video::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(23,29,51,0.55) 0%, rgba(23,29,51,0) 40%);
}

.gallery-item.is-video::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent var(--ink);
  filter: drop-shadow(0 0 6px rgba(0,0,0,0.5));
  z-index: 1;
}

/* Lightbox overlay */
.lb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 13, 26, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 32px;
}

.lb-overlay.is-open { display: flex; }

.lb-stage {
  max-width: min(90vw, 1000px);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lb-stage img,
.lb-stage video {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lb-caption {
  font-family: var(--mono);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
  margin: 0;
}

.lb-close {
  position: absolute;
  top: 20px;
  right: 28px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  font-family: var(--body);
}

.lb-close:hover { color: var(--gold); }

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: rgba(255, 255, 255, 0.85);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.lb-nav:hover,
.lb-nav:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: var(--gold);
}

.lb-prev { left: 20px; }
.lb-next { right: 20px; }

@media (max-width: 640px) {
  .lb-nav { width: 40px; height: 40px; font-size: 15px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}
