/* JHS Motion — premium animation refinement layer
   Composable with the theme's WOW.js / animate.css / GSAP stack:
   - redefines the entrance keyframes (last definition wins) with shorter
     travel, a blur->focus settle and Apple-like easing
   - adds hover micro-interactions (transform/opacity/box-shadow only)
   - provides the .jhs-reveal system driven by jhs-motion.js
   Landing pages (Preschool/middle_school/Higher) do NOT load this file. */

/* ---------------------------------------------- refined entrance keyframes */
/* Shorter travel + blur settle. These override the theme's copies because
   the browser uses the LAST @keyframes definition with a given name. */
@keyframes fadeInUp {
  0%   { opacity: 0; transform: translate3d(0, 26px, 0); filter: blur(5px); }
  60%  { filter: blur(0); }
  100% { opacity: 1; transform: none; filter: none; }
}
@keyframes fadeInDown {
  0%   { opacity: 0; transform: translate3d(0, -26px, 0); filter: blur(5px); }
  60%  { filter: blur(0); }
  100% { opacity: 1; transform: none; filter: none; }
}
@keyframes fadeInLeft {
  0%   { opacity: 0; transform: translate3d(-28px, 0, 0); filter: blur(4px); }
  60%  { filter: blur(0); }
  100% { opacity: 1; transform: none; filter: none; }
}
@keyframes fadeInRight {
  0%   { opacity: 0; transform: translate3d(28px, 0, 0); filter: blur(4px); }
  60%  { filter: blur(0); }
  100% { opacity: 1; transform: none; filter: none; }
}
@keyframes fadeIn {
  0%   { opacity: 0; filter: blur(4px); }
  100% { opacity: 1; filter: none; }
}
@keyframes zoomIn {
  0%   { opacity: 0; transform: scale3d(0.97, 0.97, 1); }
  100% { opacity: 1; transform: none; }
}

/* WOW-driven entrances: professional duration + ease-out curve */
.wow.animated {
  animation-duration: 0.75s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ------------------------------------------------------ scroll reveal (JS) */
/* Only active when jhs-motion.js has confirmed motion is allowed. */
html.jhs-motion .jhs-reveal {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  filter: blur(4px);
  transition:
    opacity   0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    filter    0.55s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--jhs-stagger, 0ms);
}
html.jhs-motion .jhs-reveal.jhs-in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* -------------------------------------------------- card micro-interactions */
.service-box,
.blog-box,
.testi-card,
.team-box,
.club-card,
.counter-box,
.jhs-blog-card {
  transition:
    transform  0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.service-box:hover,
.blog-box:hover,
.testi-card:hover,
.team-box:hover,
.club-card:hover,
.jhs-blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px -18px rgba(10, 24, 55, 0.28);
}

/* card imagery settles instead of snapping */
.service-img img,
.blog-img img,
.team-img img,
.gallery-img img {
  transition: transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}
.service-box:hover .service-img img,
.gallery-card:hover .gallery-img img {
  transform: scale(1.045);
}

/* icons inside cards give a gentle acknowledgement */
.service-box .box-icon,
.club-card .club-icon,
.about-item .about-item_img {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.service-box:hover .box-icon,
.club-card:hover .club-icon,
.about-item:hover .about-item_img {
  transform: translateY(-3px) scale(1.05);
}

/* ------------------------------------------------ button micro-interactions */
.th-btn {
  transition:
    background-color 0.25s ease-out,
    color            0.25s ease-out,
    transform        0.25s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow       0.3s  cubic-bezier(0.22, 1, 0.36, 1);
}
.th-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -12px rgba(10, 24, 55, 0.45);
}
.th-btn:active {
  transform: translateY(0);
  transition-duration: 0.1s;
}
/* arrow icons slide forward on hover */
.th-btn i,
.th-btn .fa-arrow-right {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  display: inline-block;
}
.th-btn:hover i {
  transform: translateX(4px);
}
/* keyboard users get a clear, calm focus ring */
.th-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* --------------------------------------------------------------- navigation */
/* The theme already recolours links on hover; the CURRENT page is marked
   with a distinct amber colour (set by jhs-motion.js) — no underline. */
.main-menu > ul > li.jhs-current > a,
.main-menu ul.sub-menu li.jhs-current > a {
  color: #c77700;
  font-weight: 600;
}

/* sticky header eases in with depth instead of appearing */
.sticky-wrapper {
  transition: box-shadow 0.35s ease-out;
}
.sticky-wrapper.sticky {
  box-shadow: 0 6px 24px -12px rgba(10, 24, 55, 0.18);
}

/* social icons in footer/team: gentle lift */
.th-social a,
.footer-links a i {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.th-social a:hover {
  transform: translateY(-3px);
}

/* scroll-to-top button */
.scroll-top {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease-out;
}
.scroll-top:hover {
  transform: translateY(-3px);
}

/* -------------------------------------------------------- wide desktops */
/* The theme caps every .container at --main-container (1320px), which leaves
   large empty side bands on big monitors. Scale the canvas up with the screen;
   sections that already use .th-container* (wider) are unaffected. */
@media (min-width: 1500px) {
  :root { --main-container: min(1460px, 90vw); }
}
@media (min-width: 1700px) {
  :root { --main-container: min(1580px, 88vw); }
}
@media (min-width: 1920px) {
  :root { --main-container: 1680px; }
}

/* ----------------------------------------- circle cards (Why Choose JHS) */
/* keep circles perfectly round and headings level even if a replacement
   image isn't exactly square (theme's mobile height:auto would make ovals) */
.choose-card.style5 .box-img {
  aspect-ratio: 1 / 1;
  /* the 312px circle is a block — centre it under the centred text */
  margin-inline: auto;
}
.choose-card.style5 .box-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 991px) {
  .choose-card.style5 .box-img {
    height: auto !important; /* aspect-ratio still enforces the circle */
  }
}

/* ------------------------------------------------- blog stack (homepage) */
/* the sticky deck needs opaque cards, or the text of covered cards
   shows through the one sliding over it */
.blog-grid4_wrapp {
  background: var(--white-color, #fff);
  border-radius: 16px 16px 0 0;
  /* soft top edge so each card visibly covers the previous one */
  box-shadow: 0 -14px 24px -18px rgba(10, 24, 55, 0.35);
  /* breathing room so content never touches the card edges */
  padding: 22px 26px 0;
}
/* stacking tall cards on small screens piles text unreadably — flow instead */
@media (max-width: 991px) {
  .blog-grid4_wrapp,
  .sec_title_static,
  .sec_title_static .sec_title_wrap {
    position: static;
    box-shadow: none;
    padding: 0;
  }
}

/* -------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .wow,
  .wow.animated {
    animation: none !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  html.jhs-motion .jhs-reveal {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
  .service-box, .blog-box, .testi-card, .team-box, .club-card,
  .counter-box, .jhs-blog-card, .th-btn, .th-btn i,
  .main-menu > ul > li > a,
  .service-img img, .blog-img img, .team-img img, .gallery-img img {
    transition: none !important;
  }
  .service-box:hover, .blog-box:hover, .testi-card:hover,
  .team-box:hover, .club-card:hover, .jhs-blog-card:hover, .th-btn:hover {
    transform: none;
  }
}
