/* ==========================================================================
   Enhanced Post Layout Styles
   ========================================================================== */

/* Featured Image */
.featured-image {
    width: 100%;
    margin: 1.5rem 0 2rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.featured-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 500px;
}

/* Post Description/Summary */
.post-description {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-top: 1.5rem;
    padding: 1.25rem 1.75rem;
    background: var(--code-background);
    border-left: 4px solid var(--accent-color);
    border-radius: 8px;
    font-style: italic;
}

/* Post Meta Enhancements */
.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.post-meta i {
    margin-right: 0.35rem;
    opacity: 0.8;
}

.post-author {
    font-weight: 600;
}

.tags .tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    background: var(--tag-background, rgba(99, 102, 241, 0.1));
    color: var(--tag-color, #6366F1);
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tags .tag:hover {
    background: var(--tag-hover-background, rgba(99, 102, 241, 0.2));
    transform: translateY(-1px);
}

/* Social Sharing */
.social-sharing {
    margin: 3rem 0 2rem 0;
    padding: 2rem;
    background: var(--card-background);
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.sharing-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
}

.sharing-title i {
    color: var(--accent-color);
}

.sharing-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.share-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.share-button i {
    font-size: 1.1rem;
}

/* Twitter */
.share-button.twitter {
    background: linear-gradient(135deg, #1DA1F2 0%, #0d8dd9 100%);
    color: #fff;
}

.share-button.twitter:hover {
    background: linear-gradient(135deg, #0d8dd9 0%, #0a7bc4 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 161, 242, 0.3);
}

/* LinkedIn */
.share-button.linkedin {
    background: linear-gradient(135deg, #0077B5 0%, #005a8a 100%);
    color: #fff;
}

.share-button.linkedin:hover {
    background: linear-gradient(135deg, #005a8a 0%, #004570 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 119, 181, 0.3);
}

/* Reddit */
.share-button.reddit {
    background: linear-gradient(135deg, #FF4500 0%, #d93900 100%);
    color: #fff;
}

.share-button.reddit:hover {
    background: linear-gradient(135deg, #d93900 0%, #b32e00 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 69, 0, 0.3);
}

/* Hacker News */
.share-button.hackernews {
    background: linear-gradient(135deg, #FF6600 0%, #e65c00 100%);
    color: #fff;
}

.share-button.hackernews:hover {
    background: linear-gradient(135deg, #e65c00 0%, #cc5200 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

/* Related Posts */
.related-posts {
    margin: 3rem 0 2rem 0;
    padding: 2rem;
    background: var(--card-background);
    border-radius: 12px;
    border-top: 4px solid var(--accent-color);
}

.related-posts-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
}

.related-posts-title i {
    color: var(--accent-color);
}

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

.related-post-card {
    background: var(--background-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.related-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-color);
}

.related-post-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: var(--code-background);
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-post-card:hover .related-post-image img {
    transform: scale(1.05);
}

.related-post-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.related-post-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
}

.related-post-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.related-post-title a:hover {
    color: var(--accent-color);
}

.related-post-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.related-post-meta i {
    opacity: 0.7;
}

.related-post-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
    flex: 1;
}

.related-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.tag-mini {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--tag-background, rgba(99, 102, 241, 0.1));
    color: var(--tag-color, #6366F1);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Enhanced Post Navigation */
.post-navigation {
    margin: 3rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.post-navigation a {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem;
    background: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.post-navigation a:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .featured-image {
        margin: 1rem -1rem;
        border-radius: 0;
    }

    .featured-image img {
        max-height: 300px;
    }

    .post-description {
        font-size: 1.05rem;
        padding: 1rem 1.25rem;
    }

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

    .share-button {
        width: 100%;
        justify-content: center;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .post-navigation {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode Specific Adjustments */
body.dark .related-post-card {
    background: rgba(0, 0, 0, 0.3);
}

body.dark .social-sharing {
    background: rgba(0, 0, 0, 0.2);
}

body.dark .related-posts {
    background: rgba(0, 0, 0, 0.2);
}

/* Print Styles */
@media print {
    .social-sharing,
    .related-posts,
    .featured-image {
        page-break-inside: avoid;
    }

    .share-button {
        display: none;
    }
}
