/* ===========================
   Blog System CSS
   Medium-style minimalistic design
   =========================== */

/* Blog Post Container - Matched to Blog Listing Width */
.blog-post-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    width: 100%;
    box-sizing: border-box;
}

/* Constrain inner content to match blog listing grid width */
.blog-post-container .breadcrumb,
.blog-post-container .post-header,
.blog-post-container .featured-image,
.blog-post-container .post-content,
.blog-post-container .admin-controls,
.blog-post-container .social-share,
.blog-post-container .back-to-blog {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #333;
}

.breadcrumb .separator {
    margin: 0 8px;
    color: #999;
}

/* Post Header */
.post-header {
    margin-bottom: 40px;
}

.post-category {
    margin-bottom: 16px;
}

.post-category a {
    display: inline-block;
    padding: 6px 16px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
}

.post-category a:hover {
    background: #5568d3;
}

.post-title {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    color: #1a1a1a;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.post-meta {
    display: flex;
    align-items: center;
    font-size: 15px;
    color: #666;
}

.post-meta time {
    color: #666;
}

.post-meta .separator {
    margin: 0 10px;
}

.post-meta .reading-time {
    color: #666;
}

/* Featured Image */
.featured-image {
    margin: 40px 0 50px;
}

.featured-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

/* Post Content - Enhanced Medium Typography */
.post-content {
    font-size: 18px;
    line-height: 1.8;  /* Increased from 1.75 for better readability */
    color: #333;
    margin-bottom: 60px;
}

/* First paragraph special styling */
.post-content > p:first-of-type {
    font-size: 20px;
    line-height: 1.7;
    color: #1a1a1a;
}

/* Headers with visual hierarchy */
.post-content h2 {
    font-size: 28px;  /* Slightly smaller for better balance */
    font-weight: 700;
    line-height: 1.3;
    margin-top: 56px;  /* More space before */
    margin-bottom: 20px;  /* More space after */
    color: #1a1a1a;
    letter-spacing: -0.01em;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;  /* Subtle separator */
    position: relative;
}

/* Add colored accent bar before headers */
.post-content h2::before {
    content: "";
    display: block;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    margin-bottom: 16px;
}

.post-content h3 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.35;
    margin-top: 40px;
    margin-bottom: 16px;
    color: #1a1a1a;
}

.post-content p {
    margin-bottom: 24px;  /* Consistent spacing */
    text-align: justify;  /* Justified text for clean edges */
}

.post-content br {
    display: block;
    content: "";
    margin: 0.75em 0 0 0;
}

.post-content ul,
.post-content ol {
    margin-bottom: 28px;
    padding-left: 32px;
}

.post-content li {
    margin-bottom: 12px;
}

.post-content a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid #667eea;
    transition: border-color 0.2s;
}

.post-content a:hover {
    border-bottom-color: #5568d3;
}

.post-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 24px;
    margin: 32px 0;
    font-style: italic;
    color: #555;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 32px 0;
}

.post-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 16px;
    color: #d14;
}

.post-content pre {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 32px 0;
    border: 1px solid #e8e8e8;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: #333;
}

/* Social Share */
.social-share {
    padding: 40px 0;
    border-top: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 40px;
}

.social-share .share-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.share-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.share-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.share-button:hover {
    background: #f8f8f8;
    border-color: #d0d0d0;
}

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

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

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

.share-button svg {
    width: 18px;
    height: 18px;
}

/* Back to Blog */
.back-to-blog {
    text-align: center;
    margin-top: 60px;
}

.back-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    padding: 12px 24px;
    border: 1px solid #667eea;
    border-radius: 6px;
    transition: all 0.2s;
}

.back-link:hover {
    background: #667eea;
    color: white;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .blog-post-container {
        padding: 40px 20px;
    }

    .post-title {
        font-size: 32px;
        line-height: 1.3;
    }

    .post-content {
        font-size: 17px;
        line-height: 1.75;
        text-align: left;  /* Left-aligned on mobile */
    }

    .post-content > p:first-of-type {
        font-size: 18px;
    }

    .post-content h2 {
        font-size: 24px;
        margin-top: 40px;
        margin-bottom: 16px;
        scroll-margin-top: 80px;  /* Account for sticky nav */
    }

    .post-content h3 {
        font-size: 20px;
        margin-top: 32px;
    }

    .post-content p {
        margin-bottom: 20px;
    }

    .share-buttons {
        flex-direction: column;
    }

    .share-button {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .blog-post-container {
        padding: 30px 16px;
    }

    .post-title {
        font-size: 26px;
        line-height: 1.3;
    }

    .post-content {
        font-size: 16px;
        line-height: 1.7;
    }

    .post-content > p:first-of-type {
        font-size: 17px;
    }

    .post-content h2 {
        font-size: 22px;
        margin-top: 32px;
    }

    .post-content h2::before {
        width: 40px;
        height: 2px;
        margin-bottom: 12px;
    }

    .post-content h3 {
        font-size: 19px;
    }

    .post-content p {
        margin-bottom: 18px;
    }
}
