/* ==============================================================
   GRUPO FEMAX - GALERÍA Y VISOR LIGHTBOX (60 FPS)
   Galería de fotos de proyectos universitarios en Infraestructura IT
   ============================================================== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background: #0B132B;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.gallery-item:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.75) 0%, rgba(15, 23, 42, 0.1) 60%, transparent 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 12px 14px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

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

.gallery-zoom-icon {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transform: scale(0.85);
  transition: transform 0.2s ease;
}

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

/* ==============================================================
   LIGHTBOX MODAL VISOR
   ============================================================== */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(10, 17, 40, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

/* Header del Lightbox */
.lightbox-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #FFFFFF;
  z-index: 2;
}

.lightbox-info h4 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #FFFFFF;
}

.lightbox-counter {
  font-size: 0.85rem;
  color: #00D2B4;
  font-weight: 700;
  letter-spacing: 1px;
}

.lightbox-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
}

/* Contenido Principal / Imagen Grande */
.lightbox-viewport {
  position: relative;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 20px 0;
}

.lightbox-main-img {
  max-width: 90vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  transform: scale(0.96);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  will-change: transform, opacity;
}

.lightbox-modal.active .lightbox-main-img {
  transform: scale(1);
  opacity: 1;
}

/* Botones de Navegación */
.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  z-index: 5;
}

.lightbox-nav-btn:hover {
  background: #0052CC;
  border-color: #0052CC;
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 30px;
}

.lightbox-next {
  right: 30px;
}

/* Fila de Miniaturas Inferior */
.lightbox-thumbnails {
  display: flex;
  justify-content: center;
  gap: 12px;
  overflow-x: auto;
  padding-top: 12px;
  z-index: 2;
}

.lightbox-thumb-btn {
  width: 70px;
  height: 50px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  background: transparent;
  padding: 0;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.lightbox-thumb-btn:hover {
  opacity: 0.85;
}

.lightbox-thumb-btn.active {
  opacity: 1;
  border-color: #00D2B4;
  transform: scale(1.05);
}

.lightbox-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .lightbox-nav-btn {
    width: 42px;
    height: 42px;
  }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
}
