/* ═══════════════════════════════════════════════════
   GALLERY — Grid de fotos + Lightbox
═══════════════════════════════════════════════════ */

#galeria { background: var(--c-black); }

/* ── Grid principal ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 3rem;
}

/* Items con aspect ratio diferente */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--r);
  cursor: pointer;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  transition: border-color var(--tr);
}
.gallery-item:hover { border-color: rgba(201, 168, 76, .25); }

/* Variantes de tamaño */
.gallery-item.full-wide { grid-column: span 3; aspect-ratio: 21 / 7; }
.gallery-item:not(.full-wide) { aspect-ratio: 4 / 3; }

.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s ease, filter .5s ease;
  filter: grayscale(35%) brightness(.9);
}
.gallery-item:hover img {
  transform: scale(1.07);
  filter: grayscale(0%) brightness(1);
}

/* Overlay al hover */
.gallery-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(transparent 40%, rgba(6, 7, 10, .82) 100%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 1.25rem;
  opacity: 0;
  transition: opacity var(--tr);
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-overlay h4   { font-size: .9rem; font-weight: 600; color: var(--c-white); line-height: 1.3; }
.gallery-overlay span { font-size: .74rem; color: var(--c-gold); margin-top: .2rem; }

/* Zoom icon */
.zoom-icon {
  position: absolute;
  top: .85rem; right: .85rem;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  font-size: .85rem;
  opacity: 0;
  transform: scale(.75);
  transition: all var(--tr);
  color: var(--c-white);
}
.gallery-item:hover .zoom-icon {
  opacity: 1;
  transform: scale(1);
}

/* ════════════════════════
   LIGHTBOX
════════════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(6, 7, 10, .96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.lightbox.open { opacity: 1; visibility: visible; }

.lb-img-wrap {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--r-lg);
  transition: transform .25s ease, opacity .25s ease;
  box-shadow: var(--shadow-lg);
}
.lb-img.switching { transform: scale(.92); opacity: 0; }

.lb-caption {
  position: absolute;
  bottom: -2.5rem; left: 0; right: 0;
  text-align: center;
  font-size: .8rem;
  color: var(--c-muted2);
  letter-spacing: .06em;
}

/* Botones lightbox */
.lb-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(255, 255, 255, .1);
  border: 1px solid var(--c-border);
  color: var(--c-white);
  width: 50px; height: 50px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all var(--tr);
  z-index: 1;
}
.lb-btn:hover { background: rgba(255, 255, 255, .2); border-color: var(--c-border-h); }
.lb-prev { left: 1.5rem; }
.lb-next { right: 1.5rem; }

.lb-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  background: rgba(255, 255, 255, .1);
  border: 1px solid var(--c-border);
  color: var(--c-white);
  width: 46px; height: 46px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all var(--tr);
  z-index: 1;
}
.lb-close:hover { background: rgba(255, 255, 255, .2); }

/* Contador de fotos */
.lb-counter {
  position: absolute;
  top: 1.75rem; left: 50%; transform: translateX(-50%);
  font-size: .74rem;
  color: var(--c-muted2);
  letter-spacing: .1em;
  background: rgba(6, 7, 10, .6);
  padding: .35rem .85rem;
  border-radius: 99px;
  border: 1px solid var(--c-border);
}

/* Miniaturas lightbox */
.lb-thumbs {
  position: absolute;
  bottom: 1.5rem; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: .5rem;
}
.lb-thumb {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .25);
  cursor: pointer;
  transition: all var(--tr);
}
.lb-thumb.active { background: var(--c-gold); transform: scale(1.3); }
