.blog-container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 20px;
}

.blog-header {
    text-align: center;
    margin-bottom: 60px;
}

.blog-header h1 {
    font-size: 2.8rem;
    color: var(--heading-color);
    margin-bottom: 10px;
}

.blog-header p {
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0.8;
}

.blog-header .cta-button {
    display: inline-block;
    font-size: 1.1rem;
    transition: transform 0.3s;
}

.blog-header .cta-button:hover {
    transform: scale(1.05);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
}

.post-card {
    background-color: var(--bg-color);
    border-radius: 12px;
    box-shadow: 0 4px 25px var(--shadow-color);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0, 34, 68, 0.1);
}

.post-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background-color: #eee;
}

.post-card-content {
    padding: 25px;
}

.post-card-content h3 {
    margin: 0 0 15px 0;
    font-size: 1.4rem;
    color: var(--heading-color);
}

.post-card-content p {
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    opacity: 0.8;
}

.post-card-link {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
}

.post-card-link:hover {
    text-decoration: underline;
}

.loading-spinner {
    border: 6px solid var(--border-color);
    border-top: 6px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 80px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- New Styles for Single Post Page --- */
.post-meta-data {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 15px 0;
    margin-bottom: 25px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.post-meta-item {
    font-size: 0.95rem;
    color: var(--text-color);
    opacity: 0.8;
    font-weight: 500;
}

.post-meta-item strong {
    color: var(--text-color);
}

/* === NEW COMMENT SECTION STYLES === */
.comments-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.comments-section h2 {
    font-size: 2rem;
    color: var(--heading-color);
    margin-bottom: 30px;
    text-align: left;
}

#comment-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

#comment-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
    resize: vertical;
    background-color: var(--surface-color);
}

#comment-form-anon {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

#comment-form-anon input {
    width: auto;
}

#comment-form button {
    align-self: flex-start;
}

.comment-login-prompt {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
    opacity: 0.8;
}

.comment-login-prompt a {
    font-weight: 600;
    color: var(--primary-color);
}

#comment-thread {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.comment-bubble {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: 600;
    color: var(--heading-color);
}

.comment-date {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.7;
}

.comment-body {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-color);
}

.delete-comment-btn {
    background: none;
    border: none;
    color: var(--error-color);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 5px;
}

.delete-comment-btn:hover {
    text-decoration: underline;
}

/* --- NEW: Category Tag Style --- */
.category-tag {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
}

/* === UPDATED: 3-Column Post Layout === */
.post-page-grid {
    display: grid;
    grid-template-columns: 1fr 3fr 1fr;
    gap: 30px;
}

.post-main-content {
    max-width: 100%;
}

#left-sidebar {
    padding: 20px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    height: fit-content; 
    position: sticky;
    top: 100px; 
}

#left-sidebar-ads, #right-sidebar-ads {
    position: sticky;
    top: 100px; 
}

#left-sidebar h3 {
    font-size: 1.2rem;
    color: var(--heading-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-top: 0;
}

#right-sidebar-ads ins, #left-sidebar-ads ins {
    display: block;
    width: 100%;
    text-align: center;
    color: var(--text-color);
    opacity: 0.7;
}

/* === NEW: Popular Post Link Styles === */
.popular-post-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-color);
    margin-bottom: 15px;
    transition: background-color 0.3s;
    border-radius: 8px;
    padding: 8px;
}

.popular-post-link:hover {
    background-color: var(--bg-color);
}

.popular-post-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
}

.popular-post-link span {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* === NEW: Social Share Buttons === */
.social-share-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.social-share-btn {
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s;
}

.social-share-btn:hover {
    opacity: 0.8;
}

.social-share-btn.facebook { background-color: #1877F2; }
.social-share-btn.whatsapp { background-color: #25D366; }
.social-share-btn.copy-link { background-color: #6c757d; }
.social-share-btn.share-native { background-color: var(--primary-color); }

.hidden {
    display: none;
}

@media (max-width: 1200px) {
    .post-page-grid {
        grid-template-columns: 1fr;
    }

    #left-sidebar, #right-sidebar-ads, #left-sidebar-ads {
        display: none;
    }
}

@media (max-width: 768px) {
    .blog-header h1 {
        font-size: 2.2rem;
    }
    .blog-header p {
        font-size: 1.1rem;
    }
    .blog-grid {
        grid-template-columns: 1fr;
    }
    .post-meta-data {
        flex-direction: column;
        align-items: flex-start;
    }
    .comments-section h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .blog-header h1 {
        font-size: 1.8rem;
    }
    .blog-header p {
        font-size: 1rem;
    }
    .post-card-content {
        padding: 20px;
    }
    .post-card-content h3 {
        font-size: 1.2rem;
    }
}