.rsp-popup {
	position: fixed;
	top: 20px;
	right: 20px;
	z-index: 999999;
	/* 600px square, shrinking to fit smaller screens. */
	width: min(600px, calc(100vw - 40px), calc(100vh - 40px));
	height: min(600px, calc(100vw - 40px), calc(100vh - 40px));
	border-radius: 8px;
	overflow: visible;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
	background: #0033c8;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
}

.rsp-popup.is-open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s;
}

/* Keep clear of the WordPress admin bar when logged in. */
.admin-bar .rsp-popup {
	top: 52px;
	width: min(600px, calc(100vw - 40px), calc(100vh - 72px));
	height: min(600px, calc(100vw - 40px), calc(100vh - 72px));
}
@media screen and (max-width: 782px) {
	.admin-bar .rsp-popup {
		top: 66px;
		width: min(600px, calc(100vw - 32px), calc(100vh - 86px));
		height: min(600px, calc(100vw - 32px), calc(100vh - 86px));
	}
}

.rsp-popup__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	border-radius: 8px;
	object-fit: cover;
}

.rsp-popup__close {
	position: absolute;
	top: -10px;
	right: -10px;
	width: 28px;
	height: 28px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #111;
	font: 700 20px/28px Arial, sans-serif;
	text-align: center;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.rsp-popup__close:hover,
.rsp-popup__close:focus-visible {
	background: #111;
	color: #fff;
	outline: none;
}

/* Phones: 16px gutter, nearly full width. */
@media screen and (max-width: 480px) {
	.rsp-popup {
		top: 16px;
		right: 16px;
		width: min(600px, calc(100vw - 32px), calc(100vh - 32px));
		height: min(600px, calc(100vw - 32px), calc(100vh - 32px));
	}
}
