/* =========================================================
   게시글 매뉴얼 목차
   - 800px 미만 : 기존 모바일 슬라이드 목차
   - 800px 이상 : 본문 좌측 + 목차 우측 200px
   - 목차는 sticky로 스크롤을 따라다님
   - 열기/닫기 : 200px <-> 400px
========================================================= */

#tt-body-page .tab_article_layout,
#tt-body-page .tab_article_layout *,
#tt-body-page .tab_article_toc,
#tt-body-page .tab_list_tll {
    box-sizing: border-box;
}

/* =========================================================
   모바일 기본
========================================================= */
#tt-body-page .tab_article_layout {
    display: block;
    width: 100%;
}

#tt-body-page .tab_article_body {
    min-width: 0;
}

#tt-body-page .tab_article_toc {
    position: static;
}

#tt-body-page .tab_list_tll {
    z-index: 800;
    position: fixed;
    bottom: 0;
    left: -70%;
    width: 70%;
    height: calc(100% - 50px);
    max-height: calc(100% - 50px);
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0 !important;
    padding: 18px 0 !important;
    background: #fff;
    border: 0;
    text-align: left;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.12);
    transition: left 0.2s ease-in-out;
}

#tt-body-page .tab_list_tll.open {
    left: 0;
}

#tt-body-page .tab_list_tll::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
#tt-body-page .tab_list_tll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}
#tt-body-page .tab_list_tll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

#tt-body-page .tab_list_tll_bt {
    z-index: 750;
    position: fixed;
    bottom: 15px;
    left: 15px;
    display: block;
    width: 100px;
    height: 32px;
    margin: 0 !important;
    padding: 0 !important;
    border: 0;
    border-radius: 16px;
    background: #1bbfea;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
}

#tt-body-page .tab_list_tll_bt.open {
    display: none;
}

#tt-body-page .tab_list_tll_cl {
    z-index: 700;
    position: fixed;
    top: 0;
    left: 0;
    display: none;
    width: 100%;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    background: rgba(255,255,255,0.01);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 0;
    cursor: pointer;
}

#tt-body-page .tab_list_tll_cl.open {
    display: block;
}

#tt-body-page .tab_list_tll_size_bt {
    display: none;
}

/* 목차 항목 */
#tt-body-page .tab_list_tll > li {
    position: relative;
    display: block;
    margin: 0 !important;
    padding: 10px 14px 10px 24px !important;
    border-bottom: 1px solid #eceff2 !important;
    text-align: left;
    vertical-align: top;
}

#tt-body-page .tab_list_tll > li:last-child {
    border-bottom: 0 !important;
}

#tt-body-page .tab_list_tll > li.tab_list:before {
    position: absolute;
    top: 19px;
    left: 14px;
    z-index: 1;
    width: 3px;
    height: 3px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    background: #111;
    content: "";
}

#tt-body-page .tab_list_tll > li > a {
    position: relative;
    display: block;
    margin: 0 !important;
    padding: 0 !important;
    color: #333;
    font-size: 13px;
    font-weight: 400;
    line-height: 20px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

#tt-body-page .tab_list_tll > .tab_list_line {
    display: block;
    width: 100%;
    height: 8px;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: #eef1f4;
}
#tt-body-page .tab_list_tll > .tab_list_line:before {
    display: none;
}

/* =========================================================
   800px 이상
========================================================= */
@media only screen and (min-width: 800px) {

    /* sticky를 막는 조상 overflow를 해제 */
    #tt-body-page #dkWrap,
    #tt-body-page #dkContent,
    #tt-body-page #cMain,
    #tt-body-page #mArticle,
    #tt-body-page .article_skin,
    #tt-body-page .area_view,
    #tt-body-page .tt_article_useless_p_margin.contents_style,
    #tt-body-page .tab_article_layout {
        overflow: visible !important;
    }

    /* 실제 본문 + 목차 2열 */
    #tt-body-page .tt_article_useless_p_margin.contents_style > .tab_article_layout {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 200px !important;
        column-gap: 24px !important;
        align-items: start !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        transition: grid-template-columns 0.22s ease;
    }

    #tt-body-page .tt_article_useless_p_margin.contents_style > .tab_article_layout.is-toc-wide {
        grid-template-columns: minmax(0, 1fr) 400px !important;
    }

    #tt-body-page .tab_article_body {
        grid-column: 1 !important;
        grid-row: 1 !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
        text-align: left !important;
    }

    /* 목차 컬럼 자체가 스크롤을 따라감 */
    #tt-body-page .tab_article_toc {
        grid-column: 2 !important;
        grid-row: 1 !important;
        position: sticky !important;
        top: 70px !important;
        align-self: start !important;
        justify-self: stretch !important;
        width: 200px !important;
        min-width: 200px !important;
        max-width: 200px !important;
        height: auto !important;
        max-height: calc(100vh - 90px) !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        z-index: 100 !important;
        transition: width 0.22s ease, min-width 0.22s ease, max-width 0.22s ease;
    }

    #tt-body-page .tab_article_layout.is-toc-wide > .tab_article_toc {
        width: 400px !important;
        min-width: 400px !important;
        max-width: 400px !important;
    }

    #tt-body-page .tab_article_toc > .tab_list_tll {
        position: static !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        max-height: calc(100vh - 90px) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        margin: 0 !important;
        padding: 10px 0 !important;
        border: 1px solid #dfe5e9 !important;
        border-top: 4px solid #17aad0 !important;
        border-radius: 10px !important;
        background: #fff !important;
        box-shadow: 0 4px 18px rgba(0,0,0,0.06) !important;
    }

    /* PC에서는 모바일용 버튼/배경 미사용 */
    #tt-body-page .tab_article_toc > .tab_list_tll_bt,
    #tt-body-page .tab_article_toc > .tab_list_tll_cl {
        display: none !important;
    }

    /* 200px <-> 400px */
    #tt-body-page .tab_article_toc > .tab_list_tll_size_bt {
        position: absolute !important;
        top: 50% !important;
        left: -30px !important;
        z-index: 120 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 30px !important;
        height: 72px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 1px solid #17aad0 !important;
        border-right: 0 !important;
        border-radius: 8px 0 0 8px !important;
        outline: 0 !important;
        background: #17aad0 !important;
        color: #fff !important;
        font-family: inherit !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        line-height: 1 !important;
        cursor: pointer !important;
        transform: translateY(-50%) !important;
        box-shadow: -2px 2px 8px rgba(0,0,0,0.10) !important;
        appearance: none !important;
        -webkit-appearance: none !important;
    }

    #tt-body-page .tab_article_toc > .tab_list_tll_size_bt > span {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        color: #fff !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        line-height: 1 !important;
        writing-mode: vertical-rl;
        text-orientation: upright;
        letter-spacing: 2px;
        pointer-events: none;
    }

    #tt-body-page .tab_list_tll > li.tab_list:hover > a {
        color: #1bbfea !important;
    }
    #tt-body-page .tab_list_tll > li.tab_list:hover:before {
        background: #1bbfea !important;
    }
}
