/* site-nav.css — shared top navigation, loaded on EVERY page.
 *
 * Carries the secondary (.navlinks-sub) styling that previously lived only in
 * product-v1.css (so Story/Why pages without product-v1.css had an unstyled
 * "More" nav), plus the responsive mobile toggle and aria-current highlight.
 * Navigation no longer depends on any product-function CSS.
 *
 * Relies only on global theme tokens defined in story/story-v3.css
 * (--text, --soft, --line, --muted, --cyan) which every page loads.
 */

/* Declare --pv-cyan here too so any legacy rule referencing it resolves
   even on pages that do not load product-v1.css. */
:root { --pv-cyan: #5fe6ff; }

/* Secondary nav (moved out of product-v1.css — single source of truth). */
.navlinks-sub {
  display: flex;
  align-items: center;
  gap: var(--nav-gap);
  font-size: 12.5px;
  opacity: .92;
}
.navlinks-sub a { flex: 0 0 auto; color: var(--soft); text-decoration: none; }
.navlinks-sub a:hover { color: var(--cyan); }

/* Layout of the navigation element. */
.sitenav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
  flex-wrap: wrap;
  min-width: 0;
}
.sitenav .brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  color: var(--text, #f5f7fa);
}
.sitenav .brandmark { color: var(--cyan); font-size: 1.1em; line-height: 1; }

.navlinks-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  justify-content: flex-end;
}
.navlinks {
  display: flex;
  align-items: center;
  gap: var(--nav-gap);
  font-size: 12.5px;
}
.navlinks a, .navlinks-sub a { text-decoration: none; color: var(--soft, #758392); }
.navlinks a:hover, .navlinks-sub a:hover { color: var(--cyan); }

/* Current page indicator. */
.navlinks a[aria-current="page"],
.navlinks-sub a[aria-current="page"],
.brand[aria-current="page"] {
  color: var(--text, #f5f7fa);
  font-weight: 600;
}
.navlinks a[aria-current="page"]::after,
.navlinks-sub a[aria-current="page"]::after {
  content: "";
  display: block;
  height: 2px;
  background: var(--cyan);
  margin-top: 2px;
}

/* Mobile menu toggle (hidden on desktop). */
.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line, rgba(255,255,255,.10));
  color: var(--text, #f5f7fa);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.nav-toggle:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .navlinks-wrap {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0 4px;
    margin-top: 6px;
    border-top: 1px solid var(--line, rgba(255,255,255,.10));
  }
  .navlinks-wrap.open { display: flex; }
  .navlinks, .navlinks-sub {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
  }
  .navlinks-sub {
    opacity: 1;
    padding-top: 8px;
    border-top: 1px dashed var(--line, rgba(255,255,255,.10));
  }
}
