/* Below this width the inline nav does not fit on one row — use hamburger */
:root {
  --nav-collapse: 1000px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#site-header {
  position: sticky;
  top: 0;
  z-index: 60;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid #cfd6c8;
  border-radius: 10px;
  background: var(--surface, #ffffff);
  cursor: pointer;
  color: #24322a;
  flex-shrink: 0;
  margin-left: auto;
}

.nav-toggle:hover {
  background: var(--surface-soft, #f1f4ec);
}

.nav-toggle-icon {
  position: relative;
  display: block;
  width: 1.35rem;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 59;
  background: rgba(15, 22, 20, 0.22);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.nav-backdrop.is-visible {
  display: block;
}

@media (min-width: 1001px) {
  .links {
    flex-wrap: nowrap;
    align-items: center;
  }

  .nav-toggle {
    display: none !important;
  }
}

@media (max-width: 1000px) {
  /* Larger plain text for reading; headings keep explicit rem/clamp sizes */
  body {
    font-size: 1.2em;
  }

  .nav {
    position: relative;
    flex-wrap: nowrap;
    align-items: center;
  }

  .nav-toggle {
    display: flex;
  }

  #site-header .links {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 61;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 0.5rem 0 1rem;
    margin: 0;
    list-style: none;
    background: rgba(247, 248, 245, 0.98);
    border-bottom: 1px solid #e5e7e4;
    box-shadow: 0 12px 24px rgba(15, 22, 20, 0.08);
  }

  #site-header.nav-open .links {
    display: flex;
  }

  #site-header .links a {
    display: block;
    padding: 0.75rem min(4%, 1.25rem);
    font-size: 1rem;
    border-top: 1px solid #eceee9;
  }

  #site-header .links a:first-of-type {
    border-top: 0;
  }
}
