/* Blog Post Enhancements */

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
    z-index: 9998;
    transition: width 0.1s ease-out;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.3);
}

/* Post Header with Meta Info */
.post-header {
    max-width: 800px;
    margin: 0 auto 3rem;
    padding: 2rem 1.5rem;
}

.post-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    padding: 1.5rem 0;
    border-top: 2px solid var(--border-color);
    border-bottom: 2px solid var(--border-color);
    color: var(--text-medium);
    font-size: 0.95rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-icon {
    font-size: 1.2rem;
}

/* Reading Time */
.reading-time {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border-radius: 2rem;
    font-weight: 500;
    color: var(--primary-color);
}

.reading-time::before {
    content: '📚';
    font-size: 1.1rem;
}

/* Post Date */
.post-date {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.post-date::before {
    content: '📅';
    font-size: 1.1rem;
}

/* Category Badge */
.post-category {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.post-category:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Social Share Buttons */
.social-share {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.social-share-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 0.5rem;
    text-align: center;
}

.share-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-light);
    color: var(--text-dark);
    text-decoration: none;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.share-button:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.share-button.twitter:hover {
    background: #1DA1F2;
    color: white;
    border-color: #1DA1F2;
}

.share-button.linkedin:hover {
    background: #0077B5;
    color: white;
    border-color: #0077B5;
}

.share-button.facebook:hover {
    background: #1877F2;
    color: white;
    border-color: #1877F2;
}

.share-button.email:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.share-button.copy:hover {
    background: var(--text-dark);
    color: white;
    border-color: var(--text-dark);
}

/* Post Layout with Sidebar */
.post-layout {
    display: grid;
    grid-template-columns: 1fr 800px 1fr;
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.post-sidebar-left {
    position: relative;
}

.post-main {
    grid-column: 2;
}

.post-sidebar-right {
    position: relative;
}

/* Author Bio Card */
.author-bio {
    margin-top: 4rem;
    padding: 2.5rem;
    background: var(--bg-light);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

.author-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    object-fit: cover;
}

.author-info h4 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}

.author-title {
    font-size: 0.9rem;
    color: var(--text-medium);
}

.author-bio-text {
    line-height: 1.7;
    color: var(--text-medium);
    margin-bottom: 1.5rem;
}

.author-social {
    display: flex;
    gap: 1rem;
}

.author-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-white);
    color: var(--text-dark);
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.author-social-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

/* Related Posts Section */
.related-posts {
    margin-top: 5rem;
    padding-top: 3rem;
    border-top: 2px solid var(--border-color);
}

.related-posts-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-dark);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.related-post-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

.related-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(34, 197, 94, 0.2);
}

.related-post-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
}

.related-post-content {
    padding: 1.5rem;
}

.related-post-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.related-post-excerpt {
    font-size: 0.9rem;
    color: var(--text-medium);
    line-height: 1.6;
}

/* Table of Contents */
.table-of-contents {
    position: sticky;
    top: 100px;
    padding: 1.5rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.toc-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.toc-list {
    list-style: none;
    padding: 0;
}

.toc-item {
    margin-bottom: 0.75rem;
}

.toc-link {
    display: block;
    color: var(--text-medium);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    line-height: 1.5;
}

.toc-link:hover {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    background: var(--bg-light);
    padding-left: 1rem;
}

.toc-link.active {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
    background: var(--bg-light);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    z-index: 9997;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.4);
}

.back-to-top::before {
    content: '↑';
}

/* Post Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.post-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    color: var(--text-dark);
    border-radius: 2rem;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.post-tag:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .post-layout {
        grid-template-columns: 1fr;
    }
    
    .post-main {
        grid-column: 1;
    }
    
    .post-sidebar-left,
    .post-sidebar-right {
        display: none;
    }
    
    .social-share {
        position: fixed;
        bottom: 20px;
        right: 20px;
        flex-direction: row;
        z-index: 9996;
    }
}

@media (max-width: 768px) {
    .post-title {
        font-size: 2rem;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .social-share {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .share-button {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}
