/**
 * Стилі для фронтенду - TOC блок
 */

/* Підключення шрифту Rubik */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700&display=swap');

/* Базові стилі для TOC */
.kl-toc {
    margin: 30px 0 !important;
    padding: 0 !important;
    font-family: 'Rubik', sans-serif !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.kl-toc-header {
    margin: 0 0 20px 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

.kl-toc-title {
    margin: 0 !important;
    padding: 0 !important;
    text-transform: uppercase !important;
    border: none !important;
}

.kl-toc-content {
    margin: 0 !important;
    padding: 0 !important;
}

.kl-toc-list {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    list-style-type: none !important;
    counter-reset: toc-counter !important;
}

.kl-toc-list-nested {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    list-style-type: none !important;
}

.kl-toc-item {
    position: relative !important;
    counter-increment: toc-counter !important;
    list-style: none !important;
    list-style-type: none !important;
    background: none !important;
    padding-left: 0 !important;
}

.kl-toc-item::before {
    display: none !important;
}

.kl-toc-link {
    text-decoration: none !important;
    display: block !important;
    transition: font-weight 0.2s ease !important;
    background: none !important;
    border: none !important;
}

/* Стиль 1 - Мінімалістичний білий */
.kl-toc-style1 {
    background: transparent !important;
    padding: 0 !important;
}

.kl-toc-style1 .kl-toc-title {
    font-size: 36px !important;
    font-weight: 700 !important;
    color: #000000 !important;
    margin-bottom: 25px !important;
}

.kl-toc-style1 .kl-toc-item {
    margin-bottom: 12px !important;
    list-style: none !important;
}

.kl-toc-style1 .kl-toc-link {
    font-size: 18px !important;
    font-weight: 400 !important;
    color: #3C916C !important;
    padding-left: 30px !important;
    line-height: 1.5 !important;
}

.kl-toc-style1 .kl-toc-link::before {
    content: counter(toc-counter) "." !important;
    position: absolute !important;
    left: 0 !important;
    color: #000000 !important;
    font-weight: 400 !important;
    display: block !important;
}
.kl-toc-link:hover,
.kl-toc-link.active {
    font-weight: 500 !important;
    text-decoration: none !important;
}
/* Стиль 2 - Зелений блок */
.kl-toc-style2 {
    background: #3C916C !important;
    border-radius: 20px !important;
    padding: 35px 30px !important;
    border: none !important;
    box-shadow: none !important;
}

.kl-toc-style2 .kl-toc-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    text-align: center !important;
    margin-bottom: 25px !important;
}

.kl-toc-style2 .kl-toc-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 15px 0 !important;
    list-style: none !important;
}

.kl-toc-style2 .kl-toc-item:last-child {
    border-bottom: none !important;
}

.kl-toc-style2 .kl-toc-link {
    font-size: 16px !important;
    font-weight: 300 !important;
    color: #ffffff !important;
    padding-left: 30px !important;
    line-height: 1.5 !important;
}

.kl-toc-style2 .kl-toc-link::before {
    content: counter(toc-counter) "." !important;
    position: absolute !important;
    left: 0 !important;
    color: #ffffff !important;
    font-weight: 300 !important;
    display: block !important;
}

.kl-toc-style2 .kl-toc-link:hover,
.kl-toc-style2 .kl-toc-link.active {
    font-weight: 500 !important;
}

.kl-toc-style2 .kl-toc-link:hover::before,
.kl-toc-style2 .kl-toc-link.active::before {
    font-weight: 500 !important;
}

/* Вкладені списки (якщо є h3, h4) */
.kl-toc-style1 .kl-toc-list-nested .kl-toc-item {
    margin-left: 20px !important;
}

.kl-toc-style2 .kl-toc-list-nested .kl-toc-item {
    margin-left: 20px !important;
    border-bottom: none !important;
    padding: 8px 0 !important;
}

/* Sticky TOC в сайдбарі */
.col-lg-3.col-md-12.col-12,
.col-lg-3,
.sidebar-widget-area {
    overflow: visible !important;
    height: auto !important;
    min-height: 100vh !important;
}

.kl-toc-sidebar-wrapper {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 30px !important;
    margin-top: 30px !important;
    margin-bottom: 30px !important;
    z-index: 999 !important;
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    overflow: visible !important;
    align-self: flex-start !important;
}

.kl-toc-sidebar-wrapper .kl-toc {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    width: 100% !important;
}

/* Плавна прокрутка до якорів */
html {
    scroll-behavior: smooth;
}

/* Адаптивність */
@media (max-width: 768px) {
    .kl-toc {
        padding: 15px !important;
    }
    
    .kl-toc-title {
        font-size: 18px !important;
    }
    
    .kl-toc-list-nested {
        margin-left: 15px !important;
    }
    
    /* Вимикаємо sticky на мобільних */
    .kl-toc-sidebar-wrapper {
        position: static !important;
    }
}

