/* =========================================
   SYNEXTA TOC - Static Design (Sticky-Ready)
   ========================================= */

.synexta-toc-container {
    /* Positionnement : Statique par défaut.
       Le comportement Sticky sera géré par la classe .sticky-element globale */
    position: relative; 
    display: block;
    
    /* Design "Invisible" */
    background: transparent;
    padding: 0;
    margin-bottom: 30px;
    border: none;
    box-shadow: none;
    
    /* Contraintes */
    max-height: 100%; /* On laisse la hauteur libre */
    min-width: 200px;
    max-width: 280px;

    /* Typographie */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.9rem;
    color: #6b7280;
}

/* Scrollbar invisible */
.synexta-toc-container { scrollbar-width: none; }
.synexta-toc-container::-webkit-scrollbar { display: none; }

/* Liste et Rail */
.toc-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
    border-left: 1px solid #e5e7eb; /* Rail Guide */
}

.toc-item { margin: 0; padding: 0; position: relative; }

/* Liens */
.toc-link {
    display: block;
    text-decoration: none !important;
    color: #6b7280;
    padding: 6px 0 6px 20px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
    
    /* Ellipse CSS */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Hover */
.toc-link:hover {
    color: #111827;
    border-left-color: #111827;
    background: transparent;
    padding-left: 24px;
}

/* Hiérarchie */
.toc-h1 .toc-link, .toc-h2 .toc-link { font-weight: 600; color: #374151; font-size: 1em; }
.toc-h3 .toc-link { font-weight: 400; font-size: 0.95em; padding-left: 30px; }
.toc-h4 .toc-link, .toc-h5 .toc-link, .toc-h6 .toc-link { font-size: 0.85em; color: #9ca3af; padding-left: 40px; }

/* Responsive */
@media (max-width: 1024px) {
    .synexta-toc-container {
        max-width: 100%;
        border-left: none;
        margin-bottom: 2rem;
        background: #f9fafb;
        border-radius: 8px;
        padding: 20px;
    }
    .toc-list { border-left: none; }
    .toc-link {
        border-left: none;
        padding-left: 0;
        white-space: normal; /* Retour ligne sur mobile */
        text-overflow: clip;
        border-bottom: 1px solid #e5e7eb;
    }
    .toc-link:hover { padding-left: 5px; border-left: none; color: #000; }
}