/*
Theme Name: The Silent Spectator
Description: A custom block theme scaffolded by Studio Code.
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.2
Version: 0.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: silent-spectator
Tags: full-site-editing, block-patterns, block-styles, wide-blocks, accessibility-ready, style-variations
*/

/* WordPress inserts margin-block-start: var(--wp--style--block-gap) between the
   template's top-level sections (header part, main, footer part) — a gap that
   exists even when no markup asks for it. Zero it so sections butt edge-to-edge. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

.wp-site-blocks main {
	padding-block: 0;
}
.wp-site-blocks main.is-flush {
	padding-block: 0;
}

:root {
	--run-rule: rgba(31, 28, 24, 0.22);
	--hair-rule: rgba(31, 28, 24, 0.12);
	--ink-soft: rgba(31, 28, 24, 0.72);
	--ink-faint: rgba(31, 28, 24, 0.5);
}

/* ===== Running head (header) ===== */
.running-head {
	padding-block: clamp(1.25rem, 3vw, 2.25rem) 0;
	border-bottom: 1px solid var(--run-rule);
}
.running-head .wp-block-site-title {
	font-size: var(--wp--preset--font-size--label);
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin: 0;
}
.running-head nav {
	padding: 0;
}
.running-head .wp-block-navigation a,
.running-head .wp-block-navigation .wp-block-navigation-item__label {
	color: var(--wp--preset--color--text);
	font-size: var(--wp--preset--font-size--label);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* ===== Masthead spread ===== */
.spread {
	min-height: calc(100vh - 6rem);
	display: flex;
	align-items: stretch;
}
.spread-pages {
	margin-inline: auto;
}
.spread-page {
	display: flex;
	flex-direction: column;
}
.spread-folio {
	justify-content: flex-end;
	border-right: 1px solid var(--hair-rule);
	padding-right: var(--wp--preset--spacing--lg);
}
.spread-text {
	padding-left: var(--wp--preset--spacing--lg);
}
.folio-note {
	max-width: 34rem;
}
.folio-note p:first-child {
	color: var(--wp--preset--color--primary);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-bottom: var(--wp--preset--spacing--sm);
}
.folio-note .wp-block-heading {
	margin-block: 0 var(--wp--preset--spacing--md);
}
.folio-note p {
	color: var(--ink-soft);
}

/* ===== Contents index ===== */
.contents-head {
	padding-bottom: var(--wp--preset--spacing--sm);
	border-bottom: 1px solid var(--run-rule);
	margin-bottom: var(--wp--preset--spacing--md);
	padding-left: 0 !important;
}
.contents-head p {
	margin: 0;
	color: var(--ink-faint);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}
.archive-index .wp-block-post-template {
	display: flex;
	flex-direction: column;
}
.index-entry {
	padding-block: var(--wp--preset--spacing--sm);
	border-bottom: 1px solid var(--hair-rule);
}
.index-entry h2 {
	margin: 0;
}
.index-entry h2 a {
	color: var(--wp--preset--color--text);
	text-decoration: none !important;
}
.index-entry h2 a:hover {
	color: var(--wp--preset--color--primary);
}
.index-entry .wp-block-post-date {
	margin: 0;
	font-style: italic;
	color: var(--ink-faint);
}

/* ===== Article / book page ===== */
.article-page {
	padding-block: var(--wp--preset--spacing--xl) var(--wp--preset--spacing--xl);
}
.article-head {
	border-bottom: 1px solid var(--hair-rule);
	padding-bottom: var(--wp--preset--spacing--md);
	margin-bottom: var(--wp--preset--spacing--lg);
}
.article-meta {
	align-items: baseline;
	gap: var(--wp--preset--spacing--md) !important;
	margin-bottom: var(--wp--preset--spacing--sm);
	padding-left: 0 !important;
}
.article-head .wp-block-post-date,
.article-meta .wp-block-post-terms,
.article-meta .wp-block-post-terms a {
	font-style: normal;
	color: var(--ink-soft);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin: 0;
}
.article-meta .wp-block-post-terms a {
	color: var(--wp--preset--color--primary);
	text-decoration: none !important;
	margin-inline-start: 0.4em;
}
.article-meta .wp-block-post-terms a::before {
	content: "·";
	margin-inline-end: 0.4em;
	color: var(--ink-faint);
}
.article-head .wp-block-post-title {
	margin: 0;
}

/* ===== Reading column: prose ===== */
.article-body {
	font-size: var(--wp--preset--font-size--body);
}
.article-body > * {
	max-width: 34rem;
}
.article-body p {
	line-height: 1.8;
	margin-block: 0 1.5em;
}
.article-body h2,
.article-body h3,
.article-body h4 {
	max-width: 34rem;
	font-weight: 500;
	line-height: 1.3;
	margin-block: 2.4em 0.8em;
}
.article-body h2 {
	font-size: var(--wp--preset--font-size--headline);
}
.article-body h3 {
	font-size: 1.4rem;
}
.article-body h4 {
	font-size: 1.2rem;
}
.article-body ul,
.article-body ol {
	max-width: 34rem;
	line-height: 1.7;
}
/* Drop cap opens a prose piece */
.article-body p:first-child::first-letter {
	float: left;
	font-size: 3.4em;
	line-height: 0.8;
	padding: 0.06em 0.14em 0 0;
	font-weight: 500;
	color: var(--wp--preset--color--primary);
}

/* ===== Poetry: centred verse ===== */
.single-post.category-poetry .article-body,
.single-post.category-poetry .article-body {
	max-width: none;
}
.single-post.category-poetry .article-body > * {
	max-width: 30rem;
	text-align: center;
	margin-inline: auto;
}
.single-post.category-poetry .article-body p {
	line-height: 2;
	margin-block: 0 1.6em;
}
.single-post.category-poetry .article-body .wp-block-verse,
.article-body .wp-block-verse {
	font-family: inherit;
	font-size: var(--wp--preset--font-size--body);
	line-height: 2;
	white-space: pre-wrap;
	margin-block: 0 1.6em;
	padding: 0;
	color: var(--wp--preset--color--text);
}
.single-post.category-poetry .article-body .wp-block-verse {
	margin-inline: auto;
}

/* ===== Collections archive page ===== */
.collection-open {
	padding-block: var(--wp--preset--spacing--xl) var(--wp--preset--spacing--lg);
	border-bottom: 1px solid var(--run-rule);
}
.collection-open .has-label-font-size {
	color: var(--wp--preset--color--primary);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-bottom: var(--wp--preset--spacing--sm);
}
.collection-open h1 {
	margin-block: 0 var(--wp--preset--spacing--md);
}
.collection-open > p:not(.has-label-font-size) {
	color: var(--ink-soft);
	max-width: 34rem;
	margin-block: 0 0 0;
}
.genre-links {
	gap: var(--wp--preset--spacing--lg) !important;
	margin-top: var(--wp--preset--spacing--md);
	padding-left: 0 !important;
}
.genre-links p {
	margin: 0;
}
.genre-links a {
	color: var(--wp--preset--color--text);
	font-size: var(--wp--preset--font-size--headline);
	text-decoration: none !important;
	border-bottom: 1px solid var(--run-rule);
	padding-bottom: 0.1em;
}
.genre-links a:hover {
	color: var(--wp--preset--color--primary);
	border-bottom-color: var(--wp--preset--color--primary);
}

.collection-section {
	padding-block: var(--wp--preset--spacing--lg);
	border-bottom: 1px solid var(--hair-rule);
}
.collection-section:last-child {
	border-bottom: 0;
}
.collection-head {
	margin-bottom: var(--wp--preset--spacing--md);
}
.collection-head .has-label-font-size {
	color: var(--ink-faint);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-bottom: var(--wp--preset--spacing--xs);
}
.collection-head h2 {
	margin-block: 0 var(--wp--preset--spacing--sm);
}
.collection-head p:not(.has-label-font-size) {
	color: var(--ink-soft);
	max-width: 34rem;
	margin: 0;
}
.collection-section .archive-index {
	border-top: 1px solid var(--hair-rule);
}
.collection-section .index-entry h3 {
	font-size: var(--wp--preset--font-size--body);
	font-weight: 400;
}

/* ===== Piece-to-piece navigation ===== */
.article-nav {
	margin-top: var(--wp--preset--spacing--xl);
	border-top: 1px solid var(--hair-rule);
	padding-top: var(--wp--preset--spacing--md);
}
.article-nav .wp-block-post-navigation-link {
	font-size: var(--wp--preset--font-size--label);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}
.article-nav .wp-block-post-navigation-link a {
	text-decoration: none !important;
	color: var(--wp--preset--color--text);
}
.article-nav .wp-block-post-navigation-link a:hover {
	color: var(--wp--preset--color--primary);
}

/* ===== Bookplate footer ===== */
.bookplate {
	padding-block: var(--wp--preset--spacing--lg) var(--wp--preset--spacing--lg);
	border-top: 1px solid var(--run-rule);
}
.bookplate .bookplate-inner {
	padding-left: 0 !important;
}
.bookplate p {
	margin: 0;
	color: var(--ink-faint);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

/* ===== Small screens: pages stack ===== */
@media (max-width: 781px) {
	.running-head {
		padding-top: 1rem;
	}
	.running-head .wp-block-site-title {
		font-size: 0.78rem;
	}

	.spread {
		min-height: 0;
	}
	.spread-folio {
		border-right: 0;
		border-bottom: 1px solid var(--hair-rule);
		padding-right: 0;
		padding-bottom: var(--wp--preset--spacing--md);
	}
	.spread-text {
		padding-left: 0;
		padding-top: var(--wp--preset--spacing--md);
	}
	.folio-note h1,
	.article-head .wp-block-post-title,
	.collection-open h1 {
		font-size: 2.1rem !important;
		line-height: 1.2 !important;
	}

	/* Reading column fills the screen on phones */
	.article-body > *,
	.article-body h2,
	.article-body h3,
	.article-body h4 {
		max-width: none;
	}
	.article-body p {
		line-height: 1.75;
	}

	/* Poems: slightly tighter leading keeps stanzas together */
	.single-post.category-poetry .article-body .wp-block-verse,
	.article-body .wp-block-verse {
		line-height: 1.9;
	}

	/* Index entries (home + collections): stack so long titles wrap cleanly */
	.index-entry {
		flex-direction: column !important;
		align-items: flex-start !important;
		gap: 0.2rem !important;
		padding-block: 0.9rem;
	}
	.index-entry h2,
	.index-entry h3 {
		font-size: 1.35rem !important;
		line-height: 1.3;
	}
	.index-entry .wp-block-post-date {
		font-size: 0.72rem;
	}

	/* Article meta stacks */
	.article-meta {
		align-items: flex-start;
	}

	/* Article navigation stays on one comfortable line */
	.article-nav {
		align-items: flex-start;
	}

	/* Collections page */
	.genre-links {
		gap: 1.25rem 2rem !important;
	}
	.genre-links a {
		font-size: 1.45rem;
	}
	.collection-open,
	.collection-section {
		padding-block: 2.5rem;
	}

	/* Bookplate footer */
	.bookplate p {
		font-size: 0.72rem;
	}
}
