/* Minimal editorial styling. One file. No framework. */

@font-face {
	font-family: "Departure Mono";
	src: url("fonts/DepartureMono-Regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

:root {
	--ink: #1a1a1a;
	--muted: #6b6b6b;
	--rule: #e6e3dd;
	--accent: #8a5a2b;
	--bg: #fdfcfa;
	--measure: min(56rem, calc(100vw - 3rem));
	--block-gap: 1em;
	--list-gap: 0.55em;
	--list-indent: 1.5rem;
}

* {
	box-sizing: border-box;
}

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: "Departure Mono", ui-monospace, monospace;
	font-size: 1rem;
	line-height: 1.25;
	text-rendering: optimizeLegibility;
}

main,
.site-header,
.site-footer {
	max-width: var(--measure);
	margin-inline: auto;
	padding-inline: 1.5rem;
}

/* Header */
.site-header {
	padding-top: 3rem;
	padding-bottom: 1rem;
}
.site-title {
	font-family: "Departure Mono", ui-monospace, monospace;
	font-size: 1.1rem;
	text-transform: lowercase;
	color: var(--muted);
	text-decoration: none;
}
.site-title:hover {
	color: var(--ink);
}

/* Links */
a {
	color: var(--accent);
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Index */
.index-title {
	font-size: 2rem;
	margin: 1.5rem 0 0.25rem;
}
.index-desc {
	color: var(--muted);
	margin-top: 0;
}

.post-list {
	list-style: none;
	padding: 0;
	margin: 2.5rem 0;
}
.post-list li {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	padding: 0.6rem 0;
	border-bottom: 1px solid var(--rule);
}
.post-list a {
	color: var(--ink);
	font-size: 1.2rem;
}
.post-list a:hover {
	color: var(--accent);
}
.post-list time {
	color: var(--muted);
	font-size: 0.9rem;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

/* Post */
.post :where(h1, h2, h3, h4, h5, h6) {
	line-height: 1.25;
	font-weight: 400;
	margin-bottom: 0;
}

/* Page title (from template, not markdown) */
.post > h1:first-of-type {
	font-size: 2.1rem;
	line-height: 1.2;
	margin: 1.5rem 0 0.25rem;
}

/* Markdown headings — size scales with # level */
.post h1:not(:first-of-type) {
	margin-top: 2.5rem;
	font-size: 1.35rem;
}
.post h2 {
	margin-top: 2rem;
	font-size: 1.2rem;
}
.post h3 {
	margin-top: 1.75rem;
	font-size: 1.1rem;
}
.post h4 {
	margin-top: 1.5rem;
	font-size: 1rem;
}
.post h5 {
	margin-top: 1.25rem;
	font-size: 0.95rem;
}
.post h6 {
	margin-top: 1rem;
	font-size: 0.9rem;
}

.post-meta {
	color: var(--muted);
	margin-top: 0;
	font-size: 0.95rem;
}
.post img {
	max-width: 100%;
	height: auto;
}

/* Block spacing — gaps between elements, not within lines */
.post :where(p, ul, ol, blockquote, pre, table) {
	margin: 0;
}
.post
	:where(p, ul, ol, blockquote, pre, table, img)
	+ :where(p, ul, ol, blockquote, pre, table, img),
.post
	:where(h1, h2, h3, h4, h5, h6)
	+ :where(p, ul, ol, blockquote, pre, table, img) {
	margin-top: var(--block-gap);
}
.post :where(ul, ol) {
	padding-left: var(--list-indent);
	list-style-position: outside;
}
.post :where(ul, ol) :where(ul, ol) {
	margin-top: var(--list-gap);
}
.post li + li {
	margin-top: var(--list-gap);
}
.post li > :where(ul, ol) {
	margin-top: var(--list-gap);
}

blockquote {
	margin: 0;
	padding-left: 1.2rem;
	border-left: 3px solid var(--rule);
	color: var(--muted);
	font-style: italic;
}

/* Code */
code {
	font-family: inherit;
	font-size: 0.85em;
	background: #f1efe9;
	padding: 0.15em 0.35em;
	border-radius: 3px;
}
pre {
	background: #f1efe9;
	padding: 1rem 1.2rem;
	border-radius: 6px;
	overflow-x: auto;
	line-height: 1.45;
}
pre code {
	background: none;
	padding: 0;
	font-size: 0.85rem;
}

/* Tables */
table {
	border-collapse: collapse;
	width: 100%;
	font-size: 0.95rem;
}
th,
td {
	text-align: left;
	padding: 0.5rem 0.75rem;
	border-bottom: 1px solid var(--rule);
}

/* Footer + nav */
.back {
	margin: 3rem 0 0;
}
.site-footer {
	margin-top: 4rem;
	padding-top: 1.5rem;
	padding-bottom: 3rem;
	border-top: 1px solid var(--rule);
	color: var(--muted);
	font-size: 0.85rem;
}
.site-footer a {
	color: var(--muted);
}

@media (prefers-color-scheme: dark) {
	:root {
		--ink: #e8e6e1;
		--muted: #9a968d;
		--rule: #2e2c28;
		--accent: #c79456;
		--bg: #16150f;
	}
	code,
	pre {
		background: #211f1a;
	}
}
