/**
 * Newsletter popup - the Ecomus "auto popup", rebuilt as a split panel.
 *
 * Layout: image and copy side by side from 768px up, stacked below that.
 * The image always fills its half with object-fit: cover, so a portrait,
 * square or landscape upload all crop to the same frame and the popup keeps
 * its proportions at every width.
 *
 * Everything is scoped to .ibf-site-popup. The theme resets h4/h6 to 14px,
 * so the type scale here is set explicitly rather than inherited.
 *
 * Loaded by inc/site-popup.php, only on pages where the popup renders.
 */

.ibf-site-popup {
	--pop-radius: 8px;
	--pop-gutter: 16px;
	/* Accent colour (was black). --gf-color-danger is only defined inside the
	   Gravity Forms wrapper, so the GF default red is the fallback here. */
	--pop-accent: var(--gf-color-danger, #F95C4B);
}

.ibf-site-popup .modal-dialog {
	/* Bootstrap's own max-width is replaced, so the side gutter is set here. */
	width: calc(100% - (var(--pop-gutter) * 2));
	max-width: 880px;
	margin: var(--pop-gutter) auto;
	transform: translate(0, 0) !important;
}

.ibf-quick-add-body .ibf-qa-grid .ibf-qa-content .ibf-quick-add-link {
	text-decoration: underline;
	text-underline-offset: 6px;
	text-decoration-thickness: 1px;
}

.ibf-site-popup .modal-content {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	max-height: calc(100vh - (var(--pop-gutter) * 2));
	border: 0;
	border-radius: var(--pop-radius);
	background-color: var(--white, #fff);
	box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .45);
	cursor: default !important;
}

/* --- image half ------------------------------------------------------- */

.ibf-site-popup .modal-top {
	position: relative;
	flex: 0 0 auto;
	overflow: hidden;
	aspect-ratio: 16 / 10;
	background-color: #f4f4f4;
	line-height: 0;
}

.ibf-site-popup .modal-top img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 25%;
}

/* --- close button ----------------------------------------------------- */

.ibf-site-popup .icon-close {
	position: absolute;
	z-index: 2;
	top: 12px;
	right: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background-color: var(--white, #fff);
	box-shadow: 0 2px 10px -2px rgba(0, 0, 0, .25);
	color: var(--pop-accent);
	font-size: 11px;
	line-height: 1;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
}

.ibf-site-popup.no-image .icon-close {
	background-color: transparent;
	box-shadow: none;
}

.ibf-site-popup .icon-close:hover,
.ibf-site-popup .icon-close:focus-visible {
	background-color: var(--pop-accent);
	color: var(--white, #fff);
}

/* --- copy half -------------------------------------------------------- */

.ibf-site-popup .modal-bottom {
	display: flex;
	overflow-y: auto;
	flex: 1 1 auto;
	flex-direction: column;
	justify-content: center;
	padding: 30px 24px 28px;
	text-align: center;
}

.ibf-site-popup.no-image .modal-bottom {
	padding-top: 44px;
}

.ibf-site-popup .modal-bottom h4 {
	margin: 0;
	color: var(--pop-accent);
	font-size: 24px;
	font-weight: 500;
	line-height: 1.22;
	letter-spacing: -0.01em;
}

.ibf-site-popup .modal-bottom h6 {
	max-width: 34ch;
	margin: 10px auto 0;
	color: var(--text, #545454);
	font-size: 15px;
	font-weight: 400;
	line-height: 1.55;
}

.ibf-site-popup .popup-form {
	margin-top: 22px;
}

.ibf-site-popup .popup-dismiss {
	margin-top: 16px;
}

.ibf-site-popup .popup-dismiss a {
	display: inline-block;
	border-bottom: 1px solid currentColor;
	color: var(--text, #545454);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none;
	transition: color .2s ease;
}

.ibf-site-popup .popup-dismiss a:hover {
	color: var(--pop-accent);
}

/* --- the signup form -------------------------------------------------- */

/*
 * Gravity Forms (orbital theme) prints a form title, a description and a
 * field label that all repeat what the popup already says, so they are
 * hidden here rather than switched off per form - the same form is reused
 * in the footer, where the label does belong.
 */

.ibf-site-popup .popup-form .gform_heading,
.ibf-site-popup .popup-form .gform_title,
.ibf-site-popup .popup-form .gform_description,
.ibf-site-popup .popup-form .gfield_label,
.ibf-site-popup .popup-form .gform_required_legend {
	position: absolute !important;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	border: 0;
	white-space: nowrap;
}

.ibf-site-popup .popup-form .gform_wrapper,
.ibf-site-popup .popup-form .gform-body,
.ibf-site-popup .popup-form .gform_fields {
	margin: 0;
	padding: 0;
}

.ibf-site-popup .popup-form .gform_fields {
	display: block;
	grid-row-gap: 0;
}

.ibf-site-popup .popup-form .gfield {
	margin: 0;
	padding: 0;
}

.ibf-site-popup .popup-form input[type="text"],
.ibf-site-popup .popup-form input[type="email"],
.ibf-site-popup .popup-form input[type="tel"],
.ibf-site-popup .popup-form .ginput_container input {
	box-sizing: border-box !important;
	width: 100% !important;
	max-width: none !important;
	height: 48px !important;
	min-height: 48px !important;
	margin: 0 !important;
	padding: 0 16px !important;
	border: 1px solid var(--line, #ebebeb) !important;
	border-radius: 8px !important;
	background: var(--white, #fff) !important;
	box-shadow: none !important;
	color: var(--pop-accent) !important;
	font-family: inherit !important;
	font-size: 15px !important;
	line-height: normal !important;
	transition: border-color .2s ease;
}

.ibf-site-popup .popup-form input::placeholder {
	color: #9a9a9a;
	opacity: 1;
}

.ibf-site-popup .popup-form input:focus {
	border-color: var(--pop-accent) !important;
	outline: 0;
	box-shadow: none !important;
}

.ibf-site-popup .popup-form .gform_footer,
.ibf-site-popup .popup-form .gform-footer {
	display: block;
	margin: 10px 0 0;
	padding: 0;
}

/*
 * Gravity Forms' framework theme styles its submit button through
 * .gform-theme.gform-theme--framework.gform_wrapper .button, which outranks
 * a plainly scoped rule, so the handful of properties that define the button
 * are forced here. The scope is this popup only.
 */

.ibf-site-popup .popup-form .gform_button,
.ibf-site-popup .popup-form button[type="submit"],
.ibf-site-popup .popup-form input[type="submit"] {
	box-sizing: border-box !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100% !important;
	min-width: 0 !important;
	max-width: none !important;
	height: 48px !important;
	min-height: 48px !important;
	margin: 0 !important;
	padding: 0 20px !important;
	border: 1px solid var(--pop-accent) !important;
	border-radius: 3px !important;
	background: var(--pop-accent) !important;
	box-shadow: none !important;
	color: var(--white, #fff) !important;
	font-family: inherit !important;
	font-size: 15px !important;
	font-weight: 500 !important;
	line-height: 1 !important;
	text-transform: none;
	cursor: pointer;
	transition: background-color .25s ease, color .25s ease;
}

.ibf-site-popup .popup-form .gform_button:hover,
.ibf-site-popup .popup-form button[type="submit"]:hover,
.ibf-site-popup .popup-form input[type="submit"]:hover {
	background: var(--white, #fff) !important;
	color: var(--pop-accent) !important;
}

/*
 * The framework theme paints the button colour through its own custom
 * properties at .gform-theme.gform-theme--framework.gform_wrapper .button,
 * which outranks the rule above even with !important - so the colours are
 * repeated once at a higher specificity.
 */

.ibf-site-popup .popup-form .gform_wrapper.gform-theme .gform_button.button,
.ibf-site-popup .popup-form .gform_wrapper.gform-theme button[type="submit"] {
	border-color: var(--pop-accent) !important;
	background: var(--pop-accent) !important;
	background-color: var(--pop-accent) !important;
	color: var(--white, #fff) !important;
	border-radius: 8px !important;
}

.ibf-site-popup .popup-form .gform_wrapper.gform-theme .gform_button.button:hover,
.ibf-site-popup .popup-form .gform_wrapper.gform-theme button[type="submit"]:hover {
	background: var(--white, #fff) !important;
	background-color: var(--white, #fff) !important;
	color: var(--pop-accent) !important;
}

/* Validation and confirmation keep the plugin's wording, not its colours. */

.ibf-site-popup .popup-form .gform_validation_errors,
.ibf-site-popup .popup-form .validation_message {
	margin: 0 0 10px;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	color: var(--primary, #db1215);
	font-size: 13px;
	line-height: 1.45;
	text-align: center;
}

.ibf-site-popup .popup-form .gform_confirmation_message {
	color: var(--pop-accent);
	font-size: 15px;
	line-height: 1.55;
}
/* Gravity Forms honeypot - never show it, even before GF's own CSS loads */
.gform_validation_container,
.gform_wrapper .gform_validation_container,
body .gform_wrapper .gform_body .gform_fields .gfield.gform_validation_container,
body .gform_wrapper div.gform_body ul.gform_fields li.gfield.gform_validation_container {
	display: none !important;
	position: absolute !important;
	left: -9000px !important;
}
/* --- split layout ----------------------------------------------------- */

@media (min-width: 768px) {

	.ibf-site-popup {
		--pop-gutter: 24px;
	}

	.ibf-site-popup .modal-content {
		flex-direction: row;
		min-height: 430px;
	}

	.ibf-site-popup .modal-top {
		flex: 0 0 46%;
		align-self: stretch;
		aspect-ratio: auto;
	}

	.ibf-site-popup.no-image .modal-content {
		min-height: 0;
	}

	.ibf-site-popup .modal-bottom {
		padding: 44px 40px;
	}

	.ibf-site-popup.no-image .modal-bottom {
		padding: 48px 56px;
	}

	.ibf-site-popup .modal-bottom h4 {
		font-size: 28px;
	}

	.ibf-site-popup .popup-form {
		margin-top: 26px;
	}
}

@media (min-width: 992px) {

	.ibf-site-popup .modal-content {
		min-height: 470px;
	}

	.ibf-site-popup .modal-bottom {
		padding: 48px 48px;
	}

	.ibf-site-popup .modal-bottom h4 {
		font-size: 30px;
	}
}

/* Short viewports (landscape phones): drop the image, keep the form usable. */

@media (max-height: 520px) and (min-width: 768px) {

	.ibf-site-popup .modal-content {
		min-height: 0;
	}

	.ibf-site-popup .modal-bottom {
		padding: 28px 36px;
	}
}

@media (max-height: 560px) and (max-width: 767.98px) {

	/* The image is cropped rather than dropped, so the close button stays. */

	.ibf-site-popup .modal-top {
		height: 32vh;
		aspect-ratio: auto;
	}

	.ibf-site-popup .modal-bottom {
		padding: 20px 20px 18px;
	}
}