/* Animation Styles */

/* Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Trigger the animation based on visibility in the viewport */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(30px);
  }
  
  .reveal:nth-child(1) { transition-delay: 0.1s; }
  .reveal:nth-child(2) { transition-delay: 0.2s; }
  .reveal:nth-child(3) { transition-delay: 0.3s; }
  .reveal:nth-child(4) { transition-delay: 0.4s; }
  
  /* This makes the elements visible by default if JavaScript isn't available */
  @supports not (IntersectionObserver) {
    .reveal {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Page Turn Effect */
@keyframes pageTurn {
  0% {
    transform: rotateY(0deg);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  }
  
  50% {
    transform: rotateY(15deg);
    box-shadow: 20px 10px 20px rgba(0, 0, 0, 0.1);
  }
  
  100% {
    transform: rotateY(0deg);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  }
}

/* Button Hover Animation */
.btn-primary:hover,
.btn-secondary:hover,
.btn-tertiary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary:active,
.btn-secondary:active,
.btn-tertiary:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Header Scroll Transition */
.site-header {
  transition: background-color 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}

/* Hover Effects */
.edition-item {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.edition-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Nav Link Hover */
.main-nav a::after {
  transition: width 0.3s ease;
}

/* Cover Image Hover */
.cover-container img {
  transition: transform 0.5s ease;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Accessibility: Respect user preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}