/* Webbler Popup */

.wpop {
	--wpop-font: inherit;
	--wpop-heading: #333;
	--wpop-text: #333;
	--wpop-accent: #6bcbc2;
	--wpop-btn: #163e35;
	--wpop-btn-text: #fff;
	--wpop-bg: #fff;
	--wpop-radius: 32px;

	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	box-sizing: border-box;
	font-family: var(--wpop-font);
}

.wpop[hidden] {
	display: none;
}

.wpop *,
.wpop *::before,
.wpop *::after {
	box-sizing: border-box;
}

.wpop__overlay {
	position: absolute;
	inset: 0;
	background: rgba(16, 25, 33, 0.45);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity 400ms ease;
}

.wpop__dialog {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	overflow: auto;
	overscroll-behavior: contain;
	border-radius: var(--wpop-radius);
	background: var(--wpop-bg);
	box-shadow: 0 30px 80px rgba(16, 25, 33, 0.25);
	opacity: 0;
	transform: translate3d(0, 24px, 0) scale(0.98);
	filter: blur(6px);
	transition:
		opacity 500ms ease-out,
		transform 600ms cubic-bezier(0.22, 0.61, 0.36, 1),
		filter 500ms ease-out;
	outline: none;
}

.wpop.is-open .wpop__overlay {
	opacity: 1;
}

.wpop.is-open .wpop__dialog {
	opacity: 1;
	transform: none;
	filter: none;
}

.wpop.is-closing .wpop__overlay,
.wpop.is-closing .wpop__dialog {
	opacity: 0;
	transition-duration: 250ms;
}

.wpop.is-closing .wpop__dialog {
	transform: translate3d(0, 12px, 0);
}

/* Close */
.wpop .wpop__close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.85);
	color: var(--wpop-heading);
	box-shadow: none;
	cursor: pointer;
	transition: background-color 200ms ease, transform 200ms ease;
}

.wpop .wpop__close:hover,
.wpop .wpop__close:focus-visible {
	background: var(--wpop-accent);
	color: var(--wpop-heading);
}

.wpop .wpop__close:focus-visible {
	outline: 2px solid var(--wpop-btn);
	outline-offset: 2px;
}

/* Content */
.wpop__media img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 260px;
	margin: 0;
	object-fit: cover;
}

.wpop__body {
	padding: 48px;
	color: var(--wpop-text);
	text-align: left;
}

.wpop__label {
	margin: 0 0 16px;
	color: var(--wpop-accent);
	font-family: var(--wpop-font);
	font-size: 16px;
	font-weight: 500;
	line-height: 20px;
}

.wpop .wpop__heading {
	margin: 0 0 16px;
	padding: 0 32px 0 0;
	color: var(--wpop-heading);
	font-family: var(--wpop-font);
	font-size: 36px;
	font-weight: 400;
	line-height: 40px;
	letter-spacing: 0;
	text-transform: none;
}

.wpop__text {
	color: var(--wpop-text);
	font-family: var(--wpop-font);
	font-size: 18px;
	line-height: 26px;
}

.wpop__text > * {
	margin: 0;
}

.wpop__text > * + * {
	margin-top: 12px;
}

.wpop__text a {
	color: var(--wpop-btn);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Buttons – pill, colour sweeps in from the left on hover */
.wpop__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 32px;
}

.wpop .wpop__btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	margin: 0;
	padding: 16px 32px;
	overflow: hidden;
	isolation: isolate;
	border: 1px solid var(--wpop-btn);
	border-radius: 999px;
	background: var(--wpop-btn);
	color: var(--wpop-btn-text);
	font-family: var(--wpop-font);
	font-size: 18px;
	font-weight: 400;
	line-height: 22px;
	text-decoration: none;
	text-transform: none;
	letter-spacing: 0;
	box-shadow: none;
	cursor: pointer;
	transition: color 300ms ease, border-color 300ms ease, transform 150ms ease;
}

.wpop .wpop__btn--secondary {
	background: transparent;
	color: var(--wpop-btn);
}

.wpop__fill {
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--wpop-accent);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 300ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.wpop .wpop__btn--secondary .wpop__fill {
	background: var(--wpop-btn);
}

.wpop .wpop__btn:active {
	transform: scale(0.97);
}

.wpop .wpop__btn:focus-visible {
	outline: 2px solid var(--wpop-btn);
	outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
	.wpop .wpop__btn--primary:hover {
		border-color: var(--wpop-accent);
		color: var(--wpop-btn);
	}

	.wpop .wpop__btn--secondary:hover {
		color: var(--wpop-btn-text);
	}

	.wpop .wpop__btn:hover .wpop__fill {
		transform: scaleX(1);
	}
}

html.wpop-locked,
html.wpop-locked body {
	overflow: hidden;
}

@media (max-width: 767px) {
	.wpop {
		align-items: flex-end;
		padding: 12px;
	}

	.wpop__body {
		padding: 32px 24px 24px;
	}

	.wpop .wpop__heading {
		font-size: 28px;
		line-height: 32px;
	}

	.wpop__text {
		font-size: 16px;
		line-height: 24px;
	}

	.wpop__buttons {
		flex-direction: column;
	}

	.wpop .wpop__btn {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wpop__overlay,
	.wpop__dialog,
	.wpop__fill {
		transition: none !important;
	}

	.wpop__dialog {
		transform: none !important;
		filter: none !important;
	}
}
