/* =============================================================================
   Content Studio — TOC
   ============================================================================= */

/* ── Sticky TOC Wrapper ────────────────────────────────────────────────────── */
.cs-toc-wrapper {
    background: #fff;
    padding-bottom: 24px;
    border-bottom: 1px solid #DADCDB;
    z-index: 2;
}

/* ── Header ───────────────────────────────────────────────────────── */
.cs-toc-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    box-shadow: none !important;
    background: #FFFFFF !important;
    border: 1px solid #F4F4F4 !important;
    border-radius: 16px !important;
    box-sizing: border-box;
	padding: 16px 24px !important;
    cursor: pointer !important;
    user-select: none;
    font-weight: 500 !important;
    font-size: 16px !important;
    color: #030C09 !important;
    text-align: left !important;
    transition: all 0.2s;
    line-height: 22px !important;
	font-family: var(--cs-font-accent);
	margin-bottom: 8px !important;
}

.cs-toc-header.cs-toc-open {
    border: 1px solid #35AB7D !important;
}

.cs-toc-outer .cs-toc-header:hover { color: #35AB7D !important; }
.cs-toc-outer .cs-toc-header:hover .cs-toc-icon { color: #35AB7D !important; }

.cs-toc-icon {
    flex-shrink: 0;
    transition: transform 0.25s ease;
    color: #35AB7D !important;
    width: 14px;
    height: 14px;
}

.cs-toc-icon.collapsed     { transform: rotate(180deg); }

/* ── TOC body collapse ───────────────────────────────────────────────────── */
.cs-toc-body {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 1200px;
    opacity: 1;
    box-shadow: 0 12px 24px -4px #0000000F !important;
}

.cs-toc-body.collapsed {
    max-height: 0 !important;
    opacity: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ── TOC List ───────────────────────────────────────────────────── */
.cs-toc-list {
    list-style: none !important;
    padding: 8px 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.cs-toc-item {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* ── Link Wrapper ───────────────────────────────────────────────────── */
.cs-toc-link-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    position: relative !important;
}

/* ── TOC Link ───────────────────────────────────────────────────── */
.cs-toc-link {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 12px !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #030C09 !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    line-height: 20px !important;
    background: transparent !important;
    font-family: var(--cs-font-accent);
    flex: 1 !important;
    position: relative !important;
}

/* ── INDICATOR ────────────────────────────────── */
.cs-toc-indicator {
    flex-shrink: 0 !important;
    width: 3px !important;
    height: 0 !important;
    border-radius: 10px !important;
    background: #35AB7D !important;
    transition: height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.cs-toc-link:hover .cs-toc-indicator,
.cs-toc-link.cs-toc-active .cs-toc-indicator {
    height: 20px !important;
}

.cs-toc-link.cs-toc-active {
    color: #35AB7D !important;
    font-weight: 700 !important;
}

.cs-toc-link.cs-toc-active .cs-toc-indicator {
    height: 24px !important;
}

/* ── Toggle Button (for H2 headings) ──────────────────────────────────── */
.cs-toc-toggle-btn {
    flex-shrink: 0 !important;
    width: 24px !important;
    height: 24px !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    color: #4A4D4C !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform 0.3s ease !important;
    border-radius: 50% !important;
}

.cs-toc-toggle-btn:hover {
    background: rgba(53, 171, 125, 0.08) !important;
    color: #35AB7D !important;
}

.cs-toc-toggle-btn.open {
    transform: rotate(180deg) !important;
}

.cs-toc-toggle-btn svg {
    width: 16px !important;
    height: 16px !important;
}

/* ── H3 Sub-list ─────────────────────────────────────────────────────── */
.cs-toc-sub {
    padding-left: 28px !important;
    margin: 2px 0 4px 0 !important;
    list-style: none !important;
    overflow: hidden !important;
    max-height: 0 !important;
    opacity: 0 !important;
    transition: max-height 0.3s ease, opacity 0.3s ease !important;
}

.cs-toc-sub.open {
    max-height: 500px !important;
    opacity: 1 !important;
}

.cs-toc-sub .cs-toc-link {
    font-size: 13px !important;
    font-weight: 400 !important;
    color: #4A4D4C !important;
    padding: 6px 12px !important;
}

.cs-toc-sub .cs-toc-link:hover {
    color: #35AB7D !important;
}

.cs-toc-sub .cs-toc-link.cs-toc-active {
    color: #35AB7D !important;
    font-weight: 600 !important;
}

.cs-toc-sub .cs-toc-indicator {
    width: 2px !important;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .cs-toc-sub { display: none !important; }
    
    .cs-toc-toggle-btn { display: none !important;}
	
	.cs-toc-inner,
    .ck-toc-container { padding: 14px 16px !important; }

    .cs-toc-outer nav.toc-container a,
    .ck-toc-list li a,
    a.ck-toc-link { font-size: 13px !important; }

    .cs-toc-outer .cs-toc-header,
    .ck-toc-header { font-size: 15px !important; }
}