@charset "UTF-8";
/* ==========================================================================
   The opt-in form
   --------------------------------------------------------------------------
   Redesigned for the brutalist grid. The MARKUP and the submit/validation
   logic are unchanged — every class, name, id and data attribute the handler
   and optin-form.js rely on is the same — so this file only restyles what is
   already there.

   The form appears in four contexts, each with a different ground:
     - the sidebar's inverted subscribe panel  (.panel--subscribe)
     - the violet newsletter band              (.st-optin--on-accent)
     - the modal                               (.st-modal)
     - page content, via [st_optin_form]       (the off-white ground)

   So the base rules are written for the light ground and each context
   restates only the values that must change. Tokens come from main.css;
   there are no local colours here.

   The email field and the submit button form ONE unit: the field's right
   border is dropped and the button butts against it, which is how every
   input/action pair in this design is built.
   ========================================================================== */

.st-optin {
	display: grid;
	gap: 0.75rem;
}

/* ── The honeypot ────────────────────────────────────────────────────────
   Hidden with CSS rather than type=hidden, so bots still fill it. It must
   stay off-screen rather than display:none — some bots skip undisplayed
   fields, which would defeat the trap. */
.st-optin__hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ── The email field ─────────────────────────────────────────────────────── */
.st-optin__field { display: grid; }

.st-optin__input {
	width: 100%;
	padding: 0.875rem 1rem;
	border: var(--hair) solid var(--ink);
	background: var(--surface-raise);
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
	letter-spacing: 0.02em;
	color: var(--ink);
	transition: border-color var(--dur) var(--ease);
}

.st-optin__input::placeholder {
	/* A placeholder is text a reader has to be able to read, so it takes the
	   text grey rather than the decorative -600 used for rules and marks. */
	color: var(--ink-500);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.st-optin__input:focus-visible {
	border-color: var(--accent);
	/* The border already moves to the accent, so the outline sits inside the
	   box rather than doubling the ring outside it. */
	outline-offset: -3px;
}

/* The invalid state only paints once the field has been touched: styling
   :invalid outright would flag an empty field the reader has not reached. */
.st-optin__input:user-invalid {
	border-color: var(--accent-deep);
}

/* ── The consent checkbox ────────────────────────────────────────────────── */
.st-optin__consent-label {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.625rem;
	align-items: start;
	cursor: pointer;
}

.st-optin__checkbox {
	appearance: none;
	-webkit-appearance: none;
	flex: none;
	width: 1.0625rem;
	height: 1.0625rem;
	margin: 0.1rem 0 0;
	border: var(--hair) solid var(--ink);
	background: var(--surface-raise);
	display: grid;
	place-content: center;
	cursor: pointer;
	transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

/* The tick, drawn with a clip-path rather than a glyph so it scales with the
   box and inherits the ground's colour. */
.st-optin__checkbox::before {
	content: "";
	width: 0.625rem;
	height: 0.625rem;
	background: currentColor;
	transform: scale(0);
	transition: transform var(--dur) var(--ease);
	clip-path: polygon(14% 44%, 0 60%, 40% 100%, 100% 18%, 84% 4%, 38% 68%);
}

.st-optin__checkbox:checked {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--surface-raise);
}

.st-optin__checkbox:checked::before { transform: scale(1); }

.st-optin__consent-text {
	font-size: var(--fs-xs);
	line-height: 1.5;
	color: var(--ink-400);
}

/* The consent block needs air beneath it. Without this the submit button butts
   straight against the legal sentence and the two read as one block — and this
   is the one piece of copy on the form a reader has to be able to take in
   separately before acting on it. */
.st-optin__consent {
	margin-bottom: 0.5rem;
}

.st-optin__consent-text a {
	color: var(--ink);
	text-decoration: underline;
	text-decoration-thickness: var(--hair);
	text-underline-offset: 0.18em;
}

.st-optin__consent-text a:hover,
.st-optin__consent-text a:focus-visible { color: var(--accent); }

/* ── Per-field errors ────────────────────────────────────────────────────
   optin-form.js marks the offending .st-optin__field with .has-error and
   appends a .st-optin__field-error note inside it. Both are set by JS, so
   they never appear on a first render. */
.st-optin__field.has-error .st-optin__input,
.st-optin__field.has-error .st-optin__checkbox {
	border-color: var(--accent-deep);
}

.st-optin__field-error {
	margin-top: 0.375rem;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--accent-deep);
}

.panel--subscribe .st-optin__field.has-error .st-optin__input,
.panel--subscribe .st-optin__field.has-error .st-optin__checkbox,
.st-optin--on-accent .st-optin__field.has-error .st-optin__input,
.st-optin--on-accent .st-optin__field.has-error .st-optin__checkbox {
	border-color: var(--lime);
}

.panel--subscribe .st-optin__field-error,
.st-optin--on-accent .st-optin__field-error {
	color: var(--lime);
}

/* ── The loading and done states ─────────────────────────────────────────
   .is-loading rides on the form while the request is out; .is-done lands on
   a successful submit. Both are set by optin-form.js. */
.st-optin.is-loading { cursor: progress; }

.st-optin.is-done .st-optin__field,
.st-optin.is-done .st-optin__submit {
	/* The submit succeeded: the fields are spent, and leaving them live
	   invites a second submission of the same address. */
	display: none;
}

/* ── The submit button ───────────────────────────────────────────────────── */
.st-optin__submit {
	padding: 0.875rem 1.25rem;
	border: var(--hair) solid var(--ink);
	background: var(--ink);
	color: var(--ground);
	font-family: var(--font-mono);
	font-size: var(--fs-micro);
	font-weight: 600;
	letter-spacing: var(--track-eyebrow);
	text-transform: uppercase;
	transition: background var(--dur) var(--ease),
	            color var(--dur) var(--ease),
	            border-color var(--dur) var(--ease);
}

.st-optin__submit:hover:not(:disabled),
.st-optin__submit:focus-visible:not(:disabled) {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--surface-raise);
}

.st-optin__submit:disabled {
	opacity: 0.55;
	cursor: progress;
}

/* ── The status message ──────────────────────────────────────────────────
   Empty until the handler answers, so it must collapse to nothing rather
   than reserving a blank row under the button. */
.st-optin__message:empty { display: none; }

.st-optin__message {
	padding: 0.6875rem 0.875rem;
	border: var(--hair) solid var(--line);
	font-family: var(--font-mono);
	font-size: var(--fs-micro);
	line-height: 1.5;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ink);
	background: var(--surface-raise);
}

/* The states optin-form.js sets. */
.st-optin__message.is-success {
	border-color: var(--ink);
	background: var(--lime);
	color: var(--ink);
}

.st-optin__message.is-error {
	border-color: var(--accent);
	background: var(--accent-soft);
	color: var(--accent-deep);
}

/* ── The footer: the legal entity, its address, the support address ──────
   These three lines come from the toolkit shortcodes and are required on
   commercial email, so they are set small but never hidden. */
.st-optin__footer {
	display: grid;
	gap: 0.2rem;
	padding-top: 0.625rem;
	border-top: var(--hair) solid var(--line-soft);
	font-family: var(--font-mono);
	font-size: 0.75rem;
	line-height: 1.5;
	letter-spacing: 0.04em;
	color: var(--ink-500);
}

.st-optin__company {
	font-weight: 600;
	text-transform: uppercase;
	color: var(--ink-400);
}

.st-optin__support {
	color: var(--ink-500);
	text-decoration: none;
	justify-self: start;
}

.st-optin__support:hover,
.st-optin__support:focus-visible {
	color: var(--accent);
	text-decoration: underline;
}

/* ── Context: the sidebar's inverted subscribe panel ─────────────────────── */
.panel--subscribe .st-optin__input {
	border-color: var(--line-dark);
	background: rgba(255, 255, 255, 0.05);
	color: var(--on-dark);
}

.panel--subscribe .st-optin__input::placeholder { color: var(--on-dark-dim); }

.panel--subscribe .st-optin__input:focus-visible { border-color: var(--lime); }

.panel--subscribe .st-optin__checkbox {
	border-color: var(--line-dark);
	background: rgba(255, 255, 255, 0.05);
}

.panel--subscribe .st-optin__checkbox:checked {
	background: var(--lime);
	border-color: var(--lime);
	color: var(--ink);
}

.panel--subscribe .st-optin__consent-text { color: var(--on-dark-dim); }
.panel--subscribe .st-optin__consent-text a { color: var(--on-dark); }
.panel--subscribe .st-optin__consent-text a:hover { color: var(--lime); }

.panel--subscribe .st-optin__submit {
	background: var(--lime);
	border-color: var(--lime);
	color: var(--ink);
}

.panel--subscribe .st-optin__submit:hover:not(:disabled),
.panel--subscribe .st-optin__submit:focus-visible:not(:disabled) {
	background: var(--on-dark);
	border-color: var(--on-dark);
	color: var(--ink);
}

.panel--subscribe .st-optin__message {
	border-color: var(--line-dark);
	background: rgba(255, 255, 255, 0.05);
	color: var(--on-dark);
}

.panel--subscribe .st-optin__footer {
	border-top-color: var(--line-dark-soft);
	color: var(--on-dark-faint);
}

.panel--subscribe .st-optin__company { color: var(--on-dark-dim); }
.panel--subscribe .st-optin__support { color: var(--on-dark-faint); }
.panel--subscribe .st-optin__support:hover { color: var(--lime); }

/* ── Context: the violet newsletter band ────────────────────────────────
   The ground is already the accent, so violet cannot carry the action here.
   The field goes white, the button goes near-black, and lime takes focus. */
.st-optin--on-accent .st-optin__input {
	border-color: var(--surface-raise);
	background: var(--surface-raise);
	color: var(--ink);
}

.st-optin--on-accent .st-optin__input:focus-visible {
	border-color: var(--lime);
	outline-color: var(--lime);
}

.st-optin--on-accent .st-optin__checkbox {
	border-color: var(--surface-raise);
	background: rgba(255, 255, 255, 0.18);
}

.st-optin--on-accent .st-optin__checkbox:checked {
	background: var(--lime);
	border-color: var(--lime);
	color: var(--ink);
}

.st-optin--on-accent .st-optin__consent-text { color: rgba(255, 255, 255, 0.82); }
.st-optin--on-accent .st-optin__consent-text a { color: var(--surface-raise); }
.st-optin--on-accent .st-optin__consent-text a:hover { color: var(--lime); }

.st-optin--on-accent .st-optin__submit {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--surface-raise);
}

.st-optin--on-accent .st-optin__submit:hover:not(:disabled),
.st-optin--on-accent .st-optin__submit:focus-visible:not(:disabled) {
	background: var(--lime);
	border-color: var(--lime);
	color: var(--ink);
}

.st-optin--on-accent .st-optin__message {
	border-color: var(--surface-raise);
	background: rgba(255, 255, 255, 0.12);
	color: var(--surface-raise);
}

.st-optin--on-accent .st-optin__message.is-success {
	background: var(--lime);
	border-color: var(--ink);
	color: var(--ink);
}

.st-optin--on-accent .st-optin__message.is-error {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--surface-raise);
}

.st-optin--on-accent .st-optin__footer {
	border-top-color: rgba(255, 255, 255, 0.22);
	color: rgba(255, 255, 255, 0.66);
}

.st-optin--on-accent .st-optin__company { color: rgba(255, 255, 255, 0.82); }
.st-optin--on-accent .st-optin__support { color: rgba(255, 255, 255, 0.66); }
.st-optin--on-accent .st-optin__support:hover { color: var(--lime); }

/* ── The modal ──────────────────────────────────────────────────────────── */
.st-modal {
	position: fixed;
	inset: 0;
	z-index: 400;
	display: grid;
	place-items: center;
	padding: clamp(1rem, 4vw, 2rem);
}

/* The PHP prints the wrapper with a `hidden` attribute and optin-form.js
   toggles it (`modal.hidden = false/true`).

   This `display:grid` is stronger than the `hidden` attribute's own
   `display:none`, so it DEPENDS on the `[hidden] { display:none !important }`
   rule in main.css's reset to stay closable. Do not remove that rule, and do
   not add a `display` here that assumes otherwise. */
.st-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 10, 10, 0.72);
}

.st-modal__dialog {
	position: relative;
	width: min(30rem, 100%);
	max-height: 90vh;
	overflow-y: auto;
	display: grid;
	gap: 0.875rem;
	padding: clamp(1.25rem, 3vw, 2rem);
	background: var(--ground);
	border: var(--hair) solid var(--ink);
}

.st-modal__close {
	position: absolute;
	top: 0.625rem;
	right: 0.625rem;
	width: 2rem;
	height: 2rem;
	display: grid;
	place-items: center;
	border: var(--hair) solid var(--line);
	background: none;
	font-family: var(--font-mono);
	font-size: 1.125rem;
	line-height: 1;
	color: var(--ink);
	transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.st-modal__close:hover,
.st-modal__close:focus-visible {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--ground);
}

.st-modal__kicker {
	font-family: var(--font-mono);
	font-size: var(--fs-micro);
	font-weight: 600;
	letter-spacing: var(--track-eyebrow);
	text-transform: uppercase;
	color: var(--accent);
}

.st-modal__title {
	font-family: var(--font-display);
	font-weight: 800;
	font-stretch: 112%;
	font-size: var(--fs-h2);
	line-height: 0.92;
	letter-spacing: var(--track-tighter);
	text-transform: uppercase;
	color: var(--ink);
	/* Clear of the close button, which is absolutely positioned over this
	   corner. */
	padding-right: 2.25rem;
}

.st-modal__sub {
	font-size: var(--fs-sm);
	line-height: 1.55;
	color: var(--ink-400);
}

/* The body lock, set while the modal is open so the page behind it does not
   scroll under the dialog. */
body.st-modal-open { overflow: hidden; }

/* ── Wide contexts ───────────────────────────────────────────────────────
   Where the form has room — the newsletter band, a page body — the field and
   the button share a row as one welded unit. In the sidebar and the modal
   the column is too narrow and they stay stacked. */
@media (min-width: 560px) {
	.st-optin--on-accent .st-optin,
	.entry-content .st-optin {
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 0;
		align-items: start;
	}

	/* The field and button occupy row 1; the consent block, message and
	   footer each span both columns beneath them. */
	.st-optin--on-accent .st-optin__input,
	.entry-content .st-optin__input {
		/* The button butts directly against the field — no seam, one unit. */
		border-right: 0;
	}

	.st-optin--on-accent .st-optin__consent,
	.st-optin--on-accent .st-optin__message,
	.st-optin--on-accent .st-optin__footer,
	.entry-content .st-optin__consent,
	.entry-content .st-optin__message,
	.entry-content .st-optin__footer {
		grid-column: 1 / -1;
		margin-top: 0.75rem;
	}
}
