/*!
 * "On this page" sidebar v1.0.0 (pairs with toc.js)
 * Source: robiriondo/playground, templates/toc-sidebar/
 *
 * Theme it per site with these custom properties (on :root or any parent):
 *   --toc-accent   active link, rule and button color
 *   --toc-accent-text  button text color
 *   --toc-text     link color
 *   --toc-muted    title color
 *   --toc-line     left rule color
 *   --toc-bg       mobile box background
 *   --toc-font     font family
 *   --toc-top      distance from the top when sticky (height of a fixed header)
 *   --toc-width    sidebar width
 *   --toc-max      max width of sidebar + article together
 */
.toc-layout {
  --toc-accent: #1c5dbb;
  --toc-accent-text: #fff;
  --toc-text: #3d4a57;
  --toc-muted: #6b7783;
  --toc-line: #d9e0e7;
  --toc-bg: #f4f7f9;
  --toc-font: inherit;
  --toc-top: 96px;
  --toc-width: 260px;
  --toc-max: 1160px;
  --toc-gutter: 16px;
  display: block;
  padding-inline: var(--toc-gutter);
}
.toc { font-family: var(--toc-font); margin: 0 0 1.75rem; }
.toc-box { border: 1px solid var(--toc-line); border-radius: 10px; background: var(--toc-bg); padding: 0.85rem 1rem; }
.toc-title {
  cursor: pointer; list-style: none; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--toc-muted); display: flex; justify-content: space-between; align-items: center;
}
.toc-title::-webkit-details-marker { display: none; }
.toc-title::after { content: "+"; font-size: 1.1rem; font-weight: 400; letter-spacing: 0; }
.toc-box[open] .toc-title::after { content: "\2212"; }
/* ".toc" in front of each rule so a site's own list and link styles
   (article lists are often numbered and links underlined) do not leak in. */
.toc .toc-list { list-style: none; margin: 0.9rem 0 0; padding: 0; border-left: 2px solid var(--toc-line); }
.toc .toc-item { margin: 0; padding: 0; }
.toc .toc-item::marker { content: none; }
.toc .toc-item a {
  display: block; padding: 0.32rem 0 0.32rem 1rem; margin-left: -2px; border-left: 2px solid transparent;
  color: var(--toc-text); text-decoration: none; font-size: 0.92rem; line-height: 1.4;
}
.toc .toc-h3 a { padding-left: 1.9rem; font-size: 0.87rem; }
.toc .toc-item a:hover { color: var(--toc-accent); }
.toc .toc-item a[aria-current="true"] { color: var(--toc-accent); border-left-color: var(--toc-accent); font-weight: 600; }
.toc-item a:focus-visible, .toc-cta:focus-visible, .toc-title:focus-visible { outline: 2px solid var(--toc-accent); outline-offset: 2px; }
.toc a.toc-cta {
  display: inline-block; margin-top: 1.1rem; padding: 0.6rem 1rem; border-radius: 8px;
  background: var(--toc-accent); color: var(--toc-accent-text); font-weight: 600; font-size: 0.95rem; text-decoration: none;
}
.toc a.toc-cta::after { content: " \2192"; }
.toc a.toc-cta:hover { filter: brightness(0.92); text-decoration: none; }

/* Headings land below a fixed header when jumped to. */
.toc-layout h2[id], .toc-layout h3[id] { scroll-margin-top: calc(var(--toc-top) - 8px); }

@media (min-width: 1024px) {
  .toc-layout {
    display: grid; grid-template-columns: var(--toc-width) minmax(0, 1fr); column-gap: clamp(2rem, 4vw, 4rem);
    max-width: var(--toc-max); margin-inline: auto; align-items: start;
  }
  .toc { position: sticky; top: var(--toc-top); margin: 0; max-height: calc(100vh - var(--toc-top) - 24px); overflow-y: auto; }
  .toc-box { border: 0; background: none; padding: 0; }
  .toc-title { cursor: default; pointer-events: none; }
  .toc-box .toc-title::after, .toc-box[open] .toc-title::after { content: none; }
}

@media print { .toc { display: none; } .toc-layout { display: block; } }
@media (prefers-reduced-motion: reduce) { .toc-item a { transition: none; } }
