/* Hamburger menu for phones and tablets, shared by the home, races and clubs pages.
   Above 1000px the same links sit in the header and the button is hidden. */
.menu-btn, #site-menu .menu-social { display: none; }

@media (max-width: 1000px) {
  .nav .nav-inner { gap: 8px; }
  .nav-inner > .social { margin-left: auto; }

  .nav .menu-btn {
    display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0;
    border: 0; border-radius: 50%; background: var(--ink); color: var(--paper); cursor: pointer;
  }
  .menu-btn i {
    grid-area: 1 / 1; width: 18px; height: 2.5px; border-radius: 2px; background: currentColor;
    transition: transform 0.25s var(--ease-out), opacity 0.15s;
  }
  .menu-btn i:nth-child(1) { transform: translateY(-6px); }
  .menu-btn i:nth-child(3) { transform: translateY(6px); }
  .menu-btn[aria-expanded="true"] i:nth-child(1) { transform: rotate(45deg); }
  .menu-btn[aria-expanded="true"] i:nth-child(2) { opacity: 0; }
  .menu-btn[aria-expanded="true"] i:nth-child(3) { transform: rotate(-45deg); }

  #site-menu {
    position: absolute; top: 100%; left: 0; right: 0; padding: 4px var(--gutter) 20px;
    background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 24px 32px -20px rgba(44, 32, 22, 0.45);
    visibility: hidden; opacity: 0; transition: opacity 0.2s, visibility 0.2s;
  }
  #site-menu.is-open { visibility: visible; opacity: 1; }
  #site-menu .nav-links { display: grid; gap: 0; }
  #site-menu .nav-links li + li { border-top: 1px solid var(--line); }
  #site-menu .nav-links a {
    display: flex; width: 100%; min-height: 56px; padding: 0 4px; border-radius: 0;
    background: none; color: var(--ink); font-weight: 900; font-size: 1.125rem;
  }
  #site-menu .nav-links a:hover, #site-menu .nav-links a[aria-current="page"] { color: var(--jelly); }
}

/* Phones: the header keeps Instagram; Facebook and Strava move into the menu */
@media (max-width: 640px) {
  .nav-inner > .social a:not(:first-child) { display: none; }
  #site-menu .menu-social { display: flex; margin-top: 16px; }
}
