/* ESCA Popups – front end
 * All sizes inside the banner use --u (= 1% of the popup width), set live by
 * frontend.js, so the layout scales identically on every screen size.
 * Reference design: 2576 px wide banner.
 */

.esca-popup[hidden] { display: none !important; }

.esca-popup {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
	box-sizing: border-box;
	opacity: 0;
	transition: opacity .25s ease;
}
.esca-popup.is-open { opacity: 1; }

.esca-popup__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, var(--esca-overlay, .65));
}

.esca-popup__dialog {
	/* fallback until JS measures the real width */
	--u: min(1vw, calc(var(--esca-maxw, 1200px) / 100));
	position: relative;
	width: min(var(--esca-maxw, 1200px), 100%);
	box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
	transform: translateY(14px) scale(.985);
	transition: transform .25s ease;
}
.esca-popup.is-open .esca-popup__dialog { transform: none; }

.esca-popup__banner {
	position: relative;
	width: 100%;
	aspect-ratio: var(--esca-ratio, 3.04);
	background-color: #86aad4;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	overflow: hidden;
}

/* ----- Text + buttons (left) -------------------------------------------- */

.esca-popup__content {
	position: absolute;
	left: calc(var(--u) * 8.8);
	top: 50%;
	transform: translateY(-50%);
	width: calc(var(--u) * 56);
	color: var(--esca-text, #1f1d3b);
}

.esca-popup .esca-popup__title {
	margin: 0 0 calc(var(--u) * 1.9) !important;
	padding: 0 !important;
	font-family: 'Anton', 'Oswald', 'Bebas Neue', Impact, 'Arial Narrow', sans-serif !important;
	font-weight: 400 !important;
	font-size: calc(var(--u) * 4.7) !important;
	line-height: 1 !important;
	letter-spacing: -.015em !important;
	text-transform: none !important;
	color: var(--esca-text, #1f1d3b) !important;
}

.esca-popup .esca-popup__text {
	max-width: calc(var(--u) * 43.5);
	font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif !important;
	font-weight: 500 !important;
	font-size: calc(var(--u) * 1.1) !important;
	line-height: 1.33 !important;
	color: var(--esca-text, #1f1d3b) !important;
}
.esca-popup .esca-popup__text p {
	margin: 0 !important;
	font: inherit !important;
	color: inherit !important;
}

/* ----- Buttons ---------------------------------------------------------- */

.esca-popup__actions {
	display: flex;
	gap: calc(var(--u) * 1.4);
}
.esca-popup__actions--inline { margin-top: calc(var(--u) * 2.4); }
.esca-popup__actions--bar { display: none; }

.esca-popup .esca-popup__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	height: calc(var(--u) * 2.9);
	padding: 0 calc(var(--u) * 1.05);
	font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	font-weight: 700;
	font-size: calc(var(--u) * 1);
	line-height: 1;
	letter-spacing: 0;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	border: 1px solid var(--esca-b2, #1f1d3b);
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
	transition: opacity .2s ease, background-color .2s ease, color .2s ease;
}

.esca-popup .esca-popup__btn--primary {
	background: var(--esca-b1bg, #1f1d3b);
	border-color: var(--esca-b1bg, #1f1d3b);
	color: var(--esca-b1txt, #fff);
}
.esca-popup .esca-popup__btn--secondary {
	background: transparent;
	color: var(--esca-b2, #1f1d3b);
}
.esca-popup .esca-popup__btn:hover,
.esca-popup .esca-popup__btn:focus-visible { opacity: .85; }
.esca-popup .esca-popup__btn--secondary:hover,
.esca-popup .esca-popup__btn--secondary:focus-visible {
	background: var(--esca-b2, #1f1d3b);
	color: #fff;
	opacity: 1;
}

/* ----- Close button ----------------------------------------------------- */

.esca-popup .esca-popup__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	width: 32px;
	height: 32px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, .92);
	color: #1f1d3b;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
	transition: transform .15s ease;
}
.esca-popup .esca-popup__close:hover { transform: scale(1.08); }

html.esca-popup-lock { overflow: hidden; }

/* ----- Mobile: banner scales as-is, buttons sit in a bar below the image - */

@media (max-width: 767px) {
	.esca-popup { padding: 10px; }

	.esca-popup__dialog { background: var(--esca-bar, #fff); }

	.esca-popup__actions--inline { display: none; }

	.esca-popup__actions--bar {
		display: flex;
		gap: 10px;
		padding: 12px;
		background: var(--esca-bar, #fff);
	}

	.esca-popup .esca-popup__actions--bar .esca-popup__btn {
		flex: 1 1 0;
		height: auto;
		min-height: 44px;
		padding: 10px 8px;
		font-size: 12px;
		white-space: normal;
		text-align: center;
	}

	.esca-popup .esca-popup__close { top: 6px; right: 6px; width: 28px; height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
	.esca-popup, .esca-popup__dialog { transition: none; }
}
