/* JP + CoPilot: 2025-12-18 Thu: Add per-page ToC in a sticky right panel (4 of 5) */
/* Two-column layout: main content + sticky right-hand ToC */
@media (min-width: 1100px) {
  .content-with-right-toc {
    display: grid;
    grid-template-columns: 1fr 200px; /* content | right toc */
    gap: 1.5rem;
    align-items: start;
  }

  .right-toc {
    position: sticky;
    top: 6rem; /* below the topbar */
    max-height: calc(100vh - 7rem);
    overflow: auto;
    border-left: 1px solid var(--MAIN-BORDER-color, #ddd);
    padding-left: 1rem;
    font-size: 0.95rem;
  }

  .right-toc__title {
    font-weight: 600;
    margin-bottom: 0.5rem;
  }

  /* Make nested lists tidy */
  .right-toc ul {
    margin: 0;
    padding-left: 1rem;
  }
}

/* On small screens, collapse to a single column and hide the inline ToC
   (users can still use Relearn's built-in topbar ToC overlay button). */
/* Hide the right-hand ToC on small screens (mobile) */
@media (max-width: 1099px) {
  .content-with-right-toc {
    display: block;
  }
  .right-toc {
    display: none !important;
  }
}

/* Hide the right-hand ToC when printing */
@media print {
  .right-toc {
    display: none !important;
  }
}


/* For hugo-bcp/static/js/right-toc-scrollspy.js */
/* Strong highlight for active ToC item */
.right-toc li.active > a {
  background-color: var(--PRIMARY-color, #0078d4); /* bright blue background */
  color: #fff;                                     /* white text for contrast */
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 4px;
  display: inline-block;
}

/* Optional: subtle highlight for ancestor items */
.right-toc li.active-ancestor > a {
  background-color: rgba(0, 120, 212, 0.1); /* faint blue background */
  color: var(--PRIMARY-color, #0078d4);
  font-weight: 600;
  border-radius: 4px;
  display: inline-block;
}
