/* /posts — the list (posts/index.php) and a post (posts/post.php). The cards
   themselves are home-cards.css, shared with the homepage. */

/* ── The list ─────────────────────────────────────────────────────────── */
[data-component="posts"] [data-part="lead"] {
	max-width: 48rem;
}

/* Local preview only (?posts_preview=N). */
[data-component="posts"] [data-part="preview-note"] {
	display: inline-block;
	padding: var(--spacing-xx-small) var(--spacing-x-small);
	border: 0.05rem dashed var(--focus-color);
	border-radius: var(--spacing-xx-small);
	font-size: var(--font-size-small);
}

/* The list sits under a line (<hr>) like the homepage sections, its grid /
   list tab hanging from it, at the line's full gap. */
[data-component="posts"] [data-home-cards] {
	--view-tab-w: 4.5rem;
	--view-line-gap: var(--spacing-x-large);
}

/* Search and topics, above the line. */
/* Left-aligned, whatever the site's form defaults (centred forms) say. */
[data-component="posts"] [data-part="filters"] {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: var(--spacing-small);
	width: auto;
	max-width: none;
	margin: var(--spacing-large) 0 0;
	padding: 0;
	text-align: left;
}

/* The label above, the field and its button side by side. */
[data-component="posts"] [data-part="search"] {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: stretch;
	gap: var(--spacing-xx-small) var(--spacing-x-small);
	max-width: 32rem;
	margin: 0;
	text-align: left;
}

[data-component="posts"] [data-part="search"] label {
	grid-column: 1 / -1;
	margin: 0;
	font-weight: 700;
	text-align: left;
}

[data-component="posts"] [data-part="search"] input {
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: var(--spacing-x-small) var(--spacing-small);
	border: 0.05rem solid color-mix(in srgb, var(--primary-text-color) 35%, transparent);
	border-radius: var(--spacing-x-small);
	background: var(--bg-color);
	color: var(--primary-text-color);
	font: inherit;
}

[data-component="posts"] [data-part="search"] button {
	width: auto;
	margin: 0;
	padding: var(--spacing-x-small) var(--spacing-normal);
	border: 0.05rem solid var(--primary-text-color);
	border-radius: var(--spacing-x-small);
	background: var(--primary-text-color);
	color: var(--bg-color);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

/* Topics as chips with their counts; the chosen one filled. */
[data-component="posts"] [data-part="tag-filter"] {
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-x-small);
}

[data-component="posts"] [data-part="tag-filter"] a {
	display: inline-flex;
	align-items: center;
	gap: var(--spacing-xx-small);
	padding: var(--spacing-xx-small) var(--spacing-small);
	border: 0.05rem solid color-mix(in srgb, var(--primary-text-color) 25%, transparent);
	border-radius: 1rem;
	color: var(--primary-text-color);
	font-size: var(--font-size-small);
	text-decoration: none;
}

[data-component="posts"] [data-part="tag-filter"] a span {
	color: var(--hs-muted, currentColor);
	font-weight: 400;
}

[data-component="posts"] [data-part="tag-filter"] a:hover {
	border-color: var(--focus-color);
}

[data-component="posts"] [data-part="tag-filter"] a[aria-current="page"] {
	border-color: var(--primary-text-color);
	background: var(--primary-text-color);
	color: var(--bg-color);
}

[data-component="posts"] [data-part="tag-filter"] a[aria-current="page"] span {
	color: inherit;
	opacity: 0.75;
}

[data-component="posts"] [data-part="filter-note"] {
	margin: var(--spacing-small) 0 0;
	color: var(--hs-muted, currentColor);
}

[data-component="posts"] [data-part="filter-note"] a {
	margin-left: var(--spacing-x-small);
}

[data-component="posts"] [data-home-cards] [data-view-head] h2 {
	margin: 0;
}

/* Newer / older under the list. */
[data-component="posts"] [data-part="pager"] {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--spacing-small);
	padding-top: var(--spacing-normal);
	border-top: 0.05rem solid var(--hs-line);
}

[data-component="posts"] [data-part="pager"] [rel="next"] {
	margin-left: auto;
}

[data-component="posts"] [data-part="pager-page"] {
	color: var(--hs-muted);
}

/* The tab here holds only the switch: no divider before it. */
[data-component="posts"] [data-section-tab] > [data-view-switch]:first-child {
	padding-left: 0;
	border-left: 0;
}


/* ── A post ───────────────────────────────────────────────────────────── */
[data-component="post"] {
	--post-measure: 42rem;
	--post-muted: color-mix(in srgb, var(--primary-text-color) 70%, transparent);
	--post-line: color-mix(in srgb, var(--primary-text-color) 14%, transparent);
	--post-card: color-mix(in srgb, var(--primary-text-color) 5%, var(--bg-color));
}

/* The text at a reading width; on a wide screen the side column (contents,
   more posts) takes the room beside it and stays in view while reading. */
[data-component="post"] [data-part="layout"] {
	display: grid;
	grid-template-columns: minmax(0, var(--post-measure));
	gap: var(--spacing-xx-large);
	align-items: start;
}

@container page (min-width: 60rem) {
	[data-component="post"] [data-part="layout"] {
		grid-template-columns: minmax(0, var(--post-measure)) minmax(14rem, 18rem);
		justify-content: space-between;
	}

	[data-component="post"] [data-part="aside"] {
		position: sticky;
		top: var(--spacing-large);
	}
}

/* Under the title: who, when, how long — one quiet line, dots between. */
[data-component="post"] [data-part="byline"] {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--spacing-xx-small) var(--spacing-x-small);
	margin: var(--spacing-x-small) 0 0;
	color: var(--post-muted);
}

[data-component="post"] [data-part="byline"] > :first-child {
	color: var(--primary-text-color);
	font-weight: 700;
}

/* No "·" between the items (wrapped on a phone, a line began with one):
   the date and the reading time carry a small calendar and clock instead,
   in the muted colour (CSS masks of the site's icons). */
[data-component="post"] [data-part="byline"] {
	column-gap: var(--spacing-normal);
}

[data-component="post"] [data-part="byline"] > :is(time, [data-part="read-time"]) {
	display: inline-flex;
	align-items: center;
	gap: var(--spacing-xx-small);
	white-space: nowrap;
}

[data-component="post"] [data-part="byline"] > :is(time, [data-part="read-time"])::before {
	content: "";
	flex: none;
	width: 0.85em;
	height: 0.85em;
	background-color: currentColor;
	-webkit-mask: var(--byline-icon) center / contain no-repeat;
	mask: var(--byline-icon) center / contain no-repeat;
}

[data-component="post"] [data-part="byline"] > time {
	/* outline calendar and clock, drawn to match (the site icons fill in at this size) */
	--byline-icon: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%23000%27 stroke-width=%272.4%27 stroke-linecap=%27round%27%3E%3Crect x=%273.5%27 y=%275%27 width=%2717%27 height=%2715.5%27 rx=%272.5%27/%3E%3Cpath d=%27M3.5 10h17M8 3v4M16 3v4%27/%3E%3C/svg%3E");
}

[data-component="post"] [data-part="byline"] > [data-part="read-time"] {
	--byline-icon: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%23000%27 stroke-width=%272.4%27 stroke-linecap=%27round%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%278.8%27/%3E%3Cpath d=%27M12 7.5V12l3 2%27/%3E%3C/svg%3E");
}

[data-component="post"] [data-part="cover"] {
	margin: var(--spacing-large) 0 0;
	padding: 0; /* the site's figure padding would double the gap */
}

[data-component="post"] [data-part="cover"] video {
	display: block;
	width: 100%;
	max-height: 32rem;
	border-radius: 0.6rem;
	background: #000;
}

[data-component="post"] [data-part="cover"] figcaption {
	margin-top: var(--spacing-x-small);
	padding: 0 0.6rem; /* where the video's rounded corner ends */
	color: var(--post-muted);
	font-size: var(--font-size-small);
}

[data-component="post"] [data-part="cover"] img {
	display: block;
	width: 100%;
	max-height: 26rem;
	object-fit: cover;
	border-radius: 0.6rem;
}

[data-component="post"] [data-part="body"] {
	margin-top: var(--spacing-large);
	line-height: 1.6;
	counter-reset: post-section;
}

[data-component="post"] [data-part="body"] > :first-child {
	margin-top: 0;
}

[data-component="post"] [data-part="body"] p {
	margin: 0 0 var(--spacing-normal);
}

/* The opening paragraph: the way in, in the site's display face (Xolonium,
   as the headings) a size up, before the sections. A reader who chose a
   serif or monospace font keeps it. */
[data-component="post"] [data-part="body"] > p:first-child {
	font-family: "Xolonium", sans-serif;
	font-size: calc(var(--font-size, 1rem) * 1.1);
	line-height: 1.55;
}

[data-accessibility~="serif"] [data-component="post"] [data-part="body"] > p:first-child {
	font-family: "Sentient", serif;
}

[data-accessibility~="monospace"] [data-component="post"] [data-part="body"] > p:first-child {
	font-family: "DMMono", sans-serif;
}

/* A paragraph that introduces a list sits close to it. */
[data-component="post"] [data-part="body"] p:has(+ :is(ul, ol)) {
	margin-bottom: var(--spacing-xx-small);
}

[data-component="post"] [data-part="body"] :is(ul, ol) {
	margin-top: 0;
	margin-bottom: var(--spacing-normal);
}

/* Each section opens on a thin rule with its number above the heading, the
   same 01, 02… as "On this page", so a new topic is plain to see. */
/* Section headings: the site's title line (variables.css --title-2-line) is
   shorter than the letters, so a heading that wraps ran its lines together. */
[data-component="post"] [data-part="body"] :is(h2, h3) {
	line-height: 1.2;
}

[data-component="post"] [data-part="body"] h2 {
	counter-increment: post-section;
	margin: var(--spacing-xx-large) 0 var(--spacing-small);
	padding-top: var(--spacing-large);
	border-top: 0.05rem solid var(--post-line);
	scroll-margin-top: var(--spacing-large);
}

[data-component="post"] [data-part="body"] h2::before {
	content: counter(post-section, decimal-leading-zero);
	display: block;
	margin-bottom: var(--spacing-xx-small);
	color: var(--focus-color);
	font-size: var(--font-size-small);
	letter-spacing: 0.08em;
}

[data-component="post"] [data-part="body"] h3 {
	margin: var(--spacing-x-large) 0 var(--spacing-x-small);
	scroll-margin-top: var(--spacing-large);
}

/* The end of the text: a filled round mark after its last line, like the
   dot in the logo. */
/* With a reference list at the end, the mark closes the text before it:
   the paragraph above the heading, not the bibliography. */
[data-component="post"] [data-part="body"] > :is(h2#references, h2#kasutatud-kirjandus) ~ :last-child::after {
	content: none;
}

[data-component="post"] [data-part="body"] > :last-child::after,
[data-component="post"] [data-part="body"] > p:has(+ :is(h2#references, h2#kasutatud-kirjandus))::after {
	content: "";
	display: inline-block;
	width: 0.75em;
	height: 0.75em;
	margin-left: 0.4em;
	border-radius: 50%;
	background: currentColor;
	vertical-align: baseline;
}

/* Lists in the text: the site's lists (base.css) are bulleted with a
   hanging "●" and spaced for menus (line-height 2); here they read as prose.
   A numbered list keeps its numbers, without the bullet, and in the text's
   font (base.css only sets it for ul items). */
[data-component="post"] [data-part="body"] li {
	margin-bottom: var(--spacing-x-small);
	line-height: 1.6;
}

/* A reference list: the list under a "References" (or Estonian "Kasutatud
   kirjandus") heading, written in Markdown as "- Author, A. (2024). *Title*…".
   Set as a bibliography: no bullets, each entry with a hanging indent (APA),
   a step smaller; the line above the list (how it is formatted) muted. Long
   addresses break anywhere rather than run out of the column. */
[data-component="post"] [data-part="body"] :is(h2#references, h2#kasutatud-kirjandus) {
	margin-top: var(--spacing-xx-large);
	padding-top: var(--spacing-normal);
	border-top: 0.05rem solid var(--post-line);
}

[data-component="post"] [data-part="body"] :is(h2#references, h2#kasutatud-kirjandus) ~ p {
	color: var(--post-muted);
	font-size: var(--font-size-small);
}

[data-component="post"] [data-part="body"] :is(h2#references, h2#kasutatud-kirjandus) ~ ul {
	margin: var(--spacing-small) 0 0;
	padding: 0;
	list-style: none;
}

[data-component="post"] [data-part="body"] :is(h2#references, h2#kasutatud-kirjandus) ~ ul > li {
	margin: 0 0 var(--spacing-small);
	padding-left: 2em;
	text-indent: -2em;
	font-size: var(--font-size-small);
	line-height: 1.55;
	overflow-wrap: anywhere;
}

[data-component="post"] [data-part="body"] :is(h2#references, h2#kasutatud-kirjandus) ~ ul > li::before {
	content: none;
}

/* Titles: the italic face runs small next to the upright one; a step up
   so they read at the same size. */
[data-component="post"] [data-part="body"] :is(h2#references, h2#kasutatud-kirjandus) ~ ul em {
	font-size: 1.12em;
	line-height: 1;
}

[data-component="post"] [data-part="body"] :is(h2#references, h2#kasutatud-kirjandus) ~ ul a {
	font-weight: 400;
}

[data-component="post"] [data-part="body"] ol {
	margin-left: 0;
	padding-left: var(--spacing-large);
	list-style: decimal;
}

[data-component="post"] [data-part="body"] ol li {
	padding-left: var(--spacing-xx-small);
	text-indent: 0;
	font-family: "ApfelGrotezk", sans-serif;
	font-size: var(--font-size);
	letter-spacing: var(--letter-spacing-normal);
}

[data-accessibility~="serif"] [data-component="post"] [data-part="body"] ol li {
	font-family: "Sentient", serif;
}

[data-accessibility~="monospace"] [data-component="post"] [data-part="body"] ol li {
	font-family: "DMMono", sans-serif;
}

[data-component="post"] [data-part="body"] ol li::before {
	content: none;
}

[data-component="post"] [data-part="body"] ol li::marker {
	font-weight: 700;
}

[data-component="post"] [data-part="body"] img {
	max-width: 100%;
	height: auto;
}

[data-component="post"] [data-part="body"] pre {
	overflow-x: auto;
	padding: var(--spacing-small);
	border-radius: var(--spacing-x-small);
	background: var(--post-card);
}

/* The site's quote (base.css: ⚡ and a rule) needs a box to hang the ⚡ in. */
[data-component="post"] [data-part="body"] blockquote {
	position: relative;
	margin: var(--spacing-large) 0;
}

[data-component="post"] [data-part="body"] blockquote p {
	margin-bottom: 0;
}

/* "Filed under" and the tags as chips, each the list of its posts. */
/* Take it away: "Download as Markdown" and "RSS feed" under a post, the
   RSS line under the list's lead. Small, muted, each with a little mark. */
:is([data-component="post"], [data-component="posts"]) [data-part="post-export"] {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--spacing-xx-small) var(--spacing-normal);
	margin: var(--spacing-normal) 0 0;
	color: var(--post-muted);
	font-size: var(--font-size-small);
}

:is([data-component="post"], [data-component="posts"]) [data-part="post-export"] a {
	font-weight: 600;
	text-underline-offset: 0.15em;
}

:is([data-component="post"], [data-component="posts"]) [data-part="post-export"] a[download]::before {
	content: "↓ ";
}

:is([data-component="post"], [data-component="posts"]) [data-part="post-export"] a[type="application/rss+xml"]::before {
	content: "◉ ";
	color: var(--focus-color);
}

[data-component="post"] [data-part="tags"] {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--spacing-x-small);
	margin: var(--spacing-x-large) 0 0;
	color: var(--post-muted);
	font-size: var(--font-size-small);
}

[data-component="post"] [data-part="tag"] {
	padding: var(--spacing-xx-small) var(--spacing-small);
	border: 0.05rem solid var(--post-line);
	border-radius: 1rem;
	color: var(--primary-text-color);
	text-decoration: none;
}

[data-component="post"] [data-part="tag"]:hover {
	border-color: var(--focus-color);
	color: var(--focus-color);
}

/* Older / newer: the project pages' "reveal ⌖ further" (main.css styles
   the buttons and their arrow faces), each with the other confession's
   title under it; on a phone one under the other. */
[data-component="post"] [data-part="post-nav"] {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: var(--spacing-small);
	margin-top: var(--spacing-x-large);
	padding-top: var(--spacing-large);
	border-top: 0.05rem solid var(--post-line);
}

[data-component="post"] [data-part="post-nav"] > div {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--spacing-x-small);
	flex: 1 1 0;
	max-width: 16rem;
	text-align: center;
}

[data-component="post"] [data-part="nav-title"] {
	margin: 0;
	color: var(--post-muted);
	font-size: var(--font-size-small);
	line-height: 1.35;
}

[data-component="post"] [data-part="nav-mark"] {
	align-self: flex-start;
	font-family: "Xolonium", sans-serif;
	font-size: 2.5rem;
	font-weight: 400;
	line-height: 1;
	user-select: none;
}

/* ── The side column ─────────────────────────────────────────────────── */
[data-component="post"] [data-part="aside"] {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-normal);
}

[data-component="post"] [data-part="aside"] > * {
	padding: var(--spacing-normal);
	border: 0.05rem solid var(--post-line);
	border-radius: 0.6rem;
	background: var(--post-card);
}

[data-component="post"] [data-part="aside"] h2 {
	margin: 0 0 var(--spacing-x-small);
	font-size: var(--font-size-small);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--post-muted);
}

[data-component="post"] [data-part="aside"] :is(ol, ul) {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-x-small);
	margin: 0;
	padding: 0;
	list-style: none;
}

[data-component="post"] [data-part="aside"] li {
	margin: 0;
	padding: 0;
	line-height: 1.35;
	text-indent: 0; /* the site's list hangs its bullet with a negative indent */
}

[data-component="post"] [data-part="aside"] li::before {
	content: none;
}

/* "On this page": a rail down the left with the sections numbered on it;
   the one you are reading (posts.js) is marked on the rail in orange and
   set in full colour, the rest a step quieter. */
[data-component="post"] [data-part="toc"] ol {
	gap: 0;
	counter-reset: toc;
	border-left: 0.1rem solid var(--post-line);
}

[data-component="post"] [data-part="toc"] li a {
	display: grid;
	grid-template-columns: 1.5rem minmax(0, 1fr);
	align-items: baseline;
	margin-left: -0.1rem;
	padding: var(--spacing-x-small) 0 var(--spacing-x-small) var(--spacing-small);
	border-left: 0.1rem solid transparent;
	color: var(--post-muted);
	transition:
		color 150ms,
		border-color 150ms;
}

[data-component="post"] [data-part="toc"] [data-level="2"] a::before {
	content: counter(toc, decimal-leading-zero);
	counter-increment: toc;
	color: var(--post-muted);
	font-size: 0.65rem;
	font-variant-numeric: tabular-nums;
}

[data-component="post"] [data-part="toc"] [data-level="3"] a {
	padding-left: calc(var(--spacing-small) + 1.5rem);
	grid-template-columns: minmax(0, 1fr);
	font-size: var(--font-size-small);
}

[data-component="post"] [data-part="toc"] li a:hover {
	color: var(--primary-text-color);
	text-decoration: none;
}

/* On hover only the heading is underlined, not its number. (The side card's
   link rule below underlines the whole link; this one is more specific.) */
[data-component="post"] [data-part="aside"] [data-part="toc"] li a:hover {
	text-decoration: none;
}

[data-component="post"] [data-part="toc"] li a:hover > span {
	text-decoration: underline;
	text-underline-offset: 3px;
}

[data-component="post"] [data-part="toc"] li a[aria-current] {
	border-left-color: var(--focus-color);
	color: var(--primary-text-color);
	/* Heavier without bold: a hairline stroke round the letters adds weight
	   but not width, so the lines break where they did (bold would re-wrap
	   the item and make the list jump while scrolling). */
	-webkit-text-stroke: 0.03em currentColor;
}

[data-component="post"] [data-part="toc"] li a[aria-current]::before {
	color: var(--focus-color);
}

@media (prefers-reduced-motion: reduce) {
	[data-component="post"] [data-part="toc"] li a {
		transition: none;
	}
}

/* The language of a post that is not in English: a small mark on its card
   and a note in its byline. */
[data-home-cards] [data-part="lang"] {
	flex: none;
	padding: 0 var(--spacing-xx-small);
	border: 0.05rem solid var(--hs-line);
	border-radius: 0.25rem;
	color: var(--hs-muted);
	font-size: 0.6rem;
	font-weight: 700;
	letter-spacing: 0.06em;
}

[data-component="post"] [data-part="lang-note"] {
	color: var(--post-muted);
}

[data-component="post"] [data-part="aside"] li a {
	font-weight: 400;
	text-decoration: none;
	line-height: 1.35;
}

[data-component="post"] [data-part="aside"] li a:hover {
	text-decoration: underline;
}

/* More posts: a small picture (or the post drawing) beside each title and
   date, the whole row a link. */
[data-component="post"] [data-part="more"] ul {
	gap: 0;
}

[data-component="post"] [data-part="more"] li + li {
	border-top: 0.05rem solid var(--post-line);
}

/* Each one a small card: its picture the full width of the column, the
   title and date under it (a thumbnail beside the title was too small to
   show anything). */
[data-component="post"] [data-part="more"] li a {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-x-small);
	padding: var(--spacing-x-small) 0;
	color: var(--primary-text-color);
}

[data-component="post"] [data-part="more"] li:first-child a {
	padding-top: 0;
}

/* Date and language mark on one line under the title. */
[data-component="post"] [data-part="more-meta"] {
	display: flex;
	align-items: center;
	gap: var(--spacing-x-small);
}

[data-component="post"] [data-part="more-meta"] [data-part="lang"] {
	padding: 0 var(--spacing-xx-small);
	border: 0.05rem solid var(--post-line);
	border-radius: 0.25rem;
	color: var(--post-muted);
	font-size: 0.6rem;
	font-weight: 700;
	letter-spacing: 0.06em;
}

[data-component="post"] [data-part="more"] li a:hover {
	text-decoration: none;
}

[data-component="post"] [data-part="more"] li a:hover strong {
	color: var(--focus-color);
}

[data-component="post"] [data-part="thumb"] {
	flex: none;
	display: grid;
	place-items: center;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: var(--spacing-x-small);
	color: color-mix(in srgb, var(--focus-color) 80%, var(--primary-text-color));
	background: color-mix(in srgb, var(--focus-color) 10%, var(--post-card));
}

[data-component="post"] span[data-part="thumb"] > svg {
	width: 85%;
	height: 85%;
}

[data-component="post"] [data-part="thumb"] [data-solid] {
	fill: color-mix(in srgb, var(--focus-color) 10%, var(--post-card));
}

[data-component="post"] [data-part="more-text"] {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
}

[data-component="post"] [data-part="more-text"] strong {
	font-size: var(--font-size-small);
	line-height: 1.3;
	transition: color 150ms;
}

[data-component="post"] [data-part="more"] time {
	color: var(--post-muted);
	font-size: 0.65rem;
}

/* "All posts": the same quiet full-width button as The Socialite's Mask's
   "All profiles". */
[data-component="post"] [data-part="more"] [data-part="all"] {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--spacing-x-small);
	margin-top: var(--spacing-x-small);
	padding: var(--spacing-x-small) var(--spacing-small);
	border: 0.05rem solid var(--post-line);
	border-radius: 0.5rem;
	background: var(--bg-color);
	color: var(--primary-text-color);
	font-size: var(--font-size-small);
	font-weight: 700;
	text-decoration: none;
	transition:
		border-color 150ms,
		color 150ms;
}

[data-component="post"] [data-part="more"] [data-part="all"]:hover {
	border-color: var(--focus-color);
	color: var(--focus-color);
}

@container page (max-width: 30.72rem) {
	[data-component="post"] [data-part="post-nav"] {
		flex-direction: column;
		align-items: center;
	}

	[data-component="post"] [data-part="post-nav"] > div {
		max-width: none;
		width: 100%;
	}

	[data-component="post"] [data-part="post-nav"] [data-button] {
		width: 100%;
	}

	[data-component="post"] [data-part="nav-mark"] {
		display: none;
	}
}

/* A confession's title is usually a sentence: a step smaller than a section
   page's one-word title, so it reads in two or three lines, not five. */
[data-component="post"] [data-type="title"] h1 {
	font-size: calc(var(--title-1-size) * 0.62);
	line-height: 1.1;
	text-wrap: balance;
	/* The -5px pull of the big one-word titles (main.css) is for their size;
	   here Safari pulled only the first line, which stuck out. */
	text-indent: 0;
}

/* Phones: a step smaller again, so a sentence takes three lines, not four
   or five. */
@container page (max-width: 30.72rem) {
	[data-component="post"] [data-type="title"] h1 {
		font-size: 1.4rem;
	}
}

/* "In Estonian" as a small chip, not one more "·" item: wrapped onto its
   own line on a phone, a leading "·" looked stray. */
[data-component="post"] [data-part="byline"] > [data-part="lang-note"]::before {
	content: none;
}

[data-component="post"] [data-part="byline"] > [data-part="lang-note"] {
	padding: 0 var(--spacing-x-small);
	border: 0.05rem solid var(--post-line);
	border-radius: 0.3rem;
	font-size: var(--font-size-small);
}

/* Pictures in the text (Markdown ![alt](file) with an indented caption line
   under it): the picture at its own shape, a tall one capped so it does not
   fill the screen, the caption small under it. The picture opens large in
   the site's lightbox (main.js opens every "figure a"). */
[data-component="post"] [data-part="body"] figure {
	margin: var(--spacing-small) 0 var(--spacing-normal);
	padding: 0;
}

[data-component="post"] [data-part="body"] figure img {
	display: block;
	width: auto;
	max-width: 100%;
	max-height: 34rem;
	border-radius: 0.6rem;
}

[data-component="post"] [data-part="body"] figcaption {
	/* in from the picture's edge by its corner radius, like the links under
	   the boxes elsewhere: clear of the curve, not indented like text */
	padding: 0 0.6rem;
	margin-top: var(--spacing-x-small);
	color: var(--post-muted);
	font-size: var(--font-size-small);
	line-height: 1.45;
}

/* Under a picture or video at the top, the text follows its caption a
   little closer than it follows the byline. */
[data-component="post"] [data-part="cover"] + [data-part="body"] {
	margin-top: var(--spacing-normal);
}

/* A confession's cover (cover: in its header): one banner across the page,
   above the title and the side column, in the Social profiles' 16:5 shape —
   a photo is cropped to a strip from its middle, or from where
   cover_position says (data-position → --cover-position). */
[data-component="post"] [data-part="post-cover"] {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 5;
	margin-bottom: var(--spacing-large); /* the top: main.css [data-under-tools] */
	object-fit: cover;
	object-position: var(--cover-position, center);
	/* Square at the top under the page tools (main.css [data-under-tools]). */
	border-radius: var(--cover-top-radius, 0.6rem) var(--cover-top-radius, 0.6rem)
		0.6rem 0.6rem;
}

[data-component="post"] [data-part="post-cover"][data-position="top"] {
	--cover-position: center top;
}

[data-component="post"] [data-part="post-cover"][data-position="bottom"] {
	--cover-position: center bottom;
}

/* On a phone a 16:5 strip is a sliver: a little taller there. */
@container page (max-width: 30.72rem) {
	[data-component="post"] [data-part="post-cover"] {
		aspect-ratio: 16 / 7;
	}
}

/* ── Reading tools (confessions/post.php, posts.js) ─────────────────────── */

/* "Updated 3 Dec" in the byline, a link to the change log. */
[data-component="post"] [data-part="byline"] [data-part="updated"] {
	color: inherit;
	font-weight: 400;
	text-underline-offset: 0.15em;
}

/* Reading modes: a small card in the side column, three toggles. */
[data-component="post"] [data-part="reading-modes"] > div {
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-xx-small);
}

[data-component="post"] [data-part="reading-modes"] button,
[data-component="post"] [data-part="post-actions"] :is([data-part="action"], [data-part="offline-save"]),
[data-component="post"] [data-part="cite-copy"] {
	padding: 0.15rem 0.6rem;
	border: 0.05rem solid var(--post-line);
	border-radius: 0.25rem;
	background: transparent;
	color: var(--post-muted);
	font: inherit;
	font-size: var(--font-size-small);
	font-weight: 600;
	cursor: pointer;
}

[data-component="post"] [data-part="reading-modes"] button:hover,
[data-component="post"] [data-part="post-actions"] :is([data-part="action"], [data-part="offline-save"]):hover,
[data-component="post"] [data-part="cite-copy"]:hover {
	border-color: currentColor;
	color: var(--primary-text-color);
}

[data-component="post"] [data-part="reading-modes"] button[aria-pressed="true"],
[data-component="post"] [data-part="post-actions"] :is([data-part="action"], [data-part="offline-save"])[aria-pressed="true"] {
	border-color: var(--focus-color);
	color: var(--primary-text-color);
}

[data-component="post"] :is(button, a)[data-copied] {
	border-color: var(--success-color);
	color: var(--primary-text-color);
}

/* Focus: the text alone, centred; the side column and the extras go. */
/* ── Reading modes: on <html> (posts.js), for the whole page ──────────────
   They sit beside the site's own accessibility settings and give way to
   them: high contrast keeps its colours, and the toggles stay reachable in
   every mode (the side column's card, the page tools, the floating bar). */

/* Focus: the text and what it needs. The logo and contacts block, the
   footer, the side column's other cards and the older/newer links go; the
   menu/breadcrumb tabs, skip links and the floating accessibility bar stay,
   so nothing becomes unreachable. Not the same as the site's own "Focus
   mode" setting, which dims what is not being read; the two combine. */
html[data-reading~="focus"] header[role="banner"] > nav[aria-label="Main navigation"],
html[data-reading~="focus"] body > footer,
html[data-reading~="focus"] [data-component="post"] :is([data-part="toc"], [data-part="more"], [data-part="post-nav"], [data-part="tags"]) {
	display: none;
}

/* With the logo row gone the header has no height of its own, so the
   page tools hang 1rem (--spacing-normal) below its foot (main.css) while
   the navbar line kept its own smaller gap: the line moves down to meet them. */
html[data-reading~="focus"] hr[data-type="navbar"] {
	margin-top: var(--spacing-normal);
}

/* Spacious: more room between lines, words and paragraphs, a narrower
   measure. Set on paragraphs and list items too, so it wins over the site's
   own line-spacing setting (base.css [data-accessibility~="line"] p). */
html[data-reading~="spacious"] [data-component="post"] {
	--post-measure: 36rem;
}

html[data-reading~="spacious"] [data-component="post"] [data-part="body"] :is(p, li, blockquote) {
	line-height: 1.95;
	word-spacing: 0.08em;
}

html[data-reading~="spacious"] [data-component="post"] [data-part="body"] p {
	margin-bottom: var(--spacing-large);
}

/* Paper: the colours are in main.css (html[data-reading~="paper"] with the
   site-wide Reading aid, html[data-accessibility~="paper"]). */

/* The toggles: a usable target (WCAG 2.2: 24px and up) and a clear focus
   ring; in high contrast, edges at full strength. */
[data-component="post"] [data-part="reading-modes"] button {
	min-height: 1.6rem;
}

[data-component="post"] :is([data-part="reading-modes"] button, [data-part="action"], [data-part="offline-save"], [data-part="cite-copy"]):focus-visible,
[data-part="quote-button"]:focus-visible {
	outline: 0.15rem solid var(--focus-color);
	outline-offset: 0.1rem;
}

[data-accessibility~="high-contrast"] [data-component="post"] :is([data-part="reading-modes"] button, [data-part="action"], [data-part="offline-save"], [data-part="cite-copy"]),
[data-accessibility~="high-contrast"] [data-part="cite-preview"] {
	border-color: var(--primary-text-color);
	color: var(--primary-text-color);
}

/* "Updated since you last read it" and the staff note on the recording. */
[data-component="post"] :is([data-part="changed-since"], [data-part="staff-note"]) {
	margin: var(--spacing-small) 0 0;
	padding: var(--spacing-x-small) var(--spacing-small);
	border-left: 0.2rem solid var(--focus-color);
	/* Square where the stripe is, the site's small radius on the other side. */
	border-radius: 0 0.25rem 0.25rem 0;
	background: var(--post-card);
	font-size: var(--font-size-small);
}

/* The note's button (Mark … as current), right under it, as the post's chips. */
[data-component="post"] [data-part="staff-note-action"] {
	margin: var(--spacing-xx-small) 0 0;
}

[data-component="post"] [data-part="staff-note-action"] button {
	min-height: 1.6rem;
	padding: 0.15rem 0.6rem;
	border: 0.05rem solid var(--post-line);
	border-radius: 0.25rem;
	background: transparent;
	color: var(--post-muted);
	font: inherit;
	font-size: var(--font-size-small);
	font-weight: 600;
	cursor: pointer;
}

[data-component="post"] [data-part="staff-note-action"] button:hover {
	border-color: currentColor;
	color: var(--primary-text-color);
}

[data-component="post"] [data-part="staff-note-action"] button:focus-visible {
	outline: 0.15rem solid var(--focus-color);
	outline-offset: 0.1rem;
}

[data-component="post"] [data-part="staff-note"] span {
	color: var(--post-muted);
}

/* The post's foot: a light line after the text (and its references), the
   tags, then one row of quiet actions all alike — Markdown, offline, cite,
   changes. Cite and Changes open below the row (full width when open). */
[data-component="post"] [data-part="post-foot"] {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-small);
	margin-top: var(--spacing-xx-large);
	padding-top: var(--spacing-normal);
	border-top: 0.05rem solid var(--post-line);
}

[data-component="post"] [data-part="post-foot"] [data-part="tags"] {
	margin: 0;
}

[data-component="post"] [data-part="post-actions"] {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: var(--spacing-x-small);
	font-size: var(--font-size-small);
}

[data-component="post"] [data-part="post-actions"] [data-part="action"] {
	display: inline-flex;
	align-items: center;
	min-height: 1.6rem;
	box-sizing: border-box;
	text-decoration: none;
	list-style: none;
}

[data-component="post"] [data-part="post-actions"] summary[data-part="action"]::-webkit-details-marker {
	display: none;
}

[data-component="post"] [data-part="post-actions"] a[data-part="action"][download]::before {
	content: "↓";
	margin-right: 0.35em;
}

[data-component="post"] [data-part="post-actions"] summary[data-part="action"]::after {
	content: "▾";
	margin-left: 0.4em;
	font-size: 0.8em;
}

[data-component="post"] [data-part="post-actions"] details[open]:not([data-panel-out]) {
	flex-basis: 100%;
	order: 9;
}

/* With JS (posts.js) the open panel sits here, under the row. */
[data-component="post"] [data-part="action-panels"] [data-part="action-panel"] {
	font-size: var(--font-size-small);
}

[data-component="post"] [data-part="action-panels"] [data-part="action-panel"] > :first-child {
	margin-top: 0;
}

[data-component="post"] [data-part="post-actions"] button[data-part="action"] {
	padding: 0.15rem 0.6rem;
	border: 0.05rem solid var(--post-line);
	border-radius: 0.25rem;
	background: transparent;
	color: var(--post-muted);
	font: inherit;
	font-size: var(--font-size-small);
	font-weight: 600;
	cursor: pointer;
}

[data-component="post"] [data-part="post-actions"] details[open] > summary[data-part="action"] {
	border-color: var(--focus-color);
	color: var(--primary-text-color);
}

[data-component="post"] [data-part="post-actions"] details[open] > summary[data-part="action"]::after {
	content: "▴";
}

[data-component="post"] [data-part="post-actions"] [data-part="changes"] summary span {
	margin-left: 0.35em;
	color: var(--post-muted);
}

[data-component="post"] [data-part="cite-text"] {
	margin: var(--spacing-x-small) 0;
	padding: var(--spacing-x-small) var(--spacing-small);
	border-radius: 0.25rem;
	background: var(--post-card);
	overflow-wrap: anywhere;
	user-select: all;
}

[data-component="post"] [data-part="cite-text"] a {
	font-weight: 400;
}

[data-component="post"] :is([data-part="changes"], #changes-panel) ul {
	margin: var(--spacing-x-small) 0 0;
	padding: 0;
	list-style: none;
}

[data-component="post"] :is([data-part="changes"], #changes-panel) li {
	margin: 0 0 var(--spacing-xx-small);
	text-indent: 0;
}

[data-component="post"] :is([data-part="changes"], #changes-panel) li::before {
	content: none;
}

[data-component="post"] :is([data-part="changes"], #changes-panel) time {
	margin-right: var(--spacing-x-small);
	color: var(--post-muted);
	font-variant-numeric: tabular-nums;
}

/* In-text citations: a quiet dotted underline; the entry they point to is
   marked when jumped to. */
[data-component="post"] [data-part="body"] a[data-cite] {
	font-weight: 400;
	text-decoration-style: dotted;
	text-underline-offset: 0.2em;
}

[data-component="post"] [data-part="body"] li[id^="ref-"]:target:not([data-seen]) {
	background: color-mix(in srgb, var(--focus-color) 14%, transparent);
	border-radius: 0.25rem;
}

/* The preview card (posts.js puts it on the page, places it by --cite-x/y). */
[data-part="cite-preview"] {
	position: absolute;
	top: var(--cite-y, 0);
	left: var(--cite-x, 0);
	z-index: 9990;
	width: var(--cite-w, 26rem);
	box-sizing: border-box;
	padding: var(--spacing-x-small) var(--spacing-small);
	border: 0.05rem solid color-mix(in srgb, var(--primary-text-color) 20%, transparent);
	border-radius: 0.3rem;
	background: var(--bg-color);
	color: var(--primary-text-color);
	font-size: var(--font-size-small);
	line-height: 1.5;
	overflow-wrap: anywhere;
}

[data-part="cite-preview"] em {
	font-size: 1.12em;
	line-height: 1;
}

/* "Copy as quote": a small dark button above the selected words. */
[data-part="quote-button"] {
	position: absolute;
	top: var(--q-y, 0);
	left: var(--q-x, 0);
	z-index: 9990;
	transform: translateX(-50%);
	padding: 0.3rem 0.7rem;
	border: 0;
	border-radius: 0.25rem;
	background: var(--primary-color);
	color: var(--bg-color);
	font: inherit;
	font-size: var(--font-size-small);
	font-weight: 700;
	white-space: nowrap;
	cursor: pointer;
}

[data-part="quote-button"][data-copied] {
	background: var(--success-color);
	color: #111;
}

/* The list page's foot: a light line, a quiet title, the same chips as a
   post's foot (RSS, Discord, Social), and what was saved for offline. */
[data-component="posts"] [data-part="list-foot"] {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-x-small);
	margin-top: var(--spacing-xx-large);
	padding-top: var(--spacing-normal);
	border-top: 0.05rem solid color-mix(in srgb, var(--primary-text-color) 14%, transparent);
	font-size: var(--font-size-small);
}

[data-component="posts"] [data-part="list-foot-title"] {
	margin: 0;
	color: color-mix(in srgb, var(--primary-text-color) 70%, transparent);
	font-weight: 600;
}

[data-component="posts"] [data-part="post-actions"] {
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-x-small);
}

[data-component="posts"] [data-part="post-actions"] [data-part="action"] {
	display: inline-flex;
	align-items: center;
	min-height: 1.6rem;
	box-sizing: border-box;
	padding: 0.15rem 0.6rem;
	border: 0.05rem solid color-mix(in srgb, var(--primary-text-color) 14%, transparent);
	border-radius: 0.25rem;
	color: color-mix(in srgb, var(--primary-text-color) 70%, transparent);
	font-weight: 600;
	text-decoration: none;
}

[data-component="posts"] [data-part="post-actions"] [data-part="action"]:hover {
	border-color: currentColor;
	color: var(--primary-text-color);
}

[data-component="posts"] [data-part="post-actions"] [data-part="action"]:focus-visible {
	outline: 0.15rem solid var(--focus-color);
	outline-offset: 0.1rem;
}

[data-component="posts"] [data-part="post-actions"] a[type="application/rss+xml"]::before {
	content: "◉";
	margin-right: 0.35em;
	color: var(--focus-color);
}

[data-accessibility~="high-contrast"] [data-component="posts"] [data-part="post-actions"] [data-part="action"] {
	border-color: var(--primary-text-color);
	color: var(--primary-text-color);
}

/* The list page: saved-for-offline links under the foot's chips. */
[data-component="posts"] [data-part="offline-list"] {
	margin: var(--spacing-xx-small) 0 0;
	color: var(--post-muted, inherit);
	font-size: var(--font-size-small);
}
