.popup {
	position: fixed;
	bottom: 0;
	z-index: 3000;
	left: 0;
	right: 0;
	left: 0;
	height: calc( 100vh - var( --wp-admin--admin-bar--height, 0px ) );
	justify-content: center;
	align-items: center;
	opacity: 0;
	transition: opacity 200ms ease-in-out;
	top: var( --wp-admin--admin-bar--height, 0px );

	--popup--background: #ffffff;
	--popup--background-image: linear-gradient(34.1deg, rgba(255,255,255,1) 48.93%, rgba(255,255,255, 0.15));
	--popup--text: #1a2845;
	--popup--border: #D0D5DB;
	--popup--width: 50vw;
	--popup--height: 50vh;
}

.popup:not([hidden]) {
	display: flex;
}

.popup--active {
	opacity: 1;
}

.popup--theme-light {
	--popup--background: #ffffff;
	--popup--text: #1a2845;
	--popup--border: #979797;
	--popup--backdrop: #2e2e2e;
}

.popup--theme-dark {
	--popup--background: #2e2e2e;
	--popup--background-image: linear-gradient(34.1deg, rgba(255,255,255,0) 48.93%, rgba(255,255,255, 0.15));
	--popup--text: #ffffff;
	--popup--border: #979797;
	--popup--backdrop: #ffffff;
}

.popup--theme-blue {
	--popup--background: #23557d;
	--popup--background-image: linear-gradient(34.1deg, rgba(255,255,255,0) 48.93%, rgba(255,255,255, 0.15));
	--popup--text: #ffffff;
	--popup--border: #1c4566;
	--popup--backdrop: #ffffff;
}

.popup--theme-purple {
	--popup--background: #7c1f6d;
	--popup--background-image: linear-gradient(34.1deg, rgba(255,255,255,0) 48.93%, rgba(255,255,255, 0.25));
	--popup--text: #ffffff;
	--popup--border: #4e1244;
	--popup--backdrop: #ffffff;
}

.popup--size-xsmall {
	--popup--width: 35vw;
	--popup--height: 35vh;
}

.popup--size-small {
	--popup--width: 50vw;
	--popup--height: 50vh;
}

.popup--size-medium {
	--popup--width: 75vw;
	--popup--height: 75vh;
}

.popup--size-large {
	--popup--width: 90vw;
	--popup--height: 90vh;
}

.popup::before {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background-color: var( --popup--backdrop );
	opacity: .8;
}

.popup__dialog {
	background-color: var( --popup--background );
	background-image: var( --popup--background-image );
	border-radius: 0.5rem;
	border: 1px solid var(--popup--border, #D0D5DB);
	box-sizing: border-box;
	color: var( --popup--text );
	display: flex;
	flex-direction: column;
	margin: auto;
	height: var( --popup--height, 50vh );
	width: var( --popup--width, 50vw );
	max-height: calc( 100vh - var( --wp-admin--admin-bar--height, 0px ) );
	max-width: calc( 100vw - 2rem );
	position: relative;
	transition-property: transform, opacity;
	transition-duration: 400ms;
	transition-timing-function: ease-in-out;
	transform: translate( 0, 5rem );
	transition-delay: 100ms;
	opacity: 0;
}

.popup--active .popup__dialog {
	transform: translate( 0, 0 );
	opacity: 1;
}

.popup__frame .btn {
	font-size: 0.7rem;
}

.popup__close {
	border: none;
	clear: left;
	color: inherit;
	cursor: pointer;
	font-size: 20px;
	font-weight: 700;
	line-height: 37px;
	margin-top: -3px;
	outline: none;
	overflow: hidden;
	text-decoration: none;
	transition: all 200ms;
}

.popup__flow {
	box-sizing: border-box;
	clear: both;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	font-size: 1.1rem;
	font-style: normal;
	font-weight: 400;
	height: 90%;
	line-height: 1.25;
	overflow: auto;
	padding: 1rem;
	width: 100%;
	min-height: var( --popup--height, 0px );
	max-height: calc( 95vh - var( --wp-admin--admin-bar--height, 0px ) );
}

@media ( min-width: 600px ) {
	.popup__body {
		display: flex;
		flex-direction: row;
		gap: 1rem;
	}

	.popup--layout-center .popup__body {
		text-align: center;
	}

	.popup--layout-top .popup__body {
		flex-direction: column;
	}

	.popup--layout-bottom .popup__body {
		flex-direction: column-reverse;
	}

	.popup--layout-right .popup__body {
		flex-direction: row-reverse;
	}

}

.popup--layout-left .popup__image,
.popup--layout-right .popup__image {
	flex: 0 0 50%;
}

.popup__header {
	font-weight: bold;
	font-size: 1.875rem;
	line-height: 1.6rem;
	clear: both;
	color: inherit;
	margin: 1rem 0 2rem 0;
}

.popup__header--left {
	text-align: left;
}

.popup__header--center {
	text-align: center;
}

.popup__header--right {
	text-align: right;
}

.popup__buttons {
	align-items: center;
	display: flex;
	left: auto;
	position: absolute;
	right: 0;
	top: 0;
	transform: translate(16px, -50%);
	gap: 0.5rem;
}

.popup__buttons button {
	align-items: center;
	background: var( --popup--background );
	border-radius: 50%;
	border: 1px solid var( --popup--border );
	color: inherit;
	display: flex;
	height: 32px;
	justify-content: center;
	line-height: 32px;
	position: relative;
	width: 32px;
}

.popup__buttons button path {
	fill: currentColor;
}

.popup__buttons button:hover::before,
.popup__buttons button:focus::before {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background-color: rgba(255,255,255,.2);
	border-radius: 50%;
}

.popup__buttons button:focus {
	outline: 4px solid Highlight;
}

.popup__buttons--left {
	left: 0;
	right: auto;
	top: 0;
	transform: translate(-50%, -50%);
}

.popup__content {
	flex: 1 1 100%;
}

.popup__content p {
	margin-top: 0;
}

.popup-right-image,
.popup-left-image {
	max-width: 345px;
	flex: 0 0 345px;
}

.popup__image {
	position: relative;
}

.popup__image img {
	min-height: 100%;
	min-width: 100%;
	object-fit: cover;
	height: auto;
	width: auto;
	margin: 0;
}

.popup-image-landscape {
	max-width: 800px;
	max-height: 200px;
	width: 100%;
	height: 50%;
	object-fit: cover;
	object-position: center;
}

body.has-active-popup {
	overflow: hidden;
}
