/*
 * Auto Table of Contents – Styles
 * css/toc.css
 *
 * Structural and typographic defaults only.
 * Colours and spacing that vary per-instance are applied
 * inline by JS from the config passed via wp_localize_script().
 */

.actoc-nav {
    border-radius: 4px;
    padding: 16px 0px;
    margin: 0 0 28px;
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 480px;
    /* background, border-color set by JS */
}

.actoc-nav.is-sticky {
    position: sticky;
    align-self: flex-start;
    z-index: 1; /* Keep below nav dropdown canvases */
    /* top set by JS */
}

.actoc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 10px;
}

.actoc-title {
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.07em;
    margin: 0;
    /* color set by JS */
}

.actoc-toggle {
    background: none;
    border-width: 1px;
    border-style: solid;
    border-radius: 3px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1.4;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    /* border-color, color set by JS */
}

.actoc-toggle:hover {
    /* background, color set by JS via .is-toggle-hover — see toc.js */
}

.actoc-list {
    margin: 0;
    padding: 0;
}

.actoc-list[hidden] {
    display: none;
}

/* Ordered list indentation */
ol.actoc-list {
    padding-left: 18px;
}

.actoc-item {
    list-style: none;
    margin: 4px 0;
}

ol.actoc-list .actoc-item {
    list-style: decimal;
}

.actoc-h3 {
    font-size: 0.88em;
    opacity: 0.85;
    /* padding-left set by JS */
}

.actoc-link {
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    /* color set by JS */
}

.actoc-link:hover,
.actoc-link.actoc-active {
    /* color, border-color set by JS */
}

.actoc-link.actoc-active {
    font-weight: 600;
}

/* Visually-hidden anchor spans injected into headings */
.actoc-anchor {
    display: block;
    position: relative;
    top: 0;
    visibility: hidden;
    pointer-events: none;
}
