/* ============================================================
   Form Sonic - Popup Email Collector styles
   Three templates (classic / spotlight / boldbar) driven by the
   same markup + CSS custom properties set inline by PHP:
   --fsp-bg, --fsp-headline, --fsp-subtext, --fsp-caption,
   --fsp-accent, --fsp-radius, --fsp-overlay
   Desktop: centered overlay. Under 600px: slide-up banner with
   the page still visible and interactive behind it.
   ============================================================ */

.fsonic-popup-root {
	position: fixed;
	inset: 0;
	z-index: 2147483000; /* above any theme header/sticky nav */
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

/* The display:flex above would silently defeat the [hidden] attribute
   (class beats the UA's [hidden] rule), so guard it explicitly - same
   theme-proof pattern the form CSS uses for its toast/honeypot. */
.fsonic-popup-root[hidden] { display: none !important; }

.fsonic-popup-backdrop {
	position: absolute;
	inset: 0;
	background: var(--fsp-overlay, rgba(0, 0, 0, 0.6));
	opacity: 0;
	transition: opacity 0.25s ease;
}

.fsonic-popup-dialog {
	position: relative;
	background: var(--fsp-bg, #efefef);
	border-radius: var(--fsp-radius, 14px);
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
	width: 100%;
	max-width: 620px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	outline: none;
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.fsonic-popup-root.is-open .fsonic-popup-backdrop { opacity: 1; }
.fsonic-popup-root.is-open .fsonic-popup-dialog {
	opacity: 1;
	transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
	.fsonic-popup-backdrop,
	.fsonic-popup-dialog {
		transition: none !important;
		transform: none !important;
	}
}

/* ── Close button (44px touch target) ── */
.fsonic-popup-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.08);
	color: #444;
	border: none;
	border-radius: 10px;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	z-index: 2;
	padding: 0;
}
.fsonic-popup-close:hover { background: rgba(0, 0, 0, 0.16); }

/* ── Shared content pieces ── */
.fsonic-popup-body { padding: 40px 36px 32px; }

.fsonic-popup-headline {
	color: var(--fsp-headline, #c8102e);
	font-size: 29px;
	font-weight: 800;
	text-align: center;
	line-height: 1.15;
	margin: 0 0 12px;
	/* keep clear of the close button */
	padding: 0 34px;
}

.fsonic-popup-subtext {
	color: var(--fsp-subtext, #1f2937);
	font-size: 19px;
	font-weight: 700;
	text-align: center;
	line-height: 1.35;
	margin: 0 0 22px;
}

.fsonic-popup-caption {
	color: var(--fsp-caption, #c8102e);
	font-weight: 700;
	font-size: 15px;
	text-align: center;
	margin-top: 8px;
}

.fsonic-popup-img {
	width: 150px;
	height: 150px;
	max-width: 150px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

/* The embedded Form Sonic form keeps its own appearance settings;
   just make it fill its column cleanly inside the popup. */
.fsonic-popup-formcol .formsonic-form { margin: 0 auto; }

/* ── Template: Classic (form left, image right) ── */
.fsonic-tpl-classic .fsonic-popup-row {
	display: flex;
	align-items: center;
	gap: 26px;
}
.fsonic-tpl-classic .fsonic-popup-formcol { flex: 1; min-width: 0; }
.fsonic-tpl-classic .fsonic-popup-imgcol {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 0 0 auto;
}

/* ── Template: Spotlight (image hero band, stacked) ── */
.fsonic-tpl-spotlight .fsonic-popup-dialog { max-width: 440px; }
.fsonic-tpl-spotlight .fsonic-popup-hero {
	/* solid fallback first: older browsers without color-mix() keep it */
	background: var(--fsp-accent, #1e3a5f);
	background: linear-gradient(135deg, var(--fsp-accent, #1e3a5f), color-mix(in srgb, var(--fsp-accent, #1e3a5f) 72%, #ffffff));
	border-radius: var(--fsp-radius, 14px) var(--fsp-radius, 14px) 0 0;
	padding: 32px 24px 22px;
	display: flex;
	flex-direction: column;
	align-items: center;
}
.fsonic-tpl-spotlight .fsonic-popup-hero .fsonic-popup-caption { color: #ffd34d; }
.fsonic-tpl-spotlight .fsonic-popup-body { padding: 26px 30px 30px; }
.fsonic-tpl-spotlight .fsonic-popup-headline { font-size: 26px; }
.fsonic-tpl-spotlight .fsonic-popup-subtext { font-size: 16px; }
.fsonic-tpl-spotlight .fsonic-popup-close {
	background: rgba(255, 255, 255, 0.25);
	color: #fff;
}
.fsonic-tpl-spotlight .fsonic-popup-close:hover { background: rgba(255, 255, 255, 0.4); }

/* ── Template: Bold Bar (no image, accent card) ── */
.fsonic-tpl-boldbar .fsonic-popup-dialog {
	max-width: 640px;
	background: var(--fsp-accent, #1e3a5f);
}
.fsonic-tpl-boldbar .fsonic-popup-body { padding: 38px 40px 32px; }
.fsonic-tpl-boldbar .fsonic-popup-subtext { margin-bottom: 20px; }
.fsonic-tpl-boldbar .fsonic-popup-close {
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
}
.fsonic-tpl-boldbar .fsonic-popup-close:hover { background: rgba(255, 255, 255, 0.32); }

/* ══════════════════════════════════════════════════════════
   Mobile (under 600px): slide-up banner. No dimmed backdrop,
   page behind stays visible AND interactive (root itself
   ignores clicks; only the banner receives them). Image,
   caption, hero band and subtext are dropped - headline +
   form + button only, per the approved mockup.
   ══════════════════════════════════════════════════════════ */
@media (max-width: 599px) {
	.fsonic-popup-root {
		align-items: flex-end;
		padding: 0 8px 8px;
		pointer-events: none;
	}
	.fsonic-popup-backdrop { display: none; }

	.fsonic-popup-dialog {
		pointer-events: auto;
		max-width: 100%;
		max-height: 80vh;
		transform: translateY(100%);
		box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
	}
	.fsonic-popup-root.is-open .fsonic-popup-dialog { transform: translateY(0); }

	/* Specificity must beat the desktop template rules
	   (.fsonic-tpl-classic .fsonic-popup-imgcol { display:flex } etc.) */
	.fsonic-popup-root .fsonic-popup-hero,
	.fsonic-popup-root .fsonic-popup-subtext,
	.fsonic-popup-root .fsonic-popup-imgcol { display: none; }

	.fsonic-popup-body,
	.fsonic-tpl-spotlight .fsonic-popup-body,
	.fsonic-tpl-boldbar .fsonic-popup-body { padding: 18px 16px 16px; }

	.fsonic-popup-headline,
	.fsonic-tpl-spotlight .fsonic-popup-headline {
		font-size: 17px;
		margin-bottom: 12px;
		padding: 0 30px;
	}

	.fsonic-tpl-classic .fsonic-popup-row { display: block; }

	.fsonic-popup-close {
		top: 8px;
		right: 8px;
		width: 38px;
		height: 38px;
		font-size: 15px;
	}
}
