/* Shared, reversible UI feedback. Never animate layout or delay navigation here. */
:root {
  --s13-speed-fast: .36s;
  --s13-ui-time: 360ms;
  --s13-ui-ease: cubic-bezier(.4,0,.2,1);
}

@media (prefers-reduced-motion: no-preference) {
  /* Low specificity fills gaps without overriding deliberate component motion. */
  :where(a,button,summary,input,select,textarea) {
    transition: color var(--s13-ui-time) var(--s13-ui-ease),
      background-color var(--s13-ui-time) var(--s13-ui-ease),
      border-color var(--s13-ui-time) var(--s13-ui-ease),
      text-decoration-color var(--s13-ui-time) var(--s13-ui-ease),
      opacity var(--s13-ui-time) var(--s13-ui-ease);
  }

  /* These children own their hover colour; transitioning the parent is not enough. */
  .home-stream-title h3, .archive-cover-copy :is(h3,h4), .s13-related-copy h3,
  .essential-card h3, .nb-winner-title-link, .footer-column strong,
  .s13-menu-feed a strong, .author-mix-year a small,
  .author-conversation-info small, .s13-lightbox-close small,
  .s13-external-embed-control strong {
    transition: color 440ms var(--s13-ui-ease);
  }

  .site-nav a, .s13-menu-primary a, .home-archive-index nav strong,
  .home-lead-cta, .home-journal-note-link, .home-action-button,
  .archive-search button, .archive-view-switch :is(a,button),
  .archive-search-clear, .archive-pagination a, .essential-text-link,
  .footer-manifesto a, .footer-newsletter button, .footer-floor a,
  .s13-search-panel :is([data-search-clear],[data-search-retry]),
  .s13-search-panel .s13-search-results a, .s13-search-more-tracks summary,
  .s13-search-pagination a, .policy-editorial a,
  .about-editorial .about-text-link, .about-editorial-contents a,
  .about-channel-links a, .contact-field :is(input,select,textarea),
  .contact-editorial-submit button {
    transition: color var(--s13-ui-time) var(--s13-ui-ease),
      border-color var(--s13-ui-time) var(--s13-ui-ease),
      background-color var(--s13-ui-time) var(--s13-ui-ease),
      text-decoration-color var(--s13-ui-time) var(--s13-ui-ease),
      opacity var(--s13-ui-time) var(--s13-ui-ease);
  }

  .footer-column b, .row-arrow, .s13-search-result-arrow,
  .s13-author-channels a b, .author-profile-links b,
  .authors-index-row > .s13-icon-arrow, .home-archive-index nav b {
    transition: color var(--s13-ui-time) var(--s13-ui-ease),
      transform var(--s13-ui-time) var(--s13-ui-ease);
  }

  /* A fast response must not dim/restore the whole archive in a single frame. */
  .archive-browser--paged [data-paged-results] { transition: opacity 240ms ease-in-out; }
  .archive-browser--paged[aria-busy="true"] [data-paged-results] { transition-delay: 120ms; }

  /* Give brief pointer crossings a quiet exit; keyboard focus remains immediate. */
  @media (hover: hover) and (pointer: fine) {
    .home-stream-title h3, .archive-cover-copy :is(h3,h4) { transition-delay: 80ms; }
    .home-stream-card:has(:is(.home-stream-art-link,.home-stream-story-link):is(:hover,:focus-visible)) h3,
    .archive-cover-card:has(:is(.archive-cover-art-link,.archive-cover-title-link):is(:hover,:focus-visible)) :is(h3,h4) {
      transition-delay: 0ms;
    }
  }
}

/* No shifting rows, giant white hover slabs or text struck out on contact. */
.collection-row:hover { padding-left: 0; }
.author-mix-year a:hover, .about-field-links a:hover,
.s13-nav-drawer-all:is(:hover,:focus-visible) { background: var(--s13-surface-hover); color: var(--s13-ink); }
.author-mix-year a:hover small { color: var(--s13-support); }
.s13-external-embed-control:hover strong { text-decoration: none; color: var(--s13-secondary); }

/* Keep a real underline, fading its colour instead of inserting/removing it. */
.home-stream-section-link { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: .25em; }
.home-stream-section-link:is(:hover,:focus-visible) { text-decoration-color: currentColor; }

/* Reduced motion removes new delays as well as durations; focus rings stay crisp. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-delay: 0s !important; animation-delay: 0s !important; }
}
