/*
Theme Name:   Flynn 2
Theme URI:    https://warrenflynn.com
Author:       Warren Flynn
Description:  A quiet block theme for a crime novelist. Linen and oxblood, Bodoni display over Newsreader body, and a 660px measure built for reading long prose. No page builder.
Version:      1.3.2
Requires at least: 6.5
Tested up to: 6.8
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:  flynn
Tags:         blog, one-column, custom-colors, block-patterns, full-site-editing
*/

:root {
	--flynn-rule: var(--wp--preset--color--rule);
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

a {
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}

:where(a:focus-visible),
:where(button:focus-visible) {
	outline: 2px solid var(--wp--preset--color--oxblood);
	outline-offset: 3px;
}

.entry-content p + p {
	margin-top: 1.4em;
}

.wf-eyebrow {
	font-family: var(--wp--preset--font-family--utility);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--oxblood);
}

.wf-rule {
	border: 0;
	border-top: 1px solid var(--flynn-rule);
	margin: 0;
}

/* ---------------------------------------------------------------------------
 * Keep reading
 * ------------------------------------------------------------------------ */

.wf-related {
	margin-top: var(--wp--preset--spacing--60);
	padding-top: var(--wp--preset--spacing--40);
	border-top: 1px solid var(--wp--preset--color--rule);
}

.wf-related__title {
	margin: 0 0 1em;
}

.wf-related__lead {
	margin: 0 0 1.2em;
	color: var(--wp--preset--color--ink-soft);
}

.wf-related__list {
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: var(--wp--preset--font-family--utility);
	font-size: var(--wp--preset--font-size--small);
}

.wf-related__list li {
	padding: 0.4em 0;
	border-bottom: 1px solid var(--wp--preset--color--rule);
}

.wf-related__list a {
	text-decoration: none;
}

.wf-related__list a:hover {
	text-decoration: underline;
}

.wf-related__all {
	margin-top: var(--wp--preset--spacing--30);
	font-family: var(--wp--preset--font-family--utility);
	font-size: var(--wp--preset--font-size--small);
}

.wf-related__newsletter {
	margin-top: var(--wp--preset--spacing--40);
	padding-top: var(--wp--preset--spacing--30);
	border-top: 1px solid var(--wp--preset--color--rule);
	color: var(--wp--preset--color--ink-soft);
}

/* ---------------------------------------------------------------------------
 * Table of contents
 *
 * Generated at render time from the post's own headings, and only on posts
 * with enough structure to need one. Quiet by design: it is a signpost before
 * the piece, not part of it.
 * ------------------------------------------------------------------------ */

.wf-toc {
	background: var(--wp--preset--color--paper-recessed);
	border-radius: 2px;
	padding: var(--wp--preset--spacing--40);
	margin-bottom: var(--wp--preset--spacing--50);
}

.wf-toc__title {
	margin: 0 0 0.8em;
}

.wf-toc__list {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: wf-toc;
	font-family: var(--wp--preset--font-family--utility);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
}

.wf-toc__item {
	counter-increment: wf-toc;
	margin: 0;
	padding: 0.35em 0;
}

.wf-toc__item::before {
	content: counter(wf-toc) ".";
	color: var(--wp--preset--color--ink-muted);
	margin-right: 0.6em;
	font-variant-numeric: tabular-nums;
}

.wf-toc__item--h3 {
	padding-left: 1.4em;
}

.wf-toc__item a {
	text-decoration: none;
}

.wf-toc__item a:hover {
	text-decoration: underline;
}

/*
 * Anchored headings otherwise land flush against the top of the viewport.
 */
.entry-content h2,
.entry-content h3,
.wp-block-post-content h2,
.wp-block-post-content h3 {
	scroll-margin-top: var(--wp--preset--spacing--40);
}

/*
 * Deliberately outside the reduced-motion block below, which switches this
 * back to auto for anyone who asks for less movement.
 */
html {
	scroll-behavior: smooth;
}

/*
 * Standfirst: the intro line under a story title. These arrived from the old
 * site inside heading widgets, which set 200-word blurbs in display Bodoni.
 * They are prose, so they are set as prose -- just larger and quieter than
 * the body copy that follows.
 */
.wf-standfirst {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.5;
	color: var(--wp--preset--color--ink-soft);
	margin-bottom: var(--wp--preset--spacing--50);
}

.wf-cover img {
	display: block;
	width: 100%;
	height: auto;
}

/*
 * Availability badge. Outlined rather than filled so it reads as a label
 * and never competes with the oxblood buy buttons.
 */
.wf-badge {
	display: inline-block;
	margin: 0;
	padding: 0.25em 0.7em;
	border: 1px solid var(--wp--preset--color--rule);
	border-radius: 2px;
	font-family: var(--wp--preset--font-family--utility);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1.6;
	color: var(--wp--preset--color--ink-soft);
}

.wf-badge--available {
	border-color: var(--wp--preset--color--oxblood);
	color: var(--wp--preset--color--oxblood);
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

.wf-retailers {
	font-family: var(--wp--preset--font-family--utility);
	font-size: var(--wp--preset--font-size--small);
	line-height: 2.2;
}

.wf-retailers span {
	color: var(--wp--preset--color--ink-muted);
	margin: 0 0.35em;
}

/* ---------------------------------------------------------------------------
 * Past letters archive
 * ------------------------------------------------------------------------ */

.wf-letter + .wf-letter {
	border-top: 1px solid var(--wp--preset--color--rule);
	margin-top: var(--wp--preset--spacing--30);
	padding-top: var(--wp--preset--spacing--30);
}

.wf-letter p {
	margin: 0;
}

.wf-letter .wf-eyebrow {
	margin-bottom: 0.2em;
}

/* ---------------------------------------------------------------------------
 * Contact form
 * ------------------------------------------------------------------------ */

.wf-contact-form {
	max-width: 560px;
	margin-top: var(--wp--preset--spacing--50);
}

.wf-contact-field {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	margin: 0 0 var(--wp--preset--spacing--40);
}

.wf-contact-field label {
	font-family: var(--wp--preset--font-family--utility);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-soft);
}

.wf-contact-field input,
.wf-contact-field textarea {
	width: 100%;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.6;
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--paper-recessed);
	border: 1px solid var(--wp--preset--color--rule);
	border-radius: 2px;
	padding: 0.65rem 0.85rem;
}

.wf-contact-field textarea {
	resize: vertical;
}

.wf-contact-field input:focus-visible,
.wf-contact-field textarea:focus-visible {
	outline: 2px solid var(--wp--preset--color--oxblood);
	outline-offset: 2px;
	border-color: var(--wp--preset--color--ink-soft);
}

/*
 * Off-screen rather than display:none -- a bot reading the markup should
 * still see a field worth filling in.
 */
.wf-contact-honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.wf-contact-notice {
	font-family: var(--wp--preset--font-family--utility);
	font-size: var(--wp--preset--font-size--small);
	border-left: 2px solid var(--wp--preset--color--oxblood);
	padding: 0.6rem 0 0.6rem 1rem;
	margin-top: var(--wp--preset--spacing--40);
}

.wf-contact-notice ul {
	margin: 0;
	padding-left: 1.1em;
}

.wf-contact-notice--sent {
	border-left-color: var(--wp--preset--color--ink-soft);
	color: var(--wp--preset--color--ink-soft);
}

/* ---------------------------------------------------------------------------
 * MailerLite embedded form
 *
 * MailerLite injects its own stylesheet with high specificity and inline
 * widths, so a handful of !important declarations are the honest way to
 * reclaim the form. Everything below only resets it to the theme's own
 * tokens -- no new visual language is introduced.
 * ------------------------------------------------------------------------ */

.ml-embedded {
	max-width: 460px;
}

.ml-embedded .ml-form-embedContainer,
.ml-embedded .ml-form-embedWrapper {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	width: 100% !important;
	max-width: 100% !important;
}

.ml-embedded .ml-form-embedBody {
	padding: 0 !important;
}

/* The heading and copy live in the pattern, not the embed. */
.ml-embedded .ml-form-embedContent {
	display: none !important;
}

.ml-embedded input[type="email"],
.ml-embedded input[type="text"] {
	font-family: var(--wp--preset--font-family--utility) !important;
	font-size: var(--wp--preset--font-size--small) !important;
	color: var(--wp--preset--color--ink) !important;
	background: var(--wp--preset--color--paper-recessed) !important;
	border: 1px solid var(--wp--preset--color--rule) !important;
	border-radius: 2px !important;
	padding: 0.7rem 0.9rem !important;
	height: auto !important;
}

.ml-embedded input::placeholder {
	color: var(--wp--preset--color--ink-muted) !important;
	opacity: 1;
}

.ml-embedded input:focus-visible {
	outline: 2px solid var(--wp--preset--color--oxblood);
	outline-offset: 2px;
	border-color: var(--wp--preset--color--ink-soft) !important;
}

.ml-embedded button.primary,
.ml-embedded .ml-form-embedSubmit button {
	font-family: var(--wp--preset--font-family--utility) !important;
	font-size: var(--wp--preset--font-size--small) !important;
	font-weight: 500 !important;
	letter-spacing: 0.04em;
	background: var(--wp--preset--color--oxblood) !important;
	color: var(--wp--preset--color--paper) !important;
	border: 0 !important;
	border-radius: 2px !important;
	padding: 0.7rem 1.5rem !important;
	height: auto !important;
	transition: background-color 0.15s ease;
}

.ml-embedded button.primary:hover,
.ml-embedded .ml-form-embedSubmit button:hover {
	background: var(--wp--preset--color--ink) !important;
}

/*
 * Colours are set in the MailerLite form designer, not here: the form now
 * ships linen, ink and oxblood to match the site, so the old pile of colour
 * overrides is gone.
 *
 * One exception. The "You can unsubscribe anytime" line is an unclassed <p>
 * that MailerLite hard-codes to #ffffff at id-level specificity, and no
 * setting in the designer changes it -- the Confirmation/Privacy control
 * governs a different element. White on linen is 1.15:1, so it has to be
 * overridden here, and it needs an id to outrank theirs.
 */
.ml-embedded #mlb2-24958447.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody > p,
.ml-embedded #mlb2-24958447.ml-form-embedContainer .ml-form-embedWrapper p {
	color: var(--wp--preset--color--ink-soft) !important;
}

.ml-embedded #mlb2-24958447.ml-form-embedContainer .ml-form-embedWrapper p a {
	color: var(--wp--preset--color--oxblood) !important;
	text-decoration: underline;
}

/*
 * The button is correct in the form designer, but MailerLite's CDN is still
 * serving the old #b91c1c and has been inconsistent about it -- four samples
 * in a row came back red after one came back oxblood. These stay until the
 * cache settles; check with:
 *
 *   the rule for  #mlb2-24958447 ... .ml-form-horizontalRow button
 *
 * in devtools. Once it reads #6E2B26 on repeated loads, delete this block.
 */
.ml-embedded #mlb2-24958447.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow button,
.ml-embedded #mlb2-24958447.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit button {
	background-color: var(--wp--preset--color--oxblood) !important;
	color: var(--wp--preset--color--paper) !important;
}

.ml-embedded #mlb2-24958447.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow button:hover,
.ml-embedded #mlb2-24958447.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit button:hover {
	background-color: var(--wp--preset--color--ink) !important;
}

/* Success and error states after submission. */
.ml-embedded .ml-form-successBody {
	padding: 0 !important;
}

.ml-embedded .ml-form-successContent h4,
.ml-embedded .ml-form-successContent p {
	font-family: var(--wp--preset--font-family--body) !important;
	color: var(--wp--preset--color--ink) !important;
}

.ml-embedded .ml-error input {
	border-color: var(--wp--preset--color--oxblood) !important;
}
