/* Header menu for narrow screens. Marco asked for this on 11 Sep 2026: the nav used to disappear
   below 900px with nothing in its place.
   Loaded AFTER each page's own <style>, so these rules beat that page's `nav { display: none }`. */

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #17211d;
  cursor: pointer;
}

.nav-toggle:hover {
  background: #f0f5f2;
  color: #176b4b;
}

.nav-toggle:focus-visible {
  outline: 2px solid #176b4b;
  outline-offset: 2px;
}

.nav-toggle .nav-icon-close,
.nav-toggle[aria-expanded="true"] .nav-icon-menu {
  display: none;
}

.nav-toggle[aria-expanded="true"] .nav-icon-close {
  display: block;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
  }

  header .wrap.nav {
    position: static; /* the panel anchors to <header>, not to this centred wrapper */
  }

  /* Closed by default; the button opens it. Beats the page's own rule at this width. */
  header nav {
    display: none;
  }

  /* Floats under the header bar instead of pushing it open: the bar keeps its height, so the logo
     does not jump and the page below does not reflow. Both headers are position:sticky, so this
     anchors to the header. */
  header nav.is-open {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 4px 24px 18px;
    background: #fff;
    border-top: 1px solid #e8ecea;
    box-shadow: 0 14px 26px rgba(23, 33, 29, 0.09);
    z-index: 30;
  }

  /* Separators BETWEEN rows: a top border never leaves a dangling line under the last one, whichever
     link the page happens to end with. */
  header nav.is-open a {
    padding: 15px 2px;
    font-size: 16px;
    color: #17211d;
  }

  header nav.is-open a + a {
    border-top: 1px solid #eef2f0;
  }

  /* The assessment is what the site is for, so it reads as the action rather than a sixth link.
     order:1 moves it under the links without touching the page's markup or the desktop nav. */
  header nav.is-open a[href="/start/"] {
    order: 1;
    margin-top: 14px;
    padding: 14px 18px;
    border-top: 0;
    border-radius: 999px;
    background: #176b4b;
    color: #fff;
    font-weight: 700;
    text-align: center;
  }
}

/* The page you are on, marked once and quietly. */
header nav a[aria-current="page"] {
  color: #176b4b;
  font-weight: 700;
}
