/* Table of contents column styles (scoped to the aside inside .post-with-toc) */
.post-with-toc aside .toc { font-family: inherit; color: #6b6e76; text-transform: none !important; font-size: 16px; }
.post-with-toc { display:flex; flex-wrap:wrap; align-items: flex-start; }
.post-with-toc aside {
    position: -webkit-sticky;
    position: sticky;
    top: 100px;
    align-self: flex-start;
    z-index: 3;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 0.5rem;
    /* Custom thin scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #bbb #fff;
}
/* Chrome, Edge, Safari */
.post-with-toc aside::-webkit-scrollbar {
    width: 6px;
    background: #fff;
}
.post-with-toc aside::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
}
.post-with-toc aside::-webkit-scrollbar-button {
    display: none;
    height: 0;
} 
.post-with-toc aside .toc-inner {
    position: static;
    background: #ffffff;
    /* border-left: 1px solid #0B120E24; */
    border-radius: 0;
    padding: 1rem;
}
.post-with-toc aside .toc-title {
    margin: 0 0 2rem 0;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #444;
}
.post-with-toc aside .toc-list{ list-style:none; margin:0; padding:0; }
.post-with-toc aside .toc-list li{ margin: 12px 0 0; }
.post-with-toc aside .toc-list a {
    display: block;
    color: inherit;
    text-decoration: none;
    font-weight: 400;
    text-transform: none !important;
    padding-left: 16px;
    background: transparent;
    font-size: 16px;
    border-left: 1px solid transparent;
    transition: all 0.2s ease;
}
.post-with-toc aside .toc-list a:hover {
    text-decoration: underline;
    background-color: rgba(0, 82, 204, 0.05);
    border-left: 1px solid #1868d8;
    color: #1868d8;
}
@media (max-width: 991px) { .post-with-toc aside{ position: static; } .post-with-toc aside .toc-inner{ position: static; top: auto; box-shadow:none; border:none; padding:0; } }
/* On small screens, hide the page 'On this page' TOC but keep the series list visible
     and ensure aside is not sticky and appears below content. */
@media (max-width: 991px) {
    .post-with-toc aside { position: static; top: auto; align-self: auto; max-height: none; overflow: visible; padding-right: 0; }
    .post-with-toc aside .toc-inner { padding: 0.5rem 0; }
    /* hide only the page TOC title + list */
    .post-with-toc aside .toc-inner .toc-title,
    .post-with-toc aside .toc-inner .toc-list { display: none; }
    /* ensure series (toc-series) stays visible and looks ok */
    .post-with-toc aside .toc-series { margin-top: 0; padding-top: 0; border-top: none; }
}
/* Series / accordion styles inside the TOC (scoped) */
.post-with-toc aside .toc-series {
    margin-top: 2.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
}
.post-with-toc aside .toc-series .entity-title { font-weight: 600; font-size: 16px; margin-bottom: 0.35rem; color: #222; text-transform: none !important; }
.post-with-toc aside .toc-series details { margin-bottom: 0.35rem; }
.post-with-toc aside .toc-series summary { cursor: pointer; padding: 0.4rem 0.45rem 0.4rem 16px; display:block; font-weight:400; color: inherit; border-radius:0; text-transform: none !important; background: transparent; }
.post-with-toc aside .toc-series summary::-webkit-details-marker { display:none; }
.post-with-toc aside .toc-series summary::after { content: "❯"; float: right; transform: rotate(0); transition: transform 0.15s ease; }
/* Khi accordion mở, không có border trái, giữ style bình thường */
.post-with-toc aside .toc-series details[open] summary {
    padding-left: 16px;
    background: transparent;
    box-shadow: none;
    color: inherit;
    font-weight: 400;
    border-left: none;
}
.post-with-toc aside .toc-series details[open] summary::after { transform: rotate(90deg); }
.post-with-toc aside .toc-series .topic-list { list-style:none; margin:0.5rem 0 0; padding-left:1rem; }
.post-with-toc aside .toc-series .topic-list li { margin: 12px 0 0; }
.post-with-toc aside .toc-series .topic-list a {
    display: block;
    color: inherit;
    text-decoration: none;
    font-weight: 400;
    text-transform: none !important;
    padding-left: 16px;
    background: transparent;
    font-size: 16px;
    border-left: 1px solid transparent;
    transition: all 0.2s ease;
}
.post-with-toc aside .toc-series .topic-list a.current {
      color: #1868d8;
      font-weight: 400; 
      text-decoration: underline;
      background: transparent;
      transition: all 0.2s ease;
}
/* Active TOC link for headings when user scrolls */
.post-with-toc aside .toc-list a.active {
    color: #1868d8;
    font-weight: 400;
    border-left: 1px solid #1868d8;
    background-color: rgba(0, 82, 204, 0.05);
    transition: all 0.2s ease;
}
/* Topic page link replacing accordion summary */
.post-with-toc aside .toc-series .series-topic-group { margin-bottom: 0.35rem; }
.post-with-toc aside .toc-series .series-topic-link {
    display: block;
    padding: 0.4rem 0.45rem 0.4rem 16px;
    font-weight: 600;
    color: #222;
    text-decoration: none;
    font-size: 15px;
    text-transform: none !important;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
}
.post-with-toc aside .toc-series .series-topic-link:hover {
    color: #1868d8;
    border-left-color: #1868d8;
    background-color: rgba(0, 82, 204, 0.05);
}
