/* ============================================================
   PAGE TRANSITIONS — View Transitions API (cross-document)
   ============================================================
   Adds a smooth crossfade + tiny lift between page navigations
   on Chromium-based browsers. Pure progressive enhancement —
   browsers that don't support `@view-transition` simply load
   pages the way they always have.

   Why opt in to the cross-document variant: Cove is a classic
   multi-page WordPress site (no SPA). Chromium 126+ supports
   view transitions across full-document navigations as long as
   both the outgoing and incoming page declare the rule below.

   Reference: https://developer.chrome.com/docs/web-platform/view-transitions/cross-document
   ============================================================ */
@view-transition {
  navigation: auto;
}

/* ── Default transition: 220 ms crossfade ── */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: .22s;
  animation-timing-function: cubic-bezier(.32, .72, 0, 1); /* gentle ease-out */
}

/* Outgoing page also drifts up slightly so the swap feels like
   "lifting away" rather than a flat fade. */
::view-transition-old(root) {
  animation-name: cove-page-leave;
}
::view-transition-new(root) {
  animation-name: cove-page-enter;
}

@keyframes cove-page-leave {
  to { opacity: 0; transform: translateY(-6px); }
}
@keyframes cove-page-enter {
  from { opacity: 0; transform: translateY(8px); }
}

/* Respect the user's motion preference — fall back to a plain
   crossfade with no movement. */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: .12s;
    animation-name: cove-page-fade;
  }
  @keyframes cove-page-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
}

/* ============================================================
   ENTRY ANIMATIONS — @starting-style
   ============================================================
   Animate the ChurchSuite event modal and the video modal IN
   from `display:none`. Without `@starting-style`, browsers can't
   transition from display:none / opacity:0 to a visible state.
   ============================================================ */
.cs-modal,
.video-modal {
  opacity: 1;
  transition: opacity .25s var(--ease), display .25s allow-discrete;
}
.cs-modal[aria-hidden="true"],
.video-modal[aria-hidden="true"] {
  opacity: 0;
}
@starting-style {
  .cs-modal[aria-hidden="false"],
  .video-modal[aria-hidden="false"] {
    opacity: 0;
  }
}

/* ============================================================
   HOVER POLISH — micro-interactions on cards
   ============================================================
   Subtle lift + shadow growth on activity cards. Pairs with
   the existing card markup; respected by reduced-motion users.
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .activity-card {
    transition: transform .35s var(--ease), box-shadow .35s var(--ease);
    will-change: transform;
  }
  .activity-card:hover,
  .activity-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(10, 20, 35, .18);
  }
}
