/* ========================================= */
/* Posts Page Specific Styles (Mobile First) */
/* ========================================= */

.posts-main {
    flex-grow: 1;
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    padding: 2rem 1rem;
    box-sizing: border-box;
    font-family: 'Anek Sinhala', sans-serif;
    color: #1f2937;
}

/* --- Header Section --- */
.posts-header-section {
    text-align: center;
    margin-bottom: 2rem;
}

.posts-page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #111827;
}

.posts-subtitle {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
}

/* --- Posts Grid --- */
.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* --- Post Card --- */
.post-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(212, 163, 115, 0.2); /* var(--brand-gold) with opacity */
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.post-card-img-wrap {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-card-img-wrap.no-image {
    color: #9ca3af;
    font-size: 3rem;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

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

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

.post-card-body {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.post-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    line-height: 1.4;
    color: #111827;
}

.post-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
}

/* --- Single Post View --- */
.single-post {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(212, 163, 115, 0.2);
    margin-bottom: 2rem;
}

.post-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.post-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111827;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

@media (min-width: 768px) {
    .single-post {
        padding: 3rem;
    }
    .post-title {
        font-size: 2.25rem;
    }
}

.post-meta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 600;
}

.post-featured-image {
    width: 100%;
    overflow: hidden;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-content {
    font-size: 1rem;
    line-height: 1.7;
    color: #374151;
}

/* Summernote Content Adjustments */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.post-content h2, .post-content h3, .post-content h4 {
    color: #111827;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.post-content a {
    color: #d4a373; /* var(--brand-gold) */
    text-decoration: underline;
}

.post-content ul, .post-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.post-actions {
    text-align: center;
    margin-top: 2rem;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #f3f4f6;
    color: #4b5563;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-back:hover {
    background-color: #e5e7eb;
    color: #1f2937;
}

/* --- Empty State --- */
.no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    background: #f9fafb;
    border-radius: 1rem;
    border: 2px dashed #d1d5db;
    color: #6b7280;
}

.icon-large {
    font-size: 3rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}
