/* Hotel Antalya motion. Nothing sits outside a no-preference query, so a visitor who asks for reduced motion gets
   the settled page.
   - The first screen opens once on load: the hero photograph is discovered and its words rise; inner pages give
     their opening a short rise (owner 2026-11-28: "ok on hero first section").
   - Photographs and room cards never animate on scroll: they are in place when they scroll into view (owner 1.4.1,
     2026-11-28: the scroll curtain left an empty photo frame). Only the copy beside them (.ha-reveal-text) comes in,
     once and fast (reveal profile "Gilded"). A photograph still downloading shows its frame's tint (base.css .ha-image).
   - Everything else moves only when a guest acts: the phone menu, the questions, the viewer, the page crossfade.
   Never animate the date-picker band or an ancestor of it: an animated element is a stacking context and buries
   the open calendar (design/capabilities.md trap 32). */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .32s; }

  @keyframes ha-rise { from { opacity: 0; transform: translateY(var(--ha-rise, 24px)); } to { opacity: 1; transform: none; } }
  @keyframes ha-wipe { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
  @keyframes ha-settle { from { transform: scale(1.14); } to { transform: none; } }

  /* Page opening: the photograph is discovered, the words arrive quickly. Runs once, on load. */
  .ha-hero__heading .ha-kicker { --ha-rise: 12px; animation: ha-rise .8s var(--ha-ease-out) .05s backwards; }
  .ha-hero__heading :is(.ha-h1, .ha-display) { --ha-rise: 32px; animation: ha-rise 1s var(--ha-ease-out) .12s backwards; }
  .ha-hero__intro { animation: ha-rise .9s var(--ha-ease-out) .32s backwards; }
  .ha-hero__photo { animation: ha-wipe 1.2s var(--ha-ease-out) .15s backwards; }
  .ha-hero__photo .ha-image { animation: ha-settle 2s var(--ha-ease-out) .15s backwards; }
  /* The dates card (.ha-hero__ledger) holds the booking form: it is there from the first paint. An animated ancestor
     would hide the primary action and bury the open calendar (capabilities trap 32). */
  .ha-page-opening .ha-stack > * { animation: ha-rise .9s var(--ha-ease-out) backwards; }
  .ha-page-opening .ha-stack > :nth-child(2) { animation-delay: .1s; }
  .ha-page-opening .ha-stack > :nth-child(3) { animation-delay: .2s; }

  /* Scroll: the copy beside a photograph (never the photograph) comes in once, fast, the moment it enters. Only blocks
     theme.js marked pending are hidden, so no script means no hiding. Cascade .34s, so entry to settled stays within
     .4s including the observer's frame. */
  .ha-reveal-text[data-reveal] > * { transition: opacity .28s var(--ha-ease-out), transform .28s var(--ha-ease-out); }
  .ha-reveal-text[data-reveal="pending"] > * { opacity: 0; transform: translateY(12px); }
  .ha-reveal-text[data-reveal] > :nth-child(2) { transition-delay: .03s; }
  .ha-reveal-text[data-reveal] > :nth-child(n + 3) { transition-delay: .06s; }
  /* theme.js removes data-reveal once the copy has settled, and at once on keyboard focus, print or a switch to reduced
     motion: these rules then stop applying, so a child such as .ha-button keeps its own transitions and :active press,
     and a focused link is never faint or moving (WCAG 2.4.7). */

  /* Phone menu: the panel drops in and out instead of toggling. Without JS the links are simply shown. The class
     arrives two frames after load (theme.js), so the page's own set-up never plays the closing transition. */
  @media (max-width: 800px) {
    .ha-motion .ha-navigation { opacity: 0; transform: translateY(-8px); transition: opacity .25s ease, transform .4s var(--ha-ease-out), display .4s allow-discrete; }
    .ha-motion .ha-navigation.ha-navigation--open { opacity: 1; transform: none; }
    @starting-style { .ha-motion .ha-navigation.ha-navigation--open { opacity: 0; transform: translateY(-8px); } }
  }

  /* Questions open and close on their own height (where the browser can animate to auto). */
  .ha-disclosures { interpolate-size: allow-keywords; }
  .ha-disclosures details::details-content { block-size: 0; overflow: clip; transition: block-size .45s var(--ha-ease-out), content-visibility .45s allow-discrete; }
  .ha-disclosures details[open]::details-content { block-size: auto; }

  /* Photograph viewer: fades and settles in, backdrop dims. */
  .ha-lightbox { opacity: 0; transform: translateY(14px) scale(.985); transition: opacity .3s ease, transform .45s var(--ha-ease-out), overlay .45s allow-discrete, display .45s allow-discrete; }
  .ha-lightbox[open] { opacity: 1; transform: none; }
  .ha-lightbox::backdrop { background: #10171300; transition: background-color .35s ease, overlay .45s allow-discrete, display .45s allow-discrete; }
  .ha-lightbox[open]::backdrop { background: #101713ed; }
  @starting-style {
    .ha-lightbox[open] { opacity: 0; transform: translateY(14px) scale(.985); }
    .ha-lightbox[open]::backdrop { background: #10171300; }
  }

  /* Print shows the settled page: an opening or a reveal caught mid-way prints faded or empty (WebKit bug 310030;
     the transition that beforeprint starts may not finish before the print layout). Same specificity, later wins. */
  @media print {
    :is(.ha-hero__heading .ha-kicker, .ha-hero__heading :is(.ha-h1, .ha-display), .ha-hero__intro, .ha-hero__photo,
      .ha-hero__photo .ha-image, .ha-page-opening .ha-stack > *) { animation: none; }
    .ha-reveal-text[data-reveal] > * { transition: none; }
    .ha-reveal-text[data-reveal="pending"] > * { opacity: 1; transform: none; }
  }
}
