/*!
 * Emotio Pop Up — front-end styles
 * All visual values come from CSS custom properties written by PHP,
 * so every popup on a page can look completely different.
 */

/* ---------------------------------------------------------------- Tokens */
.emotio-popup {
	--ep-ease: cubic-bezier(0.32, 0.72, 0, 1);
	--ep-ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
	--ep-duration: 420ms;
	--ep-safe: 20px;
	--ep-bg-size: cover;
	--ep-bg-pos: center center;

	position: fixed;
	inset: 0;
	z-index: var(--ep-z, 999999);
	pointer-events: none;
}

.emotio-popup[hidden] {
	display: none;
}

/* ------------------------------------------------------------- Overlay */
.emotio-popup__overlay {
	position: absolute;
	inset: 0;
	background: var(--ep-overlay-bg, rgba(0, 0, 0, 0.45));
	-webkit-backdrop-filter: var(--ep-overlay-blur, none);
	backdrop-filter: var(--ep-overlay-blur, none);
	opacity: 0;
	pointer-events: var(--ep-overlay-events, auto);
	transition: opacity var(--ep-duration) var(--ep-ease);
	will-change: opacity;
}

.emotio-popup.is-open .emotio-popup__overlay {
	opacity: 1;
}

.emotio-popup--no-overlay .emotio-popup__overlay {
	pointer-events: none;
}

/* ------------------------------------------------------- Position frame */
.emotio-popup__wrap {
	overscroll-behavior: contain; /* 1.4.1: wheel and touch momentum stay inside the pop-up */
	position: absolute;
	inset: 0;
	display: flex;
	padding: max(var(--ep-offset-y, 24px), var(--ep-safe)) max(var(--ep-offset-x, 24px), var(--ep-safe));
	pointer-events: none;
}

.emotio-popup--pos-center .emotio-popup__wrap {
	align-items: center;
	justify-content: center;
	padding: var(--ep-safe);
}

.emotio-popup--pos-top-left .emotio-popup__wrap { align-items: flex-start; justify-content: flex-start; }
.emotio-popup--pos-top-center .emotio-popup__wrap { align-items: flex-start; justify-content: center; }
.emotio-popup--pos-top-right .emotio-popup__wrap { align-items: flex-start; justify-content: flex-end; }
.emotio-popup--pos-middle-left .emotio-popup__wrap { align-items: center; justify-content: flex-start; }
.emotio-popup--pos-middle-right .emotio-popup__wrap { align-items: center; justify-content: flex-end; }
.emotio-popup--pos-bottom-left .emotio-popup__wrap { align-items: flex-end; justify-content: flex-start; }
.emotio-popup--pos-bottom-center .emotio-popup__wrap { align-items: flex-end; justify-content: center; }
.emotio-popup--pos-bottom-right .emotio-popup__wrap { align-items: flex-end; justify-content: flex-end; }

.emotio-popup--pos-fullscreen .emotio-popup__wrap {
	padding: 0;
}

/* ----------------------------------------------------------- The dialog */
.emotio-popup__box {
	position: relative;
	box-sizing: border-box;
	width: var(--ep-width, 480px);
	max-width: 100%;
	height: var(--ep-height, auto);
	max-height: var(--ep-max-height, 85vh);
	padding: var(--ep-padding, 40px);

	display: flex;
	flex-direction: column;

	background: var(--ep-bg, #fff);
	background-size: var(--ep-bg-size);
	background-position: var(--ep-bg-pos);
	background-repeat: no-repeat;
	-webkit-backdrop-filter: var(--ep-backdrop, none);
	backdrop-filter: var(--ep-backdrop, none);

	border: var(--ep-border, 0 solid transparent);
	border-radius: var(--ep-radius, 20px);
	box-shadow: var(--ep-shadow, none);
	color: var(--ep-text, #1d1d1f);
	font-size: var(--ep-font-size, inherit);

	pointer-events: auto;
	opacity: 0;
	transition:
		opacity var(--ep-duration) var(--ep-ease),
		transform var(--ep-duration) var(--ep-ease);
	will-change: opacity, transform;
	-webkit-font-smoothing: antialiased;
}

.emotio-popup--pos-fullscreen .emotio-popup__box {
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	border-radius: 0;
	align-items: center;
	justify-content: center;
}

/* A takeover reads as a poster, not a document: hold the copy to a
   comfortable measure and centre it in the viewport. */
.emotio-popup--pos-fullscreen .emotio-popup__content,
.emotio-popup--pos-fullscreen .emotio-popup__suppress {
	width: 100%;
	max-width: 620px;
	flex: 0 1 auto;
}

.emotio-popup__box:focus {
	outline: none;
}

.emotio-popup__box:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

.emotio-popup.is-open .emotio-popup__box {
	opacity: 1;
	transform: none;
}

/* ------------------------------------------------------ Entry animations */
.emotio-popup--in-fade .emotio-popup__box { transform: none; }
.emotio-popup--in-scale .emotio-popup__box { transform: scale(0.94); }
.emotio-popup--in-spring .emotio-popup__box {
	transform: scale(0.9) translateY(12px);
	transition-timing-function: var(--ep-ease-spring);
}
.emotio-popup--in-slide-up .emotio-popup__box { transform: translateY(32px); }
.emotio-popup--in-slide-down .emotio-popup__box { transform: translateY(-32px); }
.emotio-popup--in-slide-left .emotio-popup__box { transform: translateX(40px); }
.emotio-popup--in-slide-right .emotio-popup__box { transform: translateX(-40px); }
.emotio-popup--in-flip .emotio-popup__box {
	transform: perspective(1200px) rotateX(12deg) scale(0.96);
	transform-origin: center bottom;
}

/* ------------------------------------------------------- Exit animations */
.emotio-popup.is-closing .emotio-popup__overlay { opacity: 0; }
.emotio-popup.is-closing .emotio-popup__box { opacity: 0; }
.emotio-popup--out-scale.is-closing .emotio-popup__box { transform: scale(0.96); }
.emotio-popup--out-slide-up.is-closing .emotio-popup__box { transform: translateY(-24px); }
.emotio-popup--out-slide-down.is-closing .emotio-popup__box { transform: translateY(24px); }
.emotio-popup--out-slide-left.is-closing .emotio-popup__box { transform: translateX(-32px); }
.emotio-popup--out-slide-right.is-closing .emotio-popup__box { transform: translateX(32px); }

/* --------------------------------------------------------- Close button */
.emotio-popup__close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;

	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;

	box-sizing: border-box;
	width: var(--ep-close-size, 32px);
	height: var(--ep-close-size, 32px);
	padding: 0;
	margin: 0;

	background: var(--ep-close-bg, rgba(0, 0, 0, 0.06));
	color: var(--ep-close-color, #1d1d1f);
	border: 0;
	border-radius: var(--ep-close-radius, 50%);

	font: inherit;
	line-height: 1;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;

	transition: background-color 200ms var(--ep-ease), transform 200ms var(--ep-ease), opacity 200ms var(--ep-ease);
}

.emotio-popup__close:hover {
	background: var(--ep-close-bg-hover, rgba(0, 0, 0, 0.12));
	transform: scale(1.06);
}

.emotio-popup__close:active {
	transform: scale(0.94);
}

.emotio-popup__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.emotio-popup__close[hidden] {
	display: none;
}

.emotio-popup__close-icon {
	width: var(--ep-close-icon-size, 14px);
	height: var(--ep-close-icon-size, 14px);
	display: block;
}

.emotio-popup__close-text {
	padding: 0 4px;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: -0.01em;
	white-space: nowrap;
}

/* Close button variants */
.emotio-popup--close-glass .emotio-popup__close {
	-webkit-backdrop-filter: blur(14px) saturate(180%);
	backdrop-filter: blur(14px) saturate(180%);
	box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.28);
}

.emotio-popup--close-minimal .emotio-popup__close {
	background: transparent;
	opacity: 0.55;
}

.emotio-popup--close-minimal .emotio-popup__close:hover {
	background: transparent;
	opacity: 1;
}

.emotio-popup--close-label .emotio-popup__close {
	width: auto;
	height: auto;
	padding: 7px 14px;
	border-radius: 999px;
}

/* Placement: floating just outside the card */
.emotio-popup--close-outside .emotio-popup__close {
	top: calc(var(--ep-close-size, 32px) * -1 - 12px);
	right: 0;
	-webkit-backdrop-filter: blur(14px) saturate(180%);
	backdrop-filter: blur(14px) saturate(180%);
}

.emotio-popup--close-outside.emotio-popup--close-top-left .emotio-popup__close {
	right: auto;
	left: 0;
}

/* Corner: top-left, inside */
.emotio-popup--close-inside.emotio-popup--close-top-left .emotio-popup__close {
	right: auto;
	left: 14px;
}

/* ------------------------------------------------------------- Content */
.emotio-popup__content {
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

/* Themes routinely add their own box metrics to content elements — Salient,
   for one, gives every <p> 25px of bottom PADDING and every <img> 15px of
   vertical margin. Left alone that stacks up into big unexplained gaps that
   the editor never shows you. Reset the spacing here (at a specificity the
   theme cannot beat) while still inheriting its typography and colours. */
.emotio-popup .emotio-popup__content p,
.emotio-popup .emotio-popup__content h1,
.emotio-popup .emotio-popup__content h2,
.emotio-popup .emotio-popup__content h3,
.emotio-popup .emotio-popup__content h4,
.emotio-popup .emotio-popup__content h5,
.emotio-popup .emotio-popup__content h6,
.emotio-popup .emotio-popup__content ul,
.emotio-popup .emotio-popup__content ol,
.emotio-popup .emotio-popup__content figure,
.emotio-popup .emotio-popup__content blockquote,
.emotio-popup .emotio-popup__content img {
	padding: 0;
}

.emotio-popup .emotio-popup__content > *:first-child { margin-top: 0; }
.emotio-popup .emotio-popup__content > *:last-child { margin-bottom: 0; }

.emotio-popup .emotio-popup__content h1,
.emotio-popup .emotio-popup__content h2,
.emotio-popup .emotio-popup__content h3,
.emotio-popup .emotio-popup__content h4,
.emotio-popup .emotio-popup__content h5,
.emotio-popup .emotio-popup__content h6 {
	margin: 0 0 0.4em;
	line-height: 1.12;
	letter-spacing: -0.022em;
	font-weight: 600;
	color: inherit;
}

.emotio-popup .emotio-popup__content h1 { font-size: 1.85em; }
.emotio-popup .emotio-popup__content h2 { font-size: 1.45em; }
.emotio-popup .emotio-popup__content h3 { font-size: 1.2em; }

.emotio-popup .emotio-popup__content p {
	margin: 0 0 1em;
	line-height: 1.55;
	color: inherit;
	opacity: 0.86;
}

.emotio-popup .emotio-popup__content ul,
.emotio-popup .emotio-popup__content ol {
	margin: 0 0 1em;
	padding-left: 1.35em;
}

.emotio-popup .emotio-popup__content img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0;
	border-radius: 12px;
}

/* Plain links in the body inherit the card's text colour — but a CTA button
   is not a plain link, and this rule outranks the button's own colour. */
.emotio-popup .emotio-popup__content a:not(.emotio-popup__cta) {
	color: inherit;
}

/* WordPress alignment classes.
   The editor marks a centred image with class="aligncenter" and leaves the
   actual centring to the theme's stylesheet — which a pop up cannot rely on,
   and which the admin live preview does not load at all. So own them here. */
.emotio-popup .emotio-popup__content .aligncenter,
.emotio-popup .emotio-popup__content figure.aligncenter,
.emotio-popup .emotio-popup__content .wp-block-image.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

.emotio-popup .emotio-popup__content .alignleft {
	float: left;
	margin: 0 1.2em 1em 0;
}

.emotio-popup .emotio-popup__content .alignright {
	float: right;
	margin: 0 0 1em 1.2em;
}

.emotio-popup .emotio-popup__content .alignnone,
.emotio-popup .emotio-popup__content .alignwide,
.emotio-popup .emotio-popup__content .alignfull {
	display: block;
	margin-left: 0;
	margin-right: 0;
	max-width: 100%;
}

/* Floats must not escape the card. */
.emotio-popup .emotio-popup__content::after {
	content: "";
	display: table;
	clear: both;
}

.emotio-popup .emotio-popup__content figure {
	margin: 0 0 1em;
	max-width: 100%;
}

.emotio-popup .emotio-popup__content .wp-caption {
	max-width: 100%;
}

.emotio-popup .emotio-popup__content .wp-caption-text,
.emotio-popup .emotio-popup__content figcaption {
	margin: 6px 0 0;
	font-size: 0.85em;
	line-height: 1.4;
	opacity: 0.65;
	text-align: center;
}

/* Embedded provider forms (Mailchimp, ConvertKit, HubSpot…) */
.emotio-popup__embed {
	margin-top: 4px;
}

.emotio-popup__embed input[type="text"],
.emotio-popup__embed input[type="email"],
.emotio-popup__embed input[type="tel"],
.emotio-popup__embed input[type="url"],
.emotio-popup__embed input[type="number"],
.emotio-popup__embed select,
.emotio-popup__embed textarea {
	box-sizing: border-box;
	width: 100%;
	padding: 13px 16px;
	margin: 0 0 10px;
	font: inherit;
	font-size: 16px; /* stops iOS zooming on focus */
	line-height: 1.3;
	color: inherit;
	background: rgba(120, 120, 128, 0.09);
	border: 1px solid rgba(120, 120, 128, 0.16);
	border-radius: 12px;
	appearance: none;
	-webkit-appearance: none;
	transition: border-color 180ms var(--ep-ease), box-shadow 180ms var(--ep-ease), background-color 180ms var(--ep-ease);
}

.emotio-popup__embed input:focus,
.emotio-popup__embed select:focus,
.emotio-popup__embed textarea:focus {
	outline: none;
	background: rgba(120, 120, 128, 0.04);
	border-color: currentColor;
	box-shadow: 0 0 0 3px rgba(120, 120, 128, 0.16);
}

.emotio-popup__embed input::placeholder,
.emotio-popup__embed textarea::placeholder {
	color: currentColor;
	opacity: 0.42;
}

.emotio-popup__embed input[type="submit"],
.emotio-popup__embed button[type="submit"],
.emotio-popup__embed .button {
	width: 100%;
	padding: 14px 20px;
	margin-top: 4px;
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: #fff;
	background: #1d1d1f;
	border: 0;
	border-radius: 12px;
	cursor: pointer;
	transition: transform 160ms var(--ep-ease), opacity 160ms var(--ep-ease);
}

.emotio-popup__embed input[type="submit"]:hover,
.emotio-popup__embed button[type="submit"]:hover,
.emotio-popup__embed .button:hover {
	opacity: 0.88;
}

.emotio-popup__embed input[type="submit"]:active,
.emotio-popup__embed button[type="submit"]:active,
.emotio-popup__embed .button:active {
	transform: scale(0.985);
}

/* ------------------------------------------------ Call-to-action row */
.emotio-popup .emotio-popup__actions {
	display: flex;
	gap: var(--ep-cta-gap, 10px);
	margin-top: 20px;
	flex: none;
}

.emotio-popup .emotio-popup__actions:first-child {
	margin-top: 0;
	margin-bottom: 20px;
}

.emotio-popup .emotio-popup__actions--stack {
	flex-direction: column;
	align-items: var(--ep-cta-align, stretch);
}

.emotio-popup .emotio-popup__actions--row {
	flex-direction: row;
	flex-wrap: wrap;
	/* Equal heights: a two-line label must not leave the row ragged. */
	align-items: stretch;
	justify-content: var(--ep-cta-align, stretch);
}

/* In a row, "stretch" means share the width evenly. */
.emotio-popup .emotio-popup__actions--row.emotio-popup__actions--align-stretch {
	justify-content: stretch;
}

.emotio-popup .emotio-popup__actions--row.emotio-popup__actions--align-stretch .emotio-popup__cta--block {
	flex: 1 1 0;
}

.emotio-popup .emotio-popup__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;

	box-sizing: border-box;
	margin: 0;

	font: inherit;
	font-weight: 590;
	letter-spacing: -0.01em;
	line-height: 1.25;
	text-align: center;
	text-decoration: none;

	background: var(--ep-cta-bg, #1d1d1f);
	color: var(--ep-cta-color, #fff);
	border: var(--ep-cta-border, 0 solid transparent);
	border-radius: var(--ep-cta-radius, 12px);

	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	transition:
		background-color 180ms var(--ep-ease),
		color 180ms var(--ep-ease),
		border-color 180ms var(--ep-ease),
		transform 160ms var(--ep-ease),
		opacity 160ms var(--ep-ease);
}

.emotio-popup .emotio-popup__cta--secondary {
	background: var(--ep-cta2-bg, transparent);
	color: var(--ep-cta2-color, #6e6e78);
	border: var(--ep-cta2-border, 0 solid transparent);
	border-radius: var(--ep-cta2-radius, 12px);
}

.emotio-popup .emotio-popup__cta:hover {
	background: var(--ep-cta-hover-bg, #000);
	color: var(--ep-cta-hover-color, var(--ep-cta-color, #fff));
}

.emotio-popup .emotio-popup__cta--secondary:hover {
	background: var(--ep-cta2-hover-bg, transparent);
	color: var(--ep-cta2-hover-color, var(--ep-cta2-color, #6e6e78));
}

.emotio-popup .emotio-popup__cta:active { transform: scale(0.985); }

.emotio-popup .emotio-popup__cta:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px var(--ep-cta-accent, rgba(0, 0, 0, 0.35));
}

.emotio-popup .emotio-popup__cta--secondary:focus-visible {
	box-shadow: 0 0 0 3px var(--ep-cta2-accent, rgba(0, 0, 0, 0.35));
}

.emotio-popup .emotio-popup__cta--block { width: 100%; }

/* Sizes */
.emotio-popup .emotio-popup__cta--small { padding: 9px 16px; font-size: 14px; }
.emotio-popup .emotio-popup__cta--medium { padding: 13px 22px; font-size: 15px; }
.emotio-popup .emotio-popup__cta--large { padding: 17px 28px; font-size: 17px; }

/* Style variants that need more than colour swaps */
.emotio-popup .emotio-popup__cta--glass {
	-webkit-backdrop-filter: blur(14px) saturate(180%);
	backdrop-filter: blur(14px) saturate(180%);
}

.emotio-popup .emotio-popup__cta--link {
	padding-left: 0;
	padding-right: 0;
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
	font-weight: 500;
}

/* The built-in fade stands down once an explicit hover colour is set. */
.emotio-popup .emotio-popup__cta--link:not(.emotio-popup__cta--hover-custom):hover {
	opacity: 0.7;
}

.emotio-popup .emotio-popup__actions--stack .emotio-popup__cta--link.emotio-popup__cta--block {
	width: auto;
	align-self: center;
}

.emotio-popup .emotio-popup__cta-icon {
	width: 1em;
	height: 1em;
	flex: none;
	transition: transform 200ms var(--ep-ease);
}

.emotio-popup .emotio-popup__cta:hover .emotio-popup__cta-icon { transform: translateX(2px); }

/* Momentary "Copied" state for copy-to-clipboard buttons */
.emotio-popup .emotio-popup__cta.is-copied .emotio-popup__cta-icon { display: none; }

/* ------------------------------------------------- Don't-show-again row */
.emotio-popup__suppress {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 18px;
	font-size: 13px;
	line-height: 1.3;
	opacity: 0.6;
	cursor: pointer;
	user-select: none;
}

.emotio-popup__suppress input {
	width: 15px;
	height: 15px;
	margin: 0;
	accent-color: currentColor;
	cursor: pointer;
}

/* -------------------------------------------------- Auto-close progress */
.emotio-popup__timer {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	overflow: hidden;
	border-bottom-left-radius: inherit;
	border-bottom-right-radius: inherit;
	background: rgba(120, 120, 128, 0.14);
}

.emotio-popup__timer span {
	display: block;
	width: 100%;
	height: 100%;
	background: currentColor;
	opacity: 0.4;
	transform-origin: left center;
	transform: scaleX(1);
}

.emotio-popup.is-open .emotio-popup__timer span {
	transform: scaleX(0);
	transition: transform linear var(--ep-timer-duration, 0ms);
}

/* --------------------------------------------------------- Scroll lock */
html.emotio-popup-locked,
body.emotio-popup-locked {
	overflow: hidden !important;
	touch-action: none;
}

/* -------------------------------------------------------- Trigger links */
.emotio-popup-trigger {
	cursor: pointer;
}

/* ------------------------------------------------------------- Mobile */
@media (max-width: 600px) {
	.emotio-popup__box {
		width: 100%;
		max-width: 100%;
		padding: var(--ep-padding-mobile, 24px);
	}

	.emotio-popup__wrap {
		padding: max(var(--ep-safe), min(var(--ep-offset-y, 16px), 24px)) var(--ep-safe);
	}

	.emotio-popup--pos-fullscreen .emotio-popup__wrap {
		padding: 0;
	}

	.emotio-popup--close-outside .emotio-popup__close {
		top: 12px;
		right: 12px;
	}

	.emotio-popup__actions--row {
		flex-direction: column;
		align-items: stretch;
	}

	.emotio-popup__cta--large { padding: 15px 24px; font-size: 16px; }
}

/* ----------------------------------------------------- Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.emotio-popup--respect-motion .emotio-popup__box,
	.emotio-popup--respect-motion .emotio-popup__overlay,
	.emotio-popup--respect-motion .emotio-popup__cta,
	.emotio-popup--respect-motion .emotio-popup__cta-icon,
	.emotio-popup--respect-motion .emotio-popup__close {
		transition-duration: 0.01ms !important;
		transform: none !important;
	}

	.emotio-popup--respect-motion .emotio-popup__timer span {
		transition: none !important;
	}
}

/* --------------------------------------------------------- Print */
@media print {
	.emotio-popup {
		display: none !important;
	}
}
