/* Shared by every page through templates/base.html (P8, ADR 0017): the theme tokens,
   the skip link, the visually-hidden utility and .hidden. Page sheets load after it. */

/* National Park Theme Colors */
:root {
  --park-green: #2d5016;
  --park-light-green: #5d8a3a;
  --park-brown: #8b4513;
  --park-tan: #d2b48c;
  --park-cream: #f5f5dc;
  --park-gold: #daa520;
  --park-dark-brown: #654321;
  --park-sage: #87a96b;

  /* Darker stops for gradients under white text (P8 PR 3, ADR 0017): light-green and gold
     stay as they are for the uses without text on them. */
  --park-text-green: #3d6b24;
  --park-text-gold: #7a5a0a;
  --marker-unvisited: #b84300;
  --marker-unvisited-border: #8a3000;
  --shadow-light: rgb(0 0 0 / 10%);
  --shadow-medium: rgb(0 0 0 / 15%);
  --shadow-heavy: rgb(0 0 0 / 25%);
}

/* Off-screen for sighted users, present for assistive tech. The skip link uses the same
   rule until it is focused, then shows as a button at the top-left corner (R400). */
.visually-hidden,
.skip-link:not(:focus-visible) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus-visible {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 10000;
  padding: 0.75rem 1.25rem;
  background: var(--park-green);
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;

  /* The white halo first, so the green ring stays visible on the green header. */
  box-shadow:
    0 0 0 2px #fff,
    0 4px 12px var(--shadow-heavy);
}

/* Programmatic focus (the skip link's target) draws no ring or halo of its own. */
main:focus-visible {
  outline-color: transparent;
  box-shadow: none;
}

/* Utility: shared by the dashboard, the 2FA page, the account forms and menu.js. */
.hidden {
  display: none !important;
}

/* One focus ring for every control (R398). The green reads 8.36:1 on the cream cards and
   9.25:1 on white; the white halo under it reads 9.25:1 on the green header and 4.07:1 on
   the light-green gradient, so the ring is visible on every background the site has. */
:focus-visible {
  outline: 3px solid var(--park-green);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #fff;
}

/* Placeholder text on every page (R401): opaque #6c6c60 reads 4.80:1 on the cream cards and
   5.31:1 on white. */
::placeholder {
  color: #6c6c60;
  opacity: 1;
}

/* Visitors who asked for less motion get none (R399). The 0.01ms keeps animationend
   and transitionend firing, so scripts that wait on them still run; the zero delays stop
   the staggered cards (index, 2FA, contact) from popping in late. */
@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}
