/* Table of Contents Styling */
/* Hide empty TOC (no li children) */
#toc:not(:has(li)),
#markdown-toc:not(:has(li)) {
  display: none;
}

#toc,
#markdown-toc {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px 20px;
  margin-bottom: 25px;
  font-size: 0.95em;
  /* Remove default ul indent - keep box padding via padding above */
  margin-left: 0;
  list-style-position: inside;
}

#toc::before,
#markdown-toc::before {
  content: "Table of Contents";
  display: block;
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 10px;
  color: #333;
  border-bottom: 1px solid #ddd;
  padding-bottom: 8px;
}

/* Top-level items: no indent */
#toc > li,
#markdown-toc > li {
  list-style: none;
  margin: 5px 0;
  padding-left: 0;
}

/* Nested list items */
#toc li li,
#markdown-toc li li {
  list-style: none;
  margin: 5px 0;
}

#toc a,
#markdown-toc a {
  text-decoration: none;
  color: #1863a1;
}

#toc a:hover,
#markdown-toc a:hover {
  text-decoration: underline;
  color: #0181eb;
}

/* Nested lists (h3, h4 under h2) - indent these */
#toc ul,
#markdown-toc ul {
  margin-left: 20px;
  padding-left: 0;
}
