/* ShardX Pop Up 2.0 - front end */

/* Kept off-screen (not display:none) while closed, so page builders can measure
   and initialise the content on page load. */
.sxp.sxp-is-hidden {
	visibility: hidden !important;
	pointer-events: none !important;
	position: fixed !important;
	left: -99999px !important;
	right: auto !important;
	top: 0 !important;
	width: 900px !important;
	max-width: 100vw !important;
	transform: none !important;
}
.sxp.sxp-is-hidden .sxp__overlay { display: none; }

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

/* Pop-up and full screen: centred over an overlay. */
.sxp--popup,
.sxp--full {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2.5vh 2.5vw;
}
.sxp__overlay {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	cursor: pointer;
	animation: sxp-fadein .4s;
}
.sxp--full .sxp__overlay { cursor: default; }

.sxp__box {
	position: relative;
	display: flex;
	flex-direction: column;
	max-width: 95vw;
	max-height: 95vh;
	overflow: visible;
	outline: none;
	-webkit-backface-visibility: visible;
	backface-visibility: visible;
}
.sxp--full .sxp__box { max-width: 100%; max-height: 100%; }
.sxp__box--linked { cursor: pointer; }

.sxp__body {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	flex: 1 1 auto;
	min-height: 0;
	max-height: 100%;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
}
.sxp-content { width: 100%; max-width: 100%; }

/* Fly-in: bottom corner, no overlay. */
.sxp--flyin {
	position: fixed;
	bottom: 0;
	right: 20px;
}
.sxp--flyin .sxp__box {
	max-width: 85vw;
	max-height: 85vh;
	box-shadow: 0 0 20px rgba(0, 0, 0, .2);
}

html.sxp-lock { overflow: hidden; }

/* Link covering the whole pop up (behind the content). */
.sxp__link {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 0;
}
.sxp__body { z-index: 1; }

/* Close button. */
.sxp__close {
	position: absolute;
	top: -15px;
	right: -15px;
	z-index: 30;
	width: 30px;
	height: 30px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: transparent url(../images/close_modal.png) no-repeat center / 30px 30px;
	cursor: pointer;
	box-shadow: none;
}
.sxp__close:focus-visible { outline: 2px solid #2271b1; outline-offset: 2px; }
.sxp--flyin .sxp__close { left: -15px; right: auto; }
.sxp--full .sxp__close { position: fixed; top: 2em; right: 2em; }
.sxp__close--custom {
	width: auto;
	height: auto;
	background: none;
	line-height: 1;
	font-family: Arial, sans-serif;
	border-radius: 0;
}
.sxp__close--custom::before { content: "\00d7"; display: block; }

/* Sticky button. */
.sxp-sticky {
	position: fixed;
	z-index: 999998;
	cursor: pointer;
	line-height: 1.2;
	font-weight: 600;
	padding: 10px 16px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.sxp-sticky:focus-visible { outline: 2px solid #2271b1; outline-offset: 2px; }

/* ---- Media & rich content ---- */
.sxp__body img,
.sxp__body video,
.sxp__body iframe,
.sxp__body svg,
.sxp__body picture { max-width: 100%; }
.sxp-content--classic img,
.sxp-content--classic video,
.sxp-content--gutenberg img { height: auto; }
.sxp-content--classic video { display: block; width: 100%; background: #000; }
.sxp__body audio { width: 100%; max-width: 100%; }
.sxp__body figure { margin: 0; }
.sxp__body .wp-video { width: 100% !important; max-width: 100%; }
.sxp__body .wp-video-shortcode { width: 100% !important; height: auto !important; }

/* 16:9 box for YouTube / Vimeo embeds in classic content. */
.sxp-embed { position: relative; width: 100%; min-width: 280px; max-width: 100%; height: 0; padding-bottom: 56.25%; overflow: hidden; }
.sxp-embed iframe { position: absolute; top: 0; left: 0; width: 100% !important; height: 100% !important; border: 0; }

/* ---- Show effects ---- */
@keyframes sxp-fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes sxp-popin {
	0% { transform: scale(0); opacity: 0; }
	85% { transform: scale(1.05); opacity: 1; }
	100% { transform: scale(1); opacity: 1; }
}
@keyframes sxp-bounce {
	0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
	40% { transform: translateY(-30px); }
	60% { transform: translateY(-15px); }
}
@keyframes sxp-shake {
	0%, 100% { transform: translateX(0); }
	10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
	20%, 40%, 60%, 80% { transform: translateX(10px); }
}
@keyframes sxp-flash {
	0%, 50%, 100% { opacity: 1; }
	25%, 75% { opacity: 0; }
}
@keyframes sxp-tada {
	0% { transform: scale(1); }
	10%, 20% { transform: scale(.9) rotate(-3deg); }
	30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
	40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
	100% { transform: scale(1) rotate(0); }
}
@keyframes sxp-rotateIn {
	0% { transform-origin: center; transform: rotate(-200deg); opacity: 0; }
	100% { transform-origin: center; transform: rotate(0); opacity: 1; }
}
@keyframes sxp-swing {
	0% { transform-origin: top center; }
	20% { transform: rotate(15deg); }
	40% { transform: rotate(-10deg); }
	60% { transform: rotate(5deg); }
	80% { transform: rotate(-5deg); }
	100% { transform: rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
	.sxp.sxp-is-open .sxp__box,
	.sxp__overlay { animation: none !important; }
}
