/* Blog pages. Same palette, font and 960px frame as the hand-written pages;
   the text itself sits in a narrower reading column. */

:root {
  --max: 960px;
  --measure: 42rem;
  --gutter: 10.5rem;
  --link: #0b57d0;
  --muted: #666;
  --border: #e7e7e7;
  --soft: #f3f5f8;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial;
  color: #111;
}
a { color: var(--link); }
a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 2px; }
.muted { color: var(--muted); }

/* Site frame */
.site-header, .site-main, .site-footer { max-width: var(--max); margin: 0 auto; padding: 1rem; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.15rem; letter-spacing: .2px; text-decoration: none; color: inherit; }
.site-header nav a { text-decoration: none; margin-left: 1rem; }
.site-header nav a:first-child { margin-left: 0; }
.site-footer { border-top: 1px solid #eee; color: var(--muted); font-size: .95rem; margin-top: 2rem; }

h1 { margin: .3rem 0 .4rem; font-size: 1.6rem; line-height: 1.25; }

/* /blog/ — date in the left gutter, title and teaser beside it */
.entries { margin-top: 1.2rem; }
.entry {
  display: grid;
  grid-template-columns: var(--gutter) minmax(0, var(--measure));
  column-gap: 1.5rem;
  padding: 1.3rem 0 1.1rem;
  border-top: 1px solid var(--border);
}
.entry-date { color: var(--muted); font-size: .92rem; padding-top: .22rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry h2 { margin: 0 0 .35rem; font-size: 1.25rem; line-height: 1.3; }
.entry h2 a { text-decoration: none; }
.entry h2 a:hover { text-decoration: underline; }
.teaser > :first-child { margin-top: 0; }
.teaser > :last-child { margin-bottom: 0; }
.teaser::after, .post-body::after { content: ""; display: block; clear: both; }
.more { margin: .5rem 0 0; font-size: .95rem; }
.more a, .earlier a { text-decoration: none; }
.more a:hover, .earlier a:hover { text-decoration: underline; }
.earlier { margin: 0; padding: 1.1rem 0 0 calc(var(--gutter) + 1.5rem); border-top: 1px solid var(--border); }

@media (max-width: 720px) {
  .entry { grid-template-columns: 1fr; }
  .entry-date { padding: 0 0 .2rem; }
  .earlier { padding-left: 0; }
}

/* A post */
.post-meta { margin: .4rem 0 0; color: var(--muted); font-size: .92rem; }
.post-meta a { text-decoration: none; }
.post-meta a:hover { text-decoration: underline; }
.post h1 { max-width: var(--measure); font-size: 1.9rem; margin: .2rem 0 1.2rem; }

.post-body { font-size: 1.06rem; line-height: 1.7; }
.post-body > * { max-width: var(--measure); }
.post-body > .wide { max-width: 100%; }
.post-body > figure.narrow { max-width: 30rem; }
.post-body h2 { margin: 2rem 0 .5rem; font-size: 1.3rem; line-height: 1.3; }
.post-body h3 { margin: 1.6rem 0 .4rem; font-size: 1.1rem; }

/* Pictures. Plain ![](…) fills the text column; {: .wide} or the figure
   include with wide=true runs the full page width; {: .right} is the small
   floated picture the wiki news items use. */
.post-body img, .teaser img { max-width: 100%; height: auto; border-radius: 8px; }
figure { margin: 1.6rem 0; }
figure img { display: block; width: 100%; }
figcaption { margin-top: .45rem; color: var(--muted); font-size: .9rem; line-height: 1.45; max-width: var(--measure); }
img.right { float: right; width: 160px; margin: .3rem 0 .8rem 1.2rem; }
@media (max-width: 480px) { img.right { width: 120px; } }

blockquote { margin: 1.2rem 0; padding: .1rem 0 .1rem 1rem; border-left: 3px solid var(--border); color: #333; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
code { font-size: .92em; background: var(--soft); padding: .1em .3em; border-radius: 4px; }
pre { background: var(--soft); padding: .8rem 1rem; border-radius: 8px; overflow-x: auto; line-height: 1.45; }
pre code { background: none; padding: 0; }
table { border-collapse: collapse; display: block; overflow-x: auto; font-size: .95rem; }
th { text-align: left; background: var(--soft); font-weight: 600; }
th, td { padding: .35rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }

/* Long displayed formulas scroll inside themselves instead of widening the page */
mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; padding: .2rem 0; }

/* Newer / older */
.post-nav { display: flex; flex-wrap: wrap; gap: .8rem 2.5rem; margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--border); max-width: var(--measure); }
.post-nav a { text-decoration: none; }
.post-nav a:hover { text-decoration: underline; }
.post-nav span { display: block; color: var(--muted); font-size: .85rem; }

/* Archive */
h2.month { margin: 1.8rem 0 .4rem; font-size: 1.1rem; padding-bottom: .25rem; border-bottom: 1px solid var(--border); max-width: calc(var(--gutter) + 1.5rem + var(--measure)); }
ul.archive { list-style: none; margin: 0; padding: 0; }
ul.archive li { display: grid; grid-template-columns: 2rem 1fr; gap: .6rem; padding: .2rem 0; }
ul.archive time { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
ul.archive a { text-decoration: none; }
ul.archive a:hover { text-decoration: underline; }
