/* ============================================
   Animations — Hearth & Hygge
   Hover effects, shimmer, fade-in, skeleton
   loading, parallax, and button animations.
   ============================================ */

/* --- Page Load Transition --- */
body {
  opacity: 0;
  transition: opacity 0.4s ease-in;
}
body.loaded {
  opacity: 1;
}

/* --- Recipe Card Hover Animations --- */
.recipe-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.recipe-card:nth-child(even):hover {
  transform: translateY(-4px) rotate(1deg);
}
.recipe-card:nth-child(odd):hover {
  transform: translateY(-4px) rotate(-1deg);
}

/* --- National Dish Gold Shimmer --- */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.national-dish-badge {
  background: linear-gradient(
    90deg,
    #D4AF37 0%,
    #F5E6A3 25%,
    #D4AF37 50%,
    #F5E6A3 75%,
    #D4AF37 100%
  );
  background-size: 200% auto;
  animation: shimmer 4s linear infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}
@supports not (-webkit-background-clip: text) {
  .national-dish-badge {
    background: #D4AF37;
    color: #fff;
    -webkit-text-fill-color: initial;
  }
}

/* --- Scroll-Triggered Fade-In --- */
.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}
/* Staggered delays for grid items */
.recipe-grid .fade-in-up:nth-child(1) { transition-delay: 0s; }
.recipe-grid .fade-in-up:nth-child(2) { transition-delay: 0.1s; }
.recipe-grid .fade-in-up:nth-child(3) { transition-delay: 0.2s; }
.recipe-grid .fade-in-up:nth-child(4) { transition-delay: 0.3s; }
.recipe-grid .fade-in-up:nth-child(5) { transition-delay: 0.4s; }
.recipe-grid .fade-in-up:nth-child(6) { transition-delay: 0.5s; }
.recipe-grid .fade-in-up:nth-child(n+7) { transition-delay: 0.6s; }

/* --- Loading Skeleton Screens --- */
@keyframes skeleton-pulse {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.skeleton {
  background: linear-gradient(90deg, #E8E0D0 25%, #F5F0E8 50%, #E8E0D0 75%);
  background-size: 200% auto;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 4px;
}
.skeleton-card {
  height: 280px;
  border-radius: 12px;
}
.skeleton-title {
  height: 24px;
  width: 60%;
  margin: 12px 0 8px;
}
.skeleton-text {
  height: 16px;
  width: 80%;
  margin: 4px 0;
}
.skeleton-text.short {
  width: 40%;
}

/* --- Button Hover Effects --- */
.btn {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.btn:active {
  transform: scale(0.98);
}

/* --- Heart/Favorite Button Animation --- */
@keyframes heart-bounce {
  0% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(0.95); }
  75% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
.favorite-btn.active {
  animation: heart-bounce 0.4s ease;
  color: #E53935;
}

/* --- Parallax Hero (CSS-based) --- */
.region-hero {
  position: relative;
  height: 300px;
  overflow: hidden;
}
.region-hero-bg {
  position: absolute;
  top: -50px;
  left: 0;
  right: 0;
  bottom: -50px;
  background-size: cover;
  background-position: center;
  will-change: transform;
}
.region-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  padding: 1rem;
}
.region-hero-content h1 {
  color: #fff;
  margin: 0;
}
.region-hero-content p {
  margin: 0.25rem 0 0;
  font-style: italic;
  opacity: 0.9;
}

@media (max-width: 768px) {
  .region-hero {
    height: 250px;
  }
  .region-hero-bg {
    position: relative;
    top: 0;
    bottom: 0;
    height: 250px;
  }
}

/* --- SVG Dividers --- */
.divider {
  display: block;
  margin: 2rem auto;
  opacity: 0.6;
}
.divider:hover {
  opacity: 0.8;
  transition: opacity 0.3s;
}

/* --- Reduce motion for accessibility --- */
@media (prefers-reduced-motion: reduce) {
  body {
    transition: none;
    opacity: 1;
  }
  .recipe-card {
    transition: none;
  }
  .fade-in-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .national-dish-badge {
    animation: none;
  }
  .skeleton {
    animation: none;
  }
  .btn {
    transition: none;
  }
  .favorite-btn.active {
    animation: none;
  }
}
