/* --- FUENTES Y VARIABLES --- */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans:wght@300;400;700&display=swap");

/* --- CONTENEDOR PRINCIPAL --- */
.filah-gallery-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* ════════════ ANIMACIONES DE ENTRADA ════════════ */
@keyframes fadeUpGallery {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lineGrowGallery {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 80px;
    opacity: 1;
  }
}

/* Animaciones aplicadas (solo si el usuario no pidió reducción de movimiento) */
@media (prefers-reduced-motion: no-preference) {
  .gallery-header-main {
    animation: fadeUpGallery 0.7s ease-out both;
  }

  /* Cada acordeón de día entra escalonado */
  .day-group {
    animation: fadeUpGallery 0.6s ease-out both;
  }
  .day-group:nth-child(1) {
    animation-delay: 0.1s;
  }
  .day-group:nth-child(2) {
    animation-delay: 0.2s;
  }
  .day-group:nth-child(3) {
    animation-delay: 0.3s;
  }
  .day-group:nth-child(4) {
    animation-delay: 0.4s;
  }
  .day-group:nth-child(5) {
    animation-delay: 0.5s;
  }
  .day-group:nth-child(6) {
    animation-delay: 0.6s;
  }
  .day-group:nth-child(n + 7) {
    animation-delay: 0.7s;
  }

  /* Cuando se abre un día, las fotos aparecen una tras otra */
  .day-group.active .photo-card {
    animation: scaleIn 0.5s ease-out both;
  }
  .day-group.active .photo-card:nth-child(1) {
    animation-delay: 0.05s;
  }
  .day-group.active .photo-card:nth-child(2) {
    animation-delay: 0.1s;
  }
  .day-group.active .photo-card:nth-child(3) {
    animation-delay: 0.15s;
  }
  .day-group.active .photo-card:nth-child(4) {
    animation-delay: 0.2s;
  }
  .day-group.active .photo-card:nth-child(5) {
    animation-delay: 0.25s;
  }
  .day-group.active .photo-card:nth-child(6) {
    animation-delay: 0.3s;
  }
  .day-group.active .photo-card:nth-child(7) {
    animation-delay: 0.35s;
  }
  .day-group.active .photo-card:nth-child(8) {
    animation-delay: 0.4s;
  }
  .day-group.active .photo-card:nth-child(9) {
    animation-delay: 0.45s;
  }
  .day-group.active .photo-card:nth-child(10) {
    animation-delay: 0.5s;
  }
  .day-group.active .photo-card:nth-child(11) {
    animation-delay: 0.55s;
  }
  .day-group.active .photo-card:nth-child(12) {
    animation-delay: 0.6s;
  }
  .day-group.active .photo-card:nth-child(n + 13) {
    animation-delay: 0.65s;
  }
}

/* --- TÍTULO PRINCIPAL --- */
.gallery-header-main {
  text-align: center;
  margin-bottom: 50px;
  font-family: "Noto Sans", sans-serif;
}

.gallery-header-main h1 {
  font-size: 2.8rem;
  color: #284d98; /* azul */
  margin-bottom: 10px;
  font-weight: 700;
}

.gallery-header-main p {
  color: #5c3e35; /* café */
  font-size: 1.1rem;
  font-weight: 300;
}

/* --- SECCIONES DE DÍAS (ACORDEÓN) --- */
.day-group {
  margin-bottom: 25px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(92, 62, 53, 0.08);
  transition: box-shadow 0.3s ease;
}

.day-group:hover {
  box-shadow: 0 6px 20px rgba(40, 77, 152, 0.12); /* sombra azul al hover */
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 20px 25px;
  background: #fff;
  transition: background 0.3s ease;
  border-bottom: 1px solid #f3f0ce;
}

.day-header:hover {
  background: #f3f0ce;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.day-number {
  background: #284d98;
  color: #fff;
  padding: 5px 14px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

.day-group:hover .day-number {
  transform: scale(1.05); /* badge crece sutilmente al hover */
}

.day-header h2 {
  font-size: 1.4rem;
  color: #5c3e35;
  margin: 0;
  font-family: "Noto Sans", sans-serif;
}

.toggle-icon {
  font-size: 1.1rem;
  color: #284d98;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.day-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.6s cubic-bezier(0, 1, 0, 1);
  padding: 0 25px;
}

.day-group.active .day-content {
  max-height: 8000px;
  transition: max-height 1.2s ease-in-out;
  padding-bottom: 30px;
  padding-top: 25px;
}

.day-group.active .toggle-icon {
  transform: rotate(180deg);
}

/* --- GRID MASONRY --- */
.gallery-grid {
  column-count: 3;
  column-gap: 20px;
  display: block;
}

.photo-card {
  display: inline-block;
  width: 100%;
  margin-bottom: 20px;
  cursor: pointer;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #5c3e35;
  transition: transform 0.3s ease;
}

.photo-wrapper {
  position: relative;
  width: 100%;
}

.photo-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  transition: 0.6s ease;
  opacity: 0.95;
}

/* --- INFO SOBRE LA FOTO (OVERLAY) --- */
.photo-overlay {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to top,
    rgba(40, 77, 152, 0.85) 0%,
    transparent 60%
  );
  display: flex;
  align-items: flex-end;
  padding: 20px;
  opacity: 0;
  transition: 0.4s ease;
}

.photo-meta {
  color: #fff;
  font-family: "Noto Sans", sans-serif;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateY(10px);
  transition: transform 0.4s ease;
}

.photo-card:hover .photo-meta {
  transform: translateY(0); /* meta sube al hover */
}

.photo-meta span i {
  color: #dfd97c;
  margin-right: 6px;
}

.photo-card:hover .photo-overlay {
  opacity: 1;
}
.photo-card:hover img {
  transform: scale(1.06);
  opacity: 1;
}

/* --- LIGHTBOX (MODAL ACTUALIZADO) --- */
.lightbox {
  position: fixed;
  z-index: 10000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(92, 62, 53, 0.96);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease;
}

/* Contenedor interno: aparece con zoom suave */
.lightbox-content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 95vh;
  animation: scaleIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) 0.05s both;
}

.lightbox img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 0 40px rgba(40, 77, 152, 0.4);
}

/* Información del lightbox: aparece desplazándose desde arriba */
.lightbox-info {
  color: #fff;
  text-align: center;
  margin-top: 20px;
  font-family: "Noto Sans", sans-serif;
  max-width: 800px;
  animation: slideDown 0.5s ease-out 0.3s both;
}

.lightbox-info h3 {
  margin: 0 0 5px 0;
  font-size: 1.6rem;
  color: #fff;
}

.lightbox-info p#lightbox-author {
  margin: 0 0 10px 0;
  font-size: 0.9rem;
  color: #dfd97c;
  font-weight: 700;
}

.lightbox-info p#lightbox-desc {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.5;
  color: #f3f0ce;
  font-weight: 300;
}

.close-btn {
  position: absolute;
  top: 25px;
  right: 35px;
  color: #fff;
  font-size: 45px;
  cursor: pointer;
  transition:
    color 0.3s,
    transform 0.3s;
  z-index: 10001;
}

.close-btn:hover {
  color: #d23930;
  transform: scale(1.1) rotate(90deg); /* giro al hover */
}

/* --- ANIMACIONES BÁSICAS (las que ya existían) --- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s forwards;
}

.delay-1 {
  animation-delay: 0.2s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- RESPONSIVO --- */
@media (max-width: 1024px) {
  .gallery-grid {
    column-count: 2;
  }
  .gallery-header-main h1 {
    font-size: 2.2rem;
  }
  .lightbox img {
    max-height: 65vh;
  }
  .lightbox-info h3 {
    font-size: 1.3rem;
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    column-count: 1;
  }
  .day-header {
    padding: 5px;
  }
  .day-header h2 {
    font-size: 1.1rem;
  }
  .gallery-header-main h1 {
    font-size: 1.8rem;
  }
  .lightbox-info h3 {
    font-size: 1.1rem;
  }
  .lightbox-info p#lightbox-desc {
    font-size: 0.9rem;
  }
  .close-btn {
    top: 10px;
    right: 20px;
    font-size: 35px;
  }
}

/* Fix lightbox video */
#videoLightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(92, 62, 53, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

#videoLightbox .lightbox-content-wrapper {
  width: 90%;
  max-width: 900px;
  animation: scaleIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

#videoContainer {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: visible;
}

#videoContainer iframe,
#videoContainer video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 10px;
}
