/* Furuodden Sauna — motion layer (loaded after styles.css on every page).
 *
 * Everything that moves lives here and in assets/js/motion.js, so it can be tuned
 * or dropped without touching the base design. Since 2026-10-28 (test first) the
 * only motion nobody asked for is the hero's entrance; the rest answers a click
 * (page change, FAQ, booking). Scroll reveals, count-up, card glow, button sheen,
 * scroll progress line, photo pan/parallax and drifting waves were removed.
 * Rules of the house:
 *   - prefers-reduced-motion: reduce → nothing moves (static tints may stay)
 *   - only transform / opacity / filter / clip-path animate where possible
 *   - the only loops left are the booking loader shimmer and the few-seats dot
 *   - every effect is progressive: without support or JS the page looks like before
 */

/* ───────────────────────────────────────────────────────
   1. PAGE TRANSITIONS (cross-document View Transitions)
   Chrome/Edge 126+, Safari 18.2+. Others just navigate.
   ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
.topbar { view-transition-name: topbar; }
footer.site { view-transition-name: footer; }
::view-transition-old(root) { animation: vt-out 0.28s cubic-bezier(0.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vt-in 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes vt-out { to   { opacity: 0; transform: translateY(-12px); filter: blur(4px); } }
@keyframes vt-in  { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }

@media (prefers-reduced-motion: no-preference) {

  /* ─────────────────────────────────────────────────────
     2. HERO ENTRANCE — the text rises (.reveal in styles.css), then the
        photo fades in. The one moment that plays on its own.
     ───────────────────────────────────────────────────── */
  .hero-media img { animation: hero-photo 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) 0.35s both; }
  @keyframes hero-photo { from { opacity: 0; transform: scale(1.03); } }

  /* ─────────────────────────────────────────────────────
     3. FAQ — answers slide open (Chrome 131+; instant elsewhere)
     ───────────────────────────────────────────────────── */
  @supports selector(::details-content) {
    .faq { interpolate-size: allow-keywords; }
    .faq details::details-content {
      block-size: 0;
      overflow: clip;
      transition: block-size 0.4s cubic-bezier(0.2, 0.7, 0.2, 1), content-visibility 0.4s allow-discrete;
    }
    .faq details[open]::details-content { block-size: auto; }
    .faq .faq-body { transition: opacity 0.4s ease 0.05s, transform 0.4s ease 0.05s; }
    .faq details:not([open]) .faq-body { opacity: 0; transform: translateY(-6px); }
  }
  .faq summary::after { transition: transform 0.35s cubic-bezier(0.3, 1.5, 0.5, 1); }
}

/* Steps line (drawn as ::after with an ember start; replaces the border) */
.steps li { position: relative; border-top-color: transparent; }
.steps li::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--rust-soft), rgba(243, 242, 239, 0.18) 45%);
  transform-origin: 0 50%;
}
.steps li::before { transform-origin: 0 100%; }

/* Carousel photo frame; radius moves from the img to the frame */
.carousel-photo { display: block; overflow: hidden; border-radius: var(--radius-lg); }

/* ───────────────────────────────────────────────────────
   4. MJØSA WAVES — the lake-slate panels get a shoreline edge
   (two wave layers in one mask; they no longer drift)
   ─────────────────────────────────────────────────────── */
.section--deep, footer.site { position: relative; }
.section--deep::before,
footer.site::before,
.section--deep::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: clamp(18px, 2.6vw, 34px);
  background: var(--deep-panel);
  pointer-events: none;
  -webkit-mask:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 20C100 5 200 5 300 20S500 35 600 20 800 5 900 20s200 15 300 0V40H0Z'/%3E%3C/svg%3E") 0 100% / 1200px 100% repeat-x,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 40' preserveAspectRatio='none'%3E%3Cpath d='M0 28C67 18 133 18 200 28S333 38 400 28 533 18 600 28s133 10 200 0V40H0Z'/%3E%3C/svg%3E") 0 100% / 800px 100% repeat-x;
  mask:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 20C100 5 200 5 300 20S500 35 600 20 800 5 900 20s200 15 300 0V40H0Z'/%3E%3C/svg%3E") 0 100% / 1200px 100% repeat-x,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 40' preserveAspectRatio='none'%3E%3Cpath d='M0 28C67 18 133 18 200 28S333 38 400 28 533 18 600 28s133 10 200 0V40H0Z'/%3E%3C/svg%3E") 0 100% / 800px 100% repeat-x;
}
.section--deep::before, footer.site::before { bottom: calc(100% - 1px); }
footer.site::before { background: var(--deep-footer); }
/* Bottom edge of the deep panel: same waves, upside down */
.section--deep::after { top: calc(100% - 1px); transform: scaleY(-1); }
/* ───────────────────────────────────────────────────────
   5. BOOKING (ledige.js) — loading shimmer, staggered cards,
   "few seats" pulse, sliding day pill
   ─────────────────────────────────────────────────────── */
.slots-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.75rem;
  max-width: 40rem;
  margin-bottom: 1rem;
}
.slots-skeleton span {
  height: 4.4rem;
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--bone-deep) 30%, var(--paper) 50%, var(--bone-deep) 70%) 0 0 / 300% 100%;
  opacity: 0.7;
}
@media (prefers-reduced-motion: no-preference) {
  .slots-skeleton span { animation: shimmer 1.4s linear infinite; }
  @keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

  .slot-in, .slots-choice, .slots-day-chip {
    animation: slot-in 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(var(--i, 0) * 55ms);
  }
  @keyframes slot-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
  .slots-date { animation: slot-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
}

.slot--few .slot-seats::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 0.4em;
  border-radius: 50%;
  background: var(--rust);
  vertical-align: 0.08em;
}
@media (prefers-reduced-motion: no-preference) {
  /* One pulse once the card is on screen (is-seen from ledige.js) and has slid in */
  .slot--few.is-seen .slot-seats::before { animation: pulse 1.6s ease-out calc(var(--i, 0) * 55ms + 0.35s) both; }
  @keyframes pulse {
    0%   { box-shadow: 0 0 0 0 light-dark(rgba(153, 65, 30, 0.5), rgba(232, 140, 107, 0.6)); }
    100% { box-shadow: 0 0 0 8px rgba(153, 65, 30, 0); }
  }
}
/* "Book" slides in on hover */
a.slot { position: relative; overflow: hidden; }
a.slot::after {
  content: "Book";
  position: absolute;
  right: 1rem;
  bottom: 0.75rem;
  font-size: 13px;
  font-weight: 700;
  color: var(--rust);
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.2s, transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}
a.slot:hover::after, a.slot:focus-visible::after { opacity: 1; transform: none; }
a.slot:hover { box-shadow: 0 10px 26px light-dark(rgba(15, 22, 18, 0.1), rgba(0, 0, 0, 0.45)); }
@media (hover: none) { a.slot::after { display: none; } }

/* Sliding pill behind the active day chip */
.slots-days { position: relative; }
.slots-days-pill {
  position: absolute;
  top: 2px;
  left: 0;
  height: var(--pill-h, 38px);
  width: var(--pill-w, 0);
  transform: translateX(var(--pill-x, 0));
  border-radius: 999px;
  background: var(--rust);
  pointer-events: none;
  z-index: 0;
}
.slots-days.has-pill .slots-day-chip { position: relative; z-index: 1; }
.slots-days.has-pill .slots-day-chip[aria-pressed="true"] { background: transparent; }
@media (prefers-reduced-motion: no-preference) {
  .slots-days-pill.is-ready { transition: transform 0.45s cubic-bezier(0.3, 1.3, 0.5, 1), width 0.45s cubic-bezier(0.3, 1.3, 0.5, 1); }
  /* The row is rebuilt on every product switch and its chips slide in (slot-in);
     the pill sits under the first chip then, so it slides in with it. Uses
     translate/scale, not transform, which holds the pill's x position. */
  .slots-days-pill { animation: pill-in 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  @keyframes pill-in { from { opacity: 0; translate: 0 14px; scale: 0.98; } }
}

/* Product choice: a soft press */
.slots-choice:active { transform: scale(0.98); }
