/* Bricks Blocks – the plugin's own signup page, in the Scout-In27 house style.
 *
 * One column on one colour, loaded on top of newsletter-signup.css. The page prints
 * --bb-sp-bg, --bb-sp-btn and the text colours that read best on them.
 *
 * The page always fits the screen without scrolling: sizes follow the screen height
 * (--bb-sp-h, 1% of it) between a minimum and the full design size. Only if the text
 * is too long for that does the middle part scroll, so nothing can get cut off.
 *
 * wp_head() brings the site's own CSS (Bricks' colours and sizes for h1, p, ...), so
 * every rule here that matters sets its value itself, with two classes to beat it.
 *
 * The fonts are bundled (assets/fonts, SIL Open Font License): this page doesn't get
 * the theme's fonts, and fetching them from Google would send every visitor's IP
 * address there before any cookie choice.
 */

@font-face {
	font-family: "Geologica";
	src: url("fonts/geologica.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Poppins";
	src: url("fonts/poppins-400.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

html {
	-webkit-text-size-adjust: 100%;
	height: 100%;
	background: var(--bb-sp-bg);
}

html body.bb-signup-page {
	--bb-sp-h: 1vh;
	--bb-sp-pad: clamp(14px, calc(3.4 * var(--bb-sp-h)), 32px);
	--bb-sp-control: clamp(44px, calc(7 * var(--bb-sp-h)), 56px);

	/* A column: whatever wp_footer() adds as a normal element takes its own room below
	 * the content, instead of pushing the page past the bottom of the screen. */
	display: flex;
	flex-direction: column;
	height: 100vh;
	margin: 0;
	padding: 0;
	overflow: hidden;
	background: var(--bb-sp-bg);
	color: var(--bb-sp-fg);
	font-family: "Poppins", "Segoe UI", system-ui, sans-serif;
	font-size: clamp(14px, calc(2.3 * var(--bb-sp-h)), 17px);
	font-weight: 400;
	line-height: 1.5;
}

/* The part of the screen that stays visible with the browser's bars showing. */
@supports (height: 100svh) {
	html body.bb-signup-page {
		--bb-sp-h: 1svh;
		height: 100svh;
	}
}

/* The pillar colours, as a thin strip along the top. */
.bb-signup-page .bb-signup-page__strip {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1;
	height: 6px;
}

.bb-signup-page .bb-signup-page__center {
	box-sizing: border-box;
	display: flex;
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: max(var(--bb-sp-pad), env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(var(--bb-sp-pad), env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}

/* margin:auto rather than align-items:center: if this ever scrolls, the top stays reachable. */
.bb-signup-page .bb-signup-page__inner {
	width: 100%;
	max-width: 480px;
	margin: auto;
	overflow-wrap: break-word;
}

.bb-signup-page .bb-signup-page__logo {
	display: block;
	width: auto;
	max-width: 100%;
	height: clamp(44px, calc(13 * var(--bb-sp-h)), 96px);
	margin: 0 0 clamp(8px, calc(3 * var(--bb-sp-h)), 28px);
	padding: 0;
	border: 0;
}

.bb-signup-page .bb-signup-page__heading {
	margin: 0 0 clamp(6px, calc(1.6 * var(--bb-sp-h)), 14px);
	padding: 0;
	color: var(--bb-sp-fg);
	font-family: "Geologica", "Segoe UI", system-ui, sans-serif;
	font-size: clamp(22px, min(9vw, calc(5.4 * var(--bb-sp-h))), 44px);
	font-weight: 900;
	letter-spacing: normal;
	line-height: 1.1;
	text-align: left;
	text-transform: uppercase;
	text-wrap: balance;
}

.bb-signup-page .bb-signup-page__text {
	margin: 0 0 clamp(10px, calc(3 * var(--bb-sp-h)), 28px);
	padding: 0;
	color: var(--bb-sp-fg);
	font: inherit;
	line-height: 1.5;
	text-align: left;
}

.bb-signup-page .bb-signup-page__note {
	margin: clamp(8px, calc(2 * var(--bb-sp-h)), 18px) 0 0;
	padding: 0;
	color: var(--bb-sp-fg);
	font-family: inherit;
	font-size: clamp(12px, calc(1.8 * var(--bb-sp-h)), 14px);
	line-height: 1.4;
	opacity: 0.85;
	text-align: left;
}

.bb-signup-page .bb-signup-page__note a {
	color: inherit;
	text-decoration: underline;
}

/* wp_footer() may print the site's Bricks popups, and the theme CSS that hides them
 * isn't loaded here. */
.bb-signup-page .brx-popup {
	display: none !important;
}

/* ---------- The form ---------- */
.bb-signup-page .bb-newsletter {
	max-width: none;
	margin: 0;
	padding: 0;
}

.bb-signup-page .bb-newsletter__form,
.bb-signup-page .bb-newsletter__group {
	gap: clamp(6px, calc(1.2 * var(--bb-sp-h)), 10px);
}

/* 16px keeps iOS from zooming the page in when the field gets focus. */
.bb-signup-page .bb-newsletter__field {
	height: var(--bb-sp-control);
	min-height: 0;
	margin: 0;
	padding: 0 20px;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 999px;
	background-color: #ffffff;
	color: #222222;
	font-family: "Poppins", "Segoe UI", system-ui, sans-serif;
	font-size: 16px;
	line-height: 1.4;
}

/* Bold 19px is "large text", which is what makes white on the house green readable enough. */
.bb-signup-page .bb-newsletter__button {
	height: var(--bb-sp-control);
	min-height: 0;
	margin: 0;
	padding: 0 28px;
	border: 0;
	border-radius: 999px;
	background-color: var(--bb-sp-btn);
	color: var(--bb-sp-btn-fg);
	font-family: "Geologica", "Segoe UI", system-ui, sans-serif;
	font-size: 19px;
	font-weight: 700;
	letter-spacing: normal;
	line-height: 1;
	text-transform: none;
}

.bb-signup-page .bb-newsletter__button:hover,
.bb-signup-page .bb-newsletter__button:focus {
	background-color: var(--bb-sp-btn);
	color: var(--bb-sp-btn-fg);
}

.bb-signup-page .bb-newsletter__field:focus-visible,
.bb-signup-page .bb-newsletter__button:focus-visible {
	outline: 3px solid var(--bb-sp-fg);
	outline-offset: 2px;
}

/* In the flow rather than floating: nothing may cover the note below it. */
.bb-signup-page .bb-newsletter__message {
	position: static;
	color: #ffffff;
	font-size: 15px;
}

/* After signing up only the thank-you remains. */
.bb-newsletter--done .bb-newsletter__group {
	display: none;
}

@media (max-width: 480px) {
	.bb-signup-page .bb-newsletter__group {
		flex-direction: column;
		align-items: stretch;
	}
}
