/* ==========================================================================
   Personal site: a manuscript look.
   Book of Hours palette (parchment, vermilion, ultramarine, gold) with
   Insular touches (rounded pen lettering, plaited and dotted ornament).

   Type:    IM Fell English (text), Macondo (headings): both SIL OFL, self-hosted.
   Ornament (all pure CSS, no images to load):
     vine      masthead and footer
     flourish  opens each section
     dotting   between entries
   ========================================================================== */

@font-face {
	font-family: "IM Fell English";
	src: url("../fonts/im-fell-english-latin-400-normal.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "IM Fell English";
	src: url("../fonts/im-fell-english-latin-400-italic.woff2") format("woff2");
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}
@font-face {
	font-family: "Macondo";
	src: url("../fonts/macondo-latin-400-normal.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

:root {
	--paper: #efe2c2;
	--paper-hi: #f8efd9;
	--paper-lo: #e2d0a6;
	--table: #d8c79b;
	--ink: #2a2017;
	--rubric: #a52a1b;   /* vermilion */
	--blue: #1d3a8c;     /* ultramarine */
	--gold: #b88a2b;
	--muted: #6b5a43;

	--text: "IM Fell English", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
	--display: "Macondo", "IM Fell English", Georgia, serif;
	--mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

	--size: clamp(1.125rem, 1.05rem + 0.3vw, 1.3rem);
	--measure: 650px;

	/* Ornament (SVG drawn in the palette above) */
	--vine: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='24' viewBox='0 0 48 24'><path d='M0 12 C12 0 12 24 24 12 S36 0 48 12' fill='none' stroke='%231d3a8c' stroke-width='2'/><circle cx='12' cy='5' r='3.2' fill='%23b88a2b'/><circle cx='36' cy='19' r='3.2' fill='%23b88a2b'/><circle cx='24' cy='12' r='1.6' fill='%23a52a1b'/><circle cx='0' cy='12' r='1.6' fill='%23a52a1b'/><circle cx='48' cy='12' r='1.6' fill='%23a52a1b'/></svg>");
	--flourish: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='28' viewBox='0 0 220 28'><path d='M10 14 C45 0 75 28 110 14 C145 0 175 28 210 14' fill='none' stroke='%23b88a2b' stroke-width='2.4' stroke-linecap='round'/><circle cx='10' cy='14' r='3.2' fill='%23a52a1b'/><circle cx='210' cy='14' r='3.2' fill='%23a52a1b'/><path d='M110 8 L115 14 L110 20 L105 14 Z' fill='%231d3a8c'/></svg>");
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--table);
	color: var(--ink);
	font-family: var(--text);
	font-size: var(--size);
	line-height: 1.6;
	font-kerning: normal;
	font-feature-settings: "kern", "liga", "calt";
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

@media (max-width: 600px) {
	body {
		hyphens: auto;
		-webkit-hyphens: auto;
	}
}

::selection {
	background: #e6c9a0;
}

img {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--rubric);
	text-decoration-line: underline;
	text-decoration-thickness: 0.06em;
	text-underline-offset: 0.18em;
	text-decoration-skip-ink: auto;
}
a:hover {
	text-decoration-thickness: 0.12em;
}
:focus-visible {
	outline: 2px solid var(--blue);
	outline-offset: 3px;
}

.skip-link {
	position: absolute;
	left: 1rem;
	top: -4rem;
	background: var(--ink);
	color: var(--paper);
	padding: 0.5rem 0.9rem;
	z-index: 10;
}
.skip-link:focus {
	top: 1rem;
}

/* ---- The page: a parchment sheet with a gilt double frame ------------- */

.sheet {
	position: relative;
	max-width: 830px;
	margin: 1.5rem auto 3rem;
	padding: 2.2rem 3.4rem 2.6rem;
	background: radial-gradient(ellipse at 50% 0%, var(--paper-hi) 0%, var(--paper) 55%, var(--paper-lo) 100%);
	box-shadow:
		inset 0 0 0 8px var(--paper),
		inset 0 0 0 9px var(--gold),
		inset 0 0 0 12px var(--paper),
		inset 0 0 0 13px rgba(184, 138, 43, 0.55),
		0 12px 34px rgba(60, 40, 10, 0.25);
}
.sheet.wide {
	max-width: 1180px;
}
.wrap {
	max-width: var(--measure);
	margin-inline: auto;
}
.sheet.wide .wrap {
	max-width: none;
}

@media (max-width: 700px) {
	.sheet {
		margin: 0;
		padding: 1.5rem 1.5rem 2.2rem;
		box-shadow:
			inset 0 0 0 5px var(--paper),
			inset 0 0 0 6px var(--gold),
			inset 0 0 0 8px var(--paper),
			inset 0 0 0 9px rgba(184, 138, 43, 0.55);
	}
}

/* ---- Navigation --------------------------------------------------------- */

.nav {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	padding-top: 0.6rem;
	font-size: 0.95em;
	letter-spacing: 0.06em;
}
.nav-mark {
	color: var(--rubric);
	font-family: var(--display);
	font-size: 1.2em;
	letter-spacing: 0.1em;
	text-decoration: none;
}
.nav-link {
	color: var(--muted);
	text-decoration: none;
	padding-block: 0.25rem;
	border-bottom: 1px solid transparent;
}
.nav-link:hover {
	color: var(--ink);
}
.nav-link[aria-current="page"] {
	color: var(--ink);
	border-bottom-color: var(--rubric);
}

/* ---- Ornament ------------------------------------------------------------ */

/* Vine: masthead and footer */
.vine {
	height: 24px;
	margin: 1.8rem 0;
	background: var(--vine) repeat-x center / 48px 24px;
}

/* Flourish: opens each section */
.section-title {
	margin: 2.6rem 0 1.1rem;
	padding-top: 3rem;
	background: var(--flourish) no-repeat top center / 220px 28px;
	text-align: center;
	font-family: var(--display);
	font-size: 1.35em;
	font-weight: 400;
	letter-spacing: 0.03em;
	line-height: 1.2;
	color: var(--blue);
	hyphens: none;
}

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

.masthead {
	text-align: center;
	margin: 3rem 0 0;
}
.masthead-name {
	margin: 0;
	font-family: var(--display);
	font-weight: 400;
	font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3rem);
	line-height: 1.1;
	letter-spacing: 0.04em;
	color: var(--rubric);
	text-shadow: 2px 2px 0 rgba(184, 138, 43, 0.55);
	hyphens: none;
	text-wrap: balance;
}
.masthead-line {
	margin: 0.45em 0 0;
	font-family: var(--display);
	letter-spacing: 0.03em;
	line-height: 1.15;
	hyphens: none;
}
.masthead-line-1 { font-size: 1.4em; color: var(--blue); }
.masthead-line-2 { font-size: 1.2em; color: var(--ink); }
.masthead-line-3 { font-size: 1em; color: var(--muted); }

.ribbon {
	display: inline-block;
	margin: 1.7rem 0 0;
	padding: 0.45em 1.5em;
	border-block: 4px double var(--gold);
	font-family: var(--display);
	font-size: 1.05em;
	letter-spacing: 0.04em;
	color: var(--blue);
}

/* ---- Page + post headings ---------------------------------------------- */

.page-title {
	margin: 2.8rem 0 1.4rem;
	text-align: center;
	font-family: var(--display);
	font-weight: 400;
	font-size: clamp(1.9rem, 1.4rem + 2vw, 2.4rem);
	line-height: 1.15;
	letter-spacing: 0.03em;
	color: var(--rubric);
	text-shadow: 2px 2px 0 rgba(184, 138, 43, 0.5);
	text-wrap: balance;
	hyphens: none;
}
.page-intro {
	text-align: center;
	color: var(--muted);
	font-style: italic;
	margin: -0.4rem auto 2.2rem;
	max-width: 32em;
	text-wrap: balance;
}

.post-head {
	text-align: center;
	margin: 3rem 0 2.2rem;
}
.post-title {
	margin: 0.3em 0 0;
	font-family: var(--display);
	font-weight: 400;
	font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.6rem);
	line-height: 1.15;
	letter-spacing: 0.02em;
	color: var(--rubric);
	text-shadow: 2px 2px 0 rgba(184, 138, 43, 0.5);
	text-wrap: balance;
	hyphens: none;
}
.post-dek {
	margin: 0.9em auto 0;
	max-width: 30em;
	font-size: 1.08em;
	font-style: italic;
	color: var(--muted);
	text-wrap: balance;
}

.meta {
	display: block;
	font-size: 0.78em;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--muted);
}

/* ---- Prose: the running text ------------------------------------------- */

.prose > * {
	margin-block: 0 1.15em;
}
.prose p {
	text-wrap: pretty;
	hanging-punctuation: first last;
}
.prose h2,
.prose h3,
.prose h4 {
	font-family: var(--display);
	font-weight: 400;
	line-height: 1.2;
	text-wrap: balance;
	hyphens: none;
}
.prose h2 {
	margin: 2em 0 0.6em;
	font-size: 1.55em;
	letter-spacing: 0.02em;
	color: var(--blue);
}
.prose h3 {
	margin: 1.8em 0 0.5em;
	font-size: 1.25em;
	color: var(--rubric);
}
.prose h4 {
	margin: 1.7em 0 0.4em;
	font-family: var(--text);
	font-size: 0.8em;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--muted);
}
.prose ul,
.prose ol {
	padding-left: 1.4em;
}
.prose li {
	margin-block: 0.35em;
	padding-left: 0.2em;
}
.prose li::marker {
	color: var(--rubric);
}
.prose blockquote {
	margin: 1.8em 0;
	padding: 0 0 0 1.3em;
	border-left: 5px dotted var(--rubric);
	font-style: italic;
	font-size: 1.04em;
}
.prose blockquote > :last-child {
	margin-bottom: 0;
}
/* A horizontal rule in an essay becomes the flourish */
.prose hr {
	border: 0;
	height: 28px;
	margin: 2.2em 0;
	background: var(--flourish) no-repeat center / 220px 28px;
}
.prose code {
	font-family: var(--mono);
	font-size: 0.8em;
	background: #e6d6af;
	padding: 0.1em 0.35em;
	border-radius: 3px;
	hyphens: none;
}
.prose pre {
	overflow-x: auto;
	padding: 1em 1.2em;
	background: #e6d6af;
	border: 1px solid rgba(184, 138, 43, 0.5);
	border-radius: 3px;
	font-size: 0.82em;
	line-height: 1.5;
	hyphens: none;
}
.prose pre code {
	background: none;
	padding: 0;
	font-size: 1em;
}
.prose a {
	overflow-wrap: anywhere;
}
.prose sup {
	line-height: 0;
}

/* Illuminated first letter (turn on with `dropcap: true` in front matter) */
.dropcap > p:first-child::first-letter {
	float: left;
	margin: 0.04em 0.1em 0 -0.02em;
	font-family: var(--display);
	font-size: 4.2em;
	line-height: 0.85;
	color: var(--rubric);
	text-shadow: 3px 3px 0 var(--gold);
}

/* Footnotes (markdown-it-footnote) */
.prose .footnotes {
	margin-top: 3em;
	font-size: 0.85em;
	color: var(--muted);
}
.prose .footnotes-sep {
	margin: 0 0 1.5em;
	height: 0;
	border: 0;
	border-top: 1px solid rgba(184, 138, 43, 0.6);
	background: none;
}
.prose .footnotes ol {
	padding-left: 1.2em;
}
.prose .footnote-ref a,
.prose .footnote-backref {
	text-decoration: none;
}

/* ---- Lists of writing --------------------------------------------------- */

.entries {
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 0;
}
/* Red dotting between entries, as in Insular manuscripts */
.entries li::before,
.entries::after {
	content: "";
	display: block;
	height: 16px;
	background:
		radial-gradient(circle at 6px 4px, var(--rubric) 2.4px, transparent 3px) 0 0 / 12px 16px repeat-x,
		radial-gradient(circle at 0 11px, var(--gold) 2px, transparent 2.6px) 0 0 / 12px 16px repeat-x,
		radial-gradient(circle at 12px 11px, var(--gold) 2px, transparent 2.6px) 0 0 / 12px 16px repeat-x;
}
.entries li {
	padding-bottom: 0.7rem;
}
.entries li::before {
	margin-bottom: 0.8rem;
}
.entry-title {
	display: block;
	font-size: 1.35em;
	font-weight: 400;
	line-height: 1.25;
	text-decoration: none;
	text-wrap: balance;
	hyphens: none;
}
.entry-title:hover {
	text-decoration: underline;
	text-decoration-thickness: 0.07em;
}
.entries .meta {
	margin-top: 0.3rem;
}
.entry-desc {
	margin: 0.5rem 0 0;
	text-wrap: pretty;
}

.more-link {
	text-align: center;
	margin: 0 0 1rem;
	font-style: italic;
}
.back-link {
	margin-top: 3rem;
	text-align: center;
	font-style: italic;
}

/* ---- Photos: framed like miniatures ------------------------------------- */

.photo {
	margin: 0;
}
.photo a {
	display: block;
	line-height: 0;
}
.photo img {
	display: block;
	width: 100%;
	height: auto;
	background: #e6d6af;
}
.photo figcaption {
	padding: 0.45rem 0.7rem 0.55rem;
	font-size: 0.8em;
	line-height: 1.4;
	font-style: italic;
	color: var(--muted);
	text-wrap: pretty;
}
.photo--post,
.photo--gallery {
	border: 7px double var(--gold);
	outline: 2px solid var(--blue);
	outline-offset: -1px;
	background: var(--paper);
}

/* In an essay the photo steps slightly outside the text column. */
.photo--post {
	margin: 2em 0;
}
@media (min-width: 900px) {
	.prose .photo--post {
		margin-inline: -2.2rem;
	}
}

/* Gallery: columns, so portrait and landscape mix freely. */
.gallery {
	columns: 3 280px;
	column-gap: 1.4rem;
	margin-bottom: 2rem;
}
.photo--gallery {
	break-inside: avoid;
	margin-bottom: 1.5rem;
}

/* Little strip on the home page */
.photo-strip {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.8rem;
}
.photo--square {
	border: 4px double var(--gold);
	outline: 1px solid var(--blue);
	outline-offset: -1px;
}
.photo--square img {
	aspect-ratio: 1;
	object-fit: cover;
}

/* ---- Footer ------------------------------------------------------------- */

.site-footer {
	max-width: var(--measure);
	margin: 3.5rem auto 0;
	text-align: center;
	font-size: 0.88em;
	color: var(--muted);
	letter-spacing: 0.04em;
}
.site-footer p {
	margin: 0.2em 0;
}
.ornament {
	font-size: 2em;
	line-height: 1;
	margin-bottom: 0.3em;
	color: var(--blue);
	font-variant-emoji: text;
}
.colophon {
	font-style: italic;
}

@media print {
	.nav,
	.site-footer,
	.skip-link {
		display: none;
	}
	body {
		background: #fff;
		font-size: 11pt;
	}
	.sheet {
		box-shadow: none;
		background: none;
		margin: 0;
		padding: 0;
	}
}
