/* =========================================================
   TABLE OF CONTENTS
   toc.css
   ========================================================= */


/* =========================================================
   TOC CONTAINER
   ========================================================= */

.article-toc {

    width: 100%;

    margin: 30px 0;

    background: #ffffff;

    border: 1px solid rgba(47, 84, 235, 0.18);

    border-radius: 16px;

    box-shadow:
        0 8px 25px rgba(16, 32, 51, 0.06);

    overflow: hidden;

}


/* =========================================================
   TOC HEADER
   ========================================================= */

.toc-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    padding: 16px 20px;

    background:
        linear-gradient(
            135deg,
            #f4f7ff,
            #ffffff
        );

}


/* =========================================================
   TOC TITLE
   ========================================================= */

.toc-title {

    display: flex;

    align-items: center;

    gap: 10px;

    margin: 0;

    color: #173b7a;

    font-size: 18px;

    font-weight: 700;

    line-height: 1.4;

}


.toc-title i {

    color: #2f54eb;

    font-size: 17px;

}


/* =========================================================
   TOGGLE SWITCH
   ========================================================= */

.toc-switch {

    position: relative;

    display: block;

    width: 52px;

    height: 28px;

    flex-shrink: 0;

    cursor: pointer;

}


/* Hide checkbox */

.toc-switch input {

    position: absolute;

    width: 1px;

    height: 1px;

    opacity: 0;

}


/* =========================================================
   TOGGLE SLIDER
   ========================================================= */

.toc-slider {

    position: absolute;

    inset: 0;

    background: #cbd5e1;

    border-radius: 50px;

    transition:
        background .3s ease,
        box-shadow .3s ease;

}


/* Toggle circle */

.toc-slider::before {

    content: "";

    position: absolute;

    width: 22px;

    height: 22px;

    left: 3px;

    top: 3px;

    background: #ffffff;

    border-radius: 50%;

    box-shadow:
        0 2px 6px rgba(0,0,0,.20);

    transition:
        transform .3s ease;

}


/* ON state */

.toc-switch input:checked + .toc-slider {

    background: #2f54eb;

    box-shadow:
        0 0 0 4px rgba(47,84,235,.10);

}


/* Move circle */

.toc-switch input:checked + .toc-slider::before {

    transform: translateX(24px);

}


/* =========================================================
   TOC CONTENT
   ========================================================= */

.toc-content {

    display: none;

    padding: 8px 20px 18px;

    border-top: 1px solid rgba(47,84,235,.10);

}


/* Visible state */

.toc-content.show {

    display: block;

    animation: tocOpen .25s ease;

}


/* =========================================================
   TOC OPEN ANIMATION
   ========================================================= */

@keyframes tocOpen {

    from {

        opacity: 0;

        transform: translateY(-6px);

    }

    to {

        opacity: 1;

        transform: translateY(0);

    }

}


/* =========================================================
   TOC LIST
   ========================================================= */

.toc-content ul {

    list-style: none;

    padding: 0;

    margin: 0;

}


.toc-content li {

    margin: 0;

    padding: 0;

    border-bottom:
        1px solid #edf1f7;

}


.toc-content li:last-child {

    border-bottom: none;

}


/* =========================================================
   TOC LINKS
   ========================================================= */

.toc-content a {

    position: relative;

    display: block;

    padding: 5px 10px 5px 28px;

    color: #334155;

    font-size: 15px;

    font-weight: 500;

    line-height: 1.5;

    text-decoration: none;

    transition:
        color .25s ease,
        background .25s ease,
        padding-left .25s ease;

}


/* Arrow */

.toc-content a::before {

    content: "\f054";

    position: absolute;

    left: 8px;

    top: 50%;

    transform: translateY(-50%);

    font-family:
        "Font Awesome 6 Free";

    font-weight: 900;

    font-size: 10px;

    color: #2f54eb;

    transition:
        transform .25s ease;

}


/* Hover */

.toc-content a:hover {

    color: #2f54eb;

    background: #f5f8ff;

    padding-left: 34px;

}


.toc-content a:hover::before {

    transform:
        translate(3px,-50%);

}


/* =========================================================
   ACTIVE TOC LINK
   ========================================================= */

.toc-content a.active {

    color: #2f54eb;

    background: #f0f5ff;

    font-weight: 700;

}


.toc-content a.active::before {

    color: #2f54eb;

}


/* =========================================================
   IMPORTANT:
   ARTICLE HEADING SCROLL POSITION
   =========================================================

   We intentionally DO NOT use:

   scroll-margin-top

   here.

   JavaScript calculates the exact sticky-header
   height and scrolls to the correct position.
*/


.article-main h2 {

    scroll-margin-top: 0 !important;

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .article-toc {

        margin: 25px 0;

        border-radius: 13px;

    }


    .toc-header {

        padding: 14px 15px;

    }


    .toc-title {

        font-size: 16px;

    }


    .toc-title i {

        font-size: 15px;

    }


    .toc-content {

        padding: 6px 12px 14px;

    }


    .toc-content a {

        padding:
            10px 8px 10px 26px;

        font-size: 14px;

    }


    .toc-content a:hover {

        padding-left: 30px;

    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .toc-header {

        gap: 12px;

        padding: 13px 14px;

    }


    .toc-title {

        font-size: 15px;

    }


    .toc-switch {

        width: 48px;

        height: 26px;

    }


    .toc-slider::before {

        width: 20px;

        height: 20px;

    }


    .toc-switch input:checked + .toc-slider::before {

        transform: translateX(22px);

    }


    .toc-content a {

        font-size: 13.5px;

    }

}