/* Blog article and index styles. Font families mirror the homepage;
   the homepage strip is isolated in blog-home.css to avoid global overrides. */

:root {
    color-scheme: light;
    --ink: #20252d;
    --muted: #626975;
    --accent: #315c91;
    --line: #e2e6eb;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 2rem;
}

body {
    margin: 0;
    background: #fff;
    color: var(--ink);
    font-family: 'Lato', Verdana, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

a {
    color: var(--accent);
    text-underline-offset: .2em;
}

a:hover {
    text-decoration-thickness: 2px;
}

a:focus-visible, summary:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 5px;
}

.site-header {
    max-width: 1080px;
    margin: auto;
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
}

.site-header a {
    text-decoration: none;
}

.brand {
    font-weight: 700;
    color: var(--ink);
}

.site-header nav {
    display: flex;
    gap: 24px;
}

main {
    max-width: 800px;
    margin: 64px auto 80px;
    padding: 0 28px;
}

h1 {
    font-size: 28px;
    line-height: 1.25;
    margin: 16px 0 22px;
    font-weight: 300;
}

main > article > header h1 {
    font-size: 32px;
    font-weight: 700;
}

.metadata {
    font-size: 15px;
    color: var(--muted);
}

.languages {
    display: flex;
    gap: 16px;
    margin: 22px 0 32px;
    font-size: 16px;
}

.languages [aria-current] {
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 2px solid var(--ink);
}

.teaser {
    margin: 36px -70px;
}

.teaser img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

figcaption {
    font-size: 14px;
    color: var(--muted);
    text-align: center;
    margin-top: 10px;
}

.disclaimer {
    border-left: 3px solid #b9cbe2;
    padding: 12px 20px;
    background: #f5f7fa;
    margin: 28px 0;
    font-size: 16px;
}

.disclaimer p {
    margin: 0;
}

.contents {
    margin: 32px 0 42px;
    padding: 18px 24px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 16px;
}

.contents summary {
    cursor: pointer;
    font-weight: 700;
}

.contents ol {
    padding-left: 24px;
    margin-bottom: 0;
}

.contents a {
    text-decoration: none;
}

section {
    margin-top: 44px;
}

h2 {
    font-size: 21px;
    line-height: 1.35;
    font-weight: 400;
    margin: 0 0 12px;
}

/* Match homepage paragraph/heading families (hugo-academic.css).
   The body stack above matches mobile.css; homepage intro text is 16px / 1.6. */
p, h1, h2, h3, h4, h5, h6 {
    font-family: 'Lato', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    text-rendering: optimizeLegibility;
}

h3 {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.35;
}

p {
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 18px;
}

.frequency {
    display: inline-block;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
}

.pipeline {
    background: #f5f7fa;
    border-radius: 6px;
    padding: 16px 20px;
    font-size: 16px;
    line-height: 1.6;
}

.ending {
    margin-top: 36px;
}

.post-footer {
    border-top: 1px solid var(--line);
    margin-top: 48px;
    padding-top: 24px;
    font-size: 16px;
}

.post-card h3 a {
    color: var(--ink);
    text-decoration: none;
}

.post-card h3 a:hover {
    color: var(--accent);
}

@media (max-width: 980px) {
    .teaser {
        margin: 30px 0;
    }
}

@media (max-width: 600px) {
    .site-header {
        padding: 18px 20px;
    }
    .site-header nav {
        gap: 16px;
    }
    main {
        margin-top: 36px;
        padding: 0 20px;
    }
    .contents {
        padding: 16px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

.post-card {
    border-bottom: 1px solid var(--line);
    position: relative;
    display: block;
    font-family: 'Lato', sans-serif;
    padding: 18px 0;
}

.post-card .post-primary-link::after {
    content: "";
    position: absolute;
    inset: 0;
}

.post-card .post-links a {
    position: relative;
    z-index: 1;
}

.post-card:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.post-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.35;
}

.post-card .post-details {
    display: flex;
    align-items: baseline;
    gap: 18px;
    font-size: 14px;
    line-height: 1.5;
}

.post-card .metadata {
    margin: 0;
    min-width: 110px;
    font-size: inherit;
    font-weight: 400;
}

.post-card .post-links {
    display: flex;
    gap: 14px;
    font-size: inherit;
}

/* Year-grouped blog posts use visual cards; earlier-writing rows retain the
   minimal .post-card layout above. No article or homepage styles are changed. */
.post-card-modern {
    margin-top: 16px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.post-card-modern.has-preview {
    display: grid;
    grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
    align-items: center;
    gap: 24px;
}

.post-card-modern .post-preview {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 5px;
}

.post-card-modern h3 {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 14px;
}

.post-card-modern .post-details {
    flex-wrap: wrap;
    gap: 8px 18px;
}

.post-card-modern:hover,
.post-card-modern:focus-within {
    border-color: #aebfd3;
    box-shadow: 0 4px 16px rgb(24 43 73 / 8%);
}

@media (max-width: 600px) {
    .post-card-modern.has-preview {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .post-card-modern {
        padding: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .post-card-modern {
        transition: none;
    }
}
