body.jetpack-subscribe-overlay-open {
	overflow: hidden;
}

.jetpack-subscribe-overlay {
	--jetpack-subscribe-overlay--background-color: var(--wp--preset--color--background, var(--wp--preset--color--base, var(--wp--preset--color--contrast, #f9f9f9)));

	visibility: hidden;
	position: fixed;
	z-index: 50001; /* WP.com Action bar and floating subscribe button are 5000 */
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background-color: transparent;
	transition: background-color 0.4s, visibility 0.4s;
}

.jetpack-subscribe-overlay__content {
	position: relative;
	visibility: hidden;
	overflow: hidden;
	top: 100%;
	margin: min(15%, 15vh) auto;
	width: 100%;
	max-width: 400px;
	transition: top 0.4s, visibility 0.4s;
	text-wrap: pretty;
}

.jetpack-subscribe-overlay__close {
	display: none;
	cursor: pointer;
	position: fixed;
	z-index: 1;
	top: 32px;
	right: 32px;
	width: 24px;
	height: 24px;
}

body.admin-bar .jetpack-subscribe-overlay__close {
	top: 64px;
}

body.has-marketing-bar .jetpack-subscribe-overlay__close {
	top: 81px;
}

body.admin-bar.has-marketing-bar .jetpack-subscribe-overlay__close {
	top: 114px;
}

/* Keep the content below the admin and marketing bars on short screens. */
body.admin-bar .jetpack-subscribe-overlay__content {
	margin-top: max(min(15%, 15vh), 46px);
}

body.has-marketing-bar .jetpack-subscribe-overlay__content {
	margin-top: max(min(15%, 15vh), 63px);
}

body.admin-bar.has-marketing-bar .jetpack-subscribe-overlay__content {
	margin-top: max(min(15%, 15vh), 96px);
}

.jetpack-subscribe-overlay__to-content {
	display: none;
}

.jetpack-subscribe-overlay.open {
	background-color: var(--jetpack-subscribe-overlay--background-color);
	visibility: visible;
	overflow: auto;
	animation: jetpack-subscribe-overlay-clip 0.4s;

	.jetpack-subscribe-overlay__content {
		top: 0;
		visibility: visible;
	}

	.jetpack-subscribe-overlay__close {
		display: block;
	}

	.jetpack-subscribe-overlay__to-content {
		display: block;
	}
}

@keyframes jetpack-subscribe-overlay-clip {

	from,
	to {
		overflow: hidden;
	}
}

@media screen and (max-width: 640px) {

	.jetpack-subscribe-overlay__content {
		width: 94%;
	}
}
