/* Blog Enhancements - Reading Time */
.reading-time {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    font-size: 0.875em;
    color: #666;
}

.reading-time i {
    font-size: 1em;
}

/* Table of Contents */
.post-toc {
    background: #f8f9fa;
    border-left: 4px solid var(--primary-color, #3D464F);
    padding: 1.5em 2em;
    margin: 2em 0 3em;
    border-radius: 4px;
}

.post-toc .toc-title {
    font-size: 1.2em;
    font-weight: 700;
    margin: 0 0 1em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-toc .toc-title::after {
    display: none;
}

.post-toc .toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: toc-counter;
}

.post-toc .toc-item {
    margin: 0.5em 0;
    counter-increment: toc-counter;
}

.post-toc .toc-item::before {
    content: counter(toc-counter) ". ";
    font-weight: 600;
    color: var(--primary-color, #3D464F);
}

.post-toc .toc-item a {
    text-decoration: none;
    color: #333;
    transition: color 0.2s ease;
}

.post-toc .toc-item a:hover,
.post-toc .toc-item a:focus {
    color: var(--primary-color, #3D464F);
}

.post-toc .toc-level-3 {
    margin-left: 1.5em;
    font-size: 0.95em;
}

/* Narrow Reading Layout */
body.post-layout-narrow #primary {
    width: 100%;
    max-width: 100%;
    float: none;
}

body.post-layout-narrow #secondary {
    display: none;
}

body.post-layout-narrow .entry-content,
body.post-layout-narrow .entry-header,
body.post-layout-narrow #meta-footer,
body.post-layout-narrow .post-toc {
    max-width: var(--narrow-content-width, 720px);
    margin-left: auto;
    margin-right: auto;
}

/* Related Posts Section */
.related-posts {
    margin: 4em 0 3em;
    padding: 3em 0 0;
    border-top: 2px solid #e5e5e5;
}

.related-posts .section-heading {
    text-align: center;
    font-size: 2em;
    margin: 0 0 2em;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5em;
    margin-top: 2em;
}

.related-post-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.related-post-item:hover,
.related-post-item:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.related-post-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #f5f5f5;
}

.related-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-post-item:hover .related-post-thumbnail img {
    transform: scale(1.05);
}

.related-post-content {
    padding: 1.5em;
}

.related-post-category {
    display: inline-block;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-color, #3D464F);
    margin-bottom: 0.5em;
}

.related-post-category a {
    text-decoration: none;
    color: inherit;
}

.related-post-title {
    font-size: 1.3em;
    margin: 0.5em 0;
    line-height: 1.3;
}

.related-post-title::after {
    display: none;
}

.related-post-title a {
    text-decoration: none;
    color: #333;
    transition: color 0.2s ease;
}

.related-post-title a:hover,
.related-post-title a:focus {
    color: var(--primary-color, #3D464F);
}

.related-post-meta {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-size: 0.875em;
    color: #666;
    margin: 0.8em 0;
}

.related-post-meta .sep {
    margin: 0 0.3em;
}

.related-post-excerpt {
    color: #666;
    line-height: 1.6;
    margin: 1em 0;
}

.related-post-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    font-weight: 600;
    text-decoration: none;
    color: var(--primary-color, #3D464F);
    transition: gap 0.2s ease;
}

.related-post-link:hover,
.related-post-link:focus {
    gap: 0.8em;
}

.related-post-link i {
    font-size: 0.875em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 2em;
    }

    .post-toc {
        padding: 1em 1.5em;
    }

    .related-posts {
        margin: 3em 0 2em;
    }
}

@media (max-width: 480px) {
    .related-posts .section-heading {
        font-size: 1.5em;
    }

    .related-post-content {
        padding: 1.2em;
    }

    .post-toc .toc-level-3 {
        margin-left: 1em;
    }
}