/* The sidebar's height follows the reading surface, excluding related content. */
#blog-sidebar { position:relative; }
.blog-toc-panel { position:relative; }
.blog-toc-panel summary { cursor:pointer; }
#blog-toc { overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; }
#blog-toc ul { list-style:none; margin:0; padding:0; }
#blog-toc .blog-toc-children[hidden] { display:none; }
.blog-toc-link { display:block; border-left:2px solid transparent; padding:8px 10px 8px 12px; color:#777; font-size:13px; line-height:1.5; text-decoration:none; }
.blog-toc-link:hover { color:#1b0d00; }
.blog-toc-children .blog-toc-link { padding-left:28px; }
.blog-toc-link[aria-current="location"] { color:#1b0d00; font-weight:600; border-left-color:#eeb64e; background:#fff4db; }
.blog-toc-parent { color:#1b0d00; }
@media(min-width:1024px) {
  #blog-sidebar { align-self:stretch; }
  #blog-sidebar-content { position:sticky; top:var(--blog-toc-top,100px); }
  .blog-toc-panel summary { list-style:none; cursor:default; }
  .blog-toc-panel summary::-webkit-details-marker { display:none; }
  #blog-toc { max-height:max(80px,calc(100dvh - var(--blog-toc-top,100px) - var(--blog-promotion-height,0px) - 108px)); }
  /* Separate sticky tracks let the browser enforce both scroll boundaries without JS positioning. */
  #blog-promotion-track { position:absolute; top:0; left:0; width:100%; height:var(--blog-promotion-track-height); pointer-events:none; }
  #blog-sidebar .author-promotion { position:sticky; top:calc(100dvh - var(--blog-promotion-height,0px) - 20px); margin-top:0; pointer-events:auto; z-index:30; }
}
