/**
 * Front-end pop-up styles.
 */

.cpp-popup-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba( 0, 0, 0, 0.6 );
	opacity: 0;
	transition: opacity 0.2s ease;
	overflow-y: auto;
}

.cpp-popup-overlay.is-open {
	opacity: 1;
}

.cpp-popup-overlay--transparent {
	background: transparent;
	pointer-events: none;
}

.cpp-popup-overlay--transparent .cpp-popup {
	pointer-events: auto;
}

.cpp-popup {
	position: relative;
	width: 100%;
	max-width: 560px;
	margin: auto;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 20px 60px rgba( 0, 0, 0, 0.35 );
	transform: translateY( 12px ) scale( 0.98 );
	transition: transform 0.2s ease;
	overflow: hidden;
}

.cpp-popup-overlay.is-open .cpp-popup {
	transform: translateY( 0 ) scale( 1 );
}

.cpp-popup__content {
	padding: 28px;
}

.cpp-popup__content > *:first-child {
	margin-top: 0;
}

.cpp-popup__content > *:last-child {
	margin-bottom: 0;
}

/* Image pop-ups render edge to edge. */
.cpp-popup__content:has( > .cpp-popup__image ),
.cpp-popup__content:has( > .cpp-popup__image-link ) {
	padding: 0;
	font-size: 0;
}

.cpp-popup__image {
	display: block;
	width: 100%;
	height: auto;
}

.cpp-popup__close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	width: 36px;
	height: 36px;
	padding: 0;
	font-size: 24px;
	line-height: 1;
	color: #fff;
	background: rgba( 0, 0, 0, 0.45 );
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.15s ease;
}

.cpp-popup__close:hover,
.cpp-popup__close:focus-visible {
	background: rgba( 0, 0, 0, 0.75 );
	outline: 2px solid #fff;
	outline-offset: 1px;
}

body.cpp-popup-open {
	overflow: hidden;
}

@media ( max-width: 480px ) {
	.cpp-popup__content {
		padding: 20px;
	}

	.cpp-popup__close {
		top: 6px;
		right: 6px;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.cpp-popup-overlay,
	.cpp-popup {
		transition: none;
	}
}
