/* ALTERRA VR QUEST MOTION v1 - reusable across all individual quest pages.
 * Applies ONLY when quest-animations.js enables .quest-motion-ready.
 * No layout geometry, content, navigation or existing gallery/carousel logic is changed.
 * Safe fallback: without JS all elements render immediately and visibly.
 */

/* Cinematic first-visit entrance, one-time only. */
@keyframes questHeroEnter {
  from {opacity:0; transform:translate3d(0,14px,0)}
  to {opacity:1; transform:translate3d(0,0,0)}
}
@keyframes questHeroBackdrop {
  from {opacity:.73}
  to {opacity:1}
}
@keyframes questLightboxEnter {
  from {opacity:0}
  to {opacity:1}
}
@keyframes questLightboxPhoto {
  from {opacity:.6;transform:scale(.977)}
  to {opacity:1;transform:scale(1)}
}

html.quest-motion-ready .qt-hero::before {
  animation:questHeroBackdrop .9s cubic-bezier(.2,.7,.2,1) both;
}
html.quest-motion-ready .qt-hero .qt-overline,
html.quest-motion-ready .qt-hero h1,
html.quest-motion-ready .qt-hero .qt-lead,
html.quest-motion-ready .qt-hero .qt-features,
html.quest-motion-ready .qt-hero .qt-actions,
html.quest-motion-ready .qt-hero .qt-contact-note,
html.quest-motion-ready .qt-hero .qt-visual-disclaimer {
  animation:questHeroEnter .63s cubic-bezier(.19,.8,.27,1) both;
}
html.quest-motion-ready .qt-hero .qt-overline {animation-delay:.1s}
html.quest-motion-ready .qt-hero h1 {animation-delay:.21s}
html.quest-motion-ready .qt-hero .qt-lead {animation-delay:.32s}
html.quest-motion-ready .qt-hero .qt-features {animation-delay:.42s}
html.quest-motion-ready .qt-hero .qt-actions {animation-delay:.52s}
html.quest-motion-ready .qt-hero .qt-contact-note {animation-delay:.58s}
html.quest-motion-ready .qt-hero .qt-visual-disclaimer {animation-delay:.37s}

/* Reveals run once when content enters viewport. No layout reflow from transforms. */
html.quest-motion-ready .quest-reveal {
  opacity:0;
  transform:translate3d(0,16px,0);
  transition:opacity .56s cubic-bezier(.2,.7,.2,1),transform .56s cubic-bezier(.2,.7,.2,1);
  transition-delay:var(--quest-reveal-delay,0ms);
}
html.quest-motion-ready .quest-reveal.is-visible {
  opacity:1;
  transform:translate3d(0,0,0);
}
/* The original fullscreen/right-half story photograph must retain exactly its geometry. */
html.quest-motion-ready .qt-story-art.quest-reveal {transform:none;opacity:0;transition:opacity .82s ease}
html.quest-motion-ready .qt-story-art.quest-reveal.is-visible {transform:none;opacity:1}

/* Hover only where there is a physical pointer; never put hover dependencies on touch devices. */
@media (hover:hover) and (pointer:fine) {
  .qt-highlight-scene {
    transition:transform .55s cubic-bezier(.2,.7,.2,1),filter .55s ease;
  }
  .qt-highlight:hover .qt-highlight-scene {
    transform:scale(1.035);
    filter:brightness(1.06);
  }
  .qt-hero .qt-button,
  .qt-header-cta {
    transition:box-shadow .23s ease,border-color .23s ease,filter .23s ease,background-color .23s ease;
  }
  .qt-hero .qt-primary:hover,
  .qt-header-cta:hover {box-shadow:0 0 26px rgba(74,228,244,.24);filter:brightness(1.045)}
  .qt-hero .qt-secondary:hover {box-shadow:0 0 21px rgba(74,228,244,.12)}
  .qt-booking-action svg,
  .qt-hero .qt-button span[aria-hidden] {
    transition:transform .22s cubic-bezier(.2,.7,.2,1);
  }
  .qt-booking-action:hover svg,
  .qt-hero .qt-button:hover span[aria-hidden] {transform:translateX(4px)}
  .qt-related-chevron {transition:transform .22s ease,color .22s ease}
  .qt-related-card:hover .qt-related-chevron {transform:translateX(3px);color:#baffff}
  .qt-audience-item:hover .qt-audience-icon {box-shadow:0 0 30px rgba(28,200,221,.19)}
  /* Preserve the original 3px hover lift after a reveal finishes. */
  html.quest-motion-ready .qt-related-card.quest-reveal.is-visible:hover {transform:translate3d(0,-3px,0)}
}

/* Gallery changes keep existing gallery JS intact; change animations come from observer. */
.qt-gallery-main-image.quest-gallery-changing {will-change:opacity}
.qt-gallery-lightbox:not([hidden]) {animation:questLightboxEnter .23s ease-out both}
.qt-gallery-lightbox:not([hidden]) figure {animation:questLightboxPhoto .28s cubic-bezier(.22,.7,.2,1) both}

/* Mobile and tablets share the same animation structure, with shorter movements and durations. */
@media(max-width:1100px) {
  html.quest-motion-ready .quest-reveal {transform:translate3d(0,10px,0);transition-duration:.42s}
  html.quest-motion-ready .quest-reveal.is-visible {transform:translate3d(0,0,0)}
  html.quest-motion-ready .qt-story-art.quest-reveal,
  html.quest-motion-ready .qt-story-art.quest-reveal.is-visible {transform:none}
  html.quest-motion-ready .qt-hero .qt-overline,
  html.quest-motion-ready .qt-hero h1,
  html.quest-motion-ready .qt-hero .qt-lead,
  html.quest-motion-ready .qt-hero .qt-features,
  html.quest-motion-ready .qt-hero .qt-actions,
  html.quest-motion-ready .qt-hero .qt-contact-note,
  html.quest-motion-ready .qt-hero .qt-visual-disclaimer {animation-duration:.45s}
}
@media(max-width:600px) {
  html.quest-motion-ready .quest-reveal {transform:translate3d(0,7px,0);transition-duration:.38s}
  html.quest-motion-ready .quest-reveal.is-visible {transform:translate3d(0,0,0)}
  html.quest-motion-ready .qt-story-art.quest-reveal,
  html.quest-motion-ready .qt-story-art.quest-reveal.is-visible {transform:none}
  html.quest-motion-ready .qt-hero .qt-overline {animation-delay:.05s}
  html.quest-motion-ready .qt-hero h1 {animation-delay:.12s}
  html.quest-motion-ready .qt-hero .qt-lead {animation-delay:.20s}
  html.quest-motion-ready .qt-hero .qt-features {animation-delay:.27s}
  html.quest-motion-ready .qt-hero .qt-actions {animation-delay:.32s}
  html.quest-motion-ready .qt-hero .qt-contact-note {animation-delay:.36s}
}

/* Accessibility: user preference takes priority, also when switched during a session. */
@media (prefers-reduced-motion: reduce) {
  html.quest-motion-ready .quest-reveal,
  html.quest-motion-ready .quest-reveal.is-visible,
  html.quest-motion-ready .qt-story-art.quest-reveal,
  html.quest-motion-ready .qt-story-art.quest-reveal.is-visible {
    opacity:1!important;transform:none!important;
    transition:none!important;transition-delay:0ms!important;
  }
  html.quest-motion-ready .qt-hero::before,
  html.quest-motion-ready .qt-hero .qt-overline,
  html.quest-motion-ready .qt-hero h1,
  html.quest-motion-ready .qt-hero .qt-lead,
  html.quest-motion-ready .qt-hero .qt-features,
  html.quest-motion-ready .qt-hero .qt-actions,
  html.quest-motion-ready .qt-hero .qt-contact-note,
  html.quest-motion-ready .qt-hero .qt-visual-disclaimer,
  .qt-gallery-lightbox:not([hidden]),
  .qt-gallery-lightbox:not([hidden]) figure {animation:none!important}
  .qt-gallery-main-image,
  .qt-gallery-thumb img,
  .qt-highlight-scene,
  .qt-related-card,
  .qt-related-photo img,
  .qt-audience-icon,
  .qt-hero .qt-button,
  .qt-booking-action {transition:none!important}
}
