/* Post specific styles */

.post-card.transition-hover {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

    .post-card.transition-hover:hover {
        transform: translateY(-5px);
        box-shadow: 0 .5rem 1rem rgba(0,0,0,.15) !important;
    }

.share-sidebar {
    align-items: center;
}

.share-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #f3f7f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111;
    text-decoration: none;
    transition: all 0.2s ease;
}

    .share-icon i {
        font-size: 24px;
    }

    .share-icon:hover {
        background-color: #e9eef1;
        color: var(--bs-primary) !important;
    }

/* Post Content Typography */
.blog-post {
    font-size: 1.125rem;
    line-height: 1.8;
}

    .blog-post img {
        max-width: 100%;
        height: auto;
        border-radius: 0.5rem;
        margin: 1.5rem 0;
    }

    .blog-post blockquote {
        border-left: 4px solid var(--bs-primary);
        padding-left: 1.5rem;
        font-style: italic;
        color: #6c757d;
        background-color: #f8f9fa;
        padding: 1.5rem;
        border-radius: 0 0.5rem 0.5rem 0;
    }
    
/* Related Posts */
.related-posts-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    padding-bottom: 10px;
}

.related-posts-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
}

.related-post-card {
    flex: 0 0 300px;
}
/* =========================
   Table of Contents
   ========================= */

.toc-nav {
    position: relative;
    gap: 0.15rem;
}

    /* Vertical line */
    .toc-nav::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: 2px;
        background-color: var(--bs-border-color);
        border-radius: 2px;
    }

    /* TOC links */
    .toc-nav a {
        position: relative;
        display: block;
        color: var(--bs-secondary-color);
        text-decoration: none;
        font-size: 0.875rem;
        line-height: 1.4;
        padding: 0.45rem 0.75rem 0.45rem 1.25rem;
        border-left: 2px solid transparent;
        border-radius: 0 0.375rem 0.375rem 0;
        transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, padding-left 0.2s ease;
    }

        /* Hover */
        .toc-nav a:hover {
            color: var(--bs-primary);
            background-color: rgba(var(--bs-primary-rgb), 0.06);
            border-left-color: rgba(var(--bs-primary-rgb), 0.4);
        }

        /* Active */
        .toc-nav a.active {
            color: var(--bs-primary);
            background-color: rgba(var(--bs-primary-rgb), 0.1);
            border-left-color: var(--bs-primary);
            font-weight: 600;
        }

    /* =========================
   Heading Levels
   ========================= */

    /* H2 - Main sections */
    .toc-nav .toc-h2 {
        padding-left: 1.25rem;
        font-weight: 500;
    }

    /* H3 */
    .toc-nav .toc-h3 {
        padding-left: 2rem;
        font-size: 0.825rem;
    }

    /* H4 */
    .toc-nav .toc-h4 {
        padding-left: 2.75rem;
        font-size: 0.8rem;
    }

    /* H5 */
    .toc-nav .toc-h5 {
        padding-left: 3.5rem;
        font-size: 0.775rem;
    }

    /* H6 */
    .toc-nav .toc-h6 {
        padding-left: 4.25rem;
        font-size: 0.75rem;
    }

    /* =========================
   Long Titles
   ========================= */

    .toc-nav a {
        overflow: hidden;
        text-overflow: ellipsis;
    }

/* =========================
   TOC Card
   ========================= */

.toc-card {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    background-color: var(--bs-body-bg);
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.06);
}

    .toc-card .card-title {
        font-size: 1rem;
        color: var(--bs-body-color);
    }

/* =========================
   Dark Mode
   ========================= */

[data-bs-theme="dark"] .toc-nav::before {
    background-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .toc-nav a:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.12);
}

[data-bs-theme="dark"] .toc-nav a.active {
    background-color: rgba(var(--bs-primary-rgb), 0.16);
}

[data-bs-theme="dark"] .toc-card {
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.2);
}

/* =========================
   Misc
   ========================= */

.last-border-0:last-child {
    border-bottom: none !important;
}
/* Filter Bar specific styles */
.filter-bar-container {
    background-color: #f2f9fc; /* Light greyish blue */
}

.tags-scroll-container::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.tag-link {
    text-decoration: none;
    padding: 0.5rem 2rem;
    border-radius: 50rem;
    transition: all 0.2s ease-in-out;
    font-weight: 500;
    font-size: 0.95rem;
}

.tag-link.active {
    background-color: #618da4; /* Slate blue */
}

/* Expandable Search */
.search-expand-container {
    position: relative;
}

.search-input-wrapper {
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 0;
}

.search-input-wrapper.expanded {
    width: 250px;
    opacity: 1;
}

.search-input {
    width: 100%;
}

.search-toggle-btn {
    padding: 0.5rem;
    cursor: pointer;
    background: transparent;
    border: none;
}

/* Animation of TOC Highlights */
.toc-highlight {
    animation: tocHeadingHighlight 2.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    border-radius: 4px;
    border-left: 3px solid transparent;
    padding-left: 12px;
    left: -15px;
    position: relative;
    will-change: transform, background-color, box-shadow;
}

@keyframes tocHeadingHighlight {
    0% {
        background-color: transparent;
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
        border-left-color: transparent;
        transform: scale(1);
    }
    /* Peak 1: Sharp, immediate entrance with a subtle scale pop */
    12% {
        background-color: rgba(13, 110, 253, 0.18);
        box-shadow: 0 0 20px 4px rgba(13, 110, 253, 0.35);
        border-left-color: rgba(13, 110, 253, 1);
        transform: scale(1.015);
    }
    /* Dip 1: Soft contraction */
    28% {
        background-color: rgba(13, 110, 253, 0.08);
        box-shadow: 0 0 8px 1px rgba(13, 110, 253, 0.12);
        border-left-color: rgba(13, 110, 253, 0.6);
        transform: scale(1);
    }
    /* Peak 2: Secondary echo pulse */
    44% {
        background-color: rgba(13, 110, 253, 0.14);
        box-shadow: 0 0 16px 3px rgba(13, 110, 253, 0.25);
        border-left-color: rgba(13, 110, 253, 0.9);
        transform: scale(1.008);
    }
    /* Hold: Settles smoothly for reading readability */
    65% {
        background-color: rgba(13, 110, 253, 0.06);
        box-shadow: 0 0 6px 0px rgba(13, 110, 253, 0.08);
        border-left-color: rgba(13, 110, 253, 0.4);
        transform: scale(1);
    }
    /* Fade Out */
    100% {
        background-color: transparent;
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
        border-left-color: transparent;
        transform: scale(1);
    }
}