/* Blog styles. Same palette and fonts as index.html. */

* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background-color: #232223;
    color: #cccccc;
    line-height: 1.7;
}

a { color: #847C6D; text-decoration: none; transition: color 0.3s ease; }
a:hover { color: #94A3A1; text-decoration: underline; }

/* ---------- Header (mirrors the homepage) ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #32302C;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    padding: 0 20px;
}

.header-content {
    max-width: 1200px;
    min-height: 60px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.site-title {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 1.6em;
    color: #94A3A1;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.site-title:hover { color: #94A3A1; text-decoration: none; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; }
.site-nav li { margin: 0 15px; }

.site-nav a {
    color: #94A3A1;
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 5px;
}
.site-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: #847C6D;
    transition: width 0.3s ease-out;
}
.site-nav a:hover, .site-nav a.active { color: #847C6D; text-decoration: none; }
.site-nav a:hover::after, .site-nav a.active::after { width: 100%; }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #94A3A1;
    font-size: 1.6em;
    cursor: pointer;
}

/* ---------- Layout ---------- */

main {
    max-width: 900px;
    margin: 20px auto 48px;
    padding: 0 20px;
}

.section {
    background-color: #363C3D;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

h1, h2, h3, h4 {
    font-family: 'Oswald', sans-serif;
    color: #847C6D;
    line-height: 1.3;
}

.section > h1,
.post-header h1 {
    font-size: 2em;
    margin: 0 0 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #94A3A1;
    padding-bottom: 5px;
}

/* ---------- Index and tag pages ---------- */

.blog-intro a { margin-left: 12px; white-space: nowrap; }

.blog-index h2.year {
    font-size: 1.3em;
    color: #94A3A1;
    margin: 32px 0 8px;
}

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list > li {
    padding: 16px 0;
    border-bottom: 1px solid rgba(148, 163, 161, 0.15);
}
.post-list > li:last-child { border-bottom: none; }
.post-list h3 { font-size: 1.35em; margin: 2px 0 6px; }
.post-list .summary,
.post-list .summary p { margin: 0; }

.post-list.compact > li { padding: 6px 0; border: none; }
.post-list.compact time {
    display: inline-block;
    min-width: 7.5em;
    color: #94A3A1;
    font-size: 0.9em;
}

.post-meta {
    margin: 0;
    font-size: 0.85em;
    color: #94A3A1;
}

.tag {
    display: inline-block;
    margin-left: 8px;
    padding: 0 8px;
    border: 1px solid #847C6D;
    border-radius: 4px;
    font-size: 0.9em;
    line-height: 1.6;
}
.tag:hover { background-color: #847C6D; color: #232223; text-decoration: none; }

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

.post-header .post-meta { margin-bottom: 8px; }

.readings {
    background-color: #2E3334;
    border-left: 3px solid #847C6D;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 28px;
}
.readings-label {
    font-family: 'Oswald', sans-serif;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94A3A1;
}
.readings ul { margin: 4px 0 0; padding-left: 20px; }
.readings li { margin: 2px 0; }

.post-body { font-size: 1.05em; }
.post-body h2 { font-size: 1.6em; margin: 36px 0 12px; }
.post-body h3 { font-size: 1.3em; margin: 28px 0 10px; }
.post-body h4 { font-size: 1.1em; margin: 24px 0 8px; }
.post-body p { margin: 0 0 16px; }
.post-body ul, .post-body ol { padding-left: 24px; margin: 0 0 16px; }
.post-body li { margin-bottom: 6px; }
.post-body strong { color: #e0e0e0; }

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

.post-body blockquote {
    margin: 0 0 16px;
    padding: 4px 16px;
    border-left: 3px solid #94A3A1;
    color: #b5b5b5;
    font-style: italic;
}

.post-body hr {
    border: none;
    border-top: 1px solid rgba(148, 163, 161, 0.3);
    margin: 32px 0;
}

.post-body table { border-collapse: collapse; margin: 0 0 16px; }
.post-body th, .post-body td {
    border: 1px solid rgba(148, 163, 161, 0.3);
    padding: 6px 12px;
}
.post-body th { color: #94A3A1; }

.post-body code {
    font-size: 0.9em;
    background-color: #2B2F30;
    padding: 1px 5px;
    border-radius: 3px;
}
.post-body pre {
    background-color: #2B2F30;
    padding: 14px 16px;
    border-radius: 6px;
    overflow-x: auto;
    line-height: 1.5;
}
.post-body pre code { padding: 0; background: none; }

/* Wide formulas scroll instead of overflowing the card */
mjx-container[display="true"] {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 0;
}

/* ---------- Theorem-like blocks ----------
   One paragraph:      **Theorem 1.** text
                       {: .theorem}
   Several paragraphs: <div class="theorem" markdown="1"> ... </div>     */

.theorem, .definition, .remark, .example {
    padding: 12px 16px;
    margin: 0 0 16px;
    border-radius: 4px;
}
.theorem    { background-color: #2E3334; border-left: 3px solid #847C6D; }
.definition { background-color: #2E3334; border-left: 3px solid #94A3A1; }
.remark, .example { border-left: 3px solid rgba(148, 163, 161, 0.4); }
.theorem > :last-child, .definition > :last-child,
.remark > :last-child, .example > :last-child { margin-bottom: 0; }
.theorem { font-style: italic; }
.theorem strong { font-style: normal; }

.proof { margin: 0 0 16px; }
p.proof::after, div.proof > p:last-child::after {
    content: '\220E';
    float: right;
    color: #94A3A1;
}

/* ---------- Footnotes and post navigation ---------- */

.footnotes {
    margin-top: 36px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 161, 0.3);
    font-size: 0.9em;
}

.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 161, 0.3);
    font-size: 0.9em;
}
.post-nav span { flex: 1; }
.post-nav span:last-child { text-align: right; }

/* ---------- Small screens ---------- */

@media (max-width: 768px) {
    .header-content { padding: 10px 0; }
    .menu-toggle { display: block; }
    .site-nav { display: none; width: 100%; }
    .site-nav.open { display: block; }
    .site-nav ul { flex-direction: column; align-items: center; padding: 10px 0; }
    .site-nav li { margin: 8px 0; }
    .section { padding: 28px 18px; }
    .section > h1, .post-header h1 { font-size: 1.7em; }
    .post-nav { flex-direction: column; text-align: center; }
    .post-nav span:last-child { text-align: center; }
}

@media (max-width: 480px) {
    .site-title { font-size: 1.4em; }
    main { padding: 0 10px; }
    .section { padding: 22px 14px; }
}
