/* Extra rules that Tailwind utilities cannot express. Loaded after the compiled
   Tailwind sheet, so these win on equal specificity. */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem; /* keep anchor targets clear of the fixed header */
}

/* Reveal-on-scroll. Elements only get .reveal from the markup, and we hide them
   only when JavaScript can run (see the noscript fallback in each page). */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* The reveal transform would otherwise cancel the hover lift. */
.transform-hover:hover {
  transform: translateY(-5px) !important;
}

/* Keyboard-only skip link. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: #003366;
  color: #fff;
  padding: .5rem 1rem;
  border-radius: .375rem;
}

/* Collapsed navigation on small screens. */
@media (max-width: 767px) {
  #site-nav.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #fff;
    padding: .5rem 1rem 1rem;
    box-shadow: 0 12px 24px rgba(16, 24, 40, .12);
  }

  #site-nav.is-open a {
    padding: .625rem .25rem;
    border-bottom: 1px solid #f1f5f9;
  }

  /* space-x-8 indents every item but the first once the list stacks. */
  #site-nav.is-open > a {
    margin-left: 0;
  }

  #site-nav.is-open > a[aria-current="page"] {
    color: #003366;
    font-weight: 600;
    border-bottom-color: #e2e8f0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Print-friendly: drop the fixed chrome. */
@media print {
  header,
  #back-to-top {
    display: none;
  }
}
