/* ==========================================================================
   Email Hub — Front-end Form Styles
   ========================================================================== */

/* Container */
.email-hub-wrap {
	/* Auto-detect site accent color via CSS custom property chain.
	   Covers: Gutenberg presets, GeneratePress, Astra, OceanWP, Kadence, Neve, Divi, and others.
	   Only overridden by an inline style when the user sets a custom color in plugin settings. */
	--eh-btn-color: var(
		--wp--preset--color--primary,
		var(--global-palette1,
		var(--primary-color,
		var(--color-primary,
		var(--accent-color,
		var(--theme-color,
		var(--button-bg,
		#111111))))))
	);
	--eh-btn-text-color: #ffffff;
	--eh-border-color: #e2e6ea;
	--eh-border-width: 1px;
	background-color: #f8f9fa;
	border: var(--eh-border-width) solid var(--eh-border-color);
	border-radius: 8px;
	padding: 10px 14px 12px;
	margin: 8px 0;
	position: relative;
	box-sizing: border-box;
	display: block;
	align-self: flex-start;
	width: 100%;
	font-family: inherit;
}

/* Title */
.email-hub-title {
	font-size: 1.1rem;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0 0 8px !important;
	padding: 0 !important;
	line-height: 1.3;
	border: none;
	text-align: center;
}

/* Description */
.email-hub-description {
	font-size: 0.875rem;
	color: #555;
	margin: 0 0 8px !important;
	line-height: 1.4;
	text-align: center;
}

/* The form element itself */
.email-hub-form {
	margin: 0 0 8px !important;
	padding: 0;
}

/* Input row: email + button side by side */
.email-hub-input-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: stretch;
}

/* Email input */
.email-hub-email-input {
	flex: 1 1 200px;
	min-width: 0;
	padding: 10px 14px;
	font-size: 0.95rem;
	border: 1px solid #ccd0d4;
	border-radius: 0 !important;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	box-sizing: border-box;
	background: #ffffff;
	color: #333;
	line-height: 1.4;
}

.email-hub-email-input:focus {
	border-color: var(--eh-btn-color);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--eh-btn-color) 20%, transparent);
}

.email-hub-email-input::placeholder {
	color: #aab;
}

/* Submit button */
.email-hub-submit-btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	font-size: 0.95rem;
	font-weight: 600;
	border: none;
	border-radius: 0;
	cursor: pointer;
	background-color: var(--eh-btn-color);
	color: var(--eh-btn-text-color);
	transition: filter 0.15s ease, opacity 0.15s ease;
	white-space: nowrap;
	line-height: 1.4;
	box-sizing: border-box;
}

.email-hub-submit-btn:hover:not(:disabled) {
	filter: brightness(1.1);
}

.email-hub-submit-btn:active:not(:disabled) {
	filter: brightness(0.95);
}

.email-hub-submit-btn:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

/* Spinner inside button */
.email-hub-spinner {
	display: none;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: email-hub-spin 0.7s linear infinite;
	flex-shrink: 0;
}

.email-hub-submit-btn.is-loading .email-hub-spinner {
	display: inline-block;
}

@keyframes email-hub-spin {
	to { transform: rotate(360deg); }
}

/* Checkbox rows */
.email-hub-checkbox-row {
	margin-top: 8px;
	font-size: 0.9rem;
	color: #444;
	line-height: 1.4;
}

.email-hub-checkbox-row label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	cursor: pointer;
}

.email-hub-checkbox-row input[type="checkbox"] {
	margin: 2px 0 0;
	flex-shrink: 0;
	cursor: pointer;
}

/* Response area */
.email-hub-response {
	display: none;
	margin-top: 14px;
	padding: 10px 14px;
	border-radius: 5px;
	font-size: 0.95rem;
	line-height: 1.5;
	font-weight: 500;
}

.email-hub-response.email-hub-success {
	display: block;
	background-color: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.email-hub-response.email-hub-error {
	display: block;
	background-color: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

/* ==========================================================================
   Focus overlay — dims the page when hovering over the form
   ========================================================================== */

/* The overlay div injected by JS */
.email-hub-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
	z-index: 9990;
}

/* When focus mode is active: show overlay */
.email-hub-focus-mode .email-hub-overlay {
	opacity: 1;
}

/* Lift the form above the overlay */
.email-hub-focus-mode .email-hub-wrap {
	position: relative;
	z-index: 9991;
}

/* Honeypot — always visually hidden */
.email-hub-hp {
	position: absolute !important;
	left: -9999px !important;
	height: 0 !important;
	overflow: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* Input shrinks gracefully so the button always stays in the same row */
.email-hub-email-input {
	min-width: 0;
}

/* ==========================================================================
   Responsive — tighten padding on mobile but keep input + button on same row
   ========================================================================== */
@media (max-width: 600px) {
	.email-hub-wrap {
		padding: 12px 14px 14px;
	}
}
