/* LS Popup Builder: front end */

.lspb {
	position: fixed;
	inset: 0;
	z-index: var(--lspb-z, 99990);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--lspb-dur, 350ms) ease, visibility 0s linear var(--lspb-dur, 350ms);
}
.lspb *,
.lspb *::before,
.lspb *::after { box-sizing: border-box; }

.lspb.is-open {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
	transition: opacity var(--lspb-dur, 350ms) ease, visibility 0s linear 0s;
}

/* Positions */
.lspb--pos-bottom-center { align-items: flex-end; }
.lspb--pos-bottom-right  { align-items: flex-end; justify-content: flex-end; }
.lspb--pos-bottom-left   { align-items: flex-end; justify-content: flex-start; }
.lspb--pos-bottom-center,
.lspb--pos-bottom-right,
.lspb--pos-bottom-left   { padding: 24px; }

/* Overlay */
.lspb__overlay {
	position: absolute;
	inset: 0;
	background: var(--lspb-overlay, rgba(0,0,0,.6));
	-webkit-backdrop-filter: blur(var(--lspb-ov-blur, 0));
	backdrop-filter: blur(var(--lspb-ov-blur, 0));
}
.lspb--no-overlay .lspb__overlay { display: none; }
.lspb--no-overlay.is-open { pointer-events: none; }
.lspb--no-overlay.is-open .lspb__dialog { pointer-events: auto; }

/* Dialog */
.lspb__dialog {
	position: relative;
	width: min(var(--lspb-w, 720px), 100%);
	max-height: var(--lspb-maxh, 90vh);
	display: flex;
	flex-direction: column;
	background: var(--lspb-bg, #fff);
	border: var(--lspb-bw, 0) solid var(--lspb-bc, transparent);
	border-radius: var(--lspb-radius, 18px);
	box-shadow: var(--lspb-shadow, none);
	color: var(--lspb-color, #3a3a3a);
	font-family: var(--lspb-font, inherit);
	font-size: var(--lspb-size, 17px);
	line-height: var(--lspb-lh, 1.6);
	text-align: var(--lspb-align, center);
	outline: none;
	transition: transform var(--lspb-dur, 350ms) cubic-bezier(.2,.8,.2,1), opacity var(--lspb-dur, 350ms) ease;
}
.lspb--anim-zoom .lspb__dialog     { transform: scale(.92); }
.lspb--anim-slide-up .lspb__dialog { transform: translateY(40px); }
.lspb--anim-fade .lspb__dialog,
.lspb--anim-none .lspb__dialog     { transform: none; }
.lspb--anim-none,
.lspb--anim-none .lspb__dialog     { transition: none; }
.lspb.is-open .lspb__dialog        { transform: none; }

.lspb__inner {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 0;
	max-height: calc(var(--lspb-maxh, 90vh) - 2 * var(--lspb-bw, 0px));
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	border-radius: calc(var(--lspb-radius, 18px) - var(--lspb-bw, 0px));
}

/* Image layouts */
.lspb__media {
	position: relative;
	flex: 0 0 auto;
	margin: var(--lspb-img-inset, 0);
	overflow: hidden;
	border-radius: var(--lspb-img-r, 0);
}
.lspb__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--lspb-img-tint, transparent);
	pointer-events: none;
}
.lspb__media-link { display: block; height: 100%; }
.lspb .lspb__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: var(--lspb-img-fit, cover);
	object-position: var(--lspb-img-pos, center);
	border-radius: 0;
	box-shadow: none;
}

.lspb--img-left .lspb__inner,
.lspb--img-right .lspb__inner { flex-direction: row; align-items: stretch; }
.lspb--img-right .lspb__inner { flex-direction: row-reverse; }
.lspb--img-left .lspb__media,
.lspb--img-right .lspb__media { flex: 0 0 calc(var(--lspb-img-w, 45%) - 2 * var(--lspb-img-inset, 0px)); align-self: stretch; min-height: 220px; }

.lspb--img-top .lspb__media,
.lspb--img-bottom .lspb__media { height: var(--lspb-img-h, 260px); }
.lspb--img-bottom .lspb__inner { flex-direction: column-reverse; }

.lspb--img-background .lspb__media { position: absolute; inset: 0; margin: 0; border-radius: inherit; }
.lspb--img-background .lspb__body { position: relative; z-index: 1; }

/* Body + text */
.lspb__body {
	flex: 1 1 auto;
	min-width: 0;
	padding: var(--lspb-pad, 40px);
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.lspb .lspb__title {
	margin: 0 0 .45em;
	padding: 0;
	font-family: var(--lspb-t-font, inherit);
	font-size: var(--lspb-t-size, 34px);
	font-weight: var(--lspb-t-weight, 700);
	line-height: var(--lspb-t-lh, 1.2);
	letter-spacing: var(--lspb-t-ls, 0);
	text-transform: var(--lspb-t-tf, none);
	color: var(--lspb-t-color, #1b1b1b);
	text-align: inherit;
}
.lspb__content { color: inherit; }
.lspb__content > :first-child { margin-top: 0; }
.lspb__content > :last-child  { margin-bottom: 0; }
.lspb__content p,
.lspb__content li { font-size: inherit; line-height: inherit; color: inherit; }
.lspb__content img,
.lspb__content video,
.lspb__content iframe { max-width: 100%; }
.lspb__content img { height: auto; }

/* Advanced WordPress Backgrounds: let the background reach the popup edges when padding is 0 */
.lspb__content > .nk-awb:first-child,
.lspb__content > .wp-block-nk-awb:first-child { margin-top: 0; }
.lspb .nk-awb .nk-awb-wrap { border-radius: inherit; }

/* Button */
.lspb__actions { margin-top: 1.4em; }
.lspb a.lspb__btn,
.lspb--style-blocks .lspb__content .wp-block-button__link {
	display: inline-block;
	padding: var(--lspb-btn-py, 14px) var(--lspb-btn-px, 34px);
	font-family: var(--lspb-font, inherit);
	font-size: var(--lspb-btn-size, 16px);
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	color: var(--lspb-btn-color, #fff);
	background: var(--lspb-btn-bg, #a8742f);
	border: 0;
	border-radius: var(--lspb-btn-r, 999px);
	box-shadow: none;
	cursor: pointer;
	transition: background-color .2s ease, transform .2s ease;
}
.lspb a.lspb__btn:hover,
.lspb a.lspb__btn:focus-visible,
.lspb--style-blocks .lspb__content .wp-block-button__link:hover,
.lspb--style-blocks .lspb__content .wp-block-button__link:focus-visible {
	color: var(--lspb-btn-color, #fff);
	background: var(--lspb-btn-bg-h, #8a5f26);
	text-decoration: none;
}
.lspb a.lspb__btn:active { transform: translateY(1px); }
.lspb--btn-full a.lspb__btn { display: block; width: 100%; }

/* Close button */
.lspb .lspb__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--lspb-close-size, 38px);
	height: var(--lspb-close-size, 38px);
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	font-size: 0;
	line-height: 1;
	text-transform: none;
	letter-spacing: 0;
	color: var(--lspb-close-color, #1b1b1b);
	background: var(--lspb-close-bg, rgba(255,255,255,.9));
	border: 0;
	border-radius: var(--lspb-close-r, 999px);
	box-shadow: none;
	cursor: pointer;
	transition: opacity .25s ease, transform .2s ease;
}
.lspb--close-shadow .lspb__close { box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.lspb .lspb__close svg { width: 46%; height: 46%; display: block; pointer-events: none; }
.lspb .lspb__close:hover { transform: scale(1.06); color: var(--lspb-close-color, #1b1b1b); background: var(--lspb-close-bg, rgba(255,255,255,.9)); }
.lspb .lspb__close:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.lspb--close-inside-left .lspb__close { right: auto; left: 12px; }
.lspb--close-outside-right .lspb__close { top: calc(-1 * var(--lspb-close-size, 38px) - 10px); right: 0; }
.lspb .lspb__close.is-delayed { opacity: 0; pointer-events: none; }

/* Scroll lock */
html.lspb-locked,
html.lspb-locked body { overflow: hidden !important; }

/* Mobile */
@media (max-width: 767px) {
	.lspb { padding: 12px; }
	.lspb--pos-bottom-center,
	.lspb--pos-bottom-right,
	.lspb--pos-bottom-left { padding: 12px; justify-content: center; }

	.lspb__body { padding: var(--lspb-pad-m, 24px); }
	.lspb .lspb__title { font-size: var(--lspb-t-size-m, 26px); }
	.lspb__dialog { font-size: var(--lspb-size-m, 15px); }

	.lspb--img-left .lspb__inner,
	.lspb--img-right .lspb__inner { flex-direction: column; }
	.lspb--img-left .lspb__media,
	.lspb--img-right .lspb__media { flex: 0 0 auto; height: min(var(--lspb-img-h, 260px), 34vh); }
	.lspb--img-top .lspb__media,
	.lspb--img-bottom .lspb__media { height: min(var(--lspb-img-h, 260px), 34vh); }
	.lspb--img-hide-m .lspb__media { display: none; }

	.lspb--close-outside-right .lspb__close { top: 10px; right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
	.lspb,
	.lspb__dialog { transition-duration: 1ms !important; }
	.lspb__dialog { transform: none !important; }
}
