/* Blog post — table of contents (timeline) */
.post-toc {
    margin-bottom: 2rem;
    border-radius: 0.875rem;
    background: #0f172a;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.18);
}

.post-toc__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.95rem 1.25rem;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    position: relative;
    overflow: hidden;
}

/* Override global button ripple (style.css) on TOC header */
.post-toc__bar::before,
.post-toc__bar:hover::before,
.post-toc__bar:focus::before {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    content: none !important;
}

.post-toc__bar:hover,
.post-toc__bar:focus,
.post-toc__bar:focus-visible,
.post-toc__bar:active {
    background: transparent;
    outline: none;
    box-shadow: none;
}

.post-toc__bar:hover .post-toc__bar-chevron {
    color: rgba(255, 255, 255, 0.85);
}

.post-toc__bar-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.post-toc__bar-icon {
    width: 1.15rem;
    height: 1.15rem;
    color: #00A693;
    flex-shrink: 0;
}

.post-toc__bar-title {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.post-toc__bar-chevron {
    width: 1.25rem;
    height: 1.25rem;
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.25s ease;
}

.post-toc__bar-chevron svg {
    width: 100%;
    height: 100%;
}

.post-toc.is-collapsed .post-toc__bar-chevron {
    transform: rotate(-90deg);
}

.post-toc__panel {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    animation: postTocOpen 0.3s ease;
}

.post-toc.is-collapsed .post-toc__panel {
    display: none;
}

@keyframes postTocOpen {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.post-toc__tree {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0 0 0 0.35rem;
    position: relative;
}

.post-toc__tree::before {
    content: '';
    position: absolute;
    left: 0.55rem;
    top: 0.65rem;
    bottom: 0.65rem;
    width: 2px;
    background: linear-gradient(180deg, #1C39BB, #00A693);
    border-radius: 2px;
    opacity: 0.45;
}

.post-toc__node {
    position: relative;
    margin: 0;
    padding: 0;
}

.post-toc__node + .post-toc__node {
    margin-top: 0.15rem;
}

.post-toc__node-link {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.55rem 2rem 0.55rem 0.65rem;
    text-decoration: none;
    border-radius: 0.5rem;
    border-left: 3px solid transparent;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transition: border-color 0.28s ease, transform 0.28s ease, box-shadow 0.28s ease;
}

.post-toc__node-link::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background: linear-gradient(105deg, rgba(28, 57, 187, 0.42) 0%, rgba(0, 166, 147, 0.18) 55%, transparent 100%);
    opacity: 0;
    transform: scaleX(0.92);
    transform-origin: left center;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.post-toc__node-link::after {
    content: '→';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    z-index: 2;
    font-size: 0.9rem;
    font-weight: 600;
    color: #00A693;
    opacity: 0;
    transform: translateY(-50%) translateX(-8px);
    transition: opacity 0.28s ease, transform 0.28s ease, color 0.28s ease;
}

.post-toc__node-link:hover,
.post-toc__node-link:focus-visible {
    border-left-color: #00A693;
    transform: translateX(4px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 4px 16px rgba(28, 57, 187, 0.25);
    outline: none;
}

.post-toc__node-link:hover::before,
.post-toc__node-link:focus-visible::before {
    opacity: 1;
    transform: scaleX(1);
}

.post-toc__node-link:hover::after,
.post-toc__node-link:focus-visible::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    color: #fff;
}

.post-toc__marker {
    flex-shrink: 0;
    width: 0.75rem;
    height: 0.75rem;
    margin-top: 0.35rem;
    margin-left: 0.2rem;
    border-radius: 50%;
    background: #0f172a;
    border: 2px solid #00A693;
    box-shadow: 0 0 0 3px rgba(0, 166, 147, 0.15);
    position: relative;
    z-index: 1;
    transition: border-color 0.28s ease, box-shadow 0.28s ease, background 0.28s ease, transform 0.28s ease;
}

.post-toc__node--major .post-toc__marker {
    width: 0.85rem;
    height: 0.85rem;
    margin-top: 0.3rem;
    border-color: #1C39BB;
    box-shadow: 0 0 0 4px rgba(28, 57, 187, 0.2);
}

.post-toc__node-link:hover .post-toc__marker,
.post-toc__node-link:focus-visible .post-toc__marker {
    background: linear-gradient(135deg, #1C39BB, #00A693);
    border-color: #fff;
    box-shadow: 0 0 0 4px rgba(0, 166, 147, 0.35), 0 0 12px rgba(28, 57, 187, 0.5);
    transform: scale(1.15);
}

.post-toc__node-text {
    flex: 1;
    font-size: 0.92rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.88);
    font-weight: 500;
    position: relative;
    z-index: 1;
    transition: color 0.28s ease, transform 0.28s ease;
}

.post-toc__node--major .post-toc__node-text {
    font-size: 0.97rem;
    font-weight: 600;
    color: #fff;
}

.post-toc__node--minor {
    padding-left: 1.35rem;
}

.post-toc__node--minor .post-toc__marker {
    width: 0.45rem;
    height: 0.45rem;
    margin-top: 0.5rem;
    border-width: 1.5px;
    box-shadow: none;
}

.post-toc__node-link:hover .post-toc__node-text,
.post-toc__node-link:focus-visible .post-toc__node-text {
    color: #fff;
    transform: translateX(2px);
}

html {
    scroll-behavior: smooth;
}

.post-content h2,
.post-content h3 {
    scroll-margin-top: 6rem;
}

@media (min-width: 768px) {
    .post-toc__tree {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 1.5rem;
        padding-left: 0.5rem;
    }

    .post-toc__tree::before {
        display: none;
    }

    .post-toc__node--minor {
        padding-left: 0.85rem;
    }

    .post-toc__marker {
        margin-left: 0;
    }
}

@media (max-width: 767px) {
    .post-toc__node--minor::before {
        content: '';
        position: absolute;
        left: 1.15rem;
        top: 0;
        width: 1rem;
        height: 50%;
        border-left: 1px solid rgba(255, 255, 255, 0.12);
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        border-bottom-left-radius: 4px;
    }
}
