/* Royal Plugins support-article scroll-spy TOC.
   Right-rail "On this page" navigation with active section highlight.
   Fixed position at ≥1280px viewport; hidden on narrower (mobile falls back
   to linear read). */

.royal-support-toc {
  --rst-gold: #C9A227;
  --rst-ink: #2C2C2C;
  --rst-muted: #6B6B6B;
  --rst-line: rgba(201, 162, 39, 0.15);
  --rst-hover: rgba(201, 162, 39, 0.06);

  position: fixed;
  top: 6rem;
  right: 2rem;
  width: 220px;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  padding: 1rem 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.8125rem;
  z-index: 10;
  display: none;
}

.royal-support-toc.rst-ready {
  display: block;
}

.royal-support-toc .rst-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rst-muted);
  padding: 0 1rem 0.5rem;
  border-bottom: 1px solid var(--rst-line);
  margin: 0 0 0.5rem 0;
}

.royal-support-toc .rst-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.royal-support-toc .rst-list li {
  margin: 0;
}

.royal-support-toc .rst-link {
  display: block;
  padding: 0.375rem 1rem;
  text-decoration: none;
  color: var(--rst-muted);
  border-left: 2px solid transparent;
  line-height: 1.4;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.royal-support-toc .rst-link:hover,
.royal-support-toc .rst-link:focus-visible {
  color: var(--rst-ink);
  background: var(--rst-hover);
  outline: none;
}

.royal-support-toc .rst-link:focus-visible {
  outline: 2px solid var(--rst-gold);
  outline-offset: -2px;
}

.royal-support-toc .rst-active {
  color: var(--rst-ink);
  border-left-color: var(--rst-gold);
  font-weight: 500;
}

/* Hide on narrower viewports — content column is 800px centered, TOC needs
   ≥220px of right-rail space plus margin, so 1280px is the threshold. */
@media (max-width: 1279px) {
  .royal-support-toc {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .royal-support-toc .rst-link {
    transition: none;
  }
}

/* Custom scrollbar on the TOC — subtle so it doesn't fight the page */
.royal-support-toc::-webkit-scrollbar {
  width: 4px;
}
.royal-support-toc::-webkit-scrollbar-thumb {
  background: var(--rst-line);
  border-radius: 2px;
}
.royal-support-toc::-webkit-scrollbar-track {
  background: transparent;
}
