/* jazz.afropendium.com — interaction: focus, selection, and motion.
   The sleeve itself never moves. Motion lives only in the handoff between
   records: cross-document view transitions driven by assets/js/transitions.js. */

/* ---- Focus and selection ---- */
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.sleeve :focus-visible { outline-color: var(--type); }
.liner :focus-visible { outline-color: var(--ink); }

::selection { background: var(--gold); color: var(--ink); }
.liner ::selection { background: var(--field); color: var(--type); }

.ap-band a,
.ap-footer__wings a { transition: color 150ms ease-out; }

/* ---- View transitions ---- */
@view-transition { navigation: auto; }

/* The band holds still through every transition. */
.ap-band { view-transition-name: ap-band; }

::view-transition-group(root) { animation-duration: 220ms; }

/* Focal moment: the cover leaves the crate and becomes the sleeve. */
::view-transition-group(sleeve),
::view-transition-group(sleeve-photo) {
  animation-duration: 560ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
::view-transition-old(sleeve),
::view-transition-new(sleeve),
::view-transition-old(sleeve-photo),
::view-transition-new(sleeve-photo) {
  height: 100%;
  object-fit: cover;
  animation-duration: 560ms;
}
::view-transition-old(sleeve-photo),
::view-transition-new(sleeve-photo) { object-position: 50% 20%; }

/* Prev/next: flip to the neighboring record. Exit is quicker than entry. */
@keyframes flip-out-left  { to   { transform: translateX(-6%); opacity: 0; } }
@keyframes flip-out-right { to   { transform: translateX(6%);  opacity: 0; } }
@keyframes flip-in-right  { from { transform: translateX(6%);  opacity: 0; } }
@keyframes flip-in-left   { from { transform: translateX(-6%); opacity: 0; } }

html:active-view-transition-type(flip-next)::view-transition-old(root) { animation: 200ms cubic-bezier(0.4, 0, 1, 1) both flip-out-left; }
html:active-view-transition-type(flip-next)::view-transition-new(root) { animation: 380ms cubic-bezier(0.16, 1, 0.3, 1) 60ms both flip-in-right; }
html:active-view-transition-type(flip-prev)::view-transition-old(root) { animation: 200ms cubic-bezier(0.4, 0, 1, 1) both flip-out-right; }
html:active-view-transition-type(flip-prev)::view-transition-new(root) { animation: 380ms cubic-bezier(0.16, 1, 0.3, 1) 60ms both flip-in-left; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation-duration: 150ms !important; }
}
