/* valentijndegroot.com: posts read like a LaTeX article (Latin Modern, justified, numbered sections).
   Design (chosen 2026-11-26): warm paper with a red accent, boxed sidebar, topic pills, and a classic LaTeX title:
   centred small caps, italic tagline, double rule. Colours and fonts are the variables below. */

@font-face { font-family: 'Latin Modern'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../vendor/latin-modern-2.0/LM-regular.woff2') format('woff2'); }
@font-face { font-family: 'Latin Modern'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('../vendor/latin-modern-2.0/LM-italic.woff2') format('woff2'); }
@font-face { font-family: 'Latin Modern'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../vendor/latin-modern-2.0/LM-bold.woff2') format('woff2'); }
@font-face { font-family: 'Latin Modern'; font-style: italic; font-weight: 700; font-display: swap;
  src: url('../vendor/latin-modern-2.0/LM-bold-italic.woff2') format('woff2'); }

:root {
  --paper: #fbf8f1;
  --ink: #2a2420;
  --soft-ink: #3a322c;
  --muted: #6e6359;
  --faint: #a09485;
  --rule: #e3d9c7;
  --accent: #9b1c1c;
  --tint: #f2ebdd;
  --danger: #b3261e;
  --serif: 'Latin Modern', 'Latin Modern Roman', 'CMU Serif', Georgia, serif;
  --ui: var(--serif);
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 3px;
  --gutter: 16px;
  --measure: 40rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--ui); font-size: 17px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; }
img { max-width: 100%; height: auto; }
button { -webkit-tap-highlight-color: transparent; }

.env-bar { background: #c62828; color: #fff; font: 600 12px/1.7 var(--sans); text-align: center; letter-spacing: .12em; }

/* ---------------------------------------------------------------- masthead */
.masthead { padding: 34px var(--gutter) 16px; text-align: center; }
.masthead-inner { max-width: 64rem; margin: 0 auto; position: relative; border-bottom: 3px double var(--ink); padding-bottom: 14px; }
.site-name { font-family: var(--serif); text-decoration: none; display: inline-block; font-size: 31px; font-variant: small-caps;
  letter-spacing: .05em; }
.tagline { margin: 4px 0 0; color: var(--muted); font-style: italic; font-size: 16.5px; }
.owner-nav { position: absolute; right: 0; top: -28px; font-size: 15px; font-family: var(--ui); }
.owner-nav a { color: var(--accent); }


/* ---------------------------------------------------------------- topics on phones (strip under the masthead) */
.topic-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px var(--gutter) 14px; max-width: calc(64rem + 2 * var(--gutter)); margin: 0 auto;
  scrollbar-width: none; }
.topic-strip::-webkit-scrollbar { display: none; }
.topic-strip a { flex: none; text-decoration: none; color: var(--muted); padding: 6px 13px; font-size: 15.5px;
  border: 1px solid var(--rule); border-radius: 999px; }
.topic-strip a:first-child { margin-left: auto; }
.topic-strip a:last-child { margin-right: auto; }
.topic-strip a.active { color: #fff; background: var(--accent); border-color: var(--accent); }

/* ---------------------------------------------------------------- layout: main + sidebar on the right */
.layout { max-width: calc(64rem + 2 * var(--gutter)); margin: 0 auto; padding: 8px var(--gutter) 0; }
.main { min-width: 0; }
.side { margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--rule); }
.side-topics, .side-toc { display: none; }   /* phones: topics are in the strip, contents at the top of the post */

@media (min-width: 960px) {
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 64px; padding-top: 28px; }
  .topic-strip { display: none; }
  .side { margin-top: 0; padding-top: 0; border-top: 0; position: sticky; top: 28px; align-self: start;
    max-height: calc(100vh - 40px); overflow-y: auto; }
  .side-topics, .side-toc { display: block; }
  .toc-inline { display: none; }
}

.side-block { margin-bottom: 34px; background: var(--tint); padding: 16px 18px; border-radius: var(--radius); }
.side-title { margin: 0 0 10px; font-size: 18px; font-weight: 700; font-variant: small-caps; letter-spacing: .05em; color: var(--accent); }

.topic-list { list-style: none; margin: 0; padding: 0; }
.topic-list a { display: flex; align-items: baseline; gap: 6px; text-decoration: none; padding: 4px 0; }
.topic-list .leader { flex: 1; border-bottom: 1px dotted var(--faint); transform: translateY(-4px); }
.topic-list .count { color: var(--muted); font-variant-numeric: tabular-nums; }
.topic-list li.active .name { font-weight: 700; }
.topic-list a:hover .name { text-decoration: underline; }

.about-text p { margin: 0 0 8px; color: var(--muted); font-size: 16px; }

/* ---------------------------------------------------------------- post lists */
.list-title { font-size: 28px; font-weight: 400; margin: 6px 0 26px; font-family: var(--serif); font-variant: small-caps;
  letter-spacing: .04em; text-align: center; }

.entry { margin: 0 0 34px; }
.entry + .entry { border-top: 1px solid var(--rule); padding-top: 28px; }
.entry-meta { font-size: 14.5px; color: var(--muted); }
.entry-meta time { color: var(--accent); }
.entry-meta > * { white-space: nowrap; }
.entry-meta a { text-decoration: none; }
.entry-meta a:hover { text-decoration: underline; }
.entry-title { font-family: var(--serif); font-size: 24px; line-height: 1.22; margin: 3px 0 6px; font-weight: 700; }
.entry-title a { text-decoration: none; }
.entry-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.entry-summary { margin: 0; font-family: var(--serif); font-size: 17.5px; line-height: 1.5; color: var(--soft-ink); }
.entry-summary .katex { font-size: 1em; }
.entry-thumb { display: block; }
.entry-thumb img { display: block; object-fit: cover; background: var(--tint); }
.entry.has-image { display: grid; grid-template-columns: minmax(0, 1fr) 88px; gap: 16px; align-items: start; }
.entry.has-image .entry-thumb { order: 2; margin-top: 6px; }
.entry.has-image .entry-thumb img { width: 88px; height: 88px; border-radius: var(--radius); }
@media (min-width: 600px) {
  .entry.has-image { grid-template-columns: minmax(0, 1fr) 150px; gap: 24px; }
  .entry.has-image .entry-thumb img { width: 150px; height: 112px; }
}

/* ---------------------------------------------------------------- a post: LaTeX article */
.paper { max-width: var(--measure); margin: 0 auto; font-family: var(--serif); }
.maketitle { text-align: center; margin: 18px 0 30px; position: relative; }
.paper-topic { display: inline-block; font-variant: small-caps; letter-spacing: .07em; text-decoration: none;
  font-size: 17px; margin-bottom: 12px; color: var(--accent); }
.maketitle h1 { font-size: 30px; line-height: 1.2; font-weight: 400; margin: 0 0 16px; text-wrap: balance; }
.maketitle .author { font-size: 18px; }
.maketitle .date { font-size: 17px; margin-top: 6px; }
.maketitle .katex { font-size: 1em; }
.edit-link { position: absolute; top: 0; right: 0; font-size: 15px; color: var(--accent); font-family: var(--ui); }
@media (min-width: 600px) { .maketitle h1 { font-size: 35px; } }

.abstract { max-width: 34rem; margin: 0 auto 30px; font-size: 16.5px; line-height: 1.5;
  text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
@media (min-width: 600px) { .abstract { padding: 0 1.4em; } }
.abstract-title { text-align: center; font-weight: 700; font-size: 15.5px; margin-bottom: 6px; }
.abstract p { margin: 0; }
.abstract .katex { font-size: 1em; }

.toc-inline { margin: 0 0 26px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 10px 0; }
.toc-inline summary { cursor: pointer; font-weight: 700; }
.toc { list-style: none; padding: 0; margin: 8px 0 0; }
.toc li { margin: 4px 0; line-height: 1.35; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.toc .num { display: inline-block; min-width: 2.1em; }
.toc .lvl1 > a { font-weight: 700; }
.toc .lvl2 { padding-left: 1.3em; }
.toc .lvl3 { padding-left: 2.6em; }
.side-toc .toc { font-family: var(--serif); font-size: 16px; }

.latex { font-size: 18px; line-height: 1.56; text-align: justify; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
@media (min-width: 600px) { .latex { font-size: 19px; } }
.latex p { margin: 0; }
.latex p + p { text-indent: 1.5em; }
.latex h2, .latex h3, .latex h4, .latex h5, .latex h6 { text-align: left; hyphens: manual; -webkit-hyphens: manual;
  line-height: 1.25; font-weight: 700; scroll-margin-top: 16px; }
.latex h2 { font-size: 1.36em; margin: 1.8em 0 .7em; }
.latex h3 { font-size: 1.16em; margin: 1.5em 0 .55em; }
.latex h4 { font-size: 1em; margin: 1.3em 0 .45em; }
.latex h5, .latex h6 { font-size: 1em; margin: 1.2em 0 .3em; font-style: italic; }
.secnum { margin-right: .9em; }
.latex a { color: var(--accent); text-decoration: none; }
.latex a:hover { text-decoration: underline; }
.latex strong { font-weight: 700; }
.latex ul, .latex ol { margin: .6em 0; padding-left: 1.8em; }
.latex li { margin: .25em 0; }
.latex li p + p { text-indent: 0; margin-top: .4em; }
.latex blockquote { margin: .9em 1.4em; }
@media (min-width: 600px) { .latex blockquote { margin: .9em 2.5em; } }
.latex code { font-family: var(--mono); font-size: .82em; }
.latex pre { font-size: 14.5px; line-height: 1.45; overflow-x: auto; padding: 12px 14px; background: var(--tint);
  text-align: left; margin: 1em 0; border-radius: var(--radius); hyphens: none; -webkit-hyphens: none; }
.latex pre code { font-size: inherit; }
.latex hr { border: 0; border-top: 1px solid var(--rule); width: 40%; margin: 2em auto; }
.latex .katex { font-size: 1em; }           /* KaTeX's Computer Modern next to Latin Modern text: same size */
.math.display { display: block; margin: .9em 0; overflow-x: auto; overflow-y: hidden; text-align: center; text-indent: 0;
  padding: 2px 0; }
.math.display .katex-display { margin: 0; }
.figures { margin: 1.5em 0; text-indent: 0; }
.figures figure { margin: 0; text-align: center; }
.figures img { display: block; margin: 0 auto; max-height: 85vh; width: auto; }
.figures:not([data-count="1"]) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
.figures:not([data-count="1"]) img { width: 100%; }
@media (min-width: 600px) { .figures[data-count="3"], .figures[data-count="6"], .figures[data-count="9"] { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
figcaption { font-size: .88em; line-height: 1.4; margin-top: .55em; text-align: center; hyphens: auto; -webkit-hyphens: auto; }
figcaption .katex { font-size: 1em; }
.zoom { display: block; cursor: zoom-in; }
.table-wrap { overflow-x: auto; margin: 1.2em 0; text-indent: 0; }
.latex table { border-collapse: collapse; margin: 0 auto; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink);
  font-size: .92em; text-align: left; line-height: 1.4; }
.latex thead th { border-bottom: 1px solid var(--ink); }
.latex th, .latex td { padding: .35em .9em; vertical-align: top; }
.footnotes { margin-top: 2.6em; font-size: .85em; line-height: 1.45; text-indent: 0; }
.footnotes::before { content: ''; display: block; width: 33%; border-top: 1px solid var(--ink); margin-bottom: .8em; }
.footnotes ol { margin: 0; padding-left: 1.4em; }
.footnotes li { margin: .3em 0; }
.footnotes li p { margin: 0; text-indent: 0; }
.footnotes .katex { font-size: 1em; }
.footnote-backref { font-family: var(--sans); font-size: .8em; }
sup { font-size: .7em; line-height: 0; vertical-align: super; }
sup a, .footnote-ref a { text-decoration: none; }
.ref.missing { color: var(--danger); }

/* ---------------------------------------------------------------- comments and forms */
.comments { max-width: var(--measure); margin: 56px auto 0; }
.comments-title { font-family: var(--serif); font-size: 24px; font-weight: 700; border-top: 1px solid var(--rule); padding-top: 26px; margin: 0 0 6px; }
.comments-title .count { font-weight: 400; color: var(--muted); }
.comment-list { list-style: none; padding: 0; margin: 0 0 26px; }
.comment { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.comment-head { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; font-size: 15.5px; }
.comment-name { font-weight: 700; }
.badge { font-family: var(--sans); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent);
  border: 1px solid currentColor; padding: 1px 6px; border-radius: 4px; }
.comment-date { color: var(--muted); font-size: 14px; }
.comment-delete { margin-left: auto; }
.comment-body { font-family: var(--serif); font-size: 17px; margin-top: 4px; overflow-wrap: break-word; }
.comment-body p { margin: 0 0 .5em; }
.form-title { font-family: var(--serif); font-size: 19px; margin: 0 0 12px; }

.field { display: block; margin: 0 0 12px; }
.field > span { display: block; font-size: 15px; color: var(--muted); margin-bottom: 4px; }
input, textarea, select { font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1px solid #d9ccb6;
  border-radius: var(--radius); padding: 10px 12px; width: 100%; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.button { font: inherit; font-size: 16px; padding: 10px 18px; min-height: 44px; border-radius: var(--radius); border: 1px solid var(--accent);
  background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.button.secondary { background: transparent; color: var(--ink); border-color: #cbbda5; }
.button:disabled { opacity: .5; cursor: default; }
.link-button { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 15px; color: var(--accent); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; }
.link-button.danger { color: var(--danger); }
.form-status { font-size: 15px; color: var(--muted); }
.form-status.error { color: var(--danger); }
.muted { color: var(--muted); }
.empty { color: var(--muted); font-style: italic; }
.login-form { max-width: 22rem; margin-top: 12px; }

/* ---------------------------------------------------------------- footer, picture viewer */
.footer { width: calc(100% - 2 * var(--gutter)); max-width: 64rem; margin: 64px auto 0; padding: 20px 0 44px; display: flex;
  gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 15px; border-top: 1px solid var(--rule); }
.footer a { color: var(--muted); }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(12, 12, 12, .94); display: flex; align-items: center;
  justify-content: center; padding: 12px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox button { position: absolute; top: 10px; right: 12px; background: none; border: 0; color: #fff; font: 16px var(--sans);
  padding: 10px; cursor: pointer; }
