/* Simple TOC - Styles */

.simple-toc-wrap {
    --stoc-accent: #16a34a;      /* মূল থিম কালার (সবুজ) */
    --stoc-accent-dark: #0f7a34;
    --stoc-accent-tint: #eafbf1; /* হালকা সবুজ ব্যাকগ্রাউন্ড */
    --stoc-border: #e3e8ee;

    background: #ffffff;
    border: 1px solid var(--stoc-border);
    border-radius: 14px;
    padding: 16px 18px 18px;
    margin: 22px 0;
    max-width: 100%;
    font-size: 15px;
    line-height: 1.6;
    box-shadow: 0 2px 10px rgba(20, 30, 40, 0.04);
}

.simple-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--stoc-border);
}

.simple-toc-title {
    font-weight: 800;
    font-size: 19px;
    color: #16202a;
    letter-spacing: 0.2px;
}

.simple-toc-toggle {
    background: var(--stoc-accent-tint);
    border: 1px solid #cdeedd;
    border-radius: 8px;
    cursor: pointer;
    color: var(--stoc-accent-dark);
    padding: 7px 10px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.25s ease;
}

.simple-toc-toggle:hover {
    background: #d7f5e3;
}

.simple-toc-wrap.simple-toc-collapsed .simple-toc-toggle {
    transform: rotate(180deg);
}

.simple-toc-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: max-height 0.3s ease, margin 0.3s ease;
}

.simple-toc-wrap.simple-toc-collapsed .simple-toc-list {
    margin-top: 0;
}

/* ---- প্রতিটা আইটেম টাইল/কার্ড আকারে ---- */
.simple-toc-item {
    margin: 0;
}

.simple-toc-item a {
    display: flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    color: #263340;
    background: #f6f8fa;
    border: 1px solid transparent;
    padding: 6px 10px;
    border-radius: 7px;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.4;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

/* মাউস হোভার ইফেক্ট */
.simple-toc-item a:hover {
    background: var(--stoc-accent-tint);
    color: var(--stoc-accent-dark);
    border-color: #bfe9d0;
}

.simple-toc-number {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 21px;
    height: 21px;
    padding: 0 5px;
    border-radius: 6px;
    background: #eef1f4;
    color: #55606b;
    font-weight: 700;
    font-size: 12px;
    transition: background 0.18s ease, color 0.18s ease;
}

.simple-toc-item a:hover .simple-toc-number {
    background: var(--stoc-accent);
    color: #fff;
}

.simple-toc-text {
    flex: 1 1 auto;
}

/* বর্তমানে যে হেডিং পড়া হচ্ছে সেটা TOC তে হাইলাইট থাকবে */
.simple-toc-item.is-active a {
    background: var(--stoc-accent);
    color: #ffffff;
    border-color: var(--stoc-accent-dark);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.28);
}

.simple-toc-item.is-active .simple-toc-number {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* হেডিং লেভেল অনুযায়ী ইনডেন্ট (depth = 0,1,2 ...) */
.simple-toc-depth-0 > a {
    font-weight: 700;
}

.simple-toc-depth-1 {
    padding-left: 24px;
    position: relative;
}
.simple-toc-depth-1::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--stoc-border);
}
.simple-toc-depth-1 > a {
    font-size: 14px;
}

.simple-toc-depth-2 {
    padding-left: 44px;
    position: relative;
}
.simple-toc-depth-2::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--stoc-border);
}
.simple-toc-depth-2 > a {
    font-size: 13px;
}

.simple-toc-empty {
    color: #888;
    font-style: italic;
}

/* ---- পোস্ট কনটেন্টের হেডিং এর জন্য স্ক্রল পজিশনিং ---- */
/* হেডিং এ কোনো কালার/ব্যাকগ্রাউন্ড হাইলাইট নেই — শুধু স্মুথ স্ক্রল করলে
   হেডিং সঠিক জায়গায় (ফিক্সড হেডারের নিচে) থামার জন্য এই মার্জিন। */
.simple-toc-heading {
    scroll-margin-top: 90px;
}

/* ---- মোবাইল / ছোট স্ক্রিনের জন্য অ্যাডজাস্টমেন্ট ---- */
@media (max-width: 600px) {
    .simple-toc-wrap {
        padding: 16px 14px 18px;
        border-radius: 12px;
        font-size: 14px;
    }

    .simple-toc-title {
        font-size: 17px;
    }

    .simple-toc-item a {
        padding: 8px 10px; /* টাচের জন্য পর্যাপ্ত কিন্তু কম্প্যাক্ট প্যাডিং */
    }

    .simple-toc-depth-1 {
        padding-left: 18px;
    }
    .simple-toc-depth-1 > a {
        font-size: 13px;
    }

    .simple-toc-depth-2 {
        padding-left: 32px;
    }
    .simple-toc-depth-2 > a {
        font-size: 12.5px;
    }

    .simple-toc-number {
        min-width: 20px;
        height: 20px;
        font-size: 11px;
    }
}

@media (max-width: 380px) {
    .simple-toc-depth-1 {
        padding-left: 16px;
    }
    .simple-toc-depth-2 {
        padding-left: 28px;
    }
}
