/*
 * The email capture's own styling.
 *
 * EVERY COLOUR HERE IS A TOKEN. The shop went near-black in the Midnight Bold
 * rebuild by repointing the custom properties rather than by editing markup,
 * and a plugin that hard-codes #fff is the one white panel on a near-black
 * page - which is exactly how the footer went olive the first time. The
 * fallbacks after each var() are the ORIGINAL pastel values on purpose: if this
 * plugin is ever run against the theme before the rebuild, it still looks
 * deliberate rather than transparent.
 *
 * The tokens used, all declared by the theme: --paper (a raised surface),
 * --ink, --plum and --plum-muted (text), --acid (the one accent), --rose
 * (links and small caps), --radius-card, --shadow-soft and --shadow-lift.
 */

/* ------------------------------------------------------ the shared form -- */

/*
 * THE MARGIN IS SYMMETRIC, AND THAT IS NOT A DETAIL.
 *
 * It was 3rem auto 0 - top only - which put the panel's bottom edge on the
 * exact pixel where the next section starts. On the home page the next section
 * is the promise band, which Midnight Bold inverts into a full-bleed CREAM
 * panel, so a dark card ran straight into a hard white edge with no dark
 * between them. It read as a break in the page rather than as two sections.
 *
 * 4rem rather than 3 because the sections around it are py-16, which is 4rem:
 * the block now keeps the page's own rhythm instead of inventing a tighter one.
 */
.lc-capture {
	margin: 4rem auto;
	max-width: 72rem;
	padding: 0 1.25rem;
}

.lc-capture-form {
	background: var(--paper, #ffffff);
	border-radius: var(--radius-card, 8px);
	box-shadow: var(--shadow-soft);
	padding: 1.75rem 1.5rem;
	text-align: center;
}

.lc-capture-heading {
	color: var(--plum, #3f2f36);
	font-family: var(--lc-display, Quicksand, sans-serif);
	font-size: 20px;
	font-weight: 600;
	line-height: 1.25;
	margin: 0;
}

.lc-capture-blurb {
	color: var(--plum-muted, #8a7a7a);
	font-size: 13px;
	line-height: 1.5;
	margin: 0.5rem auto 0;
	max-width: 34rem;
}

.lc-capture-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	margin: 1.25rem auto 0;
	max-width: 30rem;
}

/* The label is read out but not drawn: the placeholder says the same thing to
   everybody else, and a visible label doubles the height of the row on a
   phone. Not display:none, which would take it from screen readers too. */
.lc-capture-label {
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.lc-capture-input {
	background: var(--blush, #fffaf5);
	border: 1px solid var(--plum-faint, #d8c9c9);
	border-radius: 999px;
	color: var(--plum, #3f2f36);
	flex: 1 1 14rem;
	font: inherit;
	font-size: 14px;
	min-width: 0;
	padding: 0.7rem 1.1rem;
}

.lc-capture-input::placeholder {
	color: var(--plum-faint, #b5a3a3);
}

.lc-capture-input:focus-visible {
	border-color: var(--rose, #e8848f);
	outline: 2px solid var(--rose, #e8848f);
	outline-offset: 1px;
}

.lc-capture-button {
	background: var(--acid, #f2c9a0);
	border: 0;
	border-radius: 999px;
	color: var(--ink, #2b2b2b);
	cursor: pointer;
	flex: 0 0 auto;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	padding: 0.7rem 1.4rem;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lc-capture-button:hover {
	box-shadow: var(--shadow-lift);
	transform: translateY(-1px);
}

.lc-capture-button:disabled {
	cursor: default;
	opacity: 0.6;
	transform: none;
}

.lc-capture-small {
	color: var(--plum-faint, #b5a3a3);
	font-size: 11px;
	margin: 0.85rem 0 0;
}

.lc-capture-message {
	font-size: 13px;
	margin: 0.75rem 0 0;
	min-height: 1.25rem;
}

.lc-capture-message:empty {
	margin: 0;
	min-height: 0;
}

.lc-capture-message.is-error {
	color: var(--rose, #c0392b);
}

.lc-capture-message.is-working,
.lc-capture-message.is-ok {
	color: var(--plum-muted, #8a7a7a);
}

.lc-capture-done {
	color: var(--plum, #3f2f36);
	font-size: 14px;
	margin: 0;
}

/* The code itself, which is the thing they came for. Monospace so that the
   characters cannot be misread when it is copied out by hand. */
.lc-capture-code {
	background: var(--acid, #f2c9a0);
	border-radius: 6px;
	color: var(--ink, #2b2b2b);
	display: inline-block;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 20px;
	letter-spacing: 2px;
	margin: 0.6rem 0 0;
	padding: 0.45rem 0.9rem;
}

.lc-capture-note {
	color: var(--plum-muted, #8a7a7a);
	font-size: 12px;
	margin: 0.6rem 0 0;
}

/*
 * The honeypot.
 *
 * Off-screen rather than display:none or hidden. A form-filler skips a field
 * it can see is not rendered, and the whole point is that it fills this one in.
 */
.lc-capture-hp {
	height: 0;
	left: -9999px;
	overflow: hidden;
	position: absolute;
	width: 0;
}

/* ----------------------------------------------------------- the popup -- */

.lc-capture-popup {
	align-items: center;
	display: flex;
	inset: 0;
	justify-content: center;
	padding: 1.25rem;
	position: fixed;
	/*
	 * Under the cookie notice, which is at 999999 and has to be answered
	 * first. capture.js also waits for it rather than relying on this alone -
	 * the z-index is what keeps the two in the right order if they ever do
	 * overlap.
	 */
	z-index: 999000;
}

/* [hidden] is a presentation hint and loses to display:flex. Without this the
   panel is on screen from the first paint, for everybody, every visit. */
.lc-capture-popup[hidden] {
	display: none;
}

.lc-capture-popup-backdrop {
	background: rgba(0, 0, 0, 0.55);
	inset: 0;
	position: absolute;
}

.lc-capture-popup-panel {
	animation: lc-capture-in 0.25s ease-out;
	max-width: 30rem;
	position: relative;
	width: 100%;
}

.lc-capture-popup-panel .lc-capture-form {
	box-shadow: var(--shadow-lift);
	padding: 2rem 1.5rem 1.75rem;
}

.lc-capture-close {
	background: none;
	border: 0;
	color: var(--plum-muted, #8a7a7a);
	cursor: pointer;
	font-size: 26px;
	line-height: 1;
	padding: 0.25rem 0.5rem;
	position: absolute;
	right: 0.35rem;
	top: 0.35rem;
	z-index: 1;
}

.lc-capture-close:hover {
	color: var(--plum, #3f2f36);
}

/* The page behind must not scroll while the panel is up. */
body.lc-capture-open {
	overflow: hidden;
}

@keyframes lc-capture-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lc-capture-popup-panel {
		animation: none;
	}

	.lc-capture-button:hover {
		transform: none;
	}
}

/* On a phone the button goes under the field rather than beside it - at 375px
   the two side by side leave about nine characters of the address visible. */
@media (max-width: 30rem) {
	.lc-capture-input,
	.lc-capture-button {
		flex: 1 1 100%;
	}
}
