/* Article styling for blog posts. Loaded after ../style.css, which supplies the
   theme variables, header, footer and badge styles. */

.post-wrap {
    padding: 7.5rem var(--spacing-sm) var(--spacing-lg);
}

/* The article sits on a light "paper" card so long text and equations stay readable on the dark theme */
.post {
    max-width: 780px;
    margin: 0 auto;
    background-color: #f8fafc;
    color: #1c3340;
    border-radius: var(--border-radius-lg);
    padding: 3rem 3rem 2.5rem;
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
}

.post .blog-meta {
    margin-bottom: var(--spacing-sm);
}

.post .blog-badge {
    background-color: rgba(11, 59, 79, 0.08);
    color: #0b6e8a;
    border-color: rgba(11, 110, 138, 0.3);
}

.post .blog-read-time {
    color: #5b7280;
}

.post h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    line-height: 1.15;
    color: #051d28;
    margin-bottom: var(--spacing-sm);
}

.post-subtitle {
    font-size: 1.15rem;
    line-height: 1.5;
    color: #4a6371;
    font-style: italic;
    margin-bottom: var(--spacing-sm);
}

.post-byline {
    font-size: 0.95rem;
    color: #5b7280;
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid #d6e2e8;
    margin-bottom: var(--spacing-md);
}

.noscript-note {
    background: #fff4d6;
    border: 1px solid #e8cf8a;
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 0.75rem;
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
}

/* Body text */
.post-body {
    font-size: 1.05rem;
    line-height: 1.75;
}

.post-body p {
    margin: 1.1rem 0;
}

.post-body h2 {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    line-height: 1.25;
    color: #0b3b4f;
    margin: 2.75rem 0 1rem;
}

.post-body h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: #0b3b4f;
    margin: 2rem 0 0.75rem;
}

.post-body a {
    color: #0b6e8a;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-body a:hover {
    color: #0ea5e9;
}

.post-body hr {
    border: 0;
    border-top: 1px solid #d6e2e8;
    margin: 2.5rem 0;
}

.post-body blockquote {
    margin: 1.5rem 0;
    padding: 0.5rem 1.25rem;
    border-left: 4px solid #22d3ee;
    background: #eef7fa;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    color: #25434f;
}

.post-body blockquote p {
    margin: 0.5rem 0;
}

.post-body ul,
.post-body ol {
    margin: 1rem 0 1rem 1.5rem;
}

.post-body ul {
    list-style: disc;
}

.post-body li {
    margin: 0.4rem 0;
}

/* Equations: long ones scroll sideways instead of breaking the layout */
.post-body .katex-display {
    margin: 1.4rem 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.25rem 0;
}

/* Figures */
.post-body figure {
    margin: 2rem 0;
}

.post-body figure img {
    width: 100%;
    height: auto;
    background: #fff;
    border: 1px solid #d6e2e8;
    border-radius: var(--border-radius-sm);
}

.post-body figcaption {
    margin-top: 0.6rem;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #4a6371;
    font-style: italic;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    margin: 1.75rem 0;
}

.post-body table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.92rem;
    line-height: 1.45;
}

.post-body th,
.post-body td {
    border: 1px solid #d6e2e8;
    padding: 0.6rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

.post-body th {
    background: #e4eff4;
    color: #0b3b4f;
}

/* References are a long list: keep them compact */
.post-body h2#references ~ ul,
.post-body h3 ~ ul {
    font-size: 0.93rem;
    line-height: 1.55;
}

@media (max-width: 768px) {
    .post-wrap {
        padding-top: 6rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .post {
        padding: 1.75rem 1.1rem 1.5rem;
    }

    .post h1 {
        font-size: 1.9rem;
    }

    .post-body {
        font-size: 1rem;
    }

    .post-body h2 {
        font-size: 1.4rem;
    }
}
