/* Shared navigation: site destinations, section destinations, and page outline. */
:root { --site-header-height: 64px; --section-nav-height: 54px; }
html { scroll-padding-top: calc(var(--site-header-height) + var(--section-nav-height) + 20px); }
.site-header { flex-wrap: nowrap; }
.site-logo { min-height: 44px; }
.site-menu-toggle { display: none; }

.section-nav {
  position: sticky;
  top: var(--site-header-height);
  z-index: 90;
  border-bottom: 1px solid var(--rule);
  background: var(--ink-soft);
}
.section-nav-toggle { display: none; }
.section-nav-links { display: flex; gap: 24px; }
.section-nav-links a {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 12px 0;
  border-bottom: 2px solid transparent;
  color: var(--paper-mid);
  font-size: 14px;
  line-height: 1.4;
}
.section-nav-links a:hover { color: var(--paper); }
.section-nav-links a[aria-current] { border-color: var(--accent); color: var(--paper); }
.section-nav a:focus-visible { outline-offset: -2px; }

.vc-doc-toc { border: 1px solid var(--rule); background: var(--ink-soft); border-radius: 8px; }
.page-outline summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.page-outline summary::-webkit-details-marker { display: none; }
.page-outline summary::after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  flex: 0 0 auto;
}
.page-outline[open] summary::after { transform: rotate(225deg); }
.page-outline summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.page-outline-links { padding: 0 20px 8px; }
.page-outline-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  color: var(--paper-mid);
  font-size: 14px;
  line-height: 1.5;
}
.page-outline-links a:hover { color: var(--paper); }
@media (min-width: 900px) {
  .vc-doc-toc { position: sticky; top: calc(var(--site-header-height) + var(--section-nav-height) + 24px); }
}

@media (max-width: 1100px) {
  :root { --site-header-height: 72px; --section-nav-height: 68px; }
  .site-header { height: 72px; min-height: 72px; padding: 12px var(--gutter); gap: 12px; }
  .site-logo { font-size: 12px; letter-spacing: .04em; }
  .site-logo-name { display: inline; }
  .js .site-header .site-menu-toggle {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--ghost-bd);
    border-radius: 8px;
    background: var(--ghost);
    color: var(--paper);
    cursor: pointer;
  }
  .site-menu-toggle:hover { border-color: var(--paper-dim); }
  .site-menu-icon { position: relative; width: 20px; height: 16px; }
  .site-menu-icon::before, .site-menu-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
    transition: transform .18s ease;
  }
  .site-menu-icon::before { top: 4px; }
  .site-menu-icon::after { top: 11px; }
  .site-menu-toggle[aria-expanded="true"] .site-menu-icon::before { transform: translateY(3.5px) rotate(45deg); }
  .site-menu-toggle[aria-expanded="true"] .site-menu-icon::after { transform: translateY(-3.5px) rotate(-45deg); }
  .site-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }
  .js .site-header .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100dvh - var(--site-header-height));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px var(--gutter) 24px;
    background: var(--ink);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 24px 32px rgba(0, 0, 0, .3);
  }
  .js .site-header .site-nav.is-open { display: flex; }
  .site-nav a {
    display: flex;
    align-items: center;
    min-height: 56px;
    padding: 12px 4px;
    border-top: 0;
    border-bottom: 1px solid var(--rule);
    font: 500 18px/1.4 var(--ff-body);
    letter-spacing: 0;
  }
  .site-nav a[aria-current] { color: var(--paper); }
  .site-nav a[aria-current]:not(.nav-cta)::after {
    content: '';
    width: 6px;
    height: 6px;
    margin-left: auto;
    border-radius: 50%;
    background: var(--accent);
  }
  .site-nav .nav-cta { justify-content: center; min-height: 48px; margin-top: 20px; padding: 12px 16px; border: 0; border-radius: 6px; font-size: 16px; }

  .js .section-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 68px;
    padding: 10px 0;
    gap: 16px;
    border: 0;
    background: transparent;
    color: var(--paper);
    text-align: left;
    font: inherit;
    cursor: pointer;
  }
  .section-nav-context { display: grid; gap: 2px; }
  .section-nav-name { color: var(--paper-mid); font-size: 12px; line-height: 1.4; }
  .section-nav-current { font-size: 15px; font-weight: 500; line-height: 1.4; }
  .section-nav-action { display: flex; align-items: center; gap: 10px; flex-shrink: 0; color: var(--paper-mid); font-size: 13px; }
  .section-nav-action svg { transition: transform .18s ease; }
  .section-nav-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .section-nav-links { display: grid; grid-template-columns: 1fr; gap: 0; padding: 8px 0 16px; }
  .js .section-nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 8px var(--gutter) 16px;
    max-height: calc(100dvh - var(--site-header-height) - var(--section-nav-height));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--ink-soft);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 24px 32px rgba(0, 0, 0, .3);
  }
  .js .section-nav-links.is-open { display: grid; }
  .section-nav-links a { min-height: 48px; padding: 12px; border: 0; border-radius: 5px; font-size: 16px; }
  .section-nav-links a:hover { background: var(--ghost); }
  .section-nav-links a[aria-current] { background: var(--accent-soft); box-shadow: inset 3px 0 var(--accent); }
  .section-nav-links a[aria-current]::after { content: '✓'; margin-left: auto; padding-left: 12px; color: var(--accent); }
  /* Full navigation stays usable if scripting is disabled. */
  html:not(.js) .site-header { position: static; height: auto; flex-wrap: wrap; }
  html:not(.js) .section-nav { position: static; }
}

@media (max-width: 640px) {
  .footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 0 20px; }
  .footer-links a { display: flex; align-items: center; min-height: 44px; padding: 8px 0; font: 14px/1.5 var(--ff-body); letter-spacing: 0; }
  /* The parent link provides a way back without a multi-line breadcrumb trail. */
  .breadcrumbs ol { padding: 0; }
  .breadcrumbs li { font-family: var(--ff-body); font-size: 13px; letter-spacing: 0; }
  .breadcrumbs li:not(:nth-last-child(2)) { display: none; }
  .breadcrumbs li::after { display: none; }
  .breadcrumbs a { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 0; }
  .breadcrumbs a::before { content: '‹'; font-size: 20px; line-height: 1; color: var(--paper-mid); }
}
