/* ==========================================================================
   Site-wide updates: button arrows, animated bus tab, FAQ heading alignment,
   scroll-reveal and hover motion for cards and images.
   Every animation is switched off for visitors who prefer reduced motion.
   ========================================================================== */

/* ----- Buttons: arrow icon (replaces the sparkle) ----- */
.hp-pill i svg {
  display: block;
  width: 16px;
  height: 16px;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.hp-pill:hover i svg {
  transform: translateX(3px);
}

/* ----- Campus facilities: animated bus in the Transport section ----- */
.tr-road {
  position: relative;
  height: 72px;
  margin: 0 0 22px;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(180deg, #f3f6fb, #fbf8f1);
  border: 1px solid #e1e9f4;
}
.tr-road::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  height: 0;
  border-top: 2px dashed #c9d6e8;
}
.tr-bus {
  position: absolute;
  left: 8px;
  bottom: 4px;
  width: 120px;
  height: auto;
  max-width: 60%;
  animation: tr-bus-drive 6s ease-in-out infinite;
  will-change: transform;
}
.tr-bus circle {
  transform-box: fill-box;
  transform-origin: center;
  animation: tr-wheel-spin 2.4s linear infinite;
}
@keyframes tr-bus-drive {
  0%, 100% { transform: translate(0, 0); }
  25%      { transform: translate(calc(100% * 1.4), -1px); }
  50%      { transform: translate(calc(100% * 1.4), 0); }
  75%      { transform: translate(0, -1px); }
}
@keyframes tr-wheel-spin {
  to { transform: rotate(360deg); }
}

/* ----- Admissions: FAQ heading aligned to the left ----- */
#faq .faq-head {
  text-align: left;
  margin-left: 0;
  margin-right: auto;
}
#faq .faq-head .h2,
#faq .faq-head .kicker {
  text-align: left;
}

/* ----- Scroll reveal: fade in and slide up (added by motion.js) ----- */
html.js .mo-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1);
  transition-delay: var(--mo-d, 0ms);
}
html.js .mo-reveal.mo-in {
  opacity: 1;
  transform: none;
}

/* ----- Card hover: gentle lift and shadow ----- */
.hp-why-card,
.hp-space,
.hp-note-card,
.pp-card,
.pa-card,
.cr-work-card,
.cr-contact-card,
.stage-card,
.hp-stage,
.role-card,
.tr-card,
.ann {
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .45s ease, border-color .45s ease;
}
.hp-why-card:hover,
.hp-space:hover,
.hp-note-card:hover,
.pp-card:hover,
.pa-card:hover,
.cr-work-card:hover,
.cr-contact-card:hover,
.stage-card:hover,
.hp-stage:hover,
.role-card:hover,
.tr-card:hover,
.ann:hover {
  transform: none;
  box-shadow: none;
}

/* ----- Image zoom on hover ----- */
.hp-space-img,
.hp-stage-art,
.hp-polaroid,
.cr-work-frame,
.cr-grow-frame,
.cr-photo,
.g-media {
  overflow: hidden;
}
.hp-space-img img,
.hp-stage-art > img,
.hp-polaroid img,
.cr-work-frame img,
.cr-grow-frame img,
.cr-photo img {
  transition: transform .8s cubic-bezier(.2, .8, .2, 1);
}
.hp-space:hover .hp-space-img img,
.hp-stage:hover .hp-stage-art > img,
.hp-polaroid:hover img,
.cr-work-frame:hover img,
.cr-grow-frame:hover img,
.cr-photo:hover img {
  transform: none;
}

/* ----- Learning Spaces (index): static cards, icon badge on the Art and Craft photo ----- */
.hp-space,
.hp-space:hover {
  transform: none !important;
  box-shadow: none !important;
  transition: none !important;
}
.hp-space-img img,
.hp-space:hover .hp-space-img img {
  transform: none !important;
  transition: none !important;
}
.hp-space-img {
  position: relative;
}
.hp-space-badge {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  color: var(--hp-orange);
  box-shadow: 0 8px 18px rgba(18, 41, 75, .18);
}
.hp-space-badge svg {
  display: block;
}

/* ----- Learning Spaces (index): orange sparkle rays on every card image, scales with the screen ----- */
.hp-space-img::before {
  content: "";
  position: absolute;
  left: clamp(8px, 2.6%, 14px);
  top: clamp(8px, 4%, 16px);
  width: clamp(20px, 5vw, 30px);
  height: clamp(20px, 5vw, 30px);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30' fill='none' stroke='%23f26f2e' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M3 15h5'/%3E%3Cpath d='M6.5 7l3.5 3.5'/%3E%3Cpath d='M15 3v5'/%3E%3C/svg%3E") no-repeat center / contain;
  z-index: 2;
  pointer-events: none;
}

/* ----- A New Chapter (index): orange dashed line drawn on scroll (see steps-line.js) ----- */
.hp-steps-path {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  filter: none;
}
.hp-steps-path path {
  fill: none;
  stroke: var(--hp-orange);
  stroke-width: 2.4;
  stroke-linecap: butt;
  animation: hp-line-flow 1.1s linear infinite;
}
/* dashes travel along the line from image 1 towards image 3 */
@keyframes hp-line-flow {
  to { stroke-dashoffset: calc(var(--hp-period, 21px) * -1); }
}
@media (prefers-reduced-motion: reduce) {
  .hp-steps-path path { animation: none; }
}
.hp-steps-path mask path {
  stroke: #fff;
  stroke-width: 8;
  animation: none;
}

/* ----- Our Educational Philosophy (about): circular line around the step icon on hover ----- */
.ph-why .hp-step-icon {
  position: relative;
  overflow: visible;
}
.ph-why .hp-step-icon img {
  border-radius: 50%;
}
.ph-why .hp-step-icon::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--hp-orange);
  border-right-color: rgba(242, 111, 46, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.ph-why .hp-step:hover .hp-step-icon::before,
.ph-why .hp-step:focus-within .hp-step-icon::before {
  opacity: 1;
  animation: hp-ring-spin 3.2s linear infinite;
}

/* ----- Why CBSE? (academics): graduation-cap icon in place of the sparkle ----- */
.acad-cbse .acad-why-title::before {
  content: "";
  background: #fff1e5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef6b2e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 9l10-5 10 5-10 5z'/%3E%3Cpath d='M6 11v5c0 1.7 2.7 3 6 3s6-1.3 6-3v-5'/%3E%3Cpath d='M22 9v5'/%3E%3C/svg%3E") center / 20px no-repeat;
  font-size: 0;
  color: transparent;
}

/* ----- Assessment (academics): orange decorative line for sections with .spark ----- */
.spark {
  position: relative;
  overflow: hidden;
}
.spark::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: min(38%, 360px);
  height: 4px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(90deg, var(--hp-orange), #ffb07c 60%, transparent);
  z-index: 1;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .ph-why .hp-step:hover .hp-step-icon::before,
  .ph-why .hp-step:focus-within .hp-step-icon::before {
    animation: none;
  }
}

/* ----- Primary & Middle School cards: static, original artwork restored ----- */
.hp-stage,
.hp-stage:hover {
  transform: none !important;
  box-shadow: none !important;
  transition: none !important;
}
.hp-stage-art {
  overflow: visible !important;
}
.hp-stage-art > img,
.hp-stage:hover .hp-stage-art > img {
  transform: none !important;
  transition: none !important;
}


/* ----- Desktop header: menu centred between logo and button (all pages) ----- */
@media (min-width: 1201px) {
  .site-header .main-nav > ul.hp-menu {
    justify-content: center;
    width: 100%;
  }
}

/* ----- Index hero: waving tiger with "Hi! Welcome to Ananya" ----- */
.hp-hero .hp-hero-art {
  position: relative;
}
.hp-welcome {
  position: absolute;
  left: -12%;
  bottom: 0;
  top: auto;
  width: 68px;
  z-index: 20;
  pointer-events: none;
}
.hp-welcome-img {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: 50% 100%;
  animation: none;
}
/* Mascot: body stays still; only the raised hand waves from the wrist */
.hp-welcome-fig {
  position: relative;
  display: block;
  width: 100%;
}
.hp-welcome .hp-welcome-body {
  display: block;
  width: 100%;
  height: auto;
}
.hp-welcome .hp-welcome-paw {
  position: absolute;
  left: 8%;
  bottom: 60%;
  width: 24%;
  height: auto;
  transform-origin: 50% 92%;
  animation: hp-paw-wave 1.8s ease-in-out infinite;
}
@keyframes hp-paw-wave {
  0%, 100% { transform: rotate(-8deg); }
  50%      { transform: rotate(10deg); }
}
.hp-welcome-bubble {
  position: absolute;
  left: 6%;
  bottom: 96%;
  margin: 0;
  white-space: nowrap;
  background: #fff;
  color: var(--hp-navy);
  font-family: var(--hp-nav);
  font-weight: 700;
  font-size: clamp(13px, 1.15vw, 17px);
  line-height: 1.2;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 12px 24px rgba(18, 41, 75, .14);
  animation: hp-welcome-pop .7s cubic-bezier(.2, 1.3, .4, 1) .3s both, hp-welcome-float 3.2s ease-in-out 1.2s infinite;
}
.hp-welcome-bubble::after {
  content: "";
  position: absolute;
  left: 22%;
  bottom: -8px;
  width: 16px;
  height: 16px;
  background: #fff;
  transform: rotate(45deg);
  border-radius: 0 0 4px 0;
}
.hp-welcome-bubble b {
  color: var(--hp-orange);
  font-weight: 700;
}
@keyframes hp-welcome-wave {
  0%, 100% { transform: rotate(-1.5deg) translateY(0); }
  50%      { transform: rotate(1.5deg) translateY(-6px); }
}
@keyframes hp-welcome-pop {
  from { opacity: 0; transform: scale(.6) translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes hp-welcome-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
@media (max-width: 560px) {
  .hp-welcome {
    left: 0;
    bottom: 0;
    width: 60px;
  }
  .hp-welcome-bubble {
    left: 0;
    font-size: 12px;
    padding: 7px 12px;
    box-shadow: 0 6px 14px rgba(18, 41, 75, .14);
  }
  .hp-welcome-bubble::after {
    width: 10px;
    height: 10px;
    bottom: -5px;
  }
}

/* ----- Reduced motion: no movement, content simply visible ----- */
@media (prefers-reduced-motion: reduce) {
  html.js .mo-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .tr-bus,
  .tr-bus circle,
  .hp-welcome-img,
  .hp-welcome .hp-welcome-paw,
  .hp-welcome-bubble {
    animation: none;
  }
  .hp-pill i svg,
  .hp-why-card,
  .hp-space,
  .hp-note-card,
  .pp-card,
  .pa-card,
  .cr-work-card,
  .cr-contact-card,
  .stage-card,
  .hp-stage,
  .role-card,
  .tr-card,
  .ann,
  .hp-space-img img,
  .hp-stage-art > img,
  .hp-polaroid img,
  .cr-work-frame img,
  .cr-grow-frame img,
  .cr-photo img {
    transition: none;
  }
  .hp-pill:hover i svg,
  .hp-why-card:hover,
  .hp-space:hover,
  .hp-note-card:hover,
  .pp-card:hover,
  .pa-card:hover,
  .cr-work-card:hover,
  .cr-contact-card:hover,
  .stage-card:hover,
  .hp-stage:hover,
  .role-card:hover,
  .tr-card:hover,
  .ann:hover,
  .hp-space:hover .hp-space-img img,
  .hp-stage:hover .hp-stage-art > img,
  .hp-polaroid:hover img,
  .cr-work-frame:hover img,
  .cr-grow-frame:hover img,
  .cr-photo:hover img {
    transform: none;
  }
}

/* ----- Hero tiger: sits beside the Explore Our Campus button, bottoms aligned ----- */
.hp-hero .hp-welcome {
  position: relative;
  left: auto;
  bottom: auto;
  align-self: flex-end;
  width: 68px;
  margin-left: 40px;
}
@media (max-width: 1000px) {
  .hp-hero .hp-welcome {
    width: 60px;
    margin-left: 28px;
  }
}
@media (max-width: 560px) {
  .hp-hero .hp-welcome {
    width: 56px;
    margin-left: 20px;
  }
  /* bubble grows leftward so it stays on screen */
  .hp-hero .hp-welcome-bubble {
    left: auto;
    right: 0;
    font-size: 12px;
    padding: 7px 12px;
  }
  .hp-hero .hp-welcome-bubble::after {
    left: auto;
    right: 18px;
  }
}
@media (max-width: 360px) {
  .hp-hero .hp-welcome { width: 48px; margin-left: 14px; }
  .hp-hero .hp-welcome-bubble { font-size: 11px; padding: 6px 10px; }
}

/* ----- Mobile "Apply for Admission" bar on the home page (same as other pages) ----- */
.mobile-apply { display: none; }
@media (max-width: 760px) {
  .mobile-apply {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: #ef6b2e;
    color: #fff;
    font-weight: 500;
    padding: 14px max(16px, env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    box-shadow: 0 -8px 20px rgba(14, 42, 71, .15);
  }
  .mobile-apply .arrow { width: 16px; height: 16px; }
  body { padding-bottom: 52px; }
}

/* ----- Card hover (all pages): card lifts and an orange-to-blue line draws across the top ----- */
.role-card,
.qp-card,
.tr-card,
.pp-card,
.cr-work-card,
.cr-contact-card,
.hw-card,
.ann,
.value-panel,
.hs-card,
.hv-card {
  background-image: linear-gradient(90deg, var(--hp-orange, #f26f2e), var(--hp-blue, #0d4a94)) !important;
  background-repeat: no-repeat !important;
  background-position: 22px 0 !important;
  background-size: 0 3px !important;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s ease, border-color .3s ease, background-size .5s cubic-bezier(.2, .8, .2, 1) !important;
}
.role-card:hover,
.qp-card:hover,
.tr-card:hover,
.pp-card:hover,
.cr-work-card:hover,
.cr-contact-card:hover,
.hw-card:hover,
.ann:hover,
.value-panel:hover,
.hs-card:hover,
.hv-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 16px 34px rgba(14, 42, 71, .08) !important;
  background-size: calc(100% - 44px) 3px !important;
}
@media (prefers-reduced-motion: reduce) {
  .role-card, .qp-card, .tr-card, .pp-card, .cr-work-card,
  .cr-contact-card, .hw-card, .ann, .value-panel, .hs-card, .hv-card {
    transition: none !important;
  }
  .role-card:hover, .qp-card:hover, .tr-card:hover, .pp-card:hover,   .cr-work-card:hover, .cr-contact-card:hover, .hw-card:hover,
  .ann:hover, .value-panel:hover, .hs-card:hover, .hv-card:hover {
    transform: none !important;
  }
}
