/*
Theme Name: The Piddingtons
Description: Pre-publication site for The Piddingtons by Ian Fenn.
Author: Ian Fenn
Version: 1.4.4
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: piddingtons
*/

/* Layout: cover left, summary right; then news, provisional contents and the author. The sign-up form sits in the footer of every page. */
:root {
	--ink: #0e0e0e;
	--panel: #1a1a1a;
	--rule: #2e2e2e;
	--fg: #f2f2f0;
	--muted: #a3a3a0;
	--brass: #c9b27a;
	--brass-hi: #e3cd95;
	--f-display: "Gill Sans", "Gill Sans MT", "Gill Sans Nova", "Lato", Calibri, "Trebuchet MS", sans-serif;
	--f-body: "Source Serif 4", Georgia, "Times New Roman", serif;
	--f-type: "Courier Prime", "Courier New", Courier, monospace;
	--measure: 62ch;
	--gutter-l: max(20px, env(safe-area-inset-left, 0px));
	--gutter-r: max(20px, env(safe-area-inset-right, 0px));
	color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
	margin: 0;
	background: var(--ink);
	color: var(--fg);
	font-family: var(--f-body);
	font-size: 1.125rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brass-hi); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 400; line-height: 1.05; margin: 0; text-wrap: balance; }

/* Remove WordPress's default block gaps; spacing below is set explicitly. */
.wp-site-blocks { padding: 0; }
.wp-site-blocks > * + * { margin-block-start: 0; }
.is-layout-flow > * + *, .is-layout-constrained > * + * { margin-block-start: 0; }
.wp-block-group { margin: 0; }
figure.wp-block-image { margin: 0; }

.wrap {
	max-width: 70rem;
	margin-inline: auto;
	padding-left: var(--gutter-l);
	padding-right: var(--gutter-r);
}

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .75rem 1.5rem;
	padding-block: 1rem;
}
.site-header .wordmark { font-family: var(--f-display); font-size: 1.1rem; letter-spacing: .01em; }
.site-header .wordmark a { color: var(--fg); text-decoration: none; }
.site-header .site-nav { display: flex; flex-wrap: wrap; gap: 1.25rem; font-family: var(--f-display); letter-spacing: .01em; }
.site-header .site-nav a { color: var(--muted); text-decoration: none; }
.site-header .site-nav a:hover { color: var(--fg); }
.site-header .site-nav a.nav-cta { color: var(--brass-hi); }

/* ---------- hero: cover left, summary right ---------- */
.hero .wrap {
	display: grid;
	grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
	gap: clamp(2rem, 6vw, 5rem);
	align-items: center;
	padding-block: clamp(2.5rem, 6vw, 5rem);
}
.hero .cover { min-width: 0; }
.hero .cover img {
	width: 100% !important;
	height: auto !important;
	box-shadow: 0 30px 70px -25px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .08);
}
.hero-copy { display: grid; gap: 1.1rem; min-width: 0; max-width: 38rem; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); letter-spacing: .01em; line-height: .95; }
.hero .tagline { font-family: var(--f-display); font-size: clamp(1.1rem, 2vw, 1.4rem); letter-spacing: .01em; color: var(--muted); margin-top: -.3rem; }
.hero .byline { font-family: var(--f-display); font-size: 1.1rem; letter-spacing: .01em; color: var(--brass-hi); margin-bottom: .4rem; }
.hero .summary { font-size: 1.2rem; }

/* ---------- sections ---------- */
.section { border-top: 1px solid var(--rule); }
.section > .wrap { padding-block: clamp(3rem, 7vw, 5rem); display: grid; gap: 1.75rem; }
.section h2 { font-size: clamp(2rem, 4.5vw, 2.8rem); letter-spacing: .02em; }
.prose { display: grid; gap: 1.1rem; max-width: var(--measure); }

/* ---------- news ---------- */
.news-items { list-style: none; margin: 0; padding: 0; display: grid; }
.news-items > li { border-top: 1px solid var(--rule); padding: 1.4rem 0; display: grid; gap: .45rem; align-content: start; margin: 0; }
.news-items > li:last-child { border-bottom: 1px solid var(--rule); }
.news-date { font-family: var(--f-type); font-size: .85rem; color: var(--brass); }
.news-title { font-size: 1.45rem; letter-spacing: .02em; line-height: 1.15; }
.news-index .news-title { font-size: 1.8rem; }
.news-title a { color: var(--fg); text-decoration: none; }
.news-title a:hover { color: var(--brass-hi); text-decoration: underline; }
.news-excerpt p { color: var(--muted); font-size: 1rem; }
.news-excerpt .wp-block-post-excerpt__more-text { display: none; }
.news-cats { font-family: var(--f-type); font-size: .8rem; letter-spacing: .01em; }
.news-cats a { color: var(--muted); text-decoration: none; }
.news-cats a:hover { color: var(--brass-hi); }
.news-empty { color: var(--muted); font-family: var(--f-type); font-size: .95rem; }
.news-more { font-family: var(--f-display); letter-spacing: .01em; }
.news-pages { margin-top: 2rem; font-family: var(--f-type); gap: 1rem; }

.news-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
.news-cards > li { display: grid; gap: .5rem; align-content: start; margin: 0; padding-top: 1.25rem; border-top: 2px solid var(--brass); min-width: 0; }
.news-cards .news-date { font-family: var(--f-display); font-size: .9rem; letter-spacing: .01em; color: var(--muted); }
.news-cards .news-title { font-size: 1.5rem; line-height: 1.2; }
.news-cards .news-excerpt p { font-size: 1.02rem; color: var(--muted); }

/* ---------- provisional contents ---------- */
ol.contents {
	list-style: none;
	margin: 0;
	padding: 0;
	columns: 2;
	column-gap: 3.5rem;
	font-family: var(--f-type);
	font-size: 1rem;
	counter-reset: ch;
}
ol.contents li {
	counter-increment: ch;
	break-inside: avoid;
	position: relative;
	display: block;
	padding: .5rem 0 .5rem 3.15rem;
	border-bottom: 1px dotted #3a3a3a;
	margin: 0;
}
ol.contents li::before {
	content: counter(ch, decimal-leading-zero);
	position: absolute;
	left: 0;
	top: .5rem;
	color: var(--brass);
	pointer-events: none;
	user-select: none;
}
/* In the block editor: one column, so every title is easy to click into and edit. */
ol.contents.block-editor-block-list__block { columns: 1; max-width: 40rem; }

/* ---------- footer with sign-up ---------- */
.site-footer { border-top: 1px solid var(--rule); }
.footer-signup { background: var(--panel); scroll-margin-top: 1rem; }
.signup {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
	gap: 1rem 3rem;
	align-items: center;
	padding-block: 2.25rem;
}
.signup-text { display: grid; gap: .3rem; min-width: 0; }
.signup h2 { font-size: 1.6rem; letter-spacing: .02em; }
.signup .signup-note { color: var(--muted); font-size: 1rem; }
.signup-form { min-width: 0; max-width: 36rem; }
.signup-fallback { font-family: var(--f-type); font-size: .9rem; color: var(--muted); }
.footer-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; padding-block: 1.5rem; color: var(--muted); font-size: .95rem; }
.footer-bar a { color: var(--fg); }

/* Fluent Forms: email field and button on one row, the same height.
   Works with a single email field, or the two-column "subscription" layout. */
.signup-form .fluentform,
.signup-form .fluentform form { margin: 0; }
.signup-form .fluentform fieldset { min-width: 0; }
.signup-form .fluentform p:empty,
.signup-form .fluentform fieldset > p { margin: 0; height: 0; }
.signup-form .fluentform .ff-t-container,
.signup-form .fluentform fieldset:not(:has(.ff-t-container)) {
	display: flex !important;
	flex-wrap: nowrap;
	align-items: flex-start;
	gap: .75rem !important;
	margin: 0 !important;
}
.signup-form .fluentform .ff-t-cell { padding: 0 !important; min-width: 0; }
.signup-form .fluentform .ff-t-column-1,
.signup-form .fluentform fieldset:not(:has(.ff-t-container)) > .ff-el-group:not(.ff_submit_btn_wrapper) { flex: 1 1 0 !important; width: auto !important; min-width: 0; }
.signup-form .fluentform .ff-t-column-2,
.signup-form .fluentform .ff_submit_btn_wrapper { flex: 0 0 auto !important; width: auto !important; }
.signup-form .fluentform .ff-el-group { margin: 0 !important; position: relative; }
.signup-form .fluentform .ff-el-input--label {
	position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.signup-form .fluentform .ff-el-form-control {
	display: block;
	width: 100%;
	height: 3.25rem;
	background: var(--ink);
	color: var(--fg);
	border: 1px solid #555552;
	border-radius: 0;
	box-shadow: none;
	font-family: var(--f-display);
	font-size: 1rem;
	padding: 0 1rem;
}
.signup-form .fluentform .ff-el-form-control::placeholder { color: var(--muted); opacity: 1; }
.signup-form .fluentform .ff-el-form-control:focus { background: var(--ink); color: var(--fg); border-color: var(--brass); box-shadow: inset 0 0 0 1px var(--brass); outline: none; }
.signup-form form .ff-btn.ff-btn-submit,
.signup-form form .ff-btn.ff-btn-submit.wpf_has_custom_css {
	display: block;
	height: 3.25rem;
	min-width: 0 !important;
	width: auto !important;
	margin: 0 !important;
	background: var(--brass) !important;
	color: var(--ink) !important;
	border: 0 !important;
	border-radius: 0 !important;
	font-family: var(--f-display);
	font-size: 1rem;
	letter-spacing: .01em;
	padding: 0 1.5rem !important;
	white-space: nowrap;
	box-shadow: none !important;
}
.signup-form form .ff-btn.ff-btn-submit:hover { background: var(--brass-hi) !important; color: var(--ink) !important; }
/* Error message sits under the field without pushing the row apart */
.signup-form .fluentform .error,
.signup-form .fluentform .text-danger {
	position: absolute;
	top: 100%;
	left: 0;
	margin-top: .35rem;
	color: #f0a8a0;
	font-family: var(--f-display);
	font-size: .9rem;
	white-space: nowrap;
}
.signup-form .ff-errors-in-stack:empty { display: none; }
.signup-form .ff-message-success { background: transparent; border: 1px solid var(--brass); color: var(--fg); box-shadow: none; padding: .8rem 1rem; margin: 0; }
.footer-signup .signup { padding-bottom: 2.75rem; }

/* ---------- pages, news index, single posts ---------- */
.page-body .wrap { padding-block: clamp(2.5rem, 6vw, 4rem); max-width: calc(var(--measure) + 4rem); }
.page-body h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: 1.5rem; }
.page-body .wp-block-post-content > * + * { margin-block-start: 1rem; }
.single-post .post-head { display: grid; gap: .6rem; margin-bottom: 2rem; }
.single-post .post-head h1 { margin: 0; }
.single-post .wp-block-post-content { font-size: 1.15rem; }
.single-post .wp-block-post-content h2 { font-size: 1.8rem; margin-top: 2rem; }
.single-post .wp-block-post-content blockquote { margin: 1.5rem 0; padding-left: 1.2rem; border-left: 3px solid var(--brass); }
.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; font-family: var(--f-display); }

/* ---------- responsive ---------- */
@media (max-width: 56rem) {
	.signup { grid-template-columns: minmax(0, 1fr); }
	.news-cards { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
	ol.contents { columns: 1; }
}
@media (max-width: 46rem) {
	.hero .wrap { grid-template-columns: minmax(0, 1fr); }
	.hero .cover img { width: min(60%, 14rem) !important; }
	.site-header .site-nav { gap: .9rem; }
}

/* ---------- News page: full posts ---------- */
.news-full > li { padding-block: 2rem; gap: .6rem; }
.news-full .news-body { margin-top: .6rem; font-size: 1.1rem; }
.news-full .news-body > * + * { margin-block-start: 1rem; }
.news-full .news-body blockquote { margin: 1.25rem 0; padding-left: 1.2rem; border-left: 3px solid var(--brass); }
