/**
 * Blog Table of Contents (TOC) Styles
 * WordPress Ready - Can be easily integrated into theme
 * 
 * Usage in WordPress:
 * 1. Add this CSS to your theme's style.css or enqueue as separate file
 * 2. Use the JavaScript from blog-toc.js
 * 3. Ensure your blog content has the class "_blogText" or update selectors
 */

/* TOC Wrapper Card */
.blog_toc_wrapper {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    transition: box-shadow 0.3s ease;
}

.blog_toc_wrapper:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* TOC Title */
.blog_toc_wrapper h5 {
    color: var(--bs-primary, #3F9F35);
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

/* TOC List */
.toc_wrapper .toc_list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.toc_wrapper .toc_list li {
    margin-bottom: 4px;
}

/* TOC Links */
.toc_wrapper a {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    color: #495057;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
}

/* Active TOC Link */
.toc_wrapper a.active {
    background: var(--bs-primary, #3F9F35);
    color: #fff !important;
    font-weight: 600;
    border-left-color: var(--bs-secondary, #09629D);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(63, 159, 53, 0.3);
}

/* Hover State */
.toc_wrapper a:hover {
    background: rgba(63, 159, 53, 0.1);
    color: var(--bs-primary, #3F9F35);
    transform: translateX(2px);
}

/* Sticky Sidebar - Adjust top value based on your header height */
.sticky-lg-top {
    position: sticky;
    top: 100px;
    z-index: 10;
}

@media (max-width: 991px) {
    .sticky-lg-top {
        position: relative;
        top: 0;
    }
}

/* WordPress Content Styles */
._blogText h2.wp-block-heading {
    scroll-margin-top: 120px; /* Offset for sticky header */
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--bs-dark, #212529);
    font-weight: 600;
}

._blogText h3.wp-block-heading {
    scroll-margin-top: 120px;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--bs-dark, #212529);
    font-weight: 600;
}

._blogText p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: var(--bs-paragraph, #464646);
}

/* Nested TOC (for h3 support) */
.toc_wrapper .toc_list .toc_list {
    margin-left: 15px;
    margin-top: 4px;
}

.toc_wrapper .toc_list .toc_list a {
    font-size: 13px;
    padding: 6px 10px;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .blog_toc_wrapper {
        padding: 15px;
        margin-bottom: 30px;
    }
    
    .toc_wrapper a {
        font-size: 13px;
        padding: 6px 10px;
    }
}

/* Print Styles */
@media print {
    .blog_toc_wrapper {
        display: none;
    }
}
