/* PÁGINA DE GALERÍA */
.gallery-page {
  padding-top: 100px;
  padding-bottom: 60px;
  min-height: 100vh;
}

.page-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 48px;
  letter-spacing: 0.08em;
  color: #fff;
  text-align: center;
  margin-bottom: 20px;
}

/* GRID */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: calc(100% - 80px);
  margin: 0 auto;
  min-height: 200px;
}

.gallery-item {
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  aspect-ratio: 16/10;
}

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

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

/* ================================
   FADE-IN ANIMATION
   ================================ */
.gallery-item.fade-in {
  opacity: 0;
  transform: translateY(12px);
}

.gallery-item.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* LIGHTBOX */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  cursor: default;
}

.lightbox.active {
  display: flex;
}

#lightbox-img {
  max-width: 90vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 60px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  padding: 0 20px;
}
.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }
.lightbox-prev:hover,
.lightbox-next:hover { opacity: 1; }

/* Video en lightbox */
#lightbox-video {
  max-width: 80vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  display: block;
}

/* Wrapper media + título */
#lightbox-media-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

#lightbox-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 0.08em;
  color: #fff;
  opacity: 0.9;
  pointer-events: none;
}

/* ================================
   CONFIDENTIAL PROJECTS
   ================================ */
#confidential-section {
  width: calc(100% - 80px);
  margin: 0 auto 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#confidential-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: #aaa;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  letter-spacing: 0.08em;
  padding: 8px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  max-width: 280px;
  justify-content: center;
}
#confidential-btn:hover {
  border-color: rgba(255,255,255,0.5);
  color: #fff;
  background: rgba(255,255,255,0.04);
}

.lock-icon { font-size: 18px; }

#password-modal {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}
#password-modal.hidden { display: none; }

#password-box {
  background: rgba(30,30,36,0.98);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 300px;
}
#password-box p {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #aaa;
  background: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
}

#password-input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 10px 14px;
  color: #fff;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
  letter-spacing: 0.1em;
}
#password-input:focus { border-color: rgba(255,255,255,0.4); }

#password-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}
#password-cancel, #password-submit {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 0.06em;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}
#password-cancel {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: #aaa;
}
#password-cancel:hover { border-color: rgba(255,255,255,0.3); color: #fff; }
#password-submit { background: rgba(255,255,255,0.9); color: #1a1a1f; }
#password-submit:hover { background: #fff; }

#password-error { color: #e05555; font-size: 13px; }
#password-error.hidden { display: none; }

#confidential-gallery { margin-top: 20px; }
#confidential-gallery.hidden { display: none; }
#confidential-gallery .gallery-grid {
  margin: 0 auto;
  width: calc(100% - 80px);
}

.gallery-divider {
  width: calc(100% - 80px);
  margin: 40px auto;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ================================
   MOTION GRAPHICS — FILTROS
   ================================ */
.motion-filters {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 32px 0 28px;
  flex-wrap: wrap;
}
.motion-filters .filter-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: #aaa;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  letter-spacing: 0.08em;
  padding: 8px 22px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.motion-filters .filter-btn:hover { border-color: rgba(255,255,255,0.5); color: #fff; }
.motion-filters .filter-btn.active { background: rgba(255,255,255,0.9); border-color: transparent; color: #1a1a1f; }

.motion-section { display: grid; }
.motion-section.hidden { display: none; }

/* Slots cuadradas */
#section-slots.gallery-grid .gallery-item { aspect-ratio: 1 / 1; }

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 1350px) and (min-width: 769px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .gallery-page { padding-top: 80px; padding-bottom: 40px; }
  .page-title { font-size: 32px; margin-bottom: 24px; }
  .gallery-grid { grid-template-columns: 1fr; width: calc(100% - 32px); gap: 10px; }
  #lightbox-img, #lightbox-video { max-width: 96vw; max-height: 75vh; }
  .lightbox-prev, .lightbox-next { font-size: 40px; padding: 0 10px; }
  #lightbox-title { font-size: 20px; }
  #confidential-section { width: calc(100% - 32px); }
  #confidential-gallery .gallery-grid { width: calc(100% - 32px); }
  #password-box { min-width: unset; width: 100%; padding: 20px; }
}
