:root {
  --fg: #111;
  --muted: #686868;
  --bg: #fff;
  --accent: #2a5db0;
  --accent-hover: #2a5db0;
  --border: #ddd;
  --code-bg: #f5f5f3;
  --font-body: system-ui, sans-serif;
  --font-heading: var(--font-body);
  --font-code: ui-monospace, "DejaVu Sans Mono", monospace;
  --content-width: 645px;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 1.1rem/1.5 var(--font-body); }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.24; }
.meta, time { color: var(--muted); font-size: .9rem; }
.meta { margin-top: 0; }
img, video { max-width: 100%; height: auto; }
/* (An iframe keeps its height: auto would make it 150px.) */
iframe { max-width: 100%; }
img.featured { display: block; width: 100%; height: auto; margin: 1rem 0; }
figure { margin: 1.5rem 0; }
figure img, figure video { display: block; margin: 0 auto; }
figcaption { color: var(--muted); font-size: .9rem; line-height: 1.4; text-align: center; margin-top: .4rem; }
.columns { display: flex; gap: 1rem; align-items: center; }
.columns > .column { flex: 1; min-width: 0; }
@media (max-width: 600px) { .columns { flex-direction: column; } }
.embed { position: relative; aspect-ratio: 16 / 9; margin: 1.5rem 0; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* (No ligatures: some code fonts would show <= as ≤.) */
code, pre, textarea, .cm-content { font-family: var(--font-code); font-variant-ligatures: none; font-feature-settings: "calt" 0; }
code { font-size: .8em; }
:not(pre) > code { background: var(--code-bg); padding: .1em .3em; }
/* The block's own size, so that its line height fits the code (WordPress: 14.4px on 21.6px). */
pre { background: var(--code-bg); padding: .8rem 1rem; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; line-height: 1.5; }
pre code { font-size: inherit; }
pre.linenos { counter-reset: line; }
pre.linenos .line { display: block; position: relative; padding-left: 2.5em; }
pre.linenos .line::before {
  counter-increment: line;
  content: counter(line);
  position: absolute;
  left: 0;
  width: 1.8em;
  text-align: right;
  color: var(--muted);
}
math[display=block] { font-size: 1.4em; margin: 1rem 0; }
.md-block { display: contents; }
blockquote { border-left: 3px solid var(--border); margin-left: 0; padding-left: 1rem; }
/* Tables use the article's full width; a wider one scrolls in its figure. */
table { border-collapse: collapse; width: 100%; }
figure:has(> table) { overflow-x: auto; }
/* Wide tables (`::: wide`): equal columns, as WordPress made them. */
.alignwide table { table-layout: fixed; }
th, td { border: 1px solid var(--border); padding: .3rem .6rem; }
mark { background: #fff3a8; }
kbd { border: 1px solid var(--border); border-radius: 3px; padding: 0 .3em; font-size: .85em; }
.footnote-definition { font-size: .9rem; display: flex; gap: .4rem; }
.footnote-definition p { margin: 0; }
.post-nav { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; }
.post-list { list-style: none; padding: 0; }
.post-list li { margin: .4rem 0; }
.post-list time { margin-right: .5rem; font-variant-numeric: tabular-nums; }
#comments { margin-top: 3rem; }
ol.comments { list-style: none; padding-left: 0; }
.comment { margin: 1rem 0; }
ol.comments ol.comments { padding-left: 32px; }
.comment-row { display: flex; gap: 19px; align-items: flex-start; }
.comment-row img.avatar { width: 50px; height: 50px; border-radius: 50%; flex: none; }
.comment-main { flex: 1; min-width: 0; }
.comment-date, .comment-author, .reply { font-size: .75em; }
.comment-date { color: var(--fg); text-decoration: none; }
.comment-author { color: var(--muted); }
.comment-author a { color: inherit; }
.by-author > .comment-row .comment-author::after { content: " (author)"; }
.comment-body > :first-child { margin-top: .3rem; }
.reply { color: var(--fg); }
.reply { font-size: .85rem; }
form label { display: block; margin: .6rem 0; }
form label.inline { display: inline-block; margin-right: 1rem; }
input:not([type=checkbox]), textarea, select { display: block; width: 100%; font: inherit; padding: .3rem; margin-top: .2rem; }
textarea { font-family: var(--font-code); font-size: .9rem; }
button { font: inherit; padding: .3rem 1rem; cursor: pointer; }
form.inline { display: inline; }
.narrow-form { max-width: 20rem; }
.hp { position: absolute; left: -10000px; }
.error { color: #b00020; }
.notice { color: #1e7b34; }
.draft-notice { background: #fff3a8; padding: .3rem .6rem; }
/* Edit (on a post) and Close (in the editor): the same tab at the top of the left column,
   where the editor's panel opens, so editing feels like opening and closing that panel. */
.panel-toggle { position: fixed; top: 0; left: 9.35%; transform: translateX(-50%); z-index: 20;
  padding: .15rem .9rem .25rem; font-size: .8rem; line-height: 1.4; background: var(--fg); color: var(--bg) !important;
  text-decoration: none !important; border-radius: 0 0 .35rem .35rem; }
.panes[hidden] { display: none; }
/* Settings and controls sit over the page's empty left column (18.7% on qsantos.fr);
   in Markdown view, the text covers the article's column. */
.panes .settings { position: fixed; left: 0; top: 0; bottom: 0; width: calc(18.7% - 2rem); overflow: auto; z-index: 15;
  padding: 1.8rem 1rem .5rem; font-size: .85rem; background: var(--bg); }
.panes textarea, .panes .md-editor { display: none; }
/* Placed and sized by the script (placeMarkdown): as wide as its text needs, and as tall
   (at least down to the end of the page); it scrolls with the page. */
.panes.markdown .md-editor { display: block; position: absolute; top: 0; width: fit-content;
  z-index: 15; background: var(--bg); border: 1px solid var(--border); font-size: .9rem; }
.panes .settings label { margin: .4rem 0; }
.settings .actions { display: flex; gap: .5rem; align-items: center; justify-content: space-between; }
.settings .views button { border: 1px solid var(--border); background: var(--bg); padding: .2rem .5rem; }
.settings .views button.active { background: var(--fg); color: var(--bg); }
.settings .save-state { min-height: 1.2em; margin: .4rem 0; color: var(--muted, #666); }
.settings .revisions { margin: .6rem 0; }
.settings .viewing-banner { margin: .4rem 0; padding: .4rem .6rem; background: #fff4d6; border: 1px solid #e0c060; }
.settings .viewing-banner[hidden] { display: none; }
.settings .viewing-banner p { margin: 0 0 .3rem; }
.settings .revisions summary { cursor: pointer; }
.settings .revisions ol { padding-left: 1.2rem; }
.settings .revisions li { margin: .2rem 0; display: flex; align-items: baseline; gap: .3rem; }
.settings .revisions li .view { flex: 1; }
.settings .revisions li button { font-size: .8rem; padding: 0 .4rem; }
.featured-picker { margin: .4rem 0; }
.featured-picker summary { cursor: pointer; }
.featured-picker .current img { display: block; width: 100%; height: auto; margin-top: .3rem; }
.featured-picker .choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr)); gap: .3rem; margin-top: .4rem; }
.featured-picker .choices > * { aspect-ratio: 1; padding: 0; border: 2px solid var(--border); background: var(--bg);
  display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; font-size: .8rem; }
.featured-picker .choices img { width: 100%; height: 100%; object-fit: cover; }
.panes .md-editor.dropping { outline: 3px dashed var(--accent); outline-offset: -3px; background: color-mix(in srgb, var(--accent) 6%, var(--bg)); }
.featured-picker.dropping { outline: 2px dashed var(--accent); }
.featured-picker .choices .upload { border-style: dashed; text-align: center; cursor: default; }
.featured-picker .choices .active { border-color: var(--accent); outline: 2px solid var(--accent); }
body.editing article [contenteditable]:focus { outline: none; }
body.editing article .md-block:not(.current-block) iframe { pointer-events: none; }
/* Commenting is for the published page, not while editing it. */
body.editing .comment-form { opacity: .4; pointer-events: none; user-select: none; }
body.editing article .md-atom.selected :is(img, video), body.editing article iframe.selected { outline: 3px solid #3858e9; outline-offset: 2px; }
body.editing article figcaption:empty::before { content: 'Caption'; opacity: .5; }
dialog.image-editor { width: 92vw; height: 92vh; max-width: none; max-height: none; margin: auto; padding: .6rem; border: 1px solid var(--border); background: var(--bg); color: var(--fg); font-size: .85rem; }
dialog.image-editor[open] { display: flex; flex-direction: column; gap: .5rem; }
dialog.image-editor .tools { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; }
dialog.image-editor button { border: 1px solid var(--border); background: var(--bg); color: var(--fg); padding: .2rem .5rem; }
dialog.image-editor button.active { background: var(--fg); color: var(--bg); }
dialog.image-editor .stage { flex: 1; min-height: 0; }
dialog.image-editor .stage img { display: block; max-width: 100%; }
dialog.image-editor .actions { text-align: right; }
.admin-list { width: 100%; display: table; font-size: .9rem; }
.moderation { border-bottom: 1px solid var(--border); padding: .5rem 0; }
.admin-bar { position: fixed; top: 0; left: 0; z-index: 20; display: flex; align-items: center; gap: 1rem;
  padding: .15rem .9rem .25rem; font-size: .8rem; line-height: 1.4; background: var(--fg); color: var(--bg);
  border-radius: 0 0 .35rem 0; }
/* Edit / Close, first in the bar. */
.admin-bar .panel-toggle { position: static; transform: none; padding: 0; border-radius: 0; font-weight: bold;
  min-width: 2.6rem; } /* (as wide as Close: the other links stay put) */
.admin-bar a { color: var(--bg) !important; text-decoration: none !important; }
.admin-bar form { display: contents; }
.admin-bar button { all: unset; cursor: pointer; }
.admin-bar :is(a, button):hover { text-decoration: underline !important; }
button.danger { background: #c62828; color: #fff; border: 0; padding: .5rem 1rem; cursor: pointer; }
.panel > button.danger, aside > button.danger { display: block; width: 100%; margin-top: 3rem; }
dialog.confirm-delete { max-width: 26rem; border: 1px solid var(--border); background: var(--bg); color: var(--fg); padding: 1.2rem; }
dialog.confirm-delete form { display: flex; justify-content: flex-end; gap: .6rem; }
dialog.confirm-delete button:not(.danger) { padding: .5rem 1rem; }
.settings .syntax h2 { font-size: 1em; margin: 1rem 0 .3rem; }
.settings .syntax pre { white-space: pre-wrap; font-size: .9em; }

/* Toolbar floating above the current block while editing. */
.block-toolbar { position: absolute; z-index: 16; display: flex; align-items: stretch; background: var(--bg); color: var(--fg);
  border: 1px solid var(--fg); border-radius: 4px; font-size: .9rem; line-height: 1.5; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.block-toolbar[hidden] { display: none; }
.block-toolbar .group { position: relative; display: flex; }
.block-toolbar .group + .group { border-left: 1px solid var(--border); }
.block-toolbar .group[hidden] { display: none; }
.block-toolbar button { border: 0; background: none; color: inherit; font: inherit; padding: .45rem .65rem; cursor: pointer; }
.block-toolbar button:hover:not(:disabled) { background: color-mix(in srgb, var(--fg) 10%, var(--bg)); }
.block-toolbar button:disabled { cursor: default; }
.block-toolbar .group button:disabled:not(.type) { opacity: .45; cursor: not-allowed; }
.block-toolbar .menu-holder { position: relative; display: flex; }
.block-toolbar code { font-size: .8rem; }
/* Buttons show what they do: a link, highlighted text, a heading's size… */
.block-toolbar .link-sample { color: var(--accent); text-underline-offset: .15em; }
.block-toolbar mark { padding: 0 .15em; }
.block-toolbar kbd { font: .8em var(--font-code); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 3px; padding: 0 .3em; }
.block-toolbar ruby rt { font-size: .55em; }
.block-toolbar .menu .sample-h1 { font-family: var(--font-heading); font-size: 1.5em; line-height: 1.2; }
.block-toolbar .menu .sample-h2 { font-family: var(--font-heading); font-size: 1.35em; line-height: 1.2; }
.block-toolbar .menu .sample-h3 { font-family: var(--font-heading); font-size: 1.2em; line-height: 1.2; }
.block-toolbar .menu .sample-h4 { font-family: var(--font-heading); font-size: 1.1em; line-height: 1.2; }
.block-toolbar .menu .sample-h5 { font-family: var(--font-heading); font-size: 1em; line-height: 1.2; }
.block-toolbar .menu .sample-ul::before { content: "• "; }
.block-toolbar .menu .sample-ol::before { content: "1. "; }
.block-toolbar .menu [data-convert="code"] { font-family: var(--font-code); font-size: .9em; }
.block-toolbar .menu .sample-blockquote { font-style: italic; border-left: 3px solid var(--border); margin-left: .65rem; padding-left: .5rem; }
.block-toolbar .menu { position: absolute; top: 100%; left: -1px; margin-top: 4px; display: flex; flex-direction: column; background: var(--bg);
  border: 1px solid var(--fg); border-radius: 4px; padding: 2px 0; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.block-toolbar .menu[hidden] { display: none; }
.block-toolbar .menu button { text-align: left; padding: .35rem .8rem; }
.block-toolbar .menu hr { width: 100%; margin: 2px 0; border: 0; border-top: 1px solid var(--border); }
.block-toolbar .menu button.active { font-weight: bold; }
/* Code edited in place: plain text. */
body.editing article pre.code-edit { min-height: 1.5em; }
body.editing article pre.code-edit:focus { outline: 1px solid var(--border); }
/* A block's Markdown edited in place. */
body.editing article .block-md { margin: 1rem 0; }
body.editing article .block-md textarea { display: block; width: 100%; box-sizing: border-box; font: .85rem/1.5 ui-monospace, monospace;
  white-space: pre-wrap; overflow-wrap: anywhere; resize: none; padding: .5rem; border: 1px solid var(--fg); background: var(--bg); color: var(--fg); }
/* Tables and code keep their lines (scrolling sideways); text wraps, as in the Markdown view. */
body.editing article .block-md textarea.nowrap { white-space: pre; overflow-wrap: normal; overflow-x: auto; }
body.editing article .block-md .hint { font-size: .75rem; opacity: .6; }
/* Resize handles over the current image. */
.image-handles { position: absolute; z-index: 13; pointer-events: none; }
.image-handles[hidden] { display: none; }
.image-handles span { position: absolute; pointer-events: auto; background: #3858e9; border: 2px solid #fff; border-radius: 3px; box-sizing: border-box; }
.image-handles [data-edge=e] { right: -7px; top: calc(50% - 14px); width: 12px; height: 28px; cursor: ew-resize; }
.image-handles [data-edge=s] { bottom: -7px; left: calc(50% - 14px); width: 28px; height: 12px; cursor: ns-resize; }
.image-handles [data-edge=se] { right: -8px; bottom: -8px; width: 16px; height: 16px; border-radius: 50%; cursor: nwse-resize; }
.block-toolbar .grip { cursor: grab; padding: .45rem .4rem; user-select: none; touch-action: none; display: flex; align-items: center; color: var(--muted, inherit); }
.block-toolbar .grip:active { cursor: grabbing; }
/* Formulas (MathML) hidden while their block is edited as Markdown. */
body.editing article math[hidden] { display: none; }
body.editing article :is(td, th) { min-width: 2em; }
.panes.markdown .md-editor .cm-editor { min-height: inherit; }
/* Under the Markdown view, the article takes no room (its width still sizes the view). */
body:has(.panes.markdown) article .content { height: 0; overflow: hidden; visibility: hidden; }
/* A block's content while its Markdown is edited (whatever display its own CSS gives it). */
body.editing .md-block > [hidden] { display: none !important; }
/* While editing, an image's alt text beside it (on its right, taking no room). */
body.editing .md-atom[data-alt] { position: relative; display: inline-block; vertical-align: top; }
/* (In a figure, centered as its image is.) */
body.editing figure > .md-atom[data-alt] { display: table; margin: 0 auto; }
.alt-text { display: none; }
body.editing .md-atom .alt-text { display: block; position: absolute; left: calc(100% + .5rem); top: 0; width: 11rem;
  font-size: .75rem; line-height: 1.3; font-style: normal; font-weight: normal; color: #6b6b6b; text-align: left; white-space: normal; }
body.editing .md-atom .alt-text:empty::before { content: "No alt text"; color: #b4532a; font-style: italic; }
/* The post's colours, in the editor (see render::colors_style). */
.colors-menu button > span:first-child { padding: 0 .3rem; }
/* One line per colour: its name (shown in the colour), colour, background, bold, remove. */
.colors-panel ul { list-style: none; padding: 0; margin: .3rem 0; }
.colors-panel li { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto auto auto auto; gap: .2rem; align-items: center; margin: 0 0 .25rem; }
.colors-panel input[type=text] { min-width: 0; width: 100%; box-sizing: border-box; font-family: var(--font-code, monospace); font-size: .75rem; padding: .1rem .2rem; }
.colors-panel input[type=checkbox] { margin: 0; }
.colors-panel .remove { padding: 0 .3rem; line-height: 1.3; font-size: .75rem; }
.colors-menu kbd { font-size: .75rem; margin-left: .5rem; opacity: .7; }
.reset-form .totp .qr svg { display: block; width: 200px; height: 200px; background: #fff; }
.reset-form .totp .secret code { word-break: break-all; }

/* Literata only for the site title, and only its letters (see assets/make-title-font.py):
   everything else in the visitor's own fonts, nothing to download. */
@font-face { font-family: "Literata title"; font-weight: 300; src: url(/assets/Literata-title.woff2) format("woff2"); }

:root {
  --accent: #ca3c08;
  --accent-hover: #ea9629;
  --code-bg: #fef9ec;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --font-heading: Georgia, "Noto Serif", "DejaVu Serif", "Times New Roman", serif;
  --font-code: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
}
body { font-size: clamp(1rem, .9rem + .5vw, 1.2rem); font-weight: 300; letter-spacing: -.01em; }
a { text-underline-offset: .1em; }
h1, h2, h3, h4 { font-weight: 200; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 1.8rem + 1.3vw, 2.8rem); }
h2 { font-size: clamp(1.6rem, 1.5rem + .7vw, 2.2rem); }
h3 { font-size: clamp(1.3rem, 1.2rem + .7vw, 1.8rem); }
.content h2, .sidebar h2 { border-bottom: 1px solid var(--fg); }

header.site { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: calc(var(--content-width) + 32px); margin: 0 auto 20px; padding: 0 16px; }
header.site .title { font: 300 clamp(1.8rem, 1.5rem + 1vw, 2.8rem)/1.24 "Literata title", var(--font-heading); letter-spacing: -.0125em; color: var(--fg); text-decoration: none; }
header.site .tagline { margin: 0; }
header.site nav a { color: var(--fg); text-decoration: none; margin-left: 1rem; }
header.site nav a:hover { text-decoration: underline; }

/* As on WordPress: columns of 18.7% (empty), 59.3% and 22% (sidebar), measured on the live
   site; content centered in the middle one, sidebar centered in the right one. */
.page { display: grid; grid-template-columns: 18.7% 59.3% 22%; align-items: start; padding-bottom: 3rem; }
main { grid-column: 2; padding: 0 50px; min-width: 0; container-type: inline-size; }
/* As on WordPress: wide elements up to 1340px, centered on the text (within the column). */
main .content .alignwide { display: block; width: min(1340px, 100cqw); max-width: none; margin-left: 50%; transform: translateX(-50%); box-sizing: border-box; }
main > * { max-width: var(--content-width); margin-left: auto; margin-right: auto; }
.sidebar { grid-column: 3; padding: 0 50px; display: flex; flex-direction: column; align-items: center; gap: 2rem; }
.sidebar section { width: 100%; max-width: 450px; }
@media (max-width: 781px) {
  .page { display: block; padding: 0 16px 3rem; }
  main { padding: 0; }
  .sidebar { padding: 0; margin-top: 3rem; }
}
.sidebar section { background: #fbfaf3; padding: clamp(30px, 5vw, 50px); }
.sidebar h2 { margin-top: 0; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { margin-bottom: 1rem; line-height: 1.3; }
.sidebar li time { display: block; font-size: .8125em; color: var(--fg); }
img.portrait { display: block; width: 100%; max-width: 332px; margin: 0 auto 1rem; border-radius: 50%; }
footer.site { text-align: center; color: var(--muted); font-size: .9rem; padding: 2rem 0; }
figcaption { color: var(--fg); font-size: .75em; text-align: start; margin: .5em 0 1em; }
.home-portrait { max-width: 450px; margin-bottom: 0; }
/* The about box (the `about` page): its picture a round portrait; on the home page, larger and
   without the heading. */
.about figure { margin: 0 0 1rem; }
.about img { display: block; width: 100%; max-width: 332px; height: auto; margin: 0 auto; border-radius: 50%; }
.home .about img { max-width: 450px; }
.home .about > h2:first-child { display: none; }
/* Its own page (only to edit it): as the box, at its width (see .sidebar and .sidebar section). */
article.about .content { width: min(22vw - 100px, 450px); margin: 0 auto; padding: clamp(30px, 5vw, 50px); background: #fbfaf3; }
@media (max-width: 781px) { article.about .content { width: min(100%, 450px); } }
.home h2 { margin-top: 100px; border-bottom: 1px solid var(--fg); }
.latest { list-style: none; padding: 0; }
.latest li { margin-bottom: 19px; }
.latest img.featured { margin: 0 0 .5rem; }
.latest time { display: block; font-size: .8125em; color: var(--fg); }
.latest p { margin-top: .5rem; }
/* WordPress's preset colours (classes in imported posts, e.g. the terminal transcripts:
   white on contrast), with the live site's values. */
.has-base-color { color: #fff !important; }
.has-contrast-color { color: #111 !important; }
.has-white-color { color: #fff !important; }
.has-base-background-color { background-color: #fff !important; }
.has-contrast-background-color { background-color: #111 !important; }
.has-white-background-color { background-color: #fff !important; }
pre.has-background { padding: 1.25em 2.375em; }
pre.wp-block-preformatted, .has-small-font-size { font-size: .9rem; }

/* All running text justified, hyphenating only words of 7 letters or more (3 on each side of
   the break). */
/* Prose only: paragraphs, and list items in posts (not lists of article titles). */
:is(main, .sidebar) p:not(.settings p), article .content li { text-align: justify; hyphens: auto; hyphenate-limit-chars: 7 3 3; }
