/**
 * Sagacraft component styles.
 *
 * Tokens live in theme.json: presets for the raw palette, fonts and sizes, and
 * `settings.custom` for the semantic colours and layout values used here.
 * Set like a book: rules, margins, small caps, indents. No cards, pills or icons.
 */

/* Light reading mode: swap the semantic colours. ------------------------- */

:root[data-theme="light"],
:root[data-theme="light"] body {
	--wp--custom--color--bg: var(--wp--preset--color--paper-100);
	--wp--custom--color--bg-deep: var(--wp--preset--color--paper-200);
	--wp--custom--color--surface: var(--wp--preset--color--paper-200);
	--wp--custom--color--surface-raised: var(--wp--preset--color--paper-300);
	--wp--custom--color--rule: var(--wp--preset--color--paper-400);
	--wp--custom--color--rule-strong: var(--wp--preset--color--paper-500);
	--wp--custom--color--heading: var(--wp--preset--color--ink-900);
	--wp--custom--color--text: var(--wp--preset--color--ink-800);
	--wp--custom--color--muted: var(--wp--preset--color--ink-600);
	--wp--custom--color--faint: var(--wp--preset--color--ink-500);
	--wp--custom--color--accent: var(--wp--preset--color--copper-ink);
	--wp--custom--color--accent-hover: var(--wp--preset--color--copper-ink-deep);
	--wp--custom--color--accent-press: var(--wp--preset--color--copper-ink-deep);
	--wp--custom--color--accent-tint: rgba(162, 80, 31, 0.1);
	--wp--custom--color--on-accent: var(--wp--preset--color--paper-100);
	--wp--custom--color--focus: var(--wp--preset--color--copper-ink);
	--wp--custom--color--block: var(--wp--preset--color--moss-100);
	--wp--custom--color--block-rule: var(--wp--preset--color--moss-200);
	--wp--custom--color--block-muted: var(--wp--preset--color--ink-600);
	--wp--custom--color--selection: rgba(162, 80, 31, 0.22);
}

:root {
	--sg-margin-col: var(--wp--custom--layout--margin-col, 168px);
	--sg-col-gap: var(--wp--custom--layout--column-gap, 48px);
	--sg-offset: calc(var(--sg-margin-col) + var(--sg-col-gap));
	--sg-prose: var(--wp--custom--layout--prose, 34em);
	--sg-indent: 1.4em;
	/* One line of body text (20px x 1.62): the unit of vertical rhythm in prose. */
	--sg-line: calc(var(--wp--preset--font-size--body, 20px) * var(--wp--custom--line-height--body, 1.62));
}

/* Base ------------------------------------------------------------------ */

html {
	background: var(--wp--custom--color--bg);
}

body {
	font-variant-numeric: oldstyle-nums proportional-nums;
	font-kerning: normal;
	font-feature-settings: "liga", "kern";
	text-rendering: optimizeLegibility;
	hanging-punctuation: first last;
	-webkit-font-smoothing: antialiased;
}

::selection {
	background: var(--wp--custom--color--selection);
}

a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	text-decoration-color: var(--wp--custom--color--rule-strong);
	transition: color 150ms ease, text-decoration-color 150ms ease;
}

a:hover {
	text-decoration-color: var(--wp--custom--color--accent);
}

:focus-visible {
	outline: 1px dotted var(--wp--custom--color--focus);
	outline-offset: 2px;
}

strong,
b {
	color: var(--wp--custom--color--heading);
}

/* Titles and headings break into lines of even length, never a word on its own. */
h1,
h2,
h3,
h4,
.wp-block-post-title {
	text-wrap: balance;
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
	}
}

/* Type helpers ------------------------------------------------------------ */

.sg-caps,
.is-style-sg-caps {
	font-size: 18px;
	font-variant-caps: all-small-caps;
	letter-spacing: 0.06em;
	font-variant-numeric: oldstyle-nums;
}

.sg-label {
	color: var(--wp--custom--color--accent);
}

.sg-meta,
.is-style-sg-meta {
	color: var(--wp--custom--color--muted);
	font-size: var(--wp--preset--font-size--aside);
	font-style: italic;
}

.sg-meta a,
.is-style-sg-meta a {
	color: var(--wp--custom--color--muted);
}

.sg-lead-in {
	font-variant-caps: all-small-caps;
	letter-spacing: 0.06em;
	color: var(--wp--custom--color--heading);
}

/* Header and footer --------------------------------------------------------- */

.wp-block-group.sg-header {
	align-items: baseline;
	gap: var(--wp--preset--spacing--6);
	padding: var(--wp--preset--spacing--8) 0 var(--wp--preset--spacing--5);
	border-bottom: 1px solid var(--wp--custom--color--rule);
}

.sg-name a {
	color: var(--wp--custom--color--heading);
	text-decoration: none;
}

.sg-nav .wp-block-navigation__container {
	gap: var(--wp--preset--spacing--3) var(--wp--preset--spacing--6);
}

.sg-nav .wp-block-navigation-item__content {
	color: var(--wp--custom--color--muted);
	text-decoration: none;
}

.sg-nav .wp-block-navigation-item__content:hover {
	color: var(--wp--custom--color--accent);
}

/* The one call to action keeps the accent colour. */
.sg-nav .sg-nav-subscribe > .wp-block-navigation-item__content {
	color: var(--wp--custom--color--accent);
}

.sg-nav .current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--custom--color--heading);
	text-decoration: underline;
	text-decoration-color: var(--wp--custom--color--rule-strong);
}

.wp-block-group.sg-footer {
	gap: var(--wp--preset--spacing--6);
	margin-top: var(--wp--custom--layout--section-pad);
	padding: var(--wp--preset--spacing--6) 0 var(--wp--preset--spacing--10);
	border-top: 1px solid var(--wp--custom--color--rule);
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	line-height: var(--wp--custom--line-height--small);
	color: var(--wp--custom--color--muted);
}

.sg-footer p {
	margin: 0;
}

.sg-footer a {
	color: var(--wp--custom--color--muted);
}

/* Page frame: a margin column for dates and notes, then the text ------------- */

.sg-offset {
	box-sizing: border-box;
}

@media (min-width: 721px) {
	.sg-offset {
		padding-left: var(--sg-offset);
	}
}

.sg-frame {
	display: grid;
	grid-template-columns: var(--sg-margin-col) minmax(0, var(--sg-prose));
	column-gap: var(--sg-col-gap);
}

.sg-frame > *,
.sg-frame > * + * {
	margin-block: 0;
}

.sg-frame > .sg-margin,
.sg-frame > .sg-label {
	padding-top: 0.3em;
	font-size: var(--wp--preset--font-size--aside);
	line-height: var(--wp--custom--line-height--aside);
	color: var(--wp--custom--color--muted);
}

.sg-frame > .sg-label {
	font-size: 18px;
	color: var(--wp--custom--color--accent);
}

@media (max-width: 720px) {
	.sg-frame {
		grid-template-columns: minmax(0, 1fr);
	}

	.sg-frame > .sg-margin,
	.sg-frame > .sg-label {
		padding: 0 0 var(--wp--preset--spacing--2);
	}
}

.sg-page-head {
	padding-top: var(--wp--preset--spacing--11);
}

.sg-page-head > * + * {
	margin-top: var(--wp--preset--spacing--3);
}

/* Home ------------------------------------------------------------------------ */

.sg-intro {
	padding-top: var(--wp--preset--spacing--11);
}

.sg-intro p {
	max-width: 22em;
	line-height: var(--wp--custom--line-height--intro);
	color: var(--wp--custom--color--heading);
}

.sg-intro p.sg-intro__start {
	margin-top: var(--wp--preset--spacing--5);
	line-height: var(--wp--custom--line-height--body);
	color: var(--wp--custom--color--muted);
}

.sg-intro__start a {
	color: var(--wp--custom--color--accent);
}

.wp-block-query.sg-latest {
	margin-top: var(--wp--preset--spacing--11);
}

.sg-latest__block {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
	gap: var(--wp--preset--spacing--9);
}

.sg-latest__block > *,
.sg-latest__block > * + * {
	margin: 0;
}

.sg-latest__head > * + * {
	margin-top: var(--wp--preset--spacing--3);
}

.sg-latest .sg-label {
	gap: 0.3em;
	margin-bottom: var(--wp--preset--spacing--4);
}

.sg-latest .sg-label > * {
	margin: 0;
}

.sg-latest .wp-block-post-title {
	line-height: 1.15;
}

.sg-latest .wp-block-post-title a {
	text-decoration: none;
}

.sg-latest__dek {
	font-size: var(--wp--preset--font-size--body);
}

.sg-latest__opening {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--4);
	padding-left: var(--wp--preset--spacing--8);
	border-left: 1px solid var(--wp--custom--color--block-rule);
}

.sg-latest__opening > * {
	margin: 0;
}

@media (max-width: 760px) {
	.sg-latest__opening {
		padding-left: 0;
		border-left: 0;
	}
}

.sg-recent {
	margin-top: var(--wp--preset--spacing--10);
}

.sg-recent > .sg-label {
	margin-bottom: var(--wp--preset--spacing--2);
}

.sg-recent > .wp-block-query {
	margin-top: 0;
}

h2.sg-label {
	margin-top: 0;
	font-weight: 400;
	line-height: inherit;
}

.sg-recent .sg-recent__more {
	margin-top: var(--wp--preset--spacing--5);
	font-size: var(--wp--preset--font-size--ui);
}

/* Dividers are drawn as shadows on each cell's left and top edges. The ruled
   box clips the ones that fall on its outer edge, so every row is divided
   cleanly whatever the number of categories or columns. */
.sg-sections {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
	margin-top: var(--wp--preset--spacing--10);
	overflow: hidden;
}

.sg-sections > *,
.sg-sections > * + * {
	margin: 0;
}

.sg-section {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--3);
	padding: var(--wp--preset--spacing--6);
	box-shadow:
		-1px 0 0 var(--wp--custom--color--rule),
		0 -1px 0 var(--wp--custom--color--rule);
}

.sg-section > * {
	margin: 0;
}

.sg-section__name a {
	color: var(--wp--custom--color--heading);
	text-decoration: none;
}

.sg-section__name a:hover {
	color: var(--wp--custom--color--accent);
}

.sg-subscribe {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
	gap: var(--wp--preset--spacing--8);
	align-items: end;
	margin-top: var(--wp--custom--layout--section-pad);
}

.sg-subscribe > *,
.sg-subscribe > * + * {
	margin: 0;
}

.sg-subscribe__copy {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--3);
}

.sg-subscribe__copy > * {
	margin: 0;
}

.sg-subscribe__form {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--3);
	align-items: stretch;
}

.sg-subscribe__email {
	flex: 1 1 14em;
	min-width: 0;
	padding: 10px 12px;
	font: inherit;
	font-size: var(--wp--preset--font-size--ui);
	color: var(--wp--custom--color--on-accent);
	background: transparent;
	border: 1px solid var(--wp--custom--color--on-accent);
	border-radius: 0;
}

.sg-subscribe__email::placeholder {
	color: var(--wp--custom--color--on-accent);
	opacity: 0.6;
}

.sg-subscribe__email:focus {
	outline: 2px solid var(--wp--custom--color--on-accent);
	outline-offset: 2px;
}

.sg-subscribe .sg-subscribe__rss {
	flex-basis: 100%;
	margin: 0;
	font-size: var(--wp--preset--font-size--aside);
}

/* The email field's label, for screen readers only. */
.sg-subscribe .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Honeypot: off screen, so people never fill it in but simple bots do. */
.sg-subscribe__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Subscription pages (check your inbox, confirm, unsubscribe). */
.sg-subscription .sg-page-body > * {
	max-width: var(--sg-prose);
}

.sg-subscription__form {
	margin-top: var(--wp--preset--spacing--6);
}

/* Entry lists (front page, Writing index, search) ----------------------------- */

.sg-entries {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sg-entries > li {
	display: grid;
	grid-template-columns: var(--sg-margin-col) minmax(0, var(--sg-prose));
	column-gap: var(--sg-col-gap);
	margin: 0;
	padding: var(--wp--preset--spacing--4) 0;
}

.sg-entries > li > * {
	margin: 0;
}

.sg-entry__date,
.sg-entry__aside {
	padding-top: 0.35em;
	font-size: var(--wp--preset--font-size--aside);
	line-height: var(--wp--custom--line-height--aside);
	color: var(--wp--custom--color--muted);
}

.sg-entries .sg-entry__aside > * {
	display: block;
	margin: 0;
	padding: 0;
}

/* The kind of writing, under the date: "Essay" or "Note". */
.sg-entry__aside .sg-kind {
	font-variant-caps: all-small-caps;
	letter-spacing: 0.06em;
}

.sg-entries .sg-entry__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--entry);
	font-weight: 400;
	line-height: var(--wp--custom--line-height--entry);
	color: var(--wp--custom--color--heading);
}

.sg-entry__title a {
	text-decoration: none;
}

.sg-entry__title a:hover {
	text-decoration: underline;
}

.sg-entries .sg-entry__dek,
.sg-entries .sg-entry__dek p {
	margin: 2px 0 0;
	font-style: italic;
	color: var(--wp--custom--color--muted);
}

.sg-entries .sg-entry--note .sg-entry__title,
.sg-entries .type-note .sg-entry__title,
.sg-entries .format-aside .sg-entry__title {
	font-size: var(--wp--preset--font-size--body);
	font-style: italic;
}

.sg-entries .type-note .sg-entry__dek,
.sg-entries .format-aside .sg-entry__dek {
	display: none;
}

@media (max-width: 720px) {
	.sg-entries > li {
		grid-template-columns: minmax(0, 1fr);
	}

	/* One line above the title: "25 June 2026 · Note". */
	.sg-entries .sg-entry__aside > * {
		display: inline;
	}

	.sg-entry__aside .sg-kind::before {
		content: "\00b7\00a0";
		content: "\00b7\00a0" / "";
	}
}

.sg-index__filters {
	margin: 0;
}

.sg-index__filters [aria-current] {
	color: var(--wp--custom--color--heading);
}

.sg-index__year {
	margin-top: var(--wp--preset--spacing--9);
}

h2.sg-index__label {
	margin: 0 0 var(--wp--preset--spacing--2);
	font-size: 18px;
	font-weight: 400;
	line-height: var(--wp--custom--line-height--aside);
	color: var(--wp--custom--color--accent);
}

.sg-index__empty {
	margin-top: var(--wp--preset--spacing--9);
}

.sg-pagination {
	margin-top: var(--wp--preset--spacing--6);
	font-size: var(--wp--preset--font-size--ui);
}

.sg-search .wp-block-search__inside-wrapper {
	gap: var(--wp--preset--spacing--5);
	padding: 0;
	border: 0;
}

.sg-search .wp-block-search__input {
	padding: 4px 0 6px;
	font-family: inherit;
	font-size: var(--wp--preset--font-size--body);
	color: var(--wp--custom--color--heading);
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--wp--custom--color--rule-strong);
	border-radius: 0;
}

.sg-search .wp-block-search__input::placeholder {
	font-style: italic;
	color: var(--wp--custom--color--faint);
}

.sg-search .wp-block-search__input:focus {
	border-bottom-color: var(--wp--custom--color--accent);
	outline: none;
}

/* Essays and notes ------------------------------------------------------------- */

.sg-article__meta.is-layout-flex {
	gap: 0;
	align-items: baseline;
}

.sg-article__meta > * {
	margin: 0;
}

/* Keep the space after "Essay," at the end of its flex item. */
.sg-kind__sep {
	white-space: pre;
}

.sg-theme-toggle {
	padding: 0;
	font: inherit;
	font-style: italic;
	color: inherit;
	background: none;
	border: 0;
	cursor: pointer;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-decoration-color: var(--wp--custom--color--rule-strong);
	text-underline-offset: 0.18em;
}

.sg-theme-toggle:hover {
	color: var(--wp--custom--color--accent);
	text-decoration-color: var(--wp--custom--color--accent);
}

.sg-theme-toggle:focus-visible {
	outline: 2px solid var(--wp--custom--color--focus);
	outline-offset: 3px;
}

/* In the header, after the navigation: quiet site chrome in the metadata style. */
.wp-block-group.sg-header__end {
	gap: var(--wp--preset--spacing--3) var(--wp--preset--spacing--8);
	align-items: baseline;
}

.sg-header .sg-theme-toggle {
	font-size: var(--wp--preset--font-size--aside);
	color: var(--wp--custom--color--muted);
}

.sg-header .sg-theme-toggle:hover {
	color: var(--wp--custom--color--accent);
}

.wp-block-post-content.sg-prose {
	margin-top: calc(var(--sg-line) * 1.5);
}

.sg-post-footer {
	margin-top: var(--wp--preset--spacing--10);
}

.wp-block-group.sg-post-footer__inner {
	max-width: var(--sg-prose);
	gap: var(--wp--preset--spacing--6);
	padding-top: var(--wp--preset--spacing--5);
	border-top: 1px solid var(--wp--custom--color--rule);
}

.sg-post-footer__inner > * {
	margin: 0;
	font-size: var(--wp--preset--font-size--aside);
}

.sg-post-footer .post-navigation-link__label {
	font-style: italic;
	color: var(--wp--custom--color--muted);
}

/* Prose, book style: indented paragraphs, no gaps. ------------------------------- */

/* Every vertical gap in the prose is a multiple of half a line (--sg-line), so
   text after a heading, list, quote or figure lands back on the rhythm of the
   body. Text is justified where the measure can carry it, with hyphenation held
   to the limits a book compositor would use; editor alignment still wins. */

.sg-prose {
	position: relative;
	overflow-wrap: break-word;
	hyphens: auto;
	-webkit-hyphens: auto;
	hyphenate-limit-chars: 6 3 3;
	-webkit-hyphenate-limit-before: 3;
	-webkit-hyphenate-limit-after: 3;
	hyphenate-limit-lines: 2;
	-webkit-hyphenate-limit-lines: 2;
	hyphenate-limit-last: always;
}

@media (min-width: 600px) {
	.sg-prose {
		text-align: justify;
		text-justify: inter-word;
	}
}

.sg-prose :where(p, li, dd, blockquote, figcaption) {
	text-wrap: pretty;
}

:where(.sg-prose) :where(h1, h2, h3, h4, h5, h6, figcaption, pre, table, .wp-block-buttons, .sg-exhibit__label, .sg-exhibit__title) {
	text-align: start;
	hyphens: manual;
	-webkit-hyphens: manual;
}

/* Superscripts and subscripts sit inside the line without pushing it apart. */
.sg-prose :where(sup, sub) {
	line-height: 0;
}

.sg-prose > * {
	max-width: var(--sg-prose);
	margin-block: 0;
}

.sg-prose > :first-child {
	margin-top: 0;
}

.sg-prose > p + p {
	text-indent: var(--sg-indent);
}

.sg-prose > h2 {
	margin: calc(var(--sg-line) * 1.5) 0 calc(var(--sg-line) * 0.5);
	line-height: var(--sg-line);
}

.sg-prose > h3 {
	margin: var(--sg-line) 0 0;
	font-size: var(--wp--preset--font-size--body);
	line-height: var(--sg-line);
}

.sg-prose > h2 + h3 {
	margin-top: calc(var(--sg-line) * 0.5);
}

.sg-prose > h4 {
	margin: var(--sg-line) 0 0;
	font-size: var(--wp--preset--font-size--body);
	font-variant-caps: all-small-caps;
	letter-spacing: 0.06em;
	line-height: var(--sg-line);
}

/* Lists: markers hang in the indent, in a quieter colour; items run without gaps. */
.sg-prose > ul,
.sg-prose > ol {
	margin: calc(var(--sg-line) * 0.5) 0;
	padding-left: var(--sg-indent);
}

.sg-prose li > :is(ul, ol) {
	margin: 0;
	padding-left: var(--sg-indent);
}

.sg-prose li::marker {
	color: var(--wp--custom--color--muted);
}

.sg-prose ol > li::marker {
	font-variant-numeric: lining-nums tabular-nums;
}

/* Quotes: set smaller and indented on both sides, paragraphs as in the body. */
.sg-prose > .wp-block-quote,
.sg-prose > blockquote {
	margin: calc(var(--sg-line) * 0.5) var(--sg-indent);
	padding: 0;
	border: 0;
	font-size: var(--wp--preset--font-size--aside);
	line-height: var(--wp--custom--line-height--aside);
	color: var(--wp--custom--color--heading);
}

.sg-prose blockquote > * {
	margin-block: 0;
}

.sg-prose blockquote > p + p {
	text-indent: var(--sg-indent);
}

.sg-prose blockquote cite {
	display: block;
	margin-top: calc(var(--sg-line) * 0.25);
	font-style: italic;
	text-align: end;
	color: var(--wp--custom--color--muted);
}

.sg-prose > .wp-block-image,
.sg-prose > figure {
	margin: var(--sg-line) 0;
}

.sg-prose figcaption {
	margin-top: calc(var(--sg-line) * 0.25);
	font-size: var(--wp--preset--font-size--aside);
	font-style: italic;
	line-height: var(--wp--custom--line-height--aside);
	color: var(--wp--custom--color--muted);
}

.sg-prose > .wp-block-group {
	margin: var(--sg-line) 0;
}

.sg-prose > .wp-block-group:first-child {
	margin-top: 0;
}

.sg-prose > .sg-in-brief {
	margin-bottom: calc(var(--sg-line) * 1.5);
}

/* Tables, booktabs style: heavier rules above and below, a light one under the
   head, no vertical lines, figures that line up in columns. */
.sg-prose .wp-block-table table {
	width: 100%;
	border-collapse: collapse;
	border-top: 1.5px solid var(--wp--custom--color--rule-strong);
	border-bottom: 1.5px solid var(--wp--custom--color--rule-strong);
	font-size: var(--wp--preset--font-size--aside);
	line-height: var(--wp--custom--line-height--aside);
	font-variant-numeric: lining-nums tabular-nums;
}

.sg-prose .wp-block-table :is(th, td) {
	padding: 0.35em 0.75em;
	border: 0;
	vertical-align: baseline;
}

.sg-prose .wp-block-table :is(th, td):first-child {
	padding-left: 0;
}

.sg-prose .wp-block-table :is(th, td):last-child {
	padding-right: 0;
}

/* Without specificity, so column alignment set in the editor still applies. */
:where(.sg-prose .wp-block-table) :where(th) {
	text-align: start;
}

.sg-prose .wp-block-table th {
	font-weight: 500;
	color: var(--wp--custom--color--heading);
}

.sg-prose .wp-block-table thead {
	border-bottom: 1px solid var(--wp--custom--color--rule-strong);
}

.sg-prose .wp-block-table tfoot {
	border-top: 1px solid var(--wp--custom--color--rule-strong);
}

/* Code: a monospaced face, a little smaller so it matches the serif's x-height. */
.sg-prose :is(code, kbd, samp, pre) {
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
	font-size: 0.85em;
	font-variant-ligatures: none;
	hyphens: manual;
	-webkit-hyphens: manual;
}

.sg-prose > pre,
.sg-prose > .wp-block-code {
	margin: calc(var(--sg-line) * 0.5) 0;
	padding: 0 0 0 var(--sg-indent);
	overflow-x: auto;
	line-height: var(--wp--custom--line-height--aside);
	background: none;
	border: 0;
}

.sg-prose pre code {
	font-size: inherit;
}

/* Section breaks and rules */

.wp-block-separator {
	border: 0;
	border-top: 1px solid var(--wp--custom--color--rule);
	opacity: 1;
}

.sg-prose > .wp-block-separator {
	margin: var(--sg-line) 0 calc(var(--sg-line) - 1px);
}

.sg-prose > .wp-block-separator.is-style-sg-asterisks {
	margin: calc(var(--sg-line) * 0.5) 0;
}

.wp-block-separator.is-style-sg-asterisks {
	height: auto;
	border: 0;
	background: none !important;
	color: var(--wp--custom--color--muted);
	text-align: center;
	letter-spacing: 0.6em;
	text-indent: 0.6em;
	line-height: var(--sg-line);
}

.wp-block-separator.is-style-sg-asterisks::before {
	content: "* * *";
}

/* Footnotes, and sidenotes in the margin on wide screens */

.sg-prose sup.fn {
	margin-left: 1px;
	font-size: 0.7em;
	line-height: 0;
	vertical-align: 0.45em;
	font-variant-numeric: lining-nums;
}

.sg-prose sup.fn a {
	color: var(--wp--custom--color--accent);
	text-decoration: none;
}

.sg-prose > .wp-block-footnotes {
	margin-top: calc(var(--sg-line) * 1.5);
	padding-left: var(--sg-indent);
	font-size: var(--wp--preset--font-size--aside);
	line-height: var(--wp--custom--line-height--aside);
	color: var(--wp--custom--color--muted);
}

/* Series: "Part 2 of 3 in …" under the article metadata, and the parts under the essay. */
.sg-page-head > .sg-series {
	margin-top: var(--wp--preset--spacing--1);
}

.sg-series-nav {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--2) var(--wp--preset--spacing--6);
	margin-bottom: var(--wp--preset--spacing--5);
}

.sg-series-nav p {
	margin: 0;
}

.sg-series-nav__label {
	font-style: italic;
	color: var(--wp--custom--color--muted);
}

.sg-series-nav__all {
	flex-basis: 100%;
	font-size: var(--wp--preset--font-size--aside);
}

/* Exhibits: charts and diagrams in the house style (design/exhibits.md). Inline SVG
   coloured by class, so it follows the light and dark pages. */
.sg-prose > .sg-exhibit {
	margin: calc(var(--sg-line) * 1.5) 0;
	text-indent: 0;
}

.sg-exhibit > * {
	margin: 0;
	text-indent: 0;
}

.sg-exhibit__label {
	font-size: 18px;
	font-variant-caps: all-small-caps;
	letter-spacing: 0.06em;
	color: var(--wp--custom--color--accent);
}

.sg-exhibit .sg-exhibit__title {
	margin-bottom: var(--wp--preset--spacing--4);
	color: var(--wp--custom--color--heading);
}

.sg-exhibit__canvas {
	overflow-x: auto;
}

.sg-exhibit__canvas svg {
	display: block;
	width: 100%;
	min-width: 480px;
	height: auto;
	overflow: visible;
	font-family: var(--wp--preset--font-family--sans);
}

.sg-exhibit .sg-exhibit__caption {
	margin-top: var(--wp--preset--spacing--3);
	font-size: var(--wp--preset--font-size--aside);
	font-style: italic;
	line-height: var(--wp--custom--line-height--aside);
	color: var(--wp--custom--color--muted);
}

.sg-ex-grid,
.sg-ex-axis,
.sg-ex-line,
.sg-ex-accent {
	fill: none;
	vector-effect: non-scaling-stroke;
}

.sg-ex-grid {
	stroke: var(--wp--custom--color--rule);
	stroke-width: 1;
}

.sg-ex-axis {
	stroke: var(--wp--custom--color--muted);
	stroke-width: 1;
}

.sg-ex-line {
	stroke: var(--wp--custom--color--text);
	stroke-width: 1.5;
}

.sg-ex-accent {
	stroke: var(--wp--custom--color--accent);
	stroke-width: 2.5;
}

.sg-ex-dash {
	stroke-dasharray: 4 4;
}

.sg-ex-fill {
	fill: var(--wp--custom--color--rule-strong);
}

.sg-ex-fill-accent {
	fill: var(--wp--custom--color--accent);
}

.sg-ex-fill-block {
	fill: var(--wp--custom--color--block);
}

.sg-ex-label,
.sg-ex-label-strong {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 14px;
	fill: var(--wp--custom--color--muted);
}

.sg-ex-label-strong {
	font-weight: 500;
	fill: var(--wp--custom--color--heading);
}

/* Acknowledgements: a quiet line at the end of an essay, set off by a short rule. */
.sg-prose > .sg-acknowledgements {
	margin-top: calc(var(--sg-line) * 1.5);
	padding-left: var(--sg-indent);
	font-size: var(--wp--preset--font-size--aside);
	font-style: italic;
	line-height: var(--wp--custom--line-height--aside);
	text-indent: 0;
	color: var(--wp--custom--color--muted);
}

.sg-prose > .sg-acknowledgements::before {
	content: "";
	display: block;
	width: 3em;
	margin-bottom: var(--wp--preset--spacing--4);
	border-top: 1px solid var(--wp--custom--color--rule-strong);
}

.wp-block-footnotes li::marker {
	color: var(--wp--custom--color--accent);
}

.sg-sidenote {
	display: none;
}

.sg-prose.has-sidenotes > .sg-sidenote {
	display: block;
	position: absolute;
	left: 0;
	width: var(--sg-margin-col);
	font-size: var(--wp--preset--font-size--aside);
	line-height: var(--wp--custom--line-height--aside);
	color: var(--wp--custom--color--muted);
	text-align: start;
	hyphens: manual;
	-webkit-hyphens: manual;
}

.sg-sidenote__n {
	margin-right: 4px;
	color: var(--wp--custom--color--accent);
}

/* Footnotes stay in the page for screen readers, sidenotes are shown instead. */
.sg-prose.has-sidenotes > .wp-block-footnotes {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Pages (About) */

.sg-page-body > * + * {
	margin-top: var(--wp--preset--spacing--6);
}

.sg-portrait img {
	width: 100%;
	object-fit: cover;
}

@media (max-width: 720px) {
	.sg-portrait {
		max-width: var(--sg-margin-col);
	}
}

/* 404 */

.sg-not-found {
	min-height: 50vh;
}

.sg-not-found__title {
	font-weight: 400;
	line-height: var(--wp--custom--line-height--intro);
}

.sg-not-found__title + p {
	margin-top: var(--wp--preset--spacing--4);
}

/* Blocks: square, flat grounds that give the page structure --------------------- */

.is-style-sg-moss {
	padding: var(--wp--preset--spacing--9);
	background: var(--wp--custom--color--block);
	color: var(--wp--custom--color--text);
}

.is-style-sg-moss .sg-meta,
.is-style-sg-moss .is-style-sg-meta {
	color: var(--wp--custom--color--block-muted);
}

.sg-in-brief {
	padding: var(--wp--preset--spacing--6) var(--wp--preset--spacing--7);
}

.sg-in-brief > * {
	margin: 0;
	font-size: var(--wp--preset--font-size--aside);
	line-height: 1.55;
	text-indent: 0;
}

.sg-in-brief > .sg-label {
	margin-bottom: var(--wp--preset--spacing--2);
	font-size: 18px;
}

.is-style-sg-ruled {
	border: 1px solid var(--wp--custom--color--rule);
}

.is-style-sg-copper {
	padding: var(--wp--preset--spacing--9);
	background: var(--wp--custom--color--accent);
	color: var(--wp--custom--color--on-accent);
}

.is-style-sg-copper :is(h1, h2, h3, p, a, .sg-caps, .is-style-sg-caps) {
	color: var(--wp--custom--color--on-accent);
}

.is-style-sg-copper .wp-element-button {
	color: var(--wp--custom--color--on-accent);
	border-color: var(--wp--custom--color--on-accent);
}

.is-style-sg-copper .wp-element-button:hover,
.is-style-sg-copper .wp-element-button:focus {
	color: var(--wp--custom--color--accent);
	background: var(--wp--custom--color--on-accent);
}

@media (max-width: 720px) {
	.is-style-sg-moss,
	.is-style-sg-copper {
		padding: var(--wp--preset--spacing--6);
	}
}

/* Text-link buttons */

.wp-block-button.is-style-sg-text .wp-block-button__link {
	padding: 0;
	border: 0;
	background: none;
	text-decoration: underline;
	text-decoration-color: var(--wp--custom--color--rule-strong);
	text-underline-offset: 0.18em;
}

.wp-block-read-more {
	align-self: flex-start;
	font-size: var(--wp--preset--font-size--ui);
	text-decoration: underline;
	text-decoration-color: var(--wp--custom--color--rule-strong);
	text-underline-offset: 0.18em;
}
