/* Table of Contents (TOC) - Hesam */

.hesam-toc-box {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 16px;
    padding: 16px 16px 12px;
    margin: 0 0 22px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.04);
}

.hesam-toc-title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.4;
    margin: 0 0 10px;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Optional: small accent bar (works well in RTL too) */
.hesam-toc-title::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: #2563eb;
    display: inline-block;
    opacity: 0.9;
}

.hesam-toc-list,
.hesam-toc-sublist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hesam-toc-item {
    margin: 0;
    padding: 0;
}

.hesam-toc-item-h2 {
    padding: 8px 0;
    border-top: 1px dashed rgba(0,0,0,0.10);
}

.hesam-toc-item-h2:first-child {
    border-top: none;
}

.hesam-toc-item-h3 {
    padding: 6px 0 0;
}

.hesam-toc-sublist {
    margin-top: 6px;
    padding-inline-start: 16px;
    border-inline-start: 2px solid rgba(37, 99, 235, 0.20);
}

.hesam-toc-link {
    display: inline-block;
    text-decoration: none;
    color: #1f2937;
    line-height: 1.8;
    transition: color .15s ease, transform .15s ease, opacity .15s ease;
}

.hesam-toc-item-h2 > .hesam-toc-link {
    font-weight: 700;
    font-size: 15px;
}

.hesam-toc-item-h3 > .hesam-toc-link {
    font-weight: 500;
    font-size: 14px;
    opacity: 0.9;
}

.hesam-toc-link:hover {
    color: #2563eb;
    transform: translateX(-2px);
}

/* Better focus for accessibility */
.hesam-toc-link:focus {
    outline: 2px solid rgba(37, 99, 235, 0.35);
    outline-offset: 3px;
    border-radius: 6px;
}

/* Ensure anchors don't hide under sticky headers */
h2[id],
h3[id] {
    scroll-margin-top: 120px;
}

/* Responsive */
@media (max-width: 768px) {
    .hesam-toc-box {
        border-radius: 14px;
        padding: 14px 14px 10px;
    }
    .hesam-toc-title {
        font-size: 16px;
    }
    .hesam-toc-item-h2 > .hesam-toc-link {
        font-size: 14px;
    }
    .hesam-toc-item-h3 > .hesam-toc-link {
        font-size: 13.5px;
    }
}
