/*
Theme Name: Chris Williams
Theme URI: https://www.derekkirkup.com
Author: Derek Kirkup
Author URI: https://www.derekkirkup.com
Description: A minimal, bold sans-serif theme for Chris Williams — actor, director and performance researcher. Biography on the front page, gallery, facilitation, testimonials, a directing CV with PDF download, an optional blog and a built-in mailing list that emails new posts to subscribers. Installs its own pages and content on activation.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: chris-williams
*/

/* ---------- Fonts (bundled, SIL Open Font License) ---------- */
@font-face {
	font-family: "Hanken Grotesk";
	src: url("assets/fonts/hanken-grotesk.woff") format("woff");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Hanken Grotesk";
	src: url("assets/fonts/hanken-grotesk-italic.woff") format("woff");
	font-weight: 100 900;
	font-style: italic;
	font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
	--cw-ink: #120806;
	--cw-muted: #5e4a45;
	--cw-paper: #ffffff;
	--cw-accent: #e5492d;
	--cw-rule: 2px solid var(--cw-ink);
	--cw-gutter: 48px;
	--cw-max: 1440px;
	--cw-font: "Hanken Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

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

body {
	margin: 0;
	background: var(--cw-paper);
	color: var(--cw-ink);
	font-family: var(--cw-font);
	font-size: 19px;
	font-weight: 450;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

a { color: var(--cw-ink); text-underline-offset: 4px; text-decoration-thickness: 2px; }
a:hover { color: var(--cw-muted); }
a:focus-visible,
button:focus-visible,
input:focus-visible { outline: 3px solid var(--cw-accent); outline-offset: 3px; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; text-wrap: balance; }
p { margin: 0 0 1.1em; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	position: fixed !important; top: 8px; left: 8px; z-index: 100;
	width: auto; height: auto; clip: auto;
	background: var(--cw-ink); color: #fff; padding: 12px 16px;
}

.cw-wrap {
	max-width: var(--cw-max);
	margin: 0 auto;
	padding: 0 var(--cw-gutter);
}

/* ---------- Header ---------- */
.site-header {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px 40px;
	padding: 34px 0 30px;
	border-bottom: var(--cw-rule);
}
.site-title {
	font-size: 23px;
	font-weight: 700;
	letter-spacing: -0.02em;
	text-decoration: none;
}
.site-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 30px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 17px;
	font-weight: 600;
}
.site-nav a { display: block; padding: 10px 0; text-decoration: none; }
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a,
.site-nav .current_page_parent > a {
	text-decoration: underline;
	text-decoration-color: var(--cw-accent);
	text-decoration-thickness: 3px;
	text-underline-offset: 7px;
}
.nav-toggle {
	display: none;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 0 14px;
	border: var(--cw-rule);
	background: none;
	color: var(--cw-ink);
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
}

/* ---------- Front page: biography ---------- */
.home-bio {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 48px 72px;
	padding: 64px 0 96px;
}
.home-bio__text { flex: 7 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 36px; }
.home-bio__headline {
	max-width: 720px;
	font-size: clamp(38px, 4.3vw, 60px);
	line-height: 1.04;
	letter-spacing: -0.035em;
}
.home-bio__body { max-width: 640px; }
.home-bio__body > *:last-child { margin-bottom: 0; }
.home-bio__figure { flex: 5 1 340px; min-width: 0; margin: 0; }
.home-bio__figure img { width: 100%; height: 780px; object-fit: cover; object-position: center 20%; }
figcaption,
.cw-caption { margin-top: 12px; font-size: 15px; color: var(--cw-muted); }

/* ---------- Front page: quote ---------- */
.home-quote {
	display: flex;
	flex-wrap: wrap;
	gap: 40px 64px;
	padding: 88px 0 104px;
	border-top: var(--cw-rule);
}
.home-quote__figure { flex: 4 1 280px; min-width: 0; margin: 0; }
.home-quote__figure img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.home-quote__text { flex: 8 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.home-quote__intro { max-width: 600px; margin: 0; font-size: 17px; color: var(--cw-muted); }
.home-quote blockquote {
	margin: 0;
	padding-top: 26px;
	border-top: 5px solid var(--cw-accent);
	font-size: clamp(23px, 2.3vw, 33px);
	line-height: 1.26;
	font-weight: 650;
	letter-spacing: -0.025em;
	text-wrap: pretty;
}
.home-quote blockquote p { margin: 0; }

/* ---------- Page cards ---------- */
.page-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
	gap: 24px;
	padding-bottom: 104px;
}
.page-card { display: flex; flex-direction: column; gap: 14px; text-decoration: none; }
.page-card img,
.page-card__blank { width: 100%; height: 240px; object-fit: cover; background: #ece8e6; transition: opacity 0.2s ease; }
.page-card:hover img { opacity: 0.85; }
.page-card__label { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; border-top: var(--cw-rule); }
.page-card__title { font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -0.03em; }
.page-card__sub { font-size: 16px; color: var(--cw-muted); }

/* ---------- Mailing list ---------- */
.mailing {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	gap: 32px 64px;
	padding: 88px 0 96px;
	border-top: var(--cw-rule);
}
.mailing__intro { flex: 5 1 320px; min-width: 0; }
.mailing__intro h2 { font-size: 40px; line-height: 1.05; letter-spacing: -0.035em; margin-bottom: 12px; }
.mailing__intro p { max-width: 460px; margin: 0; color: var(--cw-muted); }
.mailing__form { flex: 7 1 360px; min-width: 0; display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.mailing__field { flex: 1 1 260px; display: flex; flex-direction: column; gap: 6px; }
.mailing__field label { font-size: 15px; color: var(--cw-muted); }
.mailing__field input {
	height: 56px;
	width: 100%;
	padding: 0 16px;
	border: var(--cw-rule);
	border-radius: 0;
	background: #fff;
	color: var(--cw-ink);
	font: inherit;
}
.cw-button,
.mailing__form button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 56px;
	padding: 0 30px;
	border: 0;
	border-radius: 0;
	background: var(--cw-accent);
	color: var(--cw-ink);
	font: inherit;
	font-size: 17px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}
.cw-button:hover,
.mailing__form button:hover { background: var(--cw-ink); color: #fff; }
.cw-button--outline { background: none; border: var(--cw-rule); }
.mailing__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mailing__notice {
	flex: 1 1 100%;
	margin: 0;
	padding: 14px 18px;
	border-left: 5px solid var(--cw-accent);
	background: #f6f2f0;
	font-weight: 600;
}

/* ---------- Footer ---------- */
.site-footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px 32px;
	padding: 28px 0 40px;
	border-top: var(--cw-rule);
	font-size: 15px;
	color: var(--cw-muted);
}
.site-footer a { color: var(--cw-muted); }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* ---------- Inner pages ---------- */
.page-head { padding: 64px 0 48px; }
.page-title { font-size: clamp(40px, 5vw, 72px); line-height: 1; letter-spacing: -0.04em; }
.page-head__meta { margin: 16px 0 0; font-size: 16px; color: var(--cw-muted); }

.entry-content { max-width: 760px; padding-bottom: 104px; }
.entry-content--wide { max-width: none; }
.entry-content > * { margin-top: 0; margin-bottom: 1.25em; }
.entry-content h2 { margin-top: 1.8em; margin-bottom: 0.6em; font-size: clamp(28px, 3vw, 40px); }
.entry-content h3 { margin-top: 1.6em; margin-bottom: 0.5em; font-size: 26px; }
.entry-content > h2:first-child,
.entry-content > h3:first-child { margin-top: 0; }
.entry-content ul,
.entry-content ol { padding-left: 1.2em; }
.entry-content .wp-block-image figcaption,
.entry-content .wp-element-caption { font-size: 15px; color: var(--cw-muted); }
.entry-content .alignwide,
.entry-content .alignfull { max-width: none; width: calc(100vw - (2 * var(--cw-gutter))); max-width: calc(var(--cw-max) - (2 * var(--cw-gutter))); }

/* Quotes and testimonials */
.entry-content blockquote,
.entry-content .wp-block-quote {
	margin: 0 0 56px;
	padding: 26px 0 0;
	border: 0;
	border-top: 5px solid var(--cw-accent);
	font-size: clamp(21px, 2vw, 27px);
	line-height: 1.3;
	font-weight: 650;
	letter-spacing: -0.02em;
}
.entry-content blockquote p { margin-bottom: 0.7em; }
.entry-content blockquote cite,
.entry-content .wp-block-quote cite {
	display: block;
	margin-top: 14px;
	font-size: 16px;
	font-style: normal;
	font-weight: 450;
	letter-spacing: 0;
	color: var(--cw-muted);
}

/* Gallery */
.entry-content .wp-block-gallery { margin-bottom: 72px; }
.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
	font-size: 14px;
	color: #fff;
}

/* ---------- CV ---------- */
.cv-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 64px; }
.cv-table { width: 100%; margin-bottom: 104px; border-collapse: collapse; border-top: var(--cw-rule); }
.cv-table th,
.cv-table td { padding: 18px 24px 18px 0; text-align: left; vertical-align: top; border-bottom: 1px solid #d9d2cf; }
.cv-table th { font-size: 15px; font-weight: 600; color: var(--cw-muted); }
.cv-table td:last-child,
.cv-table th:last-child { padding-right: 0; }
.cv-table__year { width: 110px; font-weight: 700; white-space: nowrap; }
.cv-table__title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.cv-table__writer { display: block; margin-top: 4px; font-size: 16px; font-weight: 450; letter-spacing: 0; color: var(--cw-muted); }
.cv-scroll { overflow-x: auto; }

/* ---------- Blog ---------- */
.post-list { margin: 0; padding: 0 0 72px; list-style: none; border-top: var(--cw-rule); }
.post-item {
	display: flex;
	flex-wrap: wrap;
	gap: 24px 48px;
	padding: 40px 0;
	border-bottom: 1px solid #d9d2cf;
}
.post-item__thumb { flex: 4 1 260px; min-width: 0; }
.post-item__thumb img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.post-item__body { flex: 8 1 420px; min-width: 0; }
.post-item__date,
.post-meta { margin: 0 0 10px; font-size: 16px; color: var(--cw-muted); }
.post-item__title { font-size: clamp(28px, 3vw, 40px); margin-bottom: 14px; }
.post-item__title a { text-decoration: none; }
.post-item__excerpt { max-width: 640px; }
.post-item__excerpt p:last-child { margin-bottom: 0; }
.post-item__more { display: inline-block; margin-top: 16px; font-weight: 700; }
.post-hero { margin: 0 0 56px; }
.post-hero img { width: 100%; max-height: 720px; object-fit: cover; }
.post-nav,
.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 16px 32px;
	padding: 28px 0 96px;
	font-weight: 700;
}
.post-nav { border-top: var(--cw-rule); }
.pagination .nav-links { justify-content: flex-start; }
.pagination .page-numbers { padding: 8px 4px; }
.pagination .current { text-decoration: underline; text-decoration-color: var(--cw-accent); text-decoration-thickness: 3px; text-underline-offset: 7px; }
.cw-admin-note {
	margin: 24px 0 0;
	padding: 12px 16px;
	border-left: 5px solid var(--cw-accent);
	background: #f6f2f0;
	font-size: 16px;
}

/* ---------- Small screens ---------- */
@media (max-width: 860px) {
	:root { --cw-gutter: 20px; }
	body { font-size: 18px; }
	.site-header { align-items: center; padding: 18px 0; }
	.nav-toggle { display: inline-flex; }
	.site-nav { flex: 1 1 100%; display: none; }
	.site-nav.is-open { display: block; }
	.site-nav ul { flex-direction: column; gap: 0; font-size: 20px; }
	.site-nav li { border-top: 1px solid #d9d2cf; }
	.site-nav a { padding: 14px 0; }
	.home-bio { padding: 40px 0 64px; }
	.home-bio__figure img { height: auto; aspect-ratio: 4 / 5; }
	.home-quote,
	.mailing { padding: 56px 0 64px; }
	.page-cards { padding-bottom: 64px; }
	.page-head { padding: 40px 0 32px; }
	.cv-table th,
	.cv-table td { padding-right: 16px; }
	.cv-table__year { width: auto; }
	.cv-table__title { font-size: 18px; }
	.cv-table th, .cv-table td { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { transition: none !important; }
}

@media print {
	.site-nav, .nav-toggle, .mailing, .cv-actions { display: none !important; }
}
