/* Stewardship Compute — shared UX enhancements (loaded on every page) */

/* Self-hosted type system (variable woff2 in /fonts). Falls back to system serif/sans
   until the files load, so no page breaks. Defined here so every page inherits it. */
:root {
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
@font-face { font-family:"Fraunces"; src:url("/fonts/fraunces-var.woff2") format("woff2"); font-weight:100 900; font-style:normal; font-display:swap; }
@font-face { font-family:"Fraunces"; src:url("/fonts/fraunces-var-italic.woff2") format("woff2"); font-weight:100 900; font-style:italic; font-display:swap; }
@font-face { font-family:"Inter"; src:url("/fonts/inter-var.woff2") format("woff2"); font-weight:100 900; font-style:normal; font-display:swap; }

/* In-page anchors clear the fixed desktop header */
@media (min-width: 981px) {
  html { scroll-padding-top: 92px; }
}

/* Visible keyboard focus */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.portal-link:focus-visible,
.sai-card:focus-visible,
.tool-card:focus-visible {
  outline: 2px solid #b89052;
  outline-offset: 3px;
}

/* Skip to content */
.skip-link {
  position: fixed;
  top: -64px;
  left: 12px;
  z-index: 10001;
  background: #b89052;
  color: #1a2318;
  font: 800 0.9rem system-ui, -apple-system, "Segoe UI", sans-serif;
  padding: 10px 16px;
  border-radius: 0 0 6px 6px;
  text-decoration: none;
  transition: top 180ms ease;
}
.skip-link:focus { top: 0; }

/* Scroll progress bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, #b89052, #d4aa6a);
  z-index: 10000;
  pointer-events: none;
  transition: width 90ms linear;
}

/* Back to top (bottom-left, clear of the Services widget) */
.to-top {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 9990;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(184, 144, 82, 0.5);
  border-radius: 50%;
  background: rgba(26, 35, 24, 0.86);
  color: #d4aa6a;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease, background-color 180ms ease;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: rgba(36, 51, 41, 0.96); }
.to-top svg { width: 20px; height: 20px; fill: currentColor; }

/* Missing button variant — fixes invisible partner-track buttons on get-involved */
.button.dark { background: #2e5545; color: #f4f1ec; }
.button.dark:hover { background: #3d7060; }

/* Active page indicator in the nav */
.nav-links a[aria-current="page"] { color: #d4aa6a; }
.nav-links a[aria-current="page"]::after { right: 0 !important; }

/* Mobile menu toggle */
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    position: absolute;
    top: 16px;
    right: 14px;
    width: 42px;
    height: 36px;
    padding: 8px 7px;
    background: transparent;
    border: 0;
    cursor: pointer;
    z-index: 13;
  }
  .nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #f4f1ec;
    transition: transform 220ms ease, opacity 200ms ease;
  }
  .topbar .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-top: 14px;
  }
  .topbar.nav-open {
    background: rgba(18, 26, 19, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding-bottom: 16px;
  }
  .topbar.nav-open .nav-links { display: flex; }
  .topbar .nav-links li { width: 100%; }
  .topbar .nav-links a,
  .topbar .nav-links button {
    display: block;
    width: 100%;
    padding: 11px 2px;
    font-size: 0.98rem;
    border-bottom: 1px solid rgba(244, 241, 236, 0.07);
  }
  .topbar.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .topbar.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .topbar.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-progress { transition: none; }
  .to-top { transition: opacity 120ms linear; }
  .nav-toggle span { transition: none; }
}
