/**
 * OOSHMAN Popup Styles
 *
 * @package Ooshman\Popup
 */

:root {
	--oosh-overlay-colour: 0, 0, 0;
	--oosh-overlay-opacity: 0.6;
	--oosh-radius: 16px;
	--oosh-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
	--oosh-padding: 0;
	--oosh-z: 999999;
	--oosh-anim-duration: 300ms;
}

/* Overlay */
.oosh-overlay {
	position: fixed;
	inset: 0;
	background: rgba(var(--oosh-overlay-colour), var(--oosh-overlay-opacity));
	z-index: var(--oosh-z);
	backdrop-filter: blur(2px);
}

/* Modal container */
.oosh-modal {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	z-index: calc(var(--oosh-z) + 1);
	padding: var(--oosh-padding);
	pointer-events: none;
}

.oosh-card {
	background: #ffffff;
	border-radius: var(--oosh-radius);
	box-shadow: var(--oosh-shadow);
	overflow: hidden;
	max-width: 100%;
	position: relative;
	pointer-events: auto;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}

.oosh-image-wrapper {
	display: block;
	margin: 0;
	padding: 0;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}

.oosh-image {
	display: block;
	height: auto;
	width: 100%;
	max-width: 100%;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	-webkit-touch-callout: none;
	-webkit-tap-highlight-color: transparent;
}

.oosh-link {
	display: block;
	text-decoration: none;
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	-webkit-touch-callout: none;
}

/* Close button */
.oosh-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 36px;
	height: 36px;
	min-width: 36px;
	min-height: 36px;
	padding: 0;
	margin: 0;
	cursor: pointer;
	background: rgba(255, 255, 255, 0.9);
	border: none;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	transition: background-color 0.2s;
	box-sizing: border-box;
	line-height: 1;
}

.oosh-close:hover {
	background: rgba(255, 255, 255, 1);
}

.oosh-close svg {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	stroke: #333;
	stroke-width: 2.5;
	display: block;
	pointer-events: none;
}

/* Position modifiers */
.oosh--pos-center .oosh-modal {
	align-items: center;
	justify-items: center;
}

.oosh--pos-bottom_right .oosh-modal {
	align-items: flex-end;
	justify-items: flex-end;
	padding: 16px;
}

.oosh--pos-bottom_left .oosh-modal {
	align-items: flex-end;
	justify-items: flex-start;
	padding: 16px;
}

.oosh--pos-top_right .oosh-modal {
	align-items: flex-start;
	justify-items: flex-end;
	padding: 16px;
}

.oosh--pos-top_left .oosh-modal {
	align-items: flex-start;
	justify-items: flex-start;
	padding: 16px;
}

.oosh--pos-fullscreen .oosh-modal {
	padding: 0;
}

.oosh--pos-fullscreen .oosh-card {
	border-radius: 0;
	max-width: 100%;
	max-height: 100%;
	width: 100%;
	height: 100%;
}

.oosh--pos-fullscreen .oosh-image {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* Animation enter states */
.oosh-card.oosh-enter,
.oosh-overlay.oosh-enter {
	opacity: 0;
}

.oosh--anim-fade .oosh-card.oosh-enter {
	opacity: 0;
}

.oosh--anim-fade .oosh-card.oosh-enter-active {
	opacity: 1;
	transition: opacity var(--oosh-anim-duration) ease-out;
}

.oosh--anim-slide .oosh-card.oosh-enter {
	opacity: 0;
	transform: translateY(30px);
}

.oosh--anim-slide .oosh-card.oosh-enter-active {
	opacity: 1;
	transform: translateY(0);
	transition: opacity var(--oosh-anim-duration) ease-out, transform var(--oosh-anim-duration) ease-out;
}

.oosh--anim-zoom .oosh-card.oosh-enter {
	opacity: 0;
	transform: scale(0.85);
}

.oosh--anim-zoom .oosh-card.oosh-enter-active {
	opacity: 1;
	transform: scale(1);
	transition: opacity var(--oosh-anim-duration) ease-out, transform var(--oosh-anim-duration) ease-out;
}

.oosh--anim-none .oosh-card.oosh-enter {
	opacity: 1;
	transform: none;
}

.oosh--anim-none .oosh-card.oosh-enter-active {
	opacity: 1;
	transform: none;
}

/* Overlay animation */
.oosh-overlay.oosh-enter-active {
	opacity: 1;
	transition: opacity var(--oosh-anim-duration) ease-out;
}

/* Exit animations */
.oosh-card.oosh-leaving {
	opacity: 0;
	transition: opacity var(--oosh-anim-duration) ease-in;
}

.oosh--anim-slide .oosh-card.oosh-leaving {
	transform: translateY(-20px);
	transition: opacity var(--oosh-anim-duration) ease-in, transform var(--oosh-anim-duration) ease-in;
}

.oosh--anim-zoom .oosh-card.oosh-leaving {
	transform: scale(0.95);
	transition: opacity var(--oosh-anim-duration) ease-in, transform var(--oosh-anim-duration) ease-in;
}

.oosh-overlay.oosh-leaving {
	opacity: 0;
	transition: opacity var(--oosh-anim-duration) ease-in;
}

/* Responsive */
@media (max-width: 768px) {
	.oosh--pos-bottom_right .oosh-modal,
	.oosh--pos-bottom_left .oosh-modal,
	.oosh--pos-top_right .oosh-modal,
	.oosh--pos-top_left .oosh-modal {
		padding: 8px;
	}

	.oosh-close {
		top: 8px;
		right: 8px;
		width: 32px;
		height: 32px;
	}
}

/* Screen reader text */
.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
	word-wrap: normal !important;
}

/* Focus trap */
.oosh-popup:focus {
	outline: none;
}

