/*
Theme Name: Fields
Theme URI: https://chrisfieldsff.com
Author: Joe Bunting
Description: Hand-built classic theme for chrisfieldsff.com, the speaking site for Chris Fields. Speaking-first, serif-led, light and dark palettes, no page builder.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fields
*/

/* ==========================================================================
   1. Tokens
   Light palette lives on bare :root. Dark is redefined in the media query
   AND under [data-theme="dark"] so an explicit choice wins either way.
   Never declare a color only inside a media query.
   ========================================================================== */

:root {
	/* Ground & surface. Warm off-white, so the red reads as controlled
	   rather than as an alarm. */
	--ground: #f7f5f2;
	--surface: #ffffff;
	--surface-sunk: #ede9e4;

	/* Ink */
	--ink: #1c1f24;
	--ink-soft: #454b53;
	--ink-faint: #6b7280;
	--ink-invert: #f7f5f2;

	/* One accent, used sparingly: actions, rules under section titles,
	   the figure values. Never as a background for long text. */
	--accent: #a32c1e;
	--accent-hover: #862416;
	--accent-quiet: #f0e2df;
	--on-accent: #ffffff;

	--rule: #ddd7d0;
	--focus: #1c1f24;

	/* Type */
	--serif: "Source Serif 4", Georgia, "Times New Roman", serif;
	--sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

	/* Scale. Fluid, mobile-first. */
	--step--1: clamp(0.83rem, 0.81rem + 0.11vw, 0.89rem);
	--step-0: clamp(1.05rem, 1.01rem + 0.2vw, 1.19rem);
	--step-1: clamp(1.27rem, 1.19rem + 0.38vw, 1.5rem);
	--step-2: clamp(1.52rem, 1.38rem + 0.68vw, 2rem);
	--step-3: clamp(1.83rem, 1.58rem + 1.19vw, 2.66rem);
	--step-4: clamp(2.19rem, 1.78rem + 1.99vw, 3.55rem);

	/* Space */
	--gap: 1.25rem;
	--band: clamp(3rem, 2rem + 5vw, 5.5rem);
	--measure: 34rem;
	--wide: 68rem;
	--radius: 3px;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--ground: #14161a;
		--surface: #1b1e23;
		--surface-sunk: #22262c;

		--ink: #eceef1;
		--ink-soft: #bfc5cd;
		--ink-faint: #949ba4;
		--ink-invert: #14161a;

		--accent: #e0644f;
		--accent-hover: #ef8a76;
		--accent-quiet: #2c2220;
		--on-accent: #14161a;

		--rule: #2e333b;
		--focus: #eceef1;
	}
}

:root[data-theme="dark"] {
	--ground: #14161a;
	--surface: #1b1e23;
	--surface-sunk: #22262c;

	--ink: #eceef1;
	--ink-soft: #bfc5cd;
	--ink-faint: #949ba4;
	--ink-invert: #14161a;

	--accent: #e0644f;
	--accent-hover: #ef8a76;
	--accent-quiet: #2c2220;
	--on-accent: #14161a;

	--rule: #2e333b;
	--focus: #eceef1;
}

/* ==========================================================================
   2. Base
   ========================================================================== */

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

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

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

body {
	margin: 0;
	background: var(--ground);
	color: var(--ink);
	font-family: var(--serif);
	font-size: var(--step-0);
	line-height: 1.6;
	font-synthesis-weight: none;
	text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
	font-family: var(--serif);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.012em;
	margin: 0 0 0.6em;
	text-wrap: balance;
}

h1 {
	font-size: var(--step-4);
}

h2 {
	font-size: var(--step-3);
}

h3 {
	font-size: var(--step-1);
}

p {
	margin: 0 0 1.1em;
	text-wrap: pretty;
}

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	text-decoration-color: var(--accent);
}

a:hover {
	color: var(--accent);
}

:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 3px;
}

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

figure {
	margin: 0;
}

blockquote {
	margin: 0;
}

ul,
ol {
	padding-left: 1.1em;
}

li {
	margin-bottom: 0.4em;
}

hr {
	border: 0;
	border-top: 1px solid var(--rule);
	margin: var(--band) 0;
}

::selection {
	background: var(--accent-quiet);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--surface);
	color: var(--ink);
	padding: 0.75rem 1rem;
	z-index: 100;
}

.skip-link:focus {
	left: 1rem;
	top: 1rem;
}

/* ==========================================================================
   3. Layout
   ========================================================================== */

.wrap {
	width: min(100% - 2rem, var(--wide));
	margin-inline: auto;
}

.wrap--narrow {
	width: min(100% - 2rem, 46rem);
	margin-inline: auto;
}

.band {
	padding-block: var(--band);
}

.band--sunk {
	background: var(--surface-sunk);
}

.band--surface {
	background: var(--surface);
}

.measure {
	max-width: var(--measure);
}

.lede {
	font-size: var(--step-1);
	line-height: 1.5;
	color: var(--ink-soft);
}

.eyebrow {
	font-family: var(--sans);
	font-size: var(--step--1);
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ink-faint);
	margin: 0 0 0.9rem;
}

.section-title {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-bottom: 2rem;
}

.section-title h2 {
	margin: 0;
}

.section-title::after {
	content: "";
	width: 2.5rem;
	height: 2px;
	background: var(--accent);
}

/* ==========================================================================
   4. Header & navigation
   ========================================================================== */

.site-header {
	border-bottom: 1px solid var(--rule);
	background: var(--ground);
}

.site-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
	padding-block: 1.1rem;
}

.site-title {
	font-family: var(--serif);
	font-size: var(--step-1);
	font-weight: 600;
	letter-spacing: -0.01em;
	margin: 0;
}

.site-title a {
	text-decoration: none;
}

.site-title__role {
	display: block;
	font-family: var(--sans);
	font-size: var(--step--1);
	font-weight: 500;
	letter-spacing: 0.04em;
	color: var(--ink-faint);
}

.nav {
	font-family: var(--sans);
	font-size: var(--step--1);
	letter-spacing: 0.02em;
}

.nav ul {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 1.4rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.nav a {
	text-decoration: none;
	color: var(--ink-soft);
	padding-block: 0.3rem;
	border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav .current-menu-item > a {
	color: var(--ink);
	border-bottom-color: var(--accent);
}

.nav .nav-cta > a {
	background: var(--accent);
	color: var(--on-accent);
	border: 0;
	border-radius: var(--radius);
	padding: 0.5rem 0.9rem;
	font-weight: 600;
}

.nav .nav-cta > a:hover {
	background: var(--accent-hover);
	color: var(--on-accent);
}

/* ==========================================================================
   5. Buttons
   ========================================================================== */

.button {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--sans);
	font-size: var(--step--1);
	font-weight: 600;
	letter-spacing: 0.02em;
	text-decoration: none;
	padding: 0.8rem 1.3rem;
	border-radius: var(--radius);
	border: 1px solid var(--accent);
	background: var(--accent);
	color: var(--on-accent);
	cursor: pointer;
	transition: background-color 120ms ease, border-color 120ms ease;
}

.button:hover {
	background: var(--accent-hover);
	border-color: var(--accent-hover);
	color: var(--on-accent);
}

.button--quiet {
	background: transparent;
	color: var(--ink);
	border-color: var(--rule);
}

.button--quiet:hover {
	background: transparent;
	color: var(--accent);
	border-color: var(--accent);
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.75rem;
}

/* ==========================================================================
   6. Hero
   ========================================================================== */

.hero {
	padding-block: clamp(2.5rem, 1.5rem + 5vw, 5rem) var(--band);
}

.hero__inner {
	display: grid;
	gap: clamp(1.75rem, 1rem + 4vw, 3.5rem);
}

@media (min-width: 52em) {
	.hero__inner {
		grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
		align-items: center;
	}
}

.hero h1 {
	margin-bottom: 0.35em;
}

.hero__line {
	font-size: var(--step-1);
	line-height: 1.45;
	color: var(--ink-soft);
	max-width: 30ch;
}

.hero__portrait {
	position: relative;
}

.hero__portrait img {
	width: 100%;
	border-radius: var(--radius);
	background: var(--surface-sunk);
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

.portrait-placeholder {
	display: grid;
	place-items: center;
	aspect-ratio: 4 / 5;
	border: 1px dashed var(--rule);
	border-radius: var(--radius);
	background: var(--surface-sunk);
	color: var(--ink-faint);
	font-family: var(--sans);
	font-size: var(--step--1);
	text-align: center;
	padding: 1.5rem;
}

/* ==========================================================================
   7. Figures (the proof strip)
   ========================================================================== */

.figures {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.5rem 1rem;
	border-top: 1px solid var(--rule);
	padding-top: 1.75rem;
	margin-top: 2.25rem;
}

@media (min-width: 46em) {
	.figures {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.figure__value {
	display: block;
	font-family: var(--serif);
	font-size: var(--step-2);
	font-weight: 600;
	line-height: 1.1;
	color: var(--accent);
}

.figure__label {
	display: block;
	font-family: var(--sans);
	font-size: var(--step--1);
	line-height: 1.4;
	color: var(--ink-faint);
	margin-top: 0.35rem;
}

/* ==========================================================================
   8. Cards & grids
   ========================================================================== */

.grid {
	display: grid;
	gap: 1.5rem;
}

@media (min-width: 42em) {
	.grid--2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.grid--3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.card {
	background: var(--surface);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	padding: 1.5rem;
}

.card h3 {
	margin-bottom: 0.5rem;
}

.card p:last-child {
	margin-bottom: 0;
}

.card__meta {
	font-family: var(--sans);
	font-size: var(--step--1);
	color: var(--ink-faint);
}

/* Topics get a number, which is the only ornament in the theme. */
.topic {
	counter-increment: topic;
	position: relative;
	padding-top: 2.25rem;
}

.topic::before {
	content: counter(topic, decimal-leading-zero);
	position: absolute;
	top: 1.25rem;
	font-family: var(--sans);
	font-size: var(--step--1);
	font-weight: 600;
	letter-spacing: 0.1em;
	color: var(--accent);
}

.topics {
	counter-reset: topic;
}

/* ==========================================================================
   9. Quotes
   ========================================================================== */

.quote {
	border-left: 2px solid var(--accent);
	padding-left: 1.25rem;
	font-size: var(--step-1);
	line-height: 1.45;
}

.quote p {
	margin-bottom: 0.6em;
}

.quote cite {
	display: block;
	font-family: var(--sans);
	font-size: var(--step--1);
	font-style: normal;
	color: var(--ink-faint);
}

.pull {
	font-size: var(--step-2);
	line-height: 1.25;
	max-width: 22ch;
	margin: 0;
}

/* ==========================================================================
   10. Lists: events, press, endorsements
   ========================================================================== */

.entries {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.entries > li {
	margin: 0;
}

.entry__title {
	font-family: var(--serif);
	font-size: var(--step-1);
	font-weight: 600;
	line-height: 1.3;
	margin: 0 0 0.25rem;
}

.entry__title a {
	color: var(--ink);
	text-decoration: none;
}

.entry__title a:hover {
	color: var(--accent);
	text-decoration: underline;
}

.meta {
	font-family: var(--sans);
	font-size: var(--step--1);
	color: var(--ink-faint);
	margin: 0;
}

.names {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 1.25rem;
}

@media (min-width: 42em) {
	.names {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.names li {
	margin: 0;
}

.names strong {
	display: block;
}

.names span {
	font-family: var(--sans);
	font-size: var(--step--1);
	color: var(--ink-faint);
}

/* ==========================================================================
   11. Forms
   ========================================================================== */

.form {
	display: grid;
	gap: 1rem;
	max-width: 36rem;
}

.form label {
	display: block;
	font-family: var(--sans);
	font-size: var(--step--1);
	font-weight: 600;
	margin-bottom: 0.35rem;
}

.form input[type="text"],
.form input[type="email"],
.form input[type="tel"],
.form textarea,
.form select {
	width: 100%;
	font-family: var(--sans);
	font-size: var(--step-0);
	color: var(--ink);
	background: var(--surface);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	padding: 0.7rem 0.8rem;
}

.form textarea {
	min-height: 9rem;
	resize: vertical;
}

.form__hp {
	position: absolute;
	left: -9999px;
}

.form__note {
	font-family: var(--sans);
	font-size: var(--step--1);
	color: var(--ink-faint);
}

.notice {
	border-left: 2px solid var(--accent);
	background: var(--accent-quiet);
	padding: 1rem 1.25rem;
	margin-bottom: 1.5rem;
	font-family: var(--sans);
	font-size: var(--step--1);
}

/* ==========================================================================
   12. Entry content (pages and posts from the editor)
   ========================================================================== */

.entry {
	max-width: 40rem;
}

.entry h2 {
	font-size: var(--step-2);
	margin-top: 1.8em;
}

.entry h3 {
	margin-top: 1.6em;
}

.entry img {
	border-radius: var(--radius);
	margin-block: 1.5rem;
}

.entry .wp-block-quote {
	border-left: 2px solid var(--accent);
	padding-left: 1.25rem;
	font-size: var(--step-1);
}

.entry-meta {
	font-family: var(--sans);
	font-size: var(--step--1);
	color: var(--ink-faint);
	margin-bottom: 1.5rem;
}

.page-header {
	padding-block: clamp(2.5rem, 1.5rem + 4vw, 4rem) 0;
}

.page-header h1 {
	margin-bottom: 0.3em;
}

/* ==========================================================================
   13. Call to action band
   ========================================================================== */

.cta {
	background: var(--surface-sunk);
	border-top: 1px solid var(--rule);
	border-bottom: 1px solid var(--rule);
}

.cta__inner {
	display: grid;
	gap: 1.5rem;
	align-items: center;
}

@media (min-width: 46em) {
	.cta__inner {
		grid-template-columns: minmax(0, 1fr) auto;
	}
}

.cta h2 {
	margin: 0;
	font-size: var(--step-2);
}

.cta p {
	margin: 0.5rem 0 0;
	color: var(--ink-soft);
}

.cta .actions {
	margin-top: 0;
}

/* ==========================================================================
   14. Footer
   ========================================================================== */

.site-footer {
	padding-block: var(--band) 2.5rem;
	font-family: var(--sans);
	font-size: var(--step--1);
	color: var(--ink-faint);
}

.site-footer__inner {
	display: grid;
	gap: 2rem;
}

@media (min-width: 46em) {
	.site-footer__inner {
		grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
	}
}

.site-footer h2 {
	font-family: var(--sans);
	font-size: var(--step--1);
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ink-faint);
	margin-bottom: 0.9rem;
}

.site-footer ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.5rem;
}

.site-footer a {
	text-decoration: none;
	color: var(--ink-soft);
}

.site-footer a:hover {
	color: var(--accent);
}

.site-footer__legal {
	margin-top: 2.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--rule);
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	justify-content: space-between;
}

.site-footer p {
	margin: 0 0 0.6em;
}

/* ==========================================================================
   15. Theme toggle
   ========================================================================== */

.theme-toggle {
	font-family: var(--sans);
	font-size: var(--step--1);
	background: none;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	color: var(--ink-soft);
	padding: 0.35rem 0.7rem;
	cursor: pointer;
}

.theme-toggle:hover {
	color: var(--accent);
	border-color: var(--accent);
}

/* ==========================================================================
   16. Print. The press kit is meant to survive a printer.
   ========================================================================== */

@media print {
	.site-header,
	.site-footer,
	.cta,
	.theme-toggle,
	.actions {
		display: none !important;
	}

	body {
		background: #fff;
		color: #000;
		font-size: 11pt;
	}

	.band {
		padding-block: 1rem;
		break-inside: avoid;
	}
}
