/* AlexHost TOC */

h2[id],
h3[id] {
    scroll-margin-top: 30px;
}

/* Container */
#alx-toc {
    background: #fff;
    border: 1px solid rgba(45, 55, 72, 0.08);
    border-radius: 16px;
    padding: 16px 20px 20px;
    margin: 0 0 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    max-width: 680px;
    counter-reset: alx-toc-h2;
}

/* Toggle button */
.alx-toc__toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 100%;
    text-align: left;
    color: inherit;
}

.alx-toc__title {
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

/* Arrow */
.alx-toc__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(240, 82, 67, 0.08);
    flex-shrink: 0;
    transition: background 0.15s;
}

.alx-toc__arrow::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid #f05243;
    border-bottom: 1.5px solid #f05243;
    transform: rotate(45deg);
    margin-top: -3px;
    transition:
        transform 0.2s ease,
        margin-top 0.2s ease;
}

.alx-toc--closed .alx-toc__arrow::after {
    transform: rotate(-135deg);
    margin-top: 3px;
}

.alx-toc__toggle:hover .alx-toc__arrow {
    background: rgba(240, 82, 67, 0.14);
}

/* Divider */
#alx-toc-nav {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(45, 55, 72, 0.06);
}

/* Reset theme list styles — important overrides .post__content ul */
#alx-toc-nav ul,
#alx-toc-nav ul li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

#alx-toc-nav ul li::marker {
    content: none !important;
}

/* H2 items */
.alx-toc__h2 {
    counter-increment: alx-toc-h2;
    counter-reset: alx-toc-h3;
}

.alx-toc__h2 + .alx-toc__h2 {
    margin-top: 4px !important;
}

.alx-toc__h2 > a {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: #2d3748;
    text-decoration: none;
    padding: 5px 8px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition:
        background 0.15s,
        color 0.15s;
    line-height: 1.4;
}

.alx-toc__h2 > a::before {
    content: counter(alx-toc-h2) '.';
    color: #f05243;
    font-weight: 600;
    font-size: 13px;
    min-width: 18px;
    flex-shrink: 0;
}

.alx-toc__h2 > a:hover {
    color: #f05243;
    background: rgba(240, 82, 67, 0.05);
    text-decoration: none;
}

/* H3 items */
.alx-toc__h3 {
    counter-increment: alx-toc-h3;
    margin-left: 26px !important;
    border-left: 2px solid rgba(240, 82, 67, 0.15);
}

.alx-toc__h3 > a {
    display: flex;
    align-items: baseline;
    gap: 6px;
    color: #718096;
    text-decoration: none;
    padding: 3px 8px;
    font-size: 13px;
    font-weight: 400;
    border-radius: 0 6px 6px 0;
    transition:
        background 0.15s,
        color 0.15s;
    line-height: 1.4;
}

.alx-toc__h3 > a::before {
    content: counter(alx-toc-h2) '.' counter(alx-toc-h3);
    color: rgba(240, 82, 67, 0.5);
    font-size: 11px;
    font-weight: 500;
    min-width: 22px;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.alx-toc__h3 > a:hover {
    color: #2d3748;
    background: rgba(240, 82, 67, 0.04);
    text-decoration: none;
}

/* Spacing between h2 blocks and h3 group */
.alx-toc__h2 + .alx-toc__h3,
.alx-toc__h3 + .alx-toc__h2 {
    margin-top: 2px !important;
}

/* Hidden state */
#alx-toc-nav[hidden] {
    display: none;
}

@media (max-width: 768px) {
    #alx-toc {
        padding: 14px 16px 16px;
    }

    .alx-toc__h2 > a {
        font-size: 13px;
    }

    .alx-toc__h3 {
        margin-left: 20px !important;
    }

    .alx-toc__h3 > a {
        font-size: 12px;
    }
}
