/*--------------------------------------------------------------
  Gallery — grid, hover captions, lightbox, stats band
--------------------------------------------------------------*/

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-lg);
  cursor: pointer;
  background: var(--color-surface);
}

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

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

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(14, 27, 50, 0.85) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover::after { opacity: 1; }

.gallery-caption {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  z-index: 2;
  color: #fff;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.35s ease;
}

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

.gallery-caption .cat {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 4px;
}

.gallery-caption h4 {
  color: #fff;
  font-size: 1.05rem;
  margin: 0;
  font-weight: 600;
}

.gallery-zoom {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}

.gallery-item:hover .gallery-zoom {
  opacity: 1;
  transform: scale(1);
}

/* --- Lightbox --------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(14, 27, 50, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.lightbox.is-open {
  display: flex;
  animation: lbFade 0.25s ease;
}

@keyframes lbFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 82vh;
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  display: block;
}

.lightbox-caption {
  text-align: center;
  color: #fff;
  margin-top: 14px;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.lightbox-counter {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  margin-top: 4px;
  text-align: center;
  letter-spacing: 0.12em;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.lightbox-close { top: -60px; right: 0; }

.lightbox-prev {
  left: -70px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: -70px;
  top: 50%;
  transform: translateY(-50%);
}

/* --- Stats band ------------------------------------------------------- */

.gallery-stats {
  background: var(--color-surface);
  padding: var(--space-10) 0;
  margin-top: var(--space-14);
}

.gallery-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  text-align: center;
}

.gallery-stats .stat-num {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
}

.gallery-stats .stat-label {
  color: var(--color-muted);
  font-size: 0.95rem;
  margin-top: 6px;
}
