/* Album */
.photo-album {
  max-width: 1100px;
  width: 100%;
  height: auto;
  margin: 40px auto 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  perspective: 2500px;
  background: #7535d6c6;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  padding: 50px;
  box-sizing: border-box;
  position: relative;
}

.page {
  background: #fff;
  border: 14px solid #444;
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  width: 420px;
  height: 580px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  transition: transform 0.5s;
}

/* Imagen dentro de cada página */
.page img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 14px;
  user-select: none;
  pointer-events: auto;
  transition: transform 0.3s;
  cursor: pointer;
}



/* Efecto al pasar el mouse sobre la foto */
.page:hover img {
  transform: scale(1.05); /* Pequeño zoom al pasar el mouse */
}

/* Efecto al pasar el mouse sobre la página */
.page:hover {
  box-shadow: 0 12px 24px rgba(0,0,0,0.4);
  transform: translateY(-10px) scale(1.03);
}

/* Animación de pasada */
.page.turning {
  animation: slideFade 1s ease;
}

@keyframes slideFade {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  40% {
    opacity: 0;
    transform: translateX(-60px) scale(0.96);
  }
  60% {
    opacity: 0;
    transform: translateX(60px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}


/* Botones más grandes */
.album-controls {
  max-width: 1200px;
  width: 100%;
  margin: 40px auto 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  padding: 20px 0;
  flex-wrap: wrap;
  user-select: none;
}

.album-controls button {
  background: linear-gradient(90deg, #4a3c8c 0%, #6b57c7 100%);
  border: none;
  color: #faf9f7;
  font-size: 2rem;
  padding: 22px 70px;
  border-radius: 38px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(74,60,140,0.18);
  transition: background 0.3s, transform 0.2s, box-shadow 0.2s;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.album-controls button:hover,
.album-controls button:focus {
  background: linear-gradient(90deg, #6b57c7 0%, #4a3c8c 100%);
  transform: scale(1.09);
  box-shadow: 0 12px 32px #4a3c8c44;
  outline: 3px solid #f0c929;
  outline-offset: 2px;
}

.photo-caption {
  position:absolute; 
  left:50%; 
  bottom:18px; 
  transform:translateX(-50%); 
  background:rgba(30,30,40,0.82); 
  color:#fff; 
  padding:6px 18px; 
  border-radius:10px; 
  font-size:1rem; 
  max-width:90%; 
  text-align:center; 
  pointer-events:none;
}

.modal {
  display: none;
  position: fixed;
  z-index: 999;
  padding-top: 60px;
  left: 0; top: 0;
  width: 100%; height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.8);
  cursor: zoom-out;
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.8);
  user-select: none;
  pointer-events: none;
  transition: transform 0.3s ease;
}

.close {
  position: absolute;
  top: 20px; right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  transition: color 0.3s ease;
}

.close:hover {
  color: #f0c929;
}

#caption {
  margin: 20px auto;
  text-align: center;
  color: #ddd;
  font-size: 1.1rem;
  max-width: 90%;
}

/* Añade esto a tu galeria.css */
.photo-caption {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(30,30,40,0.82);
  color: #fff;
  padding: 6px 18px;
  border-radius: 10px;
  font-size: 1.5rem;
  max-width: 90%;
  text-align: center;
  pointer-events: none;
  font-style: italic;
  box-shadow: 0 2px 12px #0002;
}

/* === GALERÍA: ESTILOS RESPONSIVE PARA MÓVIL (hasta 480px) === */
@media (max-width: 480px) {
.photo-album {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  width: 80%;
  max-width: 1200px;
  margin: 40px auto 0 auto;
  padding: 40px 2vw;
  background: #7535d6c6;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  box-sizing: border-box;
}
.page {
  flex: 1 1 120px;      /* Crece y ocupa espacio, mínimo 320px */
  max-width: 480px;     /* No se hace más grande que esto */
  min-width: 150px;
  height: 60vw;         /* Altura relativa al ancho de la ventana */
  max-height: 500px;
  background: #fff;
  border: 7px solid #444;
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  transition: transform 0.5s;
}

.page img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}
  .photo-caption {
    position: absolute;
    left: 50%;
    bottom: 6px;
    transform: translateX(-50%);
    background: rgba(80, 40, 160, 0.85); /* Morado más intenso y compacto */
    color: #fff;
    padding: 3px 8px;
    border-radius: 7px;
    font-size: 0.72rem;
    max-width: 90%;
    text-align: center;
    pointer-events: none;
    font-style: italic;
    box-shadow: 0 1px 4px #0003;
    line-height: 1.2;
    opacity: 0.97;
  }
.album-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  width: 100%;
  max-width: 1200px;
  margin: 40px auto 0;
  padding: 20px 2vw;
  flex-wrap: wrap;
}
.album-controls button {
  flex: 1 1 180px;      /* Crece y ocupa espacio, mínimo 180px */
  max-width: 180px;
  min-width: 40px;
  font-size: 1.2rem;
  padding: 22px 0;
  border-radius: 38px;
  background: linear-gradient(90deg, #4a3c8c 0%, #6b57c7 100%);
  color: #faf9f7;
  border: none;
  box-shadow: 0 10px 28px rgba(74,60,140,0.18);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 1.3px;
  transition: background 0.3s, transform 0.2s, box-shadow 0.2s;
}
  .album-controls button:active,
  .album-controls button:focus {
    background: #ffcc00;
    color: #4a3c8c;
  }
}

/* === GALERÍA: TABLET PEQUEÑA (481px a 767px) === */
@media (min-width: 481px) and (max-width: 767px) {
  .photo-album {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 18px;
    width: 68vw;
    max-width: 69vw;
    margin: 24px auto 0 auto;
    padding: 24px 1vw;
    background: linear-gradient(135deg, #7535d6 70%, #a084e8 100%);
    border-radius: 18px;
    box-shadow: 0 8px 32px #7535d6a0;
  }
  .page {
    flex: 1 1 220px;
    max-width: 320px;
    min-width: 180px;
    height: 44vw;
    max-height: 380px;
    border: 6px solid #444;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    padding: 0;
  }
  .page img {
    border-radius: 10px;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .photo-caption {
    bottom: 10px;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    background: rgba(80, 40, 160, 0.85);
    max-width: 92%;
  }
  .album-controls {
    gap: 18px;
    padding: 12px 0;
    margin: 18px auto 0;
    width: 96vw;
    max-width: 96vw;
  }
  .album-controls button {
    flex: 1 1 140px;
    max-width: 220px;
    min-width: 90px;
    font-size: 1rem;
    padding: 12px 0;
    border-radius: 22px;
  }
}

/* === GALERÍA: TABLET GRANDE (768px a 1023px) === */
@media (min-width: 768px) and (max-width: 1023px) {
  .photo-album {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 26px;
    width: 78vw;
    max-width: 1000px;
    margin: 32px auto 0 auto;
    padding: 32px 2vw;
    background: linear-gradient(135deg, #7535d6 70%, #a084e8 100%);
    border-radius: 20px;
    box-shadow: 0 12px 40px #7535d6a0;
  }
  .page {
    flex: 1 1 260px;
    max-width: 380px;
    min-width: 200px;
    height: 36vw;
    max-height: 480px;
    border: 8px solid #444;
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
    padding: 0;
  }
  .page img {
    border-radius: 12px;
  }
  .photo-caption {
    bottom: 14px;
    padding: 5px 10px;
    border-radius: 9px;
    font-size: 0.8rem;
    background: rgba(80, 40, 160, 0.85);
    max-width: 92%;
  }
  .album-controls {
    gap: 24px;
    padding: 16px 0;
    margin: 24px auto 0;
    width: 98vw;
    max-width: 1100px;
  }
  .album-controls button {
    flex: 1 1 160px;
    max-width: 260px;
    min-width: 110px;
    font-size: 1.4rem;
    padding: 16px 0;
    border-radius: 28px;
  }
}

/* === GALERÍA: DESKTOP MEDIO (1024px a 1280px) === */
@media (min-width: 1024px) and (max-width: 1280px) {
  .photo-album {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    width: 80vw;
    max-width: 1200px;
    margin: 40px auto 0 auto;
    padding: 20px 2vw;
    background: linear-gradient(135deg, #7535d6 70%, #a084e8 100%);
    border-radius: 24px;
    box-shadow: 0 20px 60px #7535d6a0;
  }
  .page {
    flex: 1 1 320px;
    max-width: 420px;
    min-width: 220px;
    height: 30vw;
    max-height: 580px;
    border: 14px solid #444;
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    padding: 0;
  }
  .page img {
    border-radius: 14px;
  }
  .photo-caption {
    bottom: 18px;
    padding: 6px 18px;
    border-radius: 10px;
    font-size: 1rem;
    background: rgba(80, 40, 160, 0.852);
    max-width: 90%;
  }
  .album-controls {
    gap: 32px;
    padding: 20px 0;
    margin: 32px auto 0;
    width: 100vw;
    max-width: 1200px;
  }
  .album-controls button {
    flex: 1 1 180px;
    max-width: 180px;
    min-width: 160px;
    font-size: 1.4rem;
    padding: 18px 0;
    border-radius: 38px;
  }
}