/**
 * Rich Modern UI – Animations & scroll reveals
 * Brand: Emerald Green #0A7D3C, Ocean Blue #1A4B7C, Golden Sun #D4AA00
 */

:root {
  --anim-duration: 0.6s;
  --anim-duration-slow: 0.9s;
  --anim-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --anim-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --anim-ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --stagger-step: 80ms;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ----- Scroll-triggered reveal: stagger children ----- */
.ftco-section .row .ftco-animate:nth-child(1) { animation-delay: 0ms; }
.ftco-section .row .ftco-animate:nth-child(2) { animation-delay: calc(var(--stagger-step) * 1); }
.ftco-section .row .ftco-animate:nth-child(3) { animation-delay: calc(var(--stagger-step) * 2); }
.ftco-section .row .ftco-animate:nth-child(4) { animation-delay: calc(var(--stagger-step) * 3); }
.ftco-section .row .ftco-animate:nth-child(5) { animation-delay: calc(var(--stagger-step) * 4); }
.ftco-section .row .ftco-animate:nth-child(6) { animation-delay: calc(var(--stagger-step) * 5); }
.ftco-section .row .ftco-animate:nth-child(7) { animation-delay: calc(var(--stagger-step) * 6); }
.ftco-section .row .ftco-animate:nth-child(8) { animation-delay: calc(var(--stagger-step) * 7); }
.ftco-section .row .ftco-animate:nth-child(9) { animation-delay: calc(var(--stagger-step) * 8); }
.ftco-section .row .ftco-animate:nth-child(10) { animation-delay: calc(var(--stagger-step) * 9); }

/* ----- Custom keyframes (smoother than default animate.css) ----- */
@keyframes fadeInUpRich {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInRich {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInLeftRich {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRightRich {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleInRich {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideUpLine {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Apply richer animation when revealed (override animate.css timing) */
.ftco-animate.ftco-animated {
  animation-duration: var(--anim-duration) !important;
  animation-timing-function: var(--anim-ease-out) !important;
  animation-fill-mode: both !important;
}

/* Hero slide content: subtle entrance on load */
.hero-slider-wrapper .hero-slide.active .hero-slide-content {
  animation: fadeInRich var(--anim-duration-slow) var(--anim-ease-out) 0.3s both;
}

/* Section heading underline: animate width on reveal (keeps existing gradient from other CSS) */
.heading-section h2 {
  position: relative;
  display: inline-block;
}

.heading-section h2::after {
  transform-origin: left;
}

.ftco-animated .heading-section h2::after {
  animation: slideUpLine 0.8s var(--anim-ease-out) forwards;
}

/* Section eyebrow letter-spacing on reveal */
.section-eyebrow {
  display: inline-block;
  transition: letter-spacing 0.5s var(--anim-ease-out), opacity 0.5s ease;
}

.ftco-animated .section-eyebrow {
  letter-spacing: 0.25em;
}

/* Search wrap (homepage): gentle scale-in when in view */
.search-wrap-1.ftco-animate {
  transform-origin: center;
}

.search-wrap-1.ftco-animated {
  animation: scaleInRich 0.7s var(--anim-ease-out) both !important;
}

/* Counter blocks: pop in */
.ftco-counter .counter-wrap.ftco-animate .block-18 {
  transition: transform var(--anim-duration) var(--anim-ease-bounce), opacity var(--anim-duration) ease;
}

.ftco-counter .counter-wrap.ftco-animated .block-18 {
  animation: scaleInRich 0.6s var(--anim-ease-bounce) both;
}

/* Service/block-6 icon hover */
.media.block-6.services .icon {
  transition: transform 0.35s var(--anim-ease-bounce), color 0.25s ease;
}

.media.block-6.services:hover .icon {
  transform: scale(1.08) translateY(-2px);
}

.media.block-6.services .media-body {
  transition: color 0.2s ease;
}

/* Card image zoom on hover */
.package-card .package-image-container,
.popular-destination-card .popular-destination-image,
.destination-card-modern .destination-image-wrapper .img,
.project-wrap .img {
  overflow: hidden;
}

.package-card .package-image-container img,
.package-card .package-image-container,
.popular-destination-card .popular-destination-image,
.destination-card-modern .destination-image-wrapper a.img,
.project-wrap .img {
  transition: transform 0.6s var(--anim-ease-smooth);
}

.package-card:hover .package-image-container img,
.package-card:hover .package-image-container,
.popular-destination-card:hover .popular-destination-image,
.destination-card-modern:hover .destination-image-wrapper a.img,
.project-wrap:hover .img {
  transform: scale(1.06);
}

/* Button active state (press) */
.btn-primary:active:not(:disabled),
.btn-outline-primary:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
  transition-duration: 0.1s;
}

/* Nav link hover: subtle slide */
.navbar-nav .nav-link {
  position: relative;
}

.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.3s var(--anim-ease-out), left 0.3s var(--anim-ease-out);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-item.active .nav-link::after {
  width: 80%;
  left: 10%;
}

/* Blog entry / card hover lift with shadow */
.blog-entry,
.popular-destination-card,
.package-card,
.destination-card-modern,
.project-wrap {
  transition: transform 0.4s var(--anim-ease-out), box-shadow 0.4s var(--anim-ease-out);
}

.blog-entry:hover,
.popular-destination-card:hover,
.package-card:hover,
.destination-card-modern:hover,
.project-wrap:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(10, 125, 60, 0.12), 0 8px 16px rgba(26, 75, 124, 0.08);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  :root {
    --anim-duration: 0.01ms;
    --anim-duration-slow: 0.01ms;
    --stagger-step: 0ms;
  }

  .ftco-section .row .ftco-animate,
  .ftco-section .row .ftco-animate:nth-child(n) {
    animation-delay: 0ms !important;
  }

  .hero-slider-wrapper .hero-slide.active .hero-slide-content,
  .search-wrap-1.ftco-animated,
  .ftco-counter .counter-wrap.ftco-animated .block-18,
  .ftco-animated .heading-section h2::after {
    animation: none;
  }

  .media.block-6.services:hover .icon,
  .package-card .package-image-container img,
  .package-card:hover .package-image-container img,
  .popular-destination-card .popular-destination-image,
  .popular-destination-card:hover .popular-destination-image,
  .destination-card-modern .destination-image-wrapper a.img,
  .destination-card-modern:hover .destination-image-wrapper a.img,
  .project-wrap .img,
  .project-wrap:hover .img,
  .blog-entry,
  .popular-destination-card,
  .package-card,
  .destination-card-modern,
  .project-wrap {
    transition: none;
  }

  .media.block-6.services:hover .icon {
    transform: none;
  }

  .package-card:hover .package-image-container img,
  .popular-destination-card:hover .popular-destination-image,
  .destination-card-modern:hover .destination-image-wrapper a.img,
  .project-wrap:hover .img {
    transform: none;
  }

  .blog-entry:hover,
  .popular-destination-card:hover,
  .package-card:hover,
  .destination-card-modern:hover,
  .project-wrap:hover {
    transform: none;
  }
}
