/*
  Mathematics & AI — shared site stylesheet.
  Every page (index.html and posts/*.html) links this one file instead of
  carrying its own copy of these rules. Edit here to change the whole site.
*/

body {
    background-color: #F5EFE6;
    color: #2E281F;
    font-family: serif;
}

.font-sans {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Prose (article body) */

.prose h2 {
    margin-top: 2em;
    margin-bottom: 0.75em;
    color: #2E281F;
    font-size: 1.875rem;
    font-weight: bold;
}

.prose h3 {
    margin-top: 2em;
    margin-bottom: 0.75em;
    color: #2E281F;
    font-size: 1.25rem;
    font-weight: bold;
    border-bottom: 1px solid #D6C4AA;
    padding-bottom: 0.25rem;
}

.prose p {
    margin: 1rem 0;
}

.prose ul,
.prose ol {
    list-style-position: outside;
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.prose li {
    margin: 0.5rem 0;
}

.prose img {
    max-width: 100%;
    border-radius: 0.5rem;
}

.prose strong {
    color: #2E281F;
}

.prose code {
    color: #7C4E2B;
    font-weight: 600;
}

.prose a {
    color: #7C4E2B;
    text-decoration: underline;
    text-decoration-color: #C9B29B;
}

.prose a:hover {
    color: #5C3A20;
    text-decoration-color: currentColor;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.prose th,
.prose td {
    border: 1px solid #D6C4AA;
    padding: 0.5rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

.prose th {
    background-color: #F0E5D4;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.prose .table-scroll {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.prose .table-scroll table {
    margin: 0;
}

.explanation,
.explanation strong {
    color: #2E281F;
}

.prose blockquote {
    border-left: 3px solid #C9B29B;
    border-radius: 0;
    padding-left: 1rem;
    margin: 1.25rem 0;
    color: #5C5244;
}

.prose blockquote p {
    margin: 0.4rem 0;
}

/* Wide display math scrolls inside itself rather than widening the page */
mjx-container[display="true"] {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
}

/*
  Two-column section: prose on the left, a rail of figures on the right.
  Collapses to a single column below 1100px. Use inside .prose, and give the
  article a wider max-width (e.g. max-w-6xl) so the prose column stays roomy.
*/

.post-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
}

.post-split-main {
    min-width: 0;
}

@media (min-width: 1100px) {
    .post-split {
        grid-template-columns: minmax(0, 1fr) 340px;
        gap: 2.5rem;
        align-items: start;
    }
}

.post-figure {
    border: 1px solid #D6C4AA;
    border-radius: 0.5rem;
    background-color: #FBF7F0;
    padding: 1rem;
    margin: 0;
}

.post-figure + .post-figure {
    margin-top: 1.5rem;
}

.post-figure figcaption {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #6B5F4E;
    margin-top: 0.75rem;
}

.fig-ctl {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.75rem;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.8125rem;
    color: #6B5F4E;
}

.fig-ctl input[type="range"] {
    flex: 1;
    min-width: 0;
    accent-color: #7C4E2B;
}

.fig-ctl output {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: #2E281F;
    min-width: 1ch;
}

pre {
    background-color: #F0E5D4;
    color: #1F1A14;
    border: 1px solid #C9B29B;
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.875rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

pre code {
    color: inherit;
    font-weight: 600;
}

/* Homepage post list */

.post-card + .post-card {
    margin-top: 3rem;
}

.post-tag {
    font-size: 0.75rem;
    border: 1px solid #A89A85;
    border-radius: 0.25rem;
    padding: 0.125rem 0.5rem;
}
