/* BMH Resources. Everything is scoped to .bmh-res-* so it cannot touch the theme.
   The theme supplies the header, the footer and every font. This file loads no font.
   BMH colours are named fallbacks: ink #120805, cream #f7f0e2, amber #f2800f.
   Amber buttons carry ink labels, because white on that amber fails AA.
   BMH's brand is square-cornered, so nothing here has rounded corners.

   Display headings (the headline, section headings, the pull line) use Aldgate Sans Wide, which the live BMH
   theme already loads as "aldgate-sans-vf-wide" (the plugin loads no font itself). Elsewhere they fall back to
   the theme's heading font. A site can set --bmh-res-display-font to choose another one. */

/* Skip link for block themes: out of sight until it has keyboard focus. */
.bmh-res-skip {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.bmh-res-skip:focus {
	position: fixed;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 100000;
	width: auto;
	height: auto;
	margin: 0;
	padding: 0.75rem 1rem;
	overflow: visible;
	clip-path: none;
	font-weight: 700;
	color: #120805;
	background: #f2800f;
	outline: 3px solid #120805;
	outline-offset: 2px;
}

main.bmh-res-main:focus {
	outline: none;
}

/* The main area is full width, so the dark and cream bands can run edge to edge. In a block theme it carries the
   alignfull class, which makes WordPress step it out of any page padding. */
.bmh-res-main {
	--bmh-res-ink: var(--bmh-ink, #120805);
	--bmh-res-cream: var(--bmh-cream, #f7f0e2);
	--bmh-res-paper: #fbf8f2;
	--bmh-res-amber: var(--bmh-amber, #f2800f);
	--bmh-res-ink-soft: #3d2c25;
	--bmh-res-on-dark: #e9dfcf;
	--bmh-res-error: #9b1c1c;
	--bmh-res-gutter: clamp(1rem, 4vw, 2.5rem);
	box-sizing: border-box;
	width: auto;
	max-width: none;
	margin: 0 0 calc(var(--wp--style--block-gap, 0px) * -1);
	padding: 0;
	overflow-wrap: anywhere;
	overflow-x: clip;
}

/* Classic themes that give the main area their own width: leave it alone. */
.bmh-res *,
.bmh-res *::before,
.bmh-res *::after {
	box-sizing: border-box;
}

/* The plain pages (master list, confirm, thank-you, notices) stay a narrow column. */
.bmh-res--narrow {
	width: 100%;
	max-width: 46rem;
	margin: 0 auto;
	padding: 1.5rem 1.25rem 3rem;
}

.bmh-res-wrap {
	width: 100%;
	max-width: 72rem;
	margin: 0 auto;
	padding: 0 var(--bmh-res-gutter);
}

.bmh-res-title {
	margin: 0 0 0.75rem;
	line-height: 1.15;
}

/* Display type: heavy and, in the live theme, wide. Weight, case and size are set here, the font comes from the theme. */
.bmh-res-display {
	font-family: var(--bmh-res-display-font, "aldgate-sans-vf-wide", "aldgate-sans-vf", var(--wp--preset--font-family--heading, system-ui), sans-serif);
	font-weight: 800;
	line-height: 1.04;
	letter-spacing: -0.01em;
	text-wrap: balance;
	color: inherit;
}

.bmh-res-intro {
	margin: 0 0 1.25rem;
	font-size: 1.125rem;
	line-height: 1.55;
}

/* ---------- Hero ---------- */
/* Centred: the headline, description and form sit in the middle over the Hero photo. The overlay is an even 50% ink.
   Hero photos are prepared dark enough behind the text, so the overlay only needs to calm them a little. The Cover image is not shown in the hero. */
.bmh-res-hero {
	position: relative;
	padding: 3rem 0 3.25rem;
	color: #fff;
	text-align: center;
	background: var(--bmh-res-ink);
}

.bmh-res-hero--photo {
	background:
		linear-gradient(rgba(18, 8, 5, 0.5), rgba(18, 8, 5, 0.5)),
		var(--bmh-res-hero-photo) center / cover no-repeat,
		var(--bmh-res-ink);
}

.bmh-res-hero-text {
	min-width: 0;
}

.bmh-res-hero .bmh-res-title {
	max-width: 18ch;
	margin: 0 auto;
	font-size: clamp(2rem, 8.5vw, 4.5rem);
	text-transform: uppercase;
}

.bmh-res-hero .bmh-res-intro {
	max-width: 38rem;
	margin: 1rem auto 0;
	font-size: 1.125rem;
	color: var(--bmh-res-on-dark);
}

/* Centred forms (the hero and the closing band) get a longer email box. */
.bmh-res-hero .bmh-res-signup,
.bmh-res-closing .bmh-res-signup {
	max-width: 40rem;
	margin-inline: auto;
}

@media (min-width: 56rem) {
	.bmh-res-hero {
		padding: 6rem 0 6.5rem;
	}

	.bmh-res-hero .bmh-res-intro {
		margin-top: 1.25rem;
		font-size: 1.1875rem;
	}
}

/* ---------- Signup form ---------- */
.bmh-res-signup {
	margin-top: 1.5rem;
	max-width: 30rem;
}

.bmh-res-field {
	margin: 0;
}

/* The label is read by screen readers but not shown. The placeholder in the box says what to type. */
.bmh-res-label {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Dark enough to read easily (about 6.5:1 on white). */
.bmh-res-input::placeholder {
	color: #6b5a52;
	opacity: 1;
}

.bmh-res-row {
	display: grid;
	gap: 0.6rem;
}

/* Classic themes style inputs and buttons with heavy selectors (Twenty Twenty-One uses
   button:not(:hover):not(:active):not(.has-background)), so the colours and edges that make these
   BMH's own, and keep them readable, are !important. It reaches only these two classes. */
.bmh-res-input {
	display: block;
	width: 100%;
	min-height: 52px;
	padding: 0.6rem 0.85rem;
	font: inherit;
	color: var(--bmh-res-ink) !important;
	background: #fff !important;
	border: 2px solid #fff !important;
	border-radius: 0 !important;
}

.bmh-res-input[aria-invalid="true"] {
	border-color: var(--bmh-res-error) !important;
}

/* Two rings, so the focus outline shows on any background: ink for light ones, cream for dark ones. */
.bmh-res-input:focus-visible,
.bmh-res-button:focus-visible {
	outline: 3px solid var(--bmh-res-ink);
	outline-offset: 3px;
	box-shadow: 0 0 0 3px var(--bmh-res-cream) !important;
}

.bmh-res-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 52px;
	padding: 0.6rem 1.4rem;
	font: inherit;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--bmh-res-ink) !important;
	background: var(--bmh-res-amber) !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	cursor: pointer;
	text-decoration: none !important;
	white-space: nowrap;
}

.bmh-res-button:hover {
	background: #ffa04a !important;
}

.bmh-res-button--link {
	width: auto;
}

@media (min-width: 30rem) {
	.bmh-res-row {
		grid-template-columns: 1fr auto;
	}

	.bmh-res-button {
		width: auto;
	}
}

/* The error is on a dark band, so it sits on white to stay readable. */
.bmh-res-error {
	margin: 0.5rem 0 0;
	font-weight: 700;
	color: var(--bmh-res-error);
}

.bmh-res-field > .bmh-res-error {
	display: block;
	padding: 0.5rem 0.75rem;
	background: #fff;
	border-left: 4px solid var(--bmh-res-error);
}

.bmh-res-error--block {
	margin: 0 0 1rem;
	padding: 0.75rem;
	background: #fff;
	border: 2px solid var(--bmh-res-error);
}

/* The errors are paragraphs, and the live theme makes every paragraph weight 300 with :root :where(p), which ties
   with a single class. Two classes keep them bold. Only the weight is set here, so the rules above still decide spacing. */
.bmh-res-signup .bmh-res-error {
	font-weight: 700;
}

.bmh-res-fine {
	margin: 0.75rem 0 0;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--bmh-res-on-dark);
}

.bmh-res-sent {
	padding: 1rem 1.1rem;
	color: var(--bmh-res-ink);
	background: var(--bmh-res-cream);
}

.bmh-res-sent p {
	margin: 0;
	font-size: 0.95rem;
}

.bmh-res-sent .bmh-res-sent-title {
	margin: 0 0 0.3rem;
	font-weight: 700;
	font-size: 1.125rem;
}

/* The honeypot: out of sight, out of the tab order, still in the page for bots. */
.bmh-res-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.bmh-res-preview-note {
	margin: 1.25rem 0;
	padding: 0.75rem 1rem;
	font-weight: 700;
	color: var(--bmh-res-ink);
	background: var(--bmh-res-cream);
	border: 2px solid var(--bmh-res-amber);
}

/* The preview note is a paragraph too, so it needs two classes to stay bold on the live theme. */
.bmh-res-wrap .bmh-res-preview-note {
	font-weight: 700;
}

.bmh-res-preview-note a {
	color: var(--bmh-res-ink);
}

/* ---------- Sections from the Landing page tab ---------- */
.bmh-res-sec {
	padding: clamp(2.5rem, 8vw, 5rem) 0;
	color: var(--bmh-res-ink);
	background: #fff;
}

.bmh-res-sec > .bmh-res-wrap > * {
	max-width: 62ch;
}

/* The sections alternate white and cream, whatever kind they are, so no two next to each other look the same. */
.bmh-res-body > .bmh-res-sec:nth-child(even) {
	background: var(--bmh-res-cream);
}

.bmh-res-sec > .bmh-res-wrap > :last-child {
	margin-bottom: 0;
}

.bmh-res-sec > .bmh-res-wrap > .bmh-res-learn,
.bmh-res-sec > .bmh-res-wrap > .bmh-res-checks,
.bmh-res-sec > .bmh-res-wrap > .bmh-res-note-grid {
	max-width: none;
}

.bmh-res-sec h2 {
	margin: 0 0 0.6rem;
	font-size: clamp(1.75rem, 5vw, 2.6rem);
}

.bmh-res-sec {
	font-size: 1.0625rem;
	line-height: 1.55;
}

.bmh-res-sec p {
	margin: 0 0 1rem;
	font-size: 1.0625rem;
	line-height: 1.55;
}

.bmh-res-sec h2 + p {
	font-size: 1.125rem;
	color: var(--bmh-res-ink-soft);
}

.bmh-res-sec a {
	color: var(--bmh-res-ink);
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.bmh-res-sec img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 1.25rem 0;
}

.bmh-res-sec ul,
.bmh-res-sec ol {
	padding-left: 1.5rem;
}

.bmh-res-sec hr {
	margin: 1.75rem 0;
	border: 0;
	border-top: 2px solid var(--bmh-res-ink);
}

.bmh-res-callout {
	margin: 1.25rem 0;
	padding: 1rem;
	color: var(--bmh-res-ink);
	background: var(--bmh-res-cream);
}

.bmh-res-callout p:last-child {
	margin-bottom: 0;
}

/* The opening text, with the Cover image beside it from 56rem. */
.bmh-res-sec--intro .bmh-res-intro-grid {
	display: grid;
	gap: 2.5rem;
	align-items: center;
}

/* Only the first paragraph is large. Any after it are normal body text. */
.bmh-res-sec--intro .bmh-res-intro-text > p:first-child {
	font-size: clamp(1.3rem, 2.6vw, 1.75rem);
	font-weight: 500;
	line-height: 1.35;
	color: var(--bmh-res-ink);
}

.bmh-res-sec--intro .bmh-res-intro-text > :last-child {
	margin-bottom: 0;
}

.bmh-res-cover {
	width: 100%;
	max-width: 32rem;
	margin: 0;
}

.bmh-res-sec .bmh-res-cover img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
}

.bmh-res-cover-note {
	margin: 0.9rem 0 0;
	font-size: 0.9375rem;
	font-weight: 700;
	color: var(--bmh-res-ink-soft);
}

@media (min-width: 56rem) {
	.bmh-res-sec--intro .bmh-res-intro-grid {
		grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
		gap: 4.5rem;
	}
}

/* What you'll learn: a ruled list, not cards. */
.bmh-res-sec .bmh-res-learn {
	display: grid;
	column-gap: 3.5rem;
	margin: 2rem 0 0;
	padding: 0;
	list-style: none;
}

.bmh-res-learn > li {
	position: relative;
	padding: 1.15rem 0 1.15rem 1.6rem;
	border-top: 2px solid var(--bmh-res-ink);
}

.bmh-res-learn > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 1.55rem;
	width: 0.6rem;
	height: 0.6rem;
	background: var(--bmh-res-amber);
}

.bmh-res-learn strong {
	display: block;
	font-weight: 700;
	font-size: 1.1875rem;
	line-height: 1.3;
}

.bmh-res-learn span {
	display: block;
	font-size: 1.0625rem;
	margin-top: 0.25rem;
	color: var(--bmh-res-ink-soft);
}

@media (min-width: 48rem) {
	.bmh-res-sec .bmh-res-learn {
		grid-template-columns: 1fr 1fr;
	}
}

/* Laurence's note */

.bmh-res-note-grid {
	display: grid;
	gap: 2rem;
	align-items: center;
}

.bmh-res-note-quote {
	margin: 0;
	padding: 0;
	border: 0;
	color: var(--bmh-res-ink);
}

/* Curly quote marks show it is Laurence speaking: a large amber opening mark above, a closing one after. */
.bmh-res-sec .bmh-res-pull::before {
	content: "\201C";
	display: block;
	height: 0.55em;
	font-size: 2.6em;
	line-height: 1;
	color: var(--bmh-res-amber);
}

.bmh-res-sec .bmh-res-pull::after {
	content: "\201D";
}

/* The pull line is a paragraph, and the live theme makes every paragraph weight 300 with :root :where(p), which ties
   with a single class. Two classes keep it heavy. */
.bmh-res-sec .bmh-res-pull {
	margin: 0;
	font-weight: 800;
	font-size: clamp(1.6rem, 4.6vw, 2.5rem);
	line-height: 1.05;
	text-transform: uppercase;
	color: var(--bmh-res-ink);
}

.bmh-res-note-body {
	max-width: 62ch;
	margin-top: 1.4rem;
}

/* The live theme pads every footer element at the sides, which pushed the name in. */
.bmh-res-sec .bmh-res-note-by {
	margin-top: 1.25rem;
	padding: 0;
	font-weight: 800;
	font-size: 0.9rem;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--bmh-res-ink);
}

.bmh-res-sec img.bmh-res-note-photo {
	display: block;
	order: -1;
	width: 9rem;
	max-width: 100%;
	aspect-ratio: 1 / 1;
	margin: 0;
	object-fit: cover;
	object-position: center 20%;
}

@media (min-width: 56rem) {
	.bmh-res-note-grid--photo {
		grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
		gap: 4rem;
	}

	.bmh-res-sec img.bmh-res-note-photo {
		order: 0;
		width: 100%;
		max-width: 22rem;
		aspect-ratio: 4 / 5;
	}
}

/* For you if */

.bmh-res-sec .bmh-res-checks {
	display: grid;
	gap: 1.25rem 3.5rem;
	margin: 2rem 0 0;
	padding: 0;
	list-style: none;
}

.bmh-res-checks > li {
	display: grid;
	grid-template-columns: 1.75rem 1fr;
	gap: 0.75rem;
	align-items: start;
}

/* The tick is decoration only: an amber square with an ink tick, drawn in CSS. */
.bmh-res-tick {
	position: relative;
	display: block;
	width: 1.75rem;
	height: 1.75rem;
	background: var(--bmh-res-amber);
}

.bmh-res-tick::after {
	content: "";
	position: absolute;
	left: 0.55rem;
	top: 0.28rem;
	width: 0.5rem;
	height: 0.9rem;
	border: solid var(--bmh-res-ink);
	border-width: 0 3px 3px 0;
	transform: rotate(40deg);
}

.bmh-res-checks strong {
	display: block;
	font-weight: 700;
	font-size: 1.125rem;
}

.bmh-res-checks span:not(.bmh-res-tick) {
	font-size: 1.0625rem;
}

.bmh-res-checks span:not(.bmh-res-tick) {
	color: var(--bmh-res-ink-soft);
}

@media (min-width: 48rem) {
	.bmh-res-sec .bmh-res-checks {
		grid-template-columns: 1fr 1fr;
	}
}

/* ---------- Closing band ---------- */
.bmh-res-closing {
	padding: clamp(2.5rem, 8vw, 5rem) 0;
	color: #fff;
	text-align: center;
	background: var(--bmh-res-ink);
}

.bmh-res-closing h2 {
	max-width: 44rem;
	margin: 0 auto;
	font-size: clamp(1.9rem, 5.5vw, 3rem);
	text-transform: uppercase;
}

/* ---------- Plain pages ---------- */
.bmh-res-thanks-title {
	margin: 1.5rem 0 0.5rem;
}

.bmh-res--narrow a:not(.bmh-res-button) {
	color: inherit;
}

/* Master list */
.bmh-res-list {
	display: grid;
	gap: 1.5rem;
	margin: 1.5rem 0 0;
	padding: 0;
	list-style: none;
}

.bmh-res-card {
	display: grid;
	gap: 0.75rem;
}

.bmh-res-card-picture {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
}

.bmh-res-card-title {
	margin: 0 0 0.375rem;
	font-size: 1.375rem;
	line-height: 1.25;
}

.bmh-res-card-desc {
	margin: 0;
}

.bmh-res-empty {
	margin: 1.5rem 0 0;
	font-size: 1.125rem;
}

@media (min-width: 40rem) {
	.bmh-res-card--pic {
		grid-template-columns: 12rem 1fr;
		align-items: start;
	}
}
