/*
 * Custom CSS - only for things Tailwind utilities/theme cannot express.
 * Loaded after tailwind.css. Keep this file small.
 */

/* Without JavaScript the menu button cannot work, so show the mobile navigation
 * open and hide the button. (Scoped to phone/tablet widths; desktop shows inline links.) */
@media (scripting: none) and (max-width: 79.99rem) {
  .menu-button {
    display: none;
  }

  .mobile-menu.hidden {
    display: block;
  }
}

/* Pages with an in-page table of contents scroll smoothly to a chapter, unless the user
 * prefers reduced motion (then jumps are instant). Other pages are unaffected. */
@media (prefers-reduced-motion: no-preference) {
  html:has(.article-toc) {
    scroll-behavior: smooth;
  }
}

/* Respect the user's reduced-motion setting: no transitions or animation, no smooth scroll. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
