/* ==========================================================================
   Blog Styles — list and article views.
   Extracted from templates/blog/post_list.html and post_detail.html.
   ========================================================================== */

/* ==========================================================================
   Post List Page
   ========================================================================== */

    /* Blog Header */
    .blog-header {
        background: var(--gradient-brand);
        color: white;
        padding: 3.5rem 0;
        margin-bottom: 0;
    }

    .blog-header h1 {
        font-size: 2.5rem;
        font-weight: 700;
        margin-bottom: 0.5rem;
    }

    .blog-header .tagline {
        opacity: 0.9;
        font-size: 1.125rem;
        margin-bottom: 0;
    }

    .blog-container {
        max-width: 1100px;
        margin: 0 auto;
        padding: 3rem 1.5rem;
    }

    /* Category tag style */
    .post-category {
        display: inline-block;
        font-size: 0.8125rem;
        font-weight: 600;
        color: var(--primary-color);
        text-decoration: none;
        margin-bottom: 0.5rem;
    }

    .post-category:hover {
        color: #05a8c7;
        text-decoration: underline;
    }

    /* Post title */
    .post-title {
        font-weight: 700;
        color: #1a1a1a;
        line-height: 1.25;
        margin-bottom: 0.75rem;
    }

    .post-title a {
        color: inherit;
        text-decoration: none;
    }

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

    /* Post excerpt */
    .post-excerpt {
        color: #4a4a4a;
        line-height: 1.6;
        margin-bottom: 0.75rem;
    }

    /* Post meta */
    .post-meta {
        font-size: 0.8125rem;
        color: #888;
    }

    .post-meta span {
        margin-right: 0.25rem;
    }

    /* Featured/Hero Post */
    .featured-post {
        display: grid;
        grid-template-columns: 1.2fr 0.8fr;
        gap: 2.5rem;
        margin-bottom: 3rem;
        padding-bottom: 3rem;
        border-bottom: 1px solid #eee;
    }

    .featured-post .post-image {
        border-radius: 8px;
        overflow: hidden;
    }

    .featured-post .post-image img {
        width: 100%;
        height: 350px;
        object-fit: cover;
    }

    .featured-post .post-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .featured-post .post-title {
        font-size: 2rem;
    }

    .featured-post .post-excerpt {
        font-size: 1rem;
    }

    /* Two-column row */
    .two-col-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
        margin-bottom: 3rem;
        padding-bottom: 3rem;
        border-bottom: 1px solid #eee;
    }

    .two-col-row .post-image {
        border-radius: 8px;
        overflow: hidden;
        margin-bottom: 1rem;
    }

    .two-col-row .post-image img {
        width: 100%;
        height: 280px;
        object-fit: cover;
    }

    .two-col-row .post-title {
        font-size: 1.5rem;
    }

    .two-col-row .post-excerpt {
        font-size: 0.9375rem;
    }

    /* Three-column row */
    .three-col-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
        margin-bottom: 3rem;
    }

    .three-col-row .post-image {
        border-radius: 8px;
        overflow: hidden;
        margin-bottom: 1rem;
    }

    .three-col-row .post-image img {
        width: 100%;
        height: 180px;
        object-fit: cover;
    }

    .three-col-row .post-title {
        font-size: 1.125rem;
    }

    .three-col-row .post-excerpt {
        font-size: 0.875rem;
    }

    /* Image placeholder for posts without images */
    .post-image-placeholder {
        width: 100%;
        background: var(--gradient-brand);
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
    }

    .featured-post .post-image-placeholder {
        height: 350px;
    }

    .two-col-row .post-image-placeholder {
        height: 280px;
    }

    .three-col-row .post-image-placeholder {
        height: 180px;
    }

    .post-image-placeholder i {
        font-size: 3rem;
        color: rgba(255, 255, 255, 0.4);
    }

    /* Category Filter */
    .category-filter {
        margin-bottom: 2.5rem;
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        align-items: center;
    }

    .category-filter a {
        font-size: 0.875rem;
        color: #666;
        text-decoration: none;
        padding: 0.375rem 0;
        border-bottom: 2px solid transparent;
        transition: all 0.2s;
    }

    .category-filter a:hover,
    .category-filter a.active {
        color: var(--primary-color);
        border-bottom-color: var(--primary-color);
    }

    /* How many published posts sit behind each pill. */
    .category-count {
        display: inline-block;
        margin-left: 0.375rem;
        padding: 0.05rem 0.4rem;
        border-radius: 999px;
        background: #f1f3f5;
        color: #868e96;
        font-size: 0.75rem;
        font-weight: 600;
        line-height: 1.5;
    }

    .category-filter a:hover .category-count,
    .category-filter a.active .category-count {
        background: rgba(6, 200, 234, 0.12);
        color: var(--primary-color);
    }

    /* Search */
    .blog-search {
        position: relative;
        margin-bottom: 1.5rem;
    }

    .blog-search input {
        width: 100%;
        padding: 0.75rem 2.75rem;
        border: 1px solid #e5e7eb;
        border-radius: 999px;
        font-size: 0.9375rem;
        background: #fff;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .blog-search input:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(6, 200, 234, 0.15);
    }

    .blog-search-icon {
        position: absolute;
        top: 50%;
        left: 1rem;
        transform: translateY(-50%);
        color: #adb5bd;
        pointer-events: none;
    }

    .blog-search-clear {
        position: absolute;
        top: 50%;
        right: 1rem;
        transform: translateY(-50%);
        color: #adb5bd;
        font-size: 0.875rem;
        line-height: 1;
    }

    .blog-search-clear:hover {
        color: #495057;
    }

    .blog-search-summary {
        color: #666;
        font-size: 0.9375rem;
        margin-bottom: 1.5rem;
    }

    /* Pagination */
    .blog-pagination {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 1.5rem;
        padding-top: 2rem;
        border-top: 1px solid #eee;
    }

    .blog-pagination a {
        color: #666;
        text-decoration: none;
        font-size: 0.9375rem;
    }

    .blog-pagination a:hover {
        color: var(--primary-color);
    }

    .blog-pagination .page-info {
        color: #999;
        font-size: 0.875rem;
    }

    /* Empty State */
    .empty-state {
        text-align: center;
        padding: 5rem 2rem;
    }

    .empty-state i {
        font-size: 4rem;
        color: #ddd;
        margin-bottom: 1rem;
    }

    .empty-state h3 {
        color: #666;
        font-weight: 500;
    }

    .empty-state p {
        color: #999;
    }

    /* Responsive */
    @media (max-width: 991px) {
        .featured-post {
            grid-template-columns: 1fr;
            gap: 1.5rem;
        }

        .featured-post .post-title {
            font-size: 1.75rem;
        }

        .two-col-row {
            gap: 2rem;
        }

        .three-col-row {
            grid-template-columns: 1fr 1fr;
        }
    }

    @media (max-width: 575px) {
        .blog-container {
            padding: 2rem 1rem;
        }

        .two-col-row {
            grid-template-columns: 1fr;
        }

        .three-col-row {
            grid-template-columns: 1fr;
        }

        .featured-post .post-image img,
        .featured-post .post-image-placeholder {
            height: 250px;
        }
    }

/* ==========================================================================
   Post Detail Page (article header + .post-content typography)
   ========================================================================== */

    .post-header {
        background: var(--gradient-brand);
        color: white;
        padding: 3rem 0;
    }

    .post-category {
        display: inline-block;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding: 0.375rem 0.75rem;
        border-radius: 50px;
        background: rgba(255, 255, 255, 0.2);
        color: white;
        text-decoration: none;
        margin-bottom: 1rem;
    }

    .post-category:hover {
        background: rgba(255, 255, 255, 0.3);
        color: white;
    }

    .post-header h1 {
        font-size: 2.5rem;
        font-weight: 700;
        margin-bottom: 1rem;
    }

    .post-meta {
        opacity: 0.9;
        display: flex;
        gap: 1.5rem;
        flex-wrap: wrap;
    }

    .post-meta span {
        display: flex;
        align-items: center;
        gap: 0.375rem;
    }

    .post-featured-image {
        margin-top: 1.5rem;
        margin-bottom: 2rem;
    }

    .post-featured-image img {
        width: 100%;
        max-height: 500px;
        object-fit: cover;
        border-radius: 12px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    }
/* Article body. Georgia is the reading face - it is also the first real
   fallback in the New York Times' own body stack
   (nyt-imperial, georgia, 'times new roman', times, serif), so it is as close
   to that texture as anything licensable gets.

   max-width is in `ch` rather than px: it caps the measure at roughly 68
   characters whatever the viewport does, which matters more for readability
   than the point size. col-lg-8 alone lets lines run far too long on a wide
   screen. */
.post-content {
    font-family: var(--font-serif);
    font-size: 1.25rem;    /* 20px - NYT reading size */
    line-height: 1.6;      /* 1.7 opened gaps that striped the column at 20px */
    max-width: 68ch;
}
.post-content p {
    margin-bottom: 1.5rem;
}
/* Heading sizes are in `em` so they scale with .post-content's font-size
   rather than the 16px root. Margins stay in `rem` on purpose: `em` there
   would resolve against each heading's own size and blow the spacing out. */
.post-content h1 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.8em;
}
.post-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.45em;
}
.post-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.2em;
}
.post-content h4 {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 1.05em;
}
.post-content ul, .post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}
.post-content li {
    margin-bottom: 0.5rem;
}
.post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #6b7280;
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
}
.post-content code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}
.post-content pre {
    background-color: #1f2937;
    color: #f3f4f6;
    padding: 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}
.post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}
.post-content th, .post-content td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    text-align: left;
}
.post-content th {
    background: #f8f9fa;
    font-weight: 600;
}
.post-content hr {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 2rem 0;
}

/* Admonition Styles for MyST Directives */
.admonition {
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-left: 4px solid;
}
.admonition-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}
.admonition-content {
    line-height: 1.6;
}
.admonition-note {
    background: #e8f4fd;
    border-color: #0d6efd;
    color: #084298;
}
.admonition-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #664d03;
}
.admonition-danger {
    background: #f8d7da;
    border-color: #dc3545;
    color: #842029;
}
.admonition-tip {
    background: #d1e7dd;
    border-color: #198754;
    color: #0f5132;
}
.admonition-important {
    background: #e0cffc;
    border-color: #6f42c1;
    color: #432874;
}
.admonition-hint {
    background: #e2e3e5;
    border-color: #6c757d;
    color: #41464b;
}
.admonition-caution {
    background: #fff3cd;
    border-color: #fd7e14;
    color: #664d03;
}
.admonition-attention {
    background: #cff4fc;
    border-color: #0dcaf0;
    color: #055160;
}

/* Code syntax highlighting */
.highlight {
    background: #1f2937;
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}

/* ==========================================================================
   Post Page — byline, share, neighbour navigation, related posts
   ========================================================================== */

/* Was an inline style on the template; templates keep their CSS out here. */
.post-draft-badge {
    display: block;
    width: fit-content;
}

.post-byline {
    font-weight: 500;
}

/* Share row */
.post-share {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.post-share-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #666;
}

.post-share-links {
    display: flex;
    gap: 0.5rem;
}

.post-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    background: #fff;
    color: #666;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, transform 0.2s;
}

.post-share-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Previous / next */
.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2.5rem;
}

.post-nav-link {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.post-nav-link:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.post-nav-next {
    text-align: right;
}

.post-nav-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #adb5bd;
}

.post-nav-title {
    color: #1a1a1a;
    font-weight: 600;
    line-height: 1.35;
}

/* Related posts */
.post-related {
    background: #fafbfc;
    border-top: 1px solid #eee;
    padding: 3.5rem 0;
    margin-top: 3rem;
}

.post-related-heading {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1.75rem;
}

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

    .post-nav-next {
        text-align: left;
    }

    .post-share {
        justify-content: flex-start;
    }
}
