/* Motion styles — the CSS half of js/motion.js. Everything here is
   gated behind .motion-ok, a class motion.js adds only when the
   visitor hasn't asked for reduced motion. Without JS, or with
   reduced motion, none of this exists and nothing is ever hidden. */

/* photographs cross-fade once, slowly, as they arrive */
.motion-ok [data-fade] { opacity: 0; transition: opacity 0.9s ease; }
.motion-ok [data-fade].in { opacity: 1; }

/* the diary's line draws as the nights are picked — diary.js adds
   the range classes a frame after the cells land, so this transition
   is what draws the line */
.motion-ok .dcell.inrange::after,
.motion-ok .dcell.endpoint::after {
  transform: scaleX(1); transform-origin: left center;
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}
.motion-ok .dcell.line-from::after { transform: scaleX(0); }

/* ---------- header stays put ---------- */
/* The phone number and the Book button stay one glance away however
   far down the page someone has read. The wrapper needs the ground
   background — the header itself is transparent and scrolling
   content would show through. */
#sitehead { position: sticky; top: 0; z-index: 55; background: var(--ground); }

/* ---------- micro-interactions ---------- */

nav.main a:not(.booklink) { position: relative; }
nav.main a:not(.booklink)::after {
  content: ''; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 2px; background: var(--door);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.22s ease-out;
}
nav.main a:not(.booklink):hover::after { transform: scaleX(1); transform-origin: left; }

.btn { transition: background-color 0.2s ease-out, transform 0.15s ease-out; }
.btn:active { transform: scale(0.97); }
nav.main a.booklink { transition: background-color 0.2s ease-out, transform 0.15s ease-out; }
nav.main a.booklink:active { transform: scale(0.97); }

.room-entry .pic { overflow: hidden; }
.room-entry .pic img { transition: transform 0.4s ease-out; }
.room-entry:hover .pic img { transform: scale(1.03); }

@media (prefers-reduced-motion: reduce) {
  .btn, nav.main a.booklink, nav.main a:not(.booklink)::after,
  .room-entry .pic img { transition: none; }
}
