@font-face {
    font-family: 'Computer Modern';
    src: url('./fonts/CMU-Roman.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Computer Modern';
    src: url('./fonts/CMU-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
}

@font-face {
    font-family: 'CMU Serif Upright Italic';
    src: url('./fonts/CMU-UprightItalic.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Computer Modern', serif;
    color: black;
    background: white;
    line-height: 1.4;
    font-size: 16px;
}

a { color: black; text-decoration: none; }

.container { max-width: 760px; margin: 0 auto; padding: 0 40px; }

/* Header */
header { text-align: center; padding: 20px; }

header h1 {
    font-size: 1.35em;
    font-weight: normal;
    letter-spacing: 1px;
}

header h1 a {
    font-family: 'Computer Modern', serif;
    font-style: normal;
}

header h1 a:hover { color: #888; }

/* Main */
main { padding: 40px 0 80px; min-height: calc(100vh - 300px); }

/* Writing list: title with date underneath, left-aligned */
body.writing-page .container { max-width: 760px; }
@media (min-width: 769px) { .post-meta h3 { white-space: nowrap; } }

.post-constellation {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
    text-align: left;
}

.post-link { display: block; color: inherit; }
.post-thumb { display: none; }

.post-meta h3,
.post-date {
    font-size: 1.05em;
    font-weight: normal;
    margin: 0;
}

.post-card:hover .post-meta,
.post-card:focus-within .post-meta { color: #888; }

/* Article page */
p.story-title { font-style: italic; font-size: 1.05em; text-align: center; margin-bottom: 5px; }
p.story-author { font-size: 1.05em; text-align: center; }
.story-spacer { height: 3em; }
.story-body { font-size: 1.05em; line-height: 1.4; }
.story-body p { margin-bottom: 0.5em; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.story-image { margin: 0 auto 3em; width: 75%; }
.story-image img { width: 100%; display: block; }

.story-body blockquote {
    margin: 1em 15%;
    padding: 0;
}
@media (max-width: 768px) { .story-body blockquote { margin: 1em 7%; } }
.story-body blockquote p { margin-bottom: 0.5em; }
.math-block, mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; max-width: 100%; }
.math-block { margin: 1em 0; }

.back-link {
    font-size: 1.05em;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ccc;
}
.back-link a:hover { color: #888; }

/* Footer */
footer {
    border-top: 1px solid black;
    padding: 30px 0;
    text-align: center;
    font-size: 1.05em;
    margin-top: 60px;
}

/* Mobile */
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
    body { font-size: 14px; }
    .container, body.writing-page .container { max-width: 100%; padding: 0 20px; }
    header h1 { font-size: 1.25em; }
    main { padding: 20px 0 40px; }
    .story-spacer { height: 2em; }
    .story-image { width: 100%; }
}
