/* ============================================================================
   TOC SIDEBAR — Sommaire sticky avec image et CTA
   ============================================================================ */

/* Layout 2 colonnes sur desktop */
@media (min-width: 992px) {
    .toc-row {
        display: flex;
        gap: 2rem;
        justify-content: center;
        max-width: 1400px;
        margin: 0 auto;
    }
    .toc-content-col {
        flex: 1 1 auto;
        max-width: 760px;
        min-width: 0; /* évite que le contenu déborde */
    }
    .toc-sidebar-col {
        flex: 0 0 300px;
        max-width: 300px;
    }
}

/* La sidebar suit le scroll */
.toc-sidebar-inner {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding-right: 0.5rem;
    /* Scrollbar discret */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.toc-sidebar-inner::-webkit-scrollbar {
    width: 6px;
}
.toc-sidebar-inner::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* ============================================================================
   1) IMAGE CARD
   ============================================================================ */
.toc-image-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    aspect-ratio: 16 / 10;
    background: #f1f5f9;
}
.toc-image-card img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.toc-image-card:hover img {
    transform: scale(1.05);
}
.toc-image-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.35), transparent 50%);
    pointer-events: none;
}

/* ============================================================================
   2) CTA BUTTON
   ============================================================================ */
.toc-cta-btn {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1.1rem;
    background: linear-gradient(135deg, #F97316 0%, #ea580c 100%);
    color: #fff !important;
    border-radius: 14px;
    text-decoration: none !important;
    box-shadow: 0 6px 18px rgba(249, 115, 22, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1rem;
    width: 100%;
}
.toc-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(249, 115, 22, 0.45);
    color: #fff;
    text-decoration: none;
}
.toc-cta-btn i.fa-phone {
    font-size: 1.25rem;
    background: rgba(255, 255, 255, 0.2);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}
.toc-cta-btn span {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.toc-cta-btn strong {
    font-size: 0.95rem;
    font-weight: 700;
}
.toc-cta-btn small {
    font-size: 0.85rem;
    opacity: 0.95;
    font-weight: 500;
}

/* ============================================================================
   3) SOMMAIRE / TOC
   ============================================================================ */
.toc-nav {
    background: #f8fafc;
    border-radius: 14px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
}

.toc-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0;
    background: transparent;
    border: none;
    font-weight: 700;
    color: #0F172A;
    cursor: pointer;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #F97316;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}
.toc-toggle .toc-chevron {
    margin-left: auto;
    font-size: 0.85rem;
    transition: transform 0.3s ease;
    display: none; /* visible uniquement sur mobile */
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.toc-list li {
    margin-bottom: 0.3rem;
}
.toc-list a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0.55rem 0.85rem;
    color: #475569;
    text-decoration: none;
    border-left: 3px solid transparent;
    border-radius: 0 6px 6px 0;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    line-height: 1.4;
}
.toc-list a:hover {
    background: #fff;
    color: #F97316;
    border-left-color: #fed7aa;
    text-decoration: none;
}
.toc-list a.active {
    background: #fff;
    color: #F97316;
    border-left-color: #F97316;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.12);
}

/* ============================================================================
   4) RESPONSIVE — Mobile/Tablette
   ============================================================================ */
@media (max-width: 991px) {
    .toc-row {
        flex-direction: column;
    }
    .toc-sidebar-col {
        order: -1;
        margin-bottom: 1.5rem;
    }
    .toc-sidebar-inner {
        position: static;
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }
    .toc-image-card {
        aspect-ratio: 21 / 9;
        margin-bottom: 0.75rem;
    }
    .toc-toggle .toc-chevron {
        display: inline-block;
    }
    .toc-list {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
    }
    .toc-nav.expanded .toc-list {
        max-height: 600px;
    }
    .toc-nav.expanded .toc-chevron {
        transform: rotate(180deg);
    }
}

/* Sur mobile très étroit, optimiser l'image */
@media (max-width: 575px) {
    .toc-image-card {
        aspect-ratio: 21 / 11;
        border-radius: 10px;
    }
    .toc-cta-btn {
        border-radius: 10px;
    }
    .toc-nav {
        border-radius: 10px;
    }
}