/* Weekday Grace — refinements layered on theme.json.
   theme.json owns the palette, scale and layout. This file owns reading rhythm,
   the dark scheme, and the small details that make long-form text pleasant. */

/* ---------- Dark scheme -------------------------------------------------
   Redefine the presets rather than restyling components, so every block and
   any future pattern inherits the dark palette for free. */
@media (prefers-color-scheme: dark) {
	:root {
		--wp--preset--color--canvas: #17130F;
		--wp--preset--color--surface: #201A15;
		--wp--preset--color--ink: #EDE3D6;
		--wp--preset--color--ink-soft: #A69684;
		--wp--preset--color--rule: #362C24;
		--wp--preset--color--amber: #E0A868;
		--wp--preset--color--sage: #97A78C;
	}

	img,
	.wp-block-post-featured-image img {
		/* Full-strength photography glares against a dark ground. */
		filter: brightness(0.92) contrast(1.02);
	}
}

/* ---------- Reading rhythm --------------------------------------------- */
body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

::selection {
	background: var(--wp--preset--color--amber);
	color: var(--wp--preset--color--canvas);
}

h1, h2, h3, h4 {
	text-wrap: balance;
}

p, li {
	text-wrap: pretty;
	hyphens: auto;
}

/* Essay body: give paragraphs air, and let the opening paragraph carry weight. */
.wp-block-post-content > p {
	margin-block: 0 1.35em;
}

.wp-block-post-content > p:first-of-type {
	font-size: 1.1em;
	line-height: 1.62;
	color: var(--wp--preset--color--ink);
}

.wp-block-post-content > h2 {
	margin-block: 2.4em 0.6em;
}

.wp-block-post-content > h3 {
	margin-block: 1.9em 0.5em;
}

/* Links: underline that sits below the baseline instead of cutting descenders. */
.wp-block-post-content a,
.wp-block-post-excerpt a {
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
	text-decoration-color: var(--wp--preset--color--rule);
	transition: text-decoration-color 120ms ease, color 120ms ease;
}

.wp-block-post-content a:hover {
	text-decoration-color: currentColor;
}

/* ---------- Meta type ---------------------------------------------------
   Dates, categories and the byline share one quiet, letterspaced sans voice
   so they never compete with the serif headline. */
.wg-meta,
.wp-block-post-date,
.wp-block-post-terms {
	font-family: var(--wp--preset--font-family--ui);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-soft);
}

.wp-block-post-date a,
.wp-block-post-terms a {
	text-decoration: none;
}

.wp-block-post-date a:hover,
.wp-block-post-terms a:hover {
	text-decoration: underline;
}

/* ---------- Quotes ------------------------------------------------------ */
.wp-block-quote {
	border-left: 2px solid var(--wp--preset--color--amber);
	padding-left: 1.25em;
	margin-block: 2em;
	font-style: normal;
}

.wp-block-quote cite {
	display: block;
	margin-top: 0.7em;
	font-family: var(--wp--preset--font-family--ui);
	font-size: var(--wp--preset--font-size--x-small);
	font-style: normal;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--ink-soft);
}

/* ---------- Post list --------------------------------------------------- */
.wg-entry {
	padding-block: var(--wp--preset--spacing--30);
	border-bottom: 1px solid var(--wp--preset--color--rule);
}

/* Each post is rendered inside its own <li>, so .wg-entry is always a
   last-child. Drop the rule from the final list item instead. */
.wp-block-post-template > li:last-child .wg-entry,
.wp-block-post-template > .wp-block-post:last-child .wg-entry {
	border-bottom: 0;
}

.wg-entry .wp-block-post-title {
	margin-block: 0.25em 0.35em;
}

.wg-entry .wp-block-post-title a {
	text-decoration: none;
}

.wg-entry .wp-block-post-title a:hover {
	text-decoration: underline;
	text-underline-offset: 0.16em;
}

.wg-entry .wp-block-post-excerpt__excerpt {
	color: var(--wp--preset--color--ink-soft);
}

/* ---------- Header / footer -------------------------------------------- */
.wg-header {
	border-bottom: 1px solid var(--wp--preset--color--rule);
}

.wg-header .wp-block-site-title a {
	text-decoration: none;
}

.wg-nav a {
	font-family: var(--wp--preset--font-family--ui);
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
}

.wg-nav a:hover {
	text-decoration: underline;
	text-underline-offset: 0.16em;
}

.wg-footer {
	border-top: 1px solid var(--wp--preset--color--rule);
	font-family: var(--wp--preset--font-family--ui);
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--ink-soft);
}

/* ---------- Figures ----------------------------------------------------- */
.wp-block-image img {
	border-radius: 2px;
}

.wp-block-image figcaption {
	font-family: var(--wp--preset--font-family--ui);
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--ink-soft);
	text-align: center;
}

/* Wide media may bleed past the measure, but text never should. */
@media (max-width: 600px) {
	.wp-block-post-content > p:first-of-type {
		font-size: 1.05em;
	}
}
