/* =========================================
   Smart TOC — Frontend Styles
   Designed to blend into any WordPress theme
   ========================================= */

.smart-toc {
    display: inline-block;
    margin: 1.2em 0;
    padding: 0.6em 1em 0.7em;
    border-left: 2.5px solid currentColor;  /* left line only */
    padding-left: 14px;
    font-size: 0.88em;
    line-height: 1.55;
    max-width: 100%;
}

/* Header row: "Table of Content" label */
.smart-toc__header {
    margin-bottom: 0.35em;
}

.smart-toc__title {
    font-weight: 500;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    opacity: 0.55;
}

/* The ordered list — no numbering */
.smart-toc__list,
.smart-toc__list ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.smart-toc__list li {
    margin: 1px 0;
}

/* Each link */
.smart-toc__list a {
    display: block;
    padding: 0.1em 0;
    color: inherit;
    text-decoration: none;
    transition: opacity 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 340px;
    line-height: 1.55;
}

.smart-toc__list a:hover {
    text-decoration: underline;
    opacity: 1;
}

/* ── Indentation by heading level ── */

/* H2 — top level */
.smart-toc__list > li > a {
    font-size: 13px;
    opacity: 1;
}

/* H3 — one level in */
.smart-toc__list > li > ol {
    padding-left: 14px;
}
.smart-toc__list > li > ol > li > a {
    font-size: 12px;
    opacity: 0.88;
}

/* H4 — two levels in */
.smart-toc__list > li > ol > li > ol {
    padding-left: 14px;
}
.smart-toc__list > li > ol > li > ol > li > a {
    font-size: 11px;
    opacity: 0.72;
}

/* H5 — three levels in */
.smart-toc__list > li > ol > li > ol > li > ol {
    padding-left: 14px;
}
.smart-toc__list > li > ol > li > ol > li > ol > li > a {
    font-size: 11px;
    opacity: 0.65;
}

/* Hide entirely if no headings were found */
.smart-toc:empty,
.smart-toc--hidden {
    display: none;
}
