/* ==========================================================================
   Email list signup ("The Storm Log") — inc/subscribe.php, js/subscribe.js
   .sbcom-subscribe--footer : full-width dark band above the footer credits
   .sbcom-subscribe--inline : [sbcom_subscribe] inside page content
   ========================================================================== */

.sbcom-subscribe {
	--sub-accent: #fd513b;
	--sub-accent-hover: #ff6a55;
	--sub-bg: #000;
	--sub-field: #141414;
	--sub-line: #3a3a3a;
	--sub-title: #fff;
	--sub-text: #b8b8b8;
	--sub-muted: #8a8a8a;
	--sub-success: #6fd39a;

	/* Native controls (field fill, autofill dropdown, caret) render dark. */
	color-scheme: dark;
	position: relative;
	padding: 72px 20px 64px;
	background-color: var(--sub-bg);
	color: var(--sub-text);
	font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
	text-align: center;
	overflow: hidden;
	isolation: isolate;
}

.sbcom-subscribe *,
.sbcom-subscribe *::before,
.sbcom-subscribe *::after {
	box-sizing: border-box;
}

/* A faint storm-light glow behind the copy, plus a hairline to separate the
   band from the Instagram strip / page above. */
.sbcom-subscribe--footer::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		radial-gradient(60% 80% at 50% 0%, rgba(253, 81, 59, 0.16), transparent 70%),
		linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent) top / 100% 1px no-repeat;
}

.sbcom-subscribe__inner {
	max-width: 620px;
	margin: 0 auto;
}

.sbcom-subscribe__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 14px;
	font-family: 'Rajdhani', 'Roboto', sans-serif;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--sub-accent);
}

.sbcom-subscribe__title {
	margin: 0 0 14px;
	padding: 0;
	font-family: 'Rajdhani', 'Roboto', sans-serif;
	font-size: clamp(30px, 5vw, 46px);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: 0.01em;
	text-transform: none;
	color: var(--sub-title);
}

.sbcom-subscribe__text {
	margin: 0 auto 28px;
	max-width: 52ch;
	font-size: 16px;
	line-height: 1.6;
	color: var(--sub-text);
}

/* ---------- Form ---------- */

.sbcom-subscribe__form {
	margin: 0;
}

.sbcom-subscribe__fields {
	display: flex;
	gap: 10px;
	max-width: 520px;
	margin: 0 auto;
}

.sbcom-subscribe .sbcom-subscribe__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 54px;
	margin: 0;
	padding: 0 18px;
	border: 1px solid var(--sub-line);
	border-radius: 4px;
	background: var(--sub-field);
	background-color: var(--sub-field) !important; /* beat theme/plugin input rules */
	color: #fff;
	-webkit-text-fill-color: #fff;
	font-family: inherit;
	font-size: 16px; /* 16px+ stops iOS zooming on focus */
	line-height: 1;
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.sbcom-subscribe .sbcom-subscribe__input--name {
	flex: 0 1 38%;
}

.sbcom-subscribe .sbcom-subscribe__input::placeholder {
	color: var(--sub-muted);
	opacity: 1;
}

.sbcom-subscribe .sbcom-subscribe__input:focus {
	outline: none;
	border-color: var(--sub-accent);
	box-shadow: 0 0 0 3px rgba(253, 81, 59, 0.3);
}

/* Browser autofill (Chrome/Safari/Edge, and picking a saved email) paints the
   field light blue/yellow/white over our dark fill, leaving white text on a
   white field. Cover it with an inset shadow and force the text colour. */
.sbcom-subscribe .sbcom-subscribe__input:-webkit-autofill,
.sbcom-subscribe .sbcom-subscribe__input:-webkit-autofill:hover,
.sbcom-subscribe .sbcom-subscribe__input:-webkit-autofill:focus,
.sbcom-subscribe .sbcom-subscribe__input:autofill {
	-webkit-text-fill-color: #fff;
	caret-color: #fff;
	box-shadow: 0 0 0 1000px var(--sub-field) inset;
	transition: background-color 9999s ease-out 0s;
}

.sbcom-subscribe .sbcom-subscribe__input:-webkit-autofill:focus {
	box-shadow: 0 0 0 1000px var(--sub-field) inset, 0 0 0 3px rgba(253, 81, 59, 0.3);
}

.sbcom-subscribe .sbcom-subscribe__input[aria-invalid='true'] {
	border-color: #ff8a7a;
}

/* Rajdhani 700 at 19px counts as large text, so white on the accent passes
   WCAG AA (3:1). */
.sbcom-subscribe .sbcom-subscribe__button {
	position: relative;
	flex: 0 0 auto;
	height: 54px;
	margin: 0;
	padding: 0 26px;
	border: 0;
	border-radius: 4px;
	background: var(--sub-accent);
	color: #fff;
	font-family: 'Rajdhani', 'Roboto', sans-serif;
	font-size: 19px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1;
	text-transform: uppercase;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: 0 6px 20px -8px rgba(253, 81, 59, 0.7);
	transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.sbcom-subscribe .sbcom-subscribe__button:hover {
	background: var(--sub-accent-hover);
	transform: translateY(-1px);
	box-shadow: 0 10px 24px -8px rgba(253, 81, 59, 0.8);
}

.sbcom-subscribe .sbcom-subscribe__button:active {
	transform: translateY(0);
}

.sbcom-subscribe .sbcom-subscribe__button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

/* Loading: keep the button's width, swap the label for a spinner. */
.sbcom-subscribe__spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 20px;
	margin: -10px 0 0 -10px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	opacity: 0;
}

.sbcom-subscribe.is-loading .sbcom-subscribe__button {
	cursor: progress;
	transform: none;
}

.sbcom-subscribe.is-loading .sbcom-subscribe__button-label {
	visibility: hidden;
}

.sbcom-subscribe.is-loading .sbcom-subscribe__spinner {
	opacity: 1;
	animation: sbcom-sub-spin 0.7s linear infinite;
}

@keyframes sbcom-sub-spin {
	to { transform: rotate(360deg); }
}

.sbcom-subscribe__fine {
	margin: 14px 0 0;
	font-size: 13px;
	line-height: 1.5;
	color: var(--sub-muted);
}

.sbcom-subscribe__fine a {
	color: var(--sub-muted);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.sbcom-subscribe__fine a:hover,
.sbcom-subscribe__fine a:focus {
	color: #fff;
}

/* Honeypot: off-screen, not display:none (some bots skip hidden fields). */
.sbcom-subscribe__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* style.css has #colophon p { margin-bottom: 15px }; restore this
   component's spacing inside the footer. */
#colophon .sbcom-subscribe__eyebrow { margin-bottom: 14px; }
#colophon .sbcom-subscribe__text { margin-bottom: 28px; }
#colophon .sbcom-subscribe__fine,
#colophon .sbcom-subscribe__status { margin-bottom: 0; }

/* ---------- Status / success ---------- */

.sbcom-subscribe__status {
	margin: 0;
	font-size: 15px;
	line-height: 1.5;
}

.sbcom-subscribe__status:empty {
	display: none;
}

.sbcom-subscribe__status.is-error {
	margin-top: 14px;
	color: #ff8a7a;
}

.sbcom-subscribe__status.is-success {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: 4px;
	padding: 14px 20px;
	border: 1px solid rgba(111, 211, 154, 0.35);
	border-radius: 4px;
	background: rgba(111, 211, 154, 0.08);
	color: #fff;
	font-size: 16px;
	text-align: left;
	animation: sbcom-sub-in 0.35s ease both;
}

.sbcom-subscribe__status.is-success::before {
	content: '';
	flex: 0 0 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--sub-success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='5 12.5 10 17 19 7'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.sbcom-subscribe.is-done .sbcom-subscribe__form {
	display: none;
}

@keyframes sbcom-sub-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

/* ---------- Inline variant (shortcode inside page content) ---------- */

.sbcom-subscribe--inline {
	margin: 48px 0;
	padding: 48px 28px;
	border-radius: 6px;
	background:
		radial-gradient(70% 90% at 50% 0%, rgba(253, 81, 59, 0.18), transparent 70%),
		#0b0b0b;
}

.sbcom-subscribe--inline .sbcom-subscribe__title {
	font-size: clamp(26px, 4vw, 36px);
}

/* ---------- Small screens ---------- */

@media (max-width: 560px) {
	.sbcom-subscribe {
		padding: 56px 16px 48px;
	}

	.sbcom-subscribe--inline {
		padding: 40px 20px;
	}

	.sbcom-subscribe__fields {
		flex-direction: column;
	}

	.sbcom-subscribe .sbcom-subscribe__input,
	.sbcom-subscribe .sbcom-subscribe__input--name,
	.sbcom-subscribe .sbcom-subscribe__button {
		flex: 0 0 auto;
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sbcom-subscribe *,
	.sbcom-subscribe *::before {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition: none !important;
	}

	.sbcom-subscribe.is-loading .sbcom-subscribe__spinner {
		animation: none;
		border-color: #fff;
	}
}
