/* =========================================
   Shared case-study Table of Contents
   Same component on every Product Design case study.
   Uses the site's shared tokens (css/tokens.css) so it
   looks the same everywhere regardless of each project's
   own accent palette.
   ========================================= */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

.cs-toc {
  position: sticky;
  /* Set from JS to the real, measured header height — never a guess —
     so this can never render clipped behind the fixed header. */
  top: var(--cs-header-h, 92px);
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft, rgba(15, 23, 32, 0.08));
}

.cs-toc__rail {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  /* Horizontal-only strip: tell touch browsers not to guess, so a
     vertical swipe that starts here still scrolls the page. */
  touch-action: pan-x;
  padding-top: 10px;
  padding-bottom: 10px;
  scrollbar-width: none;
}

.cs-toc__rail::-webkit-scrollbar {
  display: none;
}

.cs-toc__link {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: var(--radius-pill, 999px);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: "Montserrat", sans-serif;
  color: var(--ink-500, #5d6a7e);
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--motion-fast, 0.18s) var(--ease-standard, ease),
    color var(--motion-fast, 0.18s) var(--ease-standard, ease);
}

.cs-toc__link:hover {
  background: var(--surface-sunken, #f4f5f7);
  color: var(--ink-900, #10131a);
}

.cs-toc__link.is-active {
  background: var(--blue, #398fba);
  color: #fff;
}

.cs-toc__link:focus-visible {
  outline: 2px solid var(--blue, #398fba);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .cs-toc__link {
    transition: none;
  }
}
