/* Incredible Popup — frontend styles */

.incpop-overlay {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: var(--incpop-overlay, rgba(0, 0, 0, 0.6));
	z-index: 999999;
	padding: 20px;
	box-sizing: border-box;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.incpop-overlay.incpop-open {
	display: flex;
	opacity: 1;
}

.incpop-box h1,
.incpop-box h2,
.incpop-box h3,
.incpop-box h4,
.incpop-box h5,
.incpop-box h6 {
	font-family: var(--incpop-heading-font, inherit);
}

.incpop-box {
	position: relative;
	font-family: var(--incpop-content-font, inherit);
	background: var(--incpop-bg, #fff);
	width: 100%;
	max-width: var(--incpop-max-desktop, 600px);
	max-height: var(--incpop-max-height, 90vh);
	overflow: auto;
	border-radius: var(--incpop-radius, 8px);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
	transform: translateY(12px) scale(0.98);
	transition: transform 0.25s ease;
	box-sizing: border-box;
}

/*
 * Window-scroll mode: the overlay itself becomes the scroll container, so the
 * whole window scrolls instead of the popup. The box has no inner scrollbar and
 * can grow past the viewport; it aligns to the top so tall content stays reachable.
 */
.incpop-overlay.incpop-scroll-window {
	/*
	 * Absolute (not fixed) positioning makes the overlay part of the page, so the
	 * dark background and the popup scroll together with the rest of the page —
	 * one single scrollbar, the browser's own. The page scroll is left unlocked
	 * (see popup.js) so everything moves at the same time.
	 */
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: auto;
	min-height: 100vh;
	height: auto;
	align-items: flex-start;
	overflow: visible;
}

.incpop-overlay.incpop-scroll-window .incpop-box {
	max-height: none;
	overflow: visible;
	margin: auto; /* centers vertically when it fits, flows with the page when taller */
}

.incpop-overlay.incpop-open .incpop-box {
	transform: translateY(0) scale(1);
}

/* The box receives programmatic focus on open (for screen readers); it's a
   container, so it shouldn't show a focus ring. Interactive controls inside
   still show their own focus styles when tabbed to. */
.incpop-box:focus {
	outline: none;
}

.incpop-content {
	padding: var(--incpop-pad, 24px);
	box-sizing: border-box;
}

/* Image mode: image should be flush; padding still applies around content wrap.
   Remove default gaps so image + button stack cleanly. */
.incpop-image {
	line-height: 0;
}

.incpop-image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: calc(var(--incpop-radius, 8px) / 2);
}

.incpop-html {
	line-height: 1.5;
	word-wrap: break-word;
}

.incpop-html img {
	max-width: 100%;
	height: auto;
}

.incpop-html :first-child {
	margin-top: 0;
}

.incpop-html :last-child {
	margin-bottom: 0;
}

/* Text alignment (background / form / classic honor the setting) */
.incpop-content {
	text-align: var(--incpop-align, left);
}

.incpop-form {
	text-align: left;
	margin: 14px auto 0;
}


/* --- Two column layout --- */
.incpop-layout-two_column .incpop-content,
.incpop-columns .incpop-content {
	text-align: left;
}

.incpop-columns {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	overflow: hidden; /* clip the 1px photo bleed below */
}

.incpop-col-media {
	flex: 1 1 45%;
	min-width: 0;
	line-height: 0;
	font-size: 0;
	/*
	 * Bleed the photo column 1px past the bottom. Flexbox stretches this column
	 * to match the taller text column; on fractional pixel heights the browser
	 * can render it a hair short, letting the popup background show through as a
	 * thin seam. The extra pixel is clipped by .incpop-columns overflow above.
	 */
	margin-bottom: -1px;
}

/* Fill mode: background-image div that stretches to the row height. */
.incpop-col-fill {
	align-self: stretch;
	min-height: 220px;
}

/* Inline mode: image sits inside the column, centered. */
.incpop-col-inline {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--incpop-pad, 24px);
	box-sizing: border-box;
}

.incpop-col-inline img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
}

.incpop-col-body {
	flex: 1 1 55%;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* Stack the columns on small screens; image always on top. */
@media (max-width: 600px) {
	.incpop-columns {
		flex-direction: column;
	}
	.incpop-columns.incpop-img-right {
		flex-direction: column-reverse;
	}
	.incpop-col-media img {
		height: auto;
		min-height: 0;
	}
}

/* --- Background image layout --- */
.incpop-bg-wrap {
	position: relative;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

/* Tint layer between the image and the text for readability. */
.incpop-bg-scrim {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.incpop-bg-content {
	position: relative;
	z-index: 1;
	color: var(--incpop-text, #fff);
	text-align: var(--incpop-align, center);
	min-height: 320px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: calc( var(--incpop-pad, 24px) + 12px );
}

.incpop-bg-content .incpop-html,
.incpop-bg-content .incpop-html * {
	color: inherit;
}


/* CTA buttons */
.incpop-buttons-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 18px;
	justify-content: var(--incpop-btn-justify, flex-start);
}

.incpop-cta {
	display: inline-block;
	padding: var(--incpop-btn-pad-v, 12px) var(--incpop-btn-pad-h, 22px);
	font-size: var(--incpop-btn-font, 16px);
	font-family: var(--incpop-cta-font, inherit);
	font-weight: 600;
	text-decoration: none;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	box-sizing: border-box;
	background: var(--b-bg, transparent);
	color: var(--b-color, inherit);
	border: var(--b-bw, 0) solid var(--b-bd, transparent);
	border-radius: var(--b-r, 6px);
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* Colors are scoped under #incpop-overlay so the theme's own link (a / a:hover)
   styles — which are often more specific — can't override the button colors.
   No !important needed. */
#incpop-overlay .incpop-cta {
	background: var(--b-bg, transparent);
	color: var(--b-color, inherit);
	border-color: var(--b-bd, transparent);
	text-decoration: none;
}

#incpop-overlay .incpop-cta:hover,
#incpop-overlay .incpop-cta:focus {
	background: var(--b-hbg, var(--b-bg, transparent));
	color: var(--b-hcolor, var(--b-color, inherit));
	border-color: var(--b-hbd, var(--b-bd, transparent));
	text-decoration: none;
}

.incpop-cta-full {
	display: block;
	width: 100%;
}

/* Close X */
.incpop-close {
	position: absolute;
	top: var(--incpop-x-top, 8px);
	right: var(--incpop-x-right, 10px);
	width: var(--incpop-x-size, 34px);
	height: var(--incpop-x-size, 34px);
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	padding: 0;
	font-size: calc( var(--incpop-x-size, 34px) * 0.76 );
	text-align: center;
	background: transparent;
	border: none;
	color: var(--incpop-x-color, #333);
	cursor: pointer;
	z-index: 2;
	border-radius: var(--incpop-x-radius, 50%);
}

.incpop-close:hover {
	background: rgba(0, 0, 0, 0.08);
}

/* Mobile */
@media (max-width: 782px) {
	.incpop-box {
		max-width: var(--incpop-max-mobile, 90%);
	}
}

/* Prevent body scroll while open */
body.incpop-noscroll {
	overflow: hidden;
}
