/* Blog styles, layered on latex.css + the academic styles.css.
   Narrower measure and slightly larger type than the homepage, tuned for
   long-form reading. */

body.blog {
    max-width: 42rem;
    padding: 2rem 1.25rem 3rem;
    font-size: 1.12rem;
    line-height: 1.75;
}

/* ---- Index ------------------------------------------------------------ */

.blog-header,
.post-header {
    display: block;
}

.blog-header {
    margin: 2.5rem 0 2rem;
}

.blog-title-row,
.blog-topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.blog-title {
    font-size: 2.4rem;
    margin: 0;
    text-align: left;
}

.blog-byline {
    margin: 0.2rem 0 0;
    color: #666;
    font-style: italic;
}

.blog-year {
    font-size: 1.1rem;
    margin: 2rem 0 0.4rem;
    color: #888;
    font-variant: small-caps;
    letter-spacing: 0.05em;
}

.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.post-list li {
    display: grid;
    grid-template-columns: 4.2rem 1fr;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid #eee;
}

.post-list time {
    color: #888;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.post-list a {
    font-size: 1.1rem;
    text-decoration: none;
    color: inherit;
    font-weight: 600;
}

.post-list a:hover {
    color: #a80000;
}

.post-list-desc {
    margin: 0.1rem 0 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

.blog-muted {
    color: #888;
}

/* ---- Post ------------------------------------------------------------- */

.blog-topnav {
    margin: 2.5rem 0 1.5rem;
    font-size: 0.95rem;
}

.blog-topnav a,
.post-end a {
    color: #666;
    text-decoration: none;
}

.blog-topnav a:hover,
.post-end a:hover {
    color: #a80000;
}

.post-header {
    margin-bottom: 2rem;
}

.post-header h1 {
    font-size: 2.1rem;
    line-height: 1.25;
    margin: 0 0 0.5rem;
    text-align: left;
}

.post-meta {
    color: #777;
    font-size: 0.95rem;
    margin: 0;
}

.post-meta a {
    color: inherit;
}

.draft-banner {
    display: inline-block;
    margin: 0 0 0.8rem;
    padding: 0.1rem 0.6rem;
    border: 1px dashed #c77;
    border-radius: 4px;
    color: #a33;
    font-size: 0.85rem;
}

.post-body h2 {
    font-size: 1.45rem;
    margin: 2.2rem 0 0.6rem;
}

.post-body h3 {
    font-size: 1.2rem;
    margin: 1.8rem 0 0.5rem;
}

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

.post-body li {
    margin-bottom: 0.3rem;
}

/* Heading permalinks: hidden until hover. */
.post-body .headerlink {
    margin-left: 0.4rem;
    color: #bbb;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.15s;
}

.post-body h2:hover .headerlink,
.post-body h3:hover .headerlink,
.post-body h4:hover .headerlink {
    opacity: 1;
}

.post-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.5rem auto;
    border-radius: 4px;
}

.post-body blockquote {
    margin: 1.5rem 0;
    padding: 0.1rem 0 0.1rem 1.2rem;
    border-left: 3px solid #ddd;
    color: #555;
    font-style: italic;
}

.post-body > hr {
    border: none;
    text-align: center;
    margin: 2.5rem 0;
}

.post-body > hr::after {
    content: "* * *";
    color: #999;
    letter-spacing: 0.5em;
}

.post-body .highlight {
    margin: 1.4rem 0;
    border-radius: 4px;
    overflow: hidden;
}

.post-body .highlight pre {
    margin: 0;
    background: transparent;
    line-height: 1.5;
}

.post-body :not(pre) > code {
    padding: 0.1em 0.3em;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.05);
}

.post-body table {
    margin: 1.5rem auto;
}

.post-body .footnote hr {
    width: 6rem;
    margin: 0 0 1rem;
    border: none;
    border-top: 1px solid #ccc;
}

body.latex-dark .post-body .footnote hr {
    border-top-color: #444;
}

.post-body .footnote {
    margin-top: 3rem;
    font-size: 0.9rem;
    color: #555;
}

.post-end {
    margin: 3rem 0 0;
    font-size: 0.95rem;
}

.blog-footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    color: #777;
}

.blog-footer p {
    margin: 0;
}

/* ---- Dark mode -------------------------------------------------------- */

body.latex-dark .blog-byline,
body.latex-dark .post-list-desc,
body.latex-dark .post-meta,
body.latex-dark .blog-topnav a,
body.latex-dark .post-end a,
body.latex-dark .post-body blockquote,
body.latex-dark .post-body .footnote {
    color: #aaa;
}

body.latex-dark .post-list li,
body.latex-dark .blog-footer {
    border-color: #333;
}

body.latex-dark .post-list a:hover,
body.latex-dark .blog-topnav a:hover,
body.latex-dark .post-end a:hover {
    color: #95daf3;
}

body.latex-dark .post-body blockquote {
    border-color: #444;
}

body.latex-dark .post-body :not(pre) > code {
    background: rgba(255, 255, 255, 0.08);
}

body.latex-dark .draft-banner {
    border-color: #a66;
    color: #e99;
}

@media (max-width: 720px) {
    body.blog {
        font-size: 1.05rem;
    }
    .blog-header,
    .blog-topnav {
        margin-top: 0.5rem;
    }
    .post-header h1 {
        font-size: 1.75rem;
    }
}
