/* Mobile navigation menu, progressive enhancement. Linked after styles.css.
   Uses the existing colour/type variables. Without JS the toggle keeps its
   [hidden] attribute and the nav stays visible at every width; with JS the
   header gains .navigation-ready and the collapsed menu is enabled. */

[hidden] { display: none !important; }

.menu-toggle {
  display: none;
  -webkit-appearance: none;
  appearance: none;
  align-items: center;
  gap: .4rem;
  padding: .45rem .6rem;
  font: inherit;
  font-size: .82rem;
  color: var(--ink-2);
  background: none;
  border: 1px solid var(--rule-2);
  border-radius: 3px;
  cursor: pointer;
}

.menu-toggle:hover { color: var(--ink); border-color: var(--ink-2); }

.menu-toggle:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.menu-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  width: 16px;
  height: 16px;
}

.menu-icon span {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}

.site-nav a[aria-current="page"] { color: var(--ink); }

@media (max-width: 60rem) {
  .site-head .head-row {
    flex-wrap: wrap;
    height: auto;
    min-height: 4.25rem;
    gap: .75rem;
    row-gap: 0;
  }

  .site-head .wordmark, .site-head .head-cta, .site-head .menu-toggle { margin-block: .7rem; }

  /* Without JS: nav stays visible, full width under the logo/CTA row. */
  .site-head:not(.navigation-ready) .site-nav {
    display: flex;
    flex-wrap: wrap;
    flex-basis: 100%;
    order: 10;
    gap: 1rem;
    padding: .5rem 0;
    border-top: 1px solid var(--rule);
  }

  /* With JS: reveal the toggle, collapse the nav. */
  .site-head.navigation-ready .menu-toggle { display: inline-flex; }

  .site-head.navigation-ready .site-nav { display: none; }

  /* Open: full-width panel in normal flow, below the header row. */
  .site-head.navigation-ready.navigation-open .site-nav {
    display: flex;
    flex-direction: column;
    flex-basis: 100%;
    order: 10;
    gap: 0;
    padding: .5rem 0;
    border-top: 1px solid var(--rule);
  }

  .site-head.navigation-ready.navigation-open .site-nav a {
    font-size: 1rem;
    padding: .7rem 0;
    border-bottom: 1px solid var(--rule);
  }

  .site-head.navigation-ready.navigation-open .site-nav a:last-child {
    border-bottom: 0;
  }

  .site-head .head-cta { padding: .45rem .75rem; font-size: .8rem; }
}

@media (max-width: 24rem) {
  .site-head .head-row { gap: .5rem; }
  .site-head .head-cta { padding: .4rem .55rem; font-size: .76rem; }
  .site-head .menu-toggle { padding: .4rem .45rem; font-size: .78rem; }
  .site-head .wordmark { gap: .4rem; font-size: 1.05rem; }
  .site-head .wordmark .mark { font-size: 1.15rem; }
}
