/* ============================================================================
   Blog Styles
   Follows the design system established in main.css
   ============================================================================ */

/* Blog Layout
   ============================================================================ */

.blog-wrapper {
    min-height: calc(100vh - 120px - 300px);
    padding-top: 1rem;
    padding-bottom: 4rem;
}

.blog-subtitle {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 0.5rem;
    color: var(--text-light);
    font-size: 1.125rem;
    line-height: 1.6;
}

.blog-empty {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-light);
    font-style: italic;
}

/* Breadcrumb
   ============================================================================ */

.blog-breadcrumb {
    margin-bottom: 2rem;
    color: var(--text-lighter);
    font-size: 0.9rem;
    line-height: 1.6;
}

.blog-breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.blog-breadcrumb a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Filters (Category pills + Tag pills)
   ============================================================================ */

.blog-filters {
    margin-bottom: 2.5rem;
}

.blog-category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.filter-pill {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    background-color: var(--background-light);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    text-decoration: none;
    transition: var(--transition);
}

.filter-pill:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
}

.filter-pill.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.blog-tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.tag-pill {
    display: inline-block;
    padding: 0.375rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    text-decoration: none;
    transition: var(--transition);
}

.tag-pill:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
}

.tag-pill.active {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.tag-pill-sm {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-lighter);
    background-color: var(--background-light);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    text-decoration: none;
    transition: var(--transition);
}

.tag-pill-sm:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
}

/* Post Cards (Listing pages)
   ============================================================================ */

.blog-post-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.blog-post-card {
    display: flex;
    flex-direction: row;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-light);
}

.blog-post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.post-card-image {
    flex: 0 0 280px;
    overflow: hidden;
}

.post-card-image a {
    display: block;
    height: 100%;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-post-card:hover .post-card-image img {
    transform: scale(1.05);
}

.post-card-body {
    flex: 1;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
}

.post-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.post-category-label {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    background-color: rgba(26, 188, 156, 0.1);
    border-radius: 4px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.post-category-label:hover {
    background-color: rgba(26, 188, 156, 0.2);
    color: var(--primary-dark);
    text-decoration: none;
}

.post-date {
    color: var(--text-lighter);
}

.post-issue-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background-color: var(--secondary-color);
    border-radius: 4px;
    letter-spacing: 0.3px;
}

.post-card-title {
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.post-card-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.post-card-title a:hover {
    color: var(--primary-color);
}

.post-card-excerpt {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: auto;
}

.post-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.read-more-link {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition);
    margin-left: auto;
}

.read-more-link:hover {
    color: var(--primary-dark);
    transform: translateX(3px);
}

/* Pagination
   ============================================================================ */

.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

.pagination-link {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    text-decoration: none;
    transition: var(--transition);
}

.pagination-link:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

.pagination-info {
    color: var(--text-lighter);
    font-size: 0.9rem;
}

/* Post Detail Page
   ============================================================================ */

.blog-post-detail {
    max-width: 800px;
    margin: 0 auto;
}

/* Post Header */
.post-header {
    margin-bottom: 2rem;
}

.post-header-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.post-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--text-lighter);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.post-author {
    font-weight: 500;
    color: var(--text-light);
}

.post-meta-divider {
    color: var(--border-color);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.25rem;
}

/* Featured Image */
.post-featured-image {
    margin-bottom: 2.5rem;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Post Content — the included template body
   Softened reading experience: off-white background, gentler contrast
   ============================================================================ */

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #2c2c3a;
    background-color: #f9f9fb;
    padding: 2.5rem 2.5rem;
    border-radius: 12px;
    border: 1px solid #ededf0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.post-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e4e4ea;
}

.post-content h3 {
    font-size: 1.375rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.post-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}

.post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background-color: #f0f0f5;
    border-radius: 0 8px 8px 0;
    color: #4a4a5a;
    font-style: italic;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

.post-content code {
    background-color: #eeeef3;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #2c2c3a;
    border: 1px solid #dddde3;
}

.post-content pre {
    background-color: #1e1e2e;
    color: #cdd6f4;
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    line-height: 1.5;
    border: 1px solid #313145;
}

.post-content pre code {
    background-color: transparent;
    padding: 0;
    border: none;
    color: inherit;
    font-size: 0.9rem;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 1rem;
    box-shadow: var(--shadow-sm);
    border-radius: 8px;
    overflow: hidden;
}

.post-content th {
    background-color: var(--primary-color);
    color: white;
    text-align: left;
    padding: 0.875rem 1rem;
    font-weight: 600;
}

.post-content td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e4e4ea;
}

.post-content tr:nth-child(even) {
    background-color: #f0f0f5;
}

.post-content tr:hover {
    background-color: #e8e8ef;
}

.post-content a {
    color: var(--primary-color);
    text-decoration: underline;
    text-decoration-color: rgba(26, 188, 156, 0.4);
    text-underline-offset: 2px;
    transition: var(--transition);
}

.post-content a:hover {
    color: var(--primary-dark);
    text-decoration-color: var(--primary-dark);
}

.post-content hr {
    border: none;
    border-top: 2px solid #e4e4ea;
    margin: 2.5rem 0;
}

/* Post Footer
   ============================================================================ */

.post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--background-medium);
}

.post-share {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.share-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
}

.share-links {
    display: flex;
    gap: 0.5rem;
}

.share-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 1rem;
    transition: var(--transition);
    text-decoration: none;
}

.share-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    color: white;
    text-decoration: none;
}

.share-linkedin {
    background-color: #0077B5;
}

.share-linkedin:hover {
    background-color: #005f8d;
}

.share-twitter {
    background-color: #1DA1F2;
}

.share-twitter:hover {
    background-color: #0d8bd9;
}

/* Related Posts
   ============================================================================ */

.related-posts-section {
    max-width: 800px;
    margin: 3rem auto 0;
    padding-top: 2.5rem;
    border-top: 2px solid var(--background-medium);
}

.related-posts-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.blog-post-card-sm {
    flex-direction: column;
}

.blog-post-card-sm .post-card-image {
    flex: none;
    height: 160px;
}

.blog-post-card-sm .post-card-body {
    padding: 1.25rem;
}

.blog-post-card-sm .post-card-title {
    font-size: 1.125rem;
}

.blog-post-card-sm .post-card-excerpt {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Responsive Design
   ============================================================================ */

@media (max-width: 991px) {
    .post-title {
        font-size: 2rem;
    }

    .post-content {
        font-size: 1.05rem;
        padding: 2rem;
    }

    .post-content h2 {
        font-size: 1.5rem;
    }

    .post-content h3 {
        font-size: 1.25rem;
    }

    .post-card-image {
        flex: 0 0 220px;
    }

    .related-posts-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767px) {
    .blog-wrapper {
        padding-bottom: 2rem;
    }

    .blog-post-card {
        flex-direction: column;
    }

    .post-card-image {
        flex: none;
        height: 200px;
    }

    .post-card-body {
        padding: 1.25rem;
    }

    .post-card-title {
        font-size: 1.2rem;
    }

    .post-title {
        font-size: 1.75rem;
    }

    .post-content {
        font-size: 1rem;
        padding: 1.5rem;
    }

    .post-content h2 {
        font-size: 1.375rem;
    }

    .post-content h3 {
        font-size: 1.125rem;
    }

    .post-featured-image {
        margin-bottom: 1.5rem;
    }

    .post-share {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .blog-post-card-sm .post-card-image {
        height: 180px;
    }

    .blog-pagination {
        gap: 0.75rem;
    }

    .pagination-link {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .filter-pill {
        padding: 0.375rem 1rem;
        font-size: 0.85rem;
    }

    .blog-breadcrumb {
        font-size: 0.8rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 576px) {
    .post-title {
        font-size: 1.5rem;
    }

    .post-header-meta {
        flex-wrap: wrap;
    }

    .post-meta {
        font-size: 0.85rem;
    }

    .post-content {
        font-size: 0.95rem;
        line-height: 1.7;
        padding: 1.25rem;
    }

    .post-content pre {
        padding: 1rem;
        font-size: 0.8rem;
    }

    .post-content table {
        font-size: 0.85rem;
    }

    .post-content th,
    .post-content td {
        padding: 0.5rem 0.625rem;
    }
}

/* Print Styles
   ============================================================================ */

@media print {
    .blog-filters,
    .blog-pagination,
    .post-share,
    .related-posts-section,
    .blog-breadcrumb {
        display: none;
    }

    .blog-post-detail {
        max-width: 100%;
    }

    .post-content {
        background-color: white;
        border: none;
        box-shadow: none;
        padding: 0;
    }

    .post-content a {
        text-decoration: none;
        color: var(--text-color);
    }

    .post-content a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: var(--text-lighter);
    }
}