/* Snug content: everything an author can put in a post's text. Headings, lists and task lists, tables,
   quotations, code, footnotes, formulas (LaTeX), and embeds: players, the PDF viewer, link and social cards.
   Theme::head() links this file on every page, whatever the theme, before the theme's own styles; the
   editor's preview uses it too. It styles what is inside .e-content, the element that holds a post's text
   (and .p-summary, the opening of an article shown in lists of posts).

   Things stand out by tone, not by outlines: flat surfaces tinted from the text colour, so they follow light
   and dark and any theme. Variables it reads when the theme has them: --ink, --ink-2, --accent, --on-accent,
   --radius, --font-mono. To set it by hand, give .e-content its own --c-* values. */
:is(.e-content,.p-summary){
  --c-ink:var(--ink,currentColor);
  --c-ink2:var(--ink-2,color-mix(in srgb,currentColor 64%,transparent));
  --c-accent:var(--accent,LinkText);
  --c-on-accent:var(--on-accent,#fff);
  --c-tint:color-mix(in srgb,var(--c-ink) 5%,transparent);
  --c-tint2:color-mix(in srgb,var(--c-ink) 9%,transparent);
  --c-rule:color-mix(in srgb,var(--c-ink) 13%,transparent);
  --c-radius:var(--radius,14px);
  --c-mono:var(--font-mono,ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace);
  overflow-wrap:break-word;
}
:is(.e-content,.p-summary) > :first-child{margin-top:0}
:is(.e-content,.p-summary) > :last-child{margin-bottom:0}
:is(.e-content,.p-summary) h2,:is(.e-content,.p-summary) h3,:is(.e-content,.p-summary) h4{line-height:1.25;letter-spacing:-.01em;margin:1.6em 0 .5em}
:is(.e-content,.p-summary) img{border-radius:10px}
:is(.e-content,.p-summary) hr{height:1px;margin:2.2em 0;border:0;background:var(--c-rule)}
:is(.e-content,.p-summary) mark{padding:.05em .25em;border-radius:5px;background:color-mix(in srgb,var(--c-accent) 20%,transparent);color:inherit}
:is(.e-content,.p-summary) kbd{padding:.12em .45em;border-radius:6px;background:var(--c-tint2);box-shadow:inset 0 -1.5px 0 var(--c-rule);font-family:var(--c-mono);font-size:.84em}

/* ---------- Code ---------- */
:is(.e-content,.p-summary) pre{margin:1.4em 0;padding:14px 16px;border-radius:12px;background:var(--c-tint);overflow:auto;font-size:.86em;line-height:1.55;tab-size:2}
:is(.e-content,.p-summary) code{padding:.12em .38em;border-radius:6px;background:var(--c-tint2);font-family:var(--c-mono);font-size:.88em}
:is(.e-content,.p-summary) pre code{padding:0;background:none;font-size:1em}

/* Code colours. highlight.js marks the parts of fenced code that names its language (```php); the colours are
   mixed here from the theme's accent and text colour, so they suit light and dark and any theme.
   To set them by hand, give .e-content its own --code-1 … --code-5. */
:is(.e-content,.p-summary){
  --code-1:color-mix(in oklab,var(--c-accent) 86%,var(--c-ink));  /* keywords, tags: the accent */
  --code-2:color-mix(in oklab,#2f9e62 62%,var(--c-ink));          /* strings: green */
  --code-3:color-mix(in oklab,#d9822b 68%,var(--c-ink));          /* numbers, built-ins, types: amber */
  --code-4:color-mix(in oklab,#7c5cff 60%,var(--c-ink));          /* names of functions and classes: violet */
  --code-5:color-mix(in oklab,#2f7fd1 60%,var(--c-ink));          /* attributes, variables, properties: blue */
}
:is(.e-content,.p-summary) .hljs-comment,:is(.e-content,.p-summary) .hljs-quote,:is(.e-content,.p-summary) .hljs-meta{color:var(--c-ink2);font-style:italic}
:is(.e-content,.p-summary) :is(.hljs-keyword,.hljs-selector-tag,.hljs-literal,.hljs-doctag,.hljs-section,.hljs-name,.hljs-tag){color:var(--code-1)}
:is(.e-content,.p-summary) :is(.hljs-string,.hljs-regexp,.hljs-addition,.hljs-symbol,.hljs-bullet,.hljs-char.escape_){color:var(--code-2)}
:is(.e-content,.p-summary) :is(.hljs-number,.hljs-built_in,.hljs-type,.hljs-template-variable,.hljs-link){color:var(--code-3)}
:is(.e-content,.p-summary) :is(.hljs-title,.hljs-selector-id,.hljs-selector-class){color:var(--code-4)}
:is(.e-content,.p-summary) :is(.hljs-attr,.hljs-attribute,.hljs-variable,.hljs-property,.hljs-params,.hljs-selector-attr,.hljs-selector-pseudo){color:var(--code-5)}
:is(.e-content,.p-summary) .hljs-meta :is(.hljs-keyword,.hljs-string){font-style:normal}
:is(.e-content,.p-summary) .hljs-deletion{color:color-mix(in oklab,#d6453d 66%,var(--c-ink))}
:is(.e-content,.p-summary) .hljs-emphasis{font-style:italic}
:is(.e-content,.p-summary) .hljs-strong{font-weight:700}

/* ---------- Lists ---------- */
:is(.e-content,.p-summary) ul,:is(.e-content,.p-summary) ol{margin:1em 0;padding-left:1.6em}
:is(.e-content,.p-summary) li{margin:.32em 0;padding-left:.15em}
:is(.e-content,.p-summary) li > ul,:is(.e-content,.p-summary) li > ol{margin:.32em 0}
:is(.e-content,.p-summary) li > p{margin:.45em 0}
:is(.e-content,.p-summary) ul{list-style:disc}
:is(.e-content,.p-summary) ul ul{list-style:circle}
:is(.e-content,.p-summary) ul ul ul{list-style:square}
:is(.e-content,.p-summary) ul > li::marker{color:var(--c-accent)}
:is(.e-content,.p-summary) ol{list-style:decimal}
:is(.e-content,.p-summary) ol ol{list-style:lower-alpha}
:is(.e-content,.p-summary) ol ol ol{list-style:lower-roman}
:is(.e-content,.p-summary) ol > li::marker{color:var(--c-ink2);font-size:.9em;font-weight:650;font-variant-numeric:tabular-nums}
/* task lists: "- [ ]" and "- [x]". The box is drawn on the item; the real check box stays for screen readers. */
:is(.e-content,.p-summary) li.task{position:relative;list-style:none}
:is(.e-content,.p-summary) li.task input{position:absolute;width:1px;height:1px;margin:0;opacity:0;pointer-events:none}
:is(.e-content,.p-summary) li.task::before,:is(.e-content,.p-summary) li.task.is-done::after{content:"";position:absolute;left:-1.5em;top:.3em;width:1.08em;height:1.08em;border-radius:.34em}
:is(.e-content,.p-summary) li.task::before{background:var(--c-tint2);box-shadow:inset 0 0 0 1.5px var(--c-rule)}
:is(.e-content,.p-summary) li.task.is-done::before{background:var(--c-accent);box-shadow:none}
:is(.e-content,.p-summary) li.task.is-done::after{background:var(--c-on-accent);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5.5 12.5 4.2 4.2 8.8-9.4'/%3E%3C/svg%3E") center/78% no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5.5 12.5 4.2 4.2 8.8-9.4'/%3E%3C/svg%3E") center/78% no-repeat}
:is(.e-content,.p-summary) li.task.is-done{color:var(--c-ink2)}
:is(.e-content,.p-summary) dt{margin-top:.9em;font-weight:650}
:is(.e-content,.p-summary) dd{margin:.2em 0 0 1.4em;color:var(--c-ink2)}

/* ---------- Tables ---------- */
:is(.e-content,.p-summary) .table-wrap{margin:1.5em 0;border-radius:var(--c-radius);background:var(--c-tint);overflow-x:auto;-webkit-overflow-scrolling:touch}
:is(.e-content,.p-summary) table{width:100%;border-collapse:collapse;font-size:.93em;line-height:1.45;font-variant-numeric:tabular-nums}
:is(.e-content,.p-summary) th,:is(.e-content,.p-summary) td{padding:.72em 1.05em;border:0;text-align:left;vertical-align:top}
:is(.e-content,.p-summary) thead th{padding:.84em 1.22em;background:var(--c-tint2);color:var(--c-ink2);font-size:.86em;font-weight:650;letter-spacing:.01em;white-space:nowrap} /* 1.22em here = the cells' 1.05em */
:is(.e-content,.p-summary) tbody tr + tr > *{border-top:1px solid var(--c-rule)}
:is(.e-content,.p-summary) tbody tr:hover > *{background:var(--c-tint)}
:is(.e-content,.p-summary) > table{display:block;margin:1.5em 0;overflow-x:auto} /* a table written without the wrapper */

/* ---------- Quotations ---------- */
:is(.e-content,.p-summary) blockquote{position:relative;margin:1.5em 0;padding:1.05em 1.35em 1.05em 3.3em;border:0;border-radius:var(--c-radius);background:var(--quote-bg,var(--c-tint));color:var(--c-ink);font-style:normal}
:is(.e-content,.p-summary) blockquote::before{content:"\201C";position:absolute;left:.3em;top:.06em;color:var(--quote-mark,var(--c-accent));font:700 3.5em/1 Georgia,"Times New Roman",serif;opacity:.6}
:is(.e-content,.p-summary) blockquote > :first-child{margin-top:0}
:is(.e-content,.p-summary) blockquote > :last-child{margin-bottom:0}
:is(.e-content,.p-summary) blockquote p{margin:.65em 0}
:is(.e-content,.p-summary) blockquote cite,:is(.e-content,.p-summary) blockquote footer{display:block;margin-top:.75em;color:var(--c-ink2);font-size:.86em;font-style:normal}
:is(.e-content,.p-summary) blockquote cite::before,:is(.e-content,.p-summary) blockquote footer::before{content:"\2014\00A0"}
:is(.e-content,.p-summary) blockquote footer cite{display:inline;margin:0;font-size:1em}
:is(.e-content,.p-summary) blockquote footer cite::before{content:none}
/* a quotation inside a quotation: a quiet rule beside it */
:is(.e-content,.p-summary) blockquote blockquote{margin:.8em 0;padding:.1em 0 .1em 1.05em;border-radius:0;background:none;box-shadow:inset 3px 0 0 var(--c-rule);color:var(--c-ink2)}
:is(.e-content,.p-summary) blockquote blockquote::before{content:none}
@media (max-width:520px){
  :is(.e-content,.p-summary) blockquote{padding:.95em 1.05em .95em 2.7em}
  :is(.e-content,.p-summary) blockquote::before{left:.22em;font-size:3em}
}

/* ---------- Footnotes ---------- */
:is(.e-content,.p-summary) .footnote-ref{font-size:.7em;line-height:0;vertical-align:super}
:is(.e-content,.p-summary) .footnote-ref a{display:inline-block;min-width:1.55em;margin:0 .1em;padding:.2em .38em;border-radius:999px;background:var(--c-tint2);color:var(--c-accent);font-weight:700;font-variant-numeric:tabular-nums;line-height:1.1;text-align:center;text-decoration:none;transition:background-color .15s,color .15s}
:is(.e-content,.p-summary) .footnote-ref a:hover,:is(.e-content,.p-summary) .footnote-ref a:target{background:var(--c-accent);color:var(--c-on-accent)}
:is(.e-content,.p-summary) .footnotes{margin-top:2.4em;padding-top:1em;border-top:1px solid var(--c-rule);color:var(--c-ink2);font-size:.88em;line-height:1.55}
:is(.e-content,.p-summary) .footnotes ol{margin:0;padding:0;list-style:none;counter-reset:fn}
:is(.e-content,.p-summary) .footnotes li{position:relative;margin:.1em 0;padding:.45em .7em .45em 2.6em;border-radius:10px;counter-increment:fn;scroll-margin-top:5rem}
:is(.e-content,.p-summary) .footnotes li::before{content:counter(fn);position:absolute;left:.55em;top:.55em;min-width:1.6em;padding:.16em .3em;border-radius:999px;background:var(--c-tint2);font-size:.8em;font-weight:700;font-variant-numeric:tabular-nums;line-height:1.2;text-align:center}
:is(.e-content,.p-summary) .footnotes li p{margin:.2em 0}
:is(.e-content,.p-summary) .footnotes li:target{background:var(--c-tint2);color:var(--c-ink)}
:is(.e-content,.p-summary) .footnote-back{margin-left:.3em;color:var(--c-accent);text-decoration:none}
:is(.e-content,.p-summary) .footnote-ref a{scroll-margin-top:5rem}

/* ---------- Formulas (LaTeX, drawn by KaTeX) ---------- */
/* until it is drawn, and where scripts are off, a formula shows as it was written */
:is(.e-content,.p-summary) .math{font-family:var(--c-mono);font-size:.88em}
:is(.e-content,.p-summary) .math.display{display:block;margin:1.4em 0;padding:.9em 1.1em;border-radius:12px;background:var(--c-tint);white-space:pre-wrap}
:is(.e-content,.p-summary) .math.is-drawn{font-family:inherit;font-size:1em}
:is(.e-content,.p-summary) .math.display.is-drawn{padding:.25em 0;border-radius:0;background:none;white-space:normal;text-align:center;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}
:is(.e-content,.p-summary) .math .katex{font-size:1.1em}
:is(.e-content,.p-summary) .math.display .katex{font-size:1.18em}
:is(.e-content,.p-summary) .math.display .katex-display{margin:0}
:is(.e-content,.p-summary) .math .katex-error{font-family:var(--c-mono);font-size:.8em}

/* ---------- Embeds: an address standing alone in the text ---------- */
:is(.e-content,.p-summary) .embed{max-width:var(--embed-max,none);margin:1.5em 0}
/* players */
:is(.e-content,.p-summary) .embed-player{position:relative;overflow:hidden;border-radius:var(--c-radius);background:var(--c-tint)}
/* A player fits the screen whichever way it is held: never taller than --embed-fit of the screen's height. */
:is(.e-content,.p-summary) .embed-player.is-ratio{aspect-ratio:var(--embed-ar,16/9);max-width:min(var(--embed-max,100%),calc(var(--embed-fit,82vh) * var(--embed-ar,16/9)));background:#000}
:is(.e-content,.p-summary) .embed-player.is-fixed{height:min(var(--embed-h,152px),86vh);border-radius:12px}
:is(.e-content,.p-summary) .embed-player.is-fluid{height:var(--embed-h,320px)} /* as tall as its content (Instagram, Reddit, Facebook) */
/* an upright video stays under two thirds of the screen's height; two in a row stand side by side */
:is(.e-content,.p-summary) .embed-player.is-upright{--embed-fit:66vh;display:inline-block;width:100%;margin-right:10px;vertical-align:top}
:is(.e-content,.p-summary) .embed-player iframe{position:relative;display:block;width:100%;height:100%;border:0}
/* until a frame is fetched: the service's name, quietly */
:is(.e-content,.p-summary) .embed-player:not(.is-loaded)::before{content:attr(data-name);position:absolute;inset:0;display:grid;place-items:center;color:var(--c-ink2);font-size:.82rem;font-weight:600;letter-spacing:.02em}
:is(.e-content,.p-summary) .embed-player.is-ratio:not(.is-loaded)::before{color:rgba(255,255,255,.6)}
/* Players that are rounded cards already (their own corners are 10 to 12 px): nothing of ours shows behind them. */
:is(.e-content,.p-summary) .embed-player:is(.is-spotify,.is-tidal,.is-deezer,.is-apple-music,.is-apple-podcasts).is-loaded{background:none}
:is(.e-content,.p-summary) .embed-player.is-apple-podcasts{border-radius:12px}
:is(.e-content,.p-summary) .embed-player.is-spotify iframe{color-scheme:light;border-radius:12px} /* keeps its rounded corners clear on a dark page */
/* Players that draw a hairline around a square box: the hairline is tucked just outside the frame, so the rounded
   corners here cut through nothing. */
:is(.e-content,.p-summary) .embed-player:is(.is-soundcloud,.is-bandcamp,.is-mixcloud,.is-instagram,.is-facebook.is-fixed){border-radius:12px;background:#fff}
:is(.e-content,.p-summary) .embed-player:is(.is-soundcloud,.is-bandcamp,.is-mixcloud,.is-instagram,.is-facebook.is-fixed) iframe{width:calc(100% + 2px);height:calc(100% + 2px);margin:-1px}
:is(.e-content,.p-summary) .embed-player.is-mixcloud{background:#1c1f22}
/* Reddit rounds and outlines its own card: it is shown whole, with nothing cut. */
:is(.e-content,.p-summary) .embed-player.is-reddit{overflow:visible;border-radius:0;background:none}
/* a sound, video or picture file */
:is(.e-content,.p-summary) .embed-file video,:is(.e-content,.p-summary) .embed-file img{display:block;max-width:100%;height:auto;border-radius:var(--c-radius)}
:is(.e-content,.p-summary) .embed-file video{width:100%;background:#000}
/* link and social cards (the card itself is quote.css) */
:is(.e-content,.p-summary) .embed-card .quote{margin:0}
/* PDF: the browser's own viewer draws a dark frame around the page, so the viewer's corners stay square
   (rounding them would cut that frame); the bar above it is rounded. */
:is(.e-content,.p-summary) .embed-pdf{overflow:hidden;border-radius:var(--c-radius) var(--c-radius) 0 0;background:var(--c-tint)}
:is(.e-content,.p-summary) .embed-pdf.is-compact{border-radius:var(--c-radius)}
:is(.e-content,.p-summary) .pdf-bar{display:flex;align-items:center;gap:.7em;margin:0;padding:.65em .7em .65em .95em;color:var(--c-ink);font-size:.9rem;line-height:1.3}
:is(.e-content,.p-summary) .pdf-badge{flex:none;padding:.3em .52em;border-radius:6px;background:var(--c-tint2);color:var(--c-ink2);font-size:.66rem;font-weight:750;letter-spacing:.07em}
:is(.e-content,.p-summary) .pdf-name{flex:1;min-width:0;overflow:hidden;font-weight:600;text-overflow:ellipsis;white-space:nowrap}
:is(.e-content,.p-summary) .pdf-size{flex:none;color:var(--c-ink2);font-size:.8rem;font-variant-numeric:tabular-nums}
:is(.e-content,.p-summary) .pdf-open{flex:none;padding:.42em 1em;border-radius:999px;background:var(--c-accent);color:var(--c-on-accent);font-size:.82rem;font-weight:650;text-decoration:none}
:is(.e-content,.p-summary) .pdf-open:hover{text-decoration:none;filter:brightness(1.08)}
:is(.e-content,.p-summary) .pdf-view{display:block;width:100%;height:clamp(240px,42vh,440px);border:0;background:#fff} /* with its bar, under half the screen; "Open" shows it whole */
/* in lists of posts: smaller */
:is(.e-content,.p-summary) .embed.is-compact{max-width:min(100%,var(--embed-max,520px))}
:is(.e-content,.p-summary) .embed-player.is-ratio.is-compact{max-width:min(var(--embed-max,520px),calc(var(--embed-fit,82vh) * var(--embed-ar,16/9)))}
@media (max-width:520px){
  :is(.e-content,.p-summary) .pdf-view{height:clamp(240px,42vh,440px)}
  :is(.e-content,.p-summary) .pdf-size{display:none}
}
