/* Popup block. On the page it is hidden until opened; in the editor it is shown in place. */

.vw-popup
{
	position: fixed;
	inset: 0;
	z-index: 99990;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
	background: color-mix(in srgb, var(--wp--preset--color--contrast, #15232e) 55%, transparent);
}

.vw-popup[hidden]
{
	display: none;
}

.vw-popup-box
{
	position: relative;
	width: 100%;
	max-height: calc(100vh - 40px);
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	background: var(--wp--preset--color--base, #ffffff);
	color: var(--wp--preset--color--contrast, #15232e);
	border-radius: 14px;
	box-shadow: 0 24px 70px rgba(21, 51, 74, 0.28);
	overflow: hidden;
}

.vw-popup-small { max-width: 440px; }
.vw-popup-medium { max-width: 640px; }
.vw-popup-large { max-width: 960px; }

.vw-popup-head
{
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 18px 24px;
	border-bottom: 1px solid var(--wp--preset--color--border, #e2e8ee);
}

.vw-popup-head .vw-popup-title
{
	margin: 0;
	font-size: 1.3rem;
	font-weight: 700;
}

.vw-popup-close
{
	position: relative;
	flex: none;
	width: 32px;
	height: 32px;
	margin-left: auto;
	padding: 0;
	border: none;
	border-radius: 8px;
	background: transparent;
	color: inherit;
	opacity: 0.55;
	cursor: pointer;
}

.vw-popup-close:hover
{
	opacity: 1;
	background: var(--wp--preset--color--base-alt, #f4f7fa);
}

.vw-popup-close::before,
.vw-popup-close::after
{
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	width: 18px;
	height: 2px;
	border-radius: 1px;
	background: currentColor;
	transform: translate(-50%, -50%) rotate(45deg);
}

.vw-popup-close::after
{
	transform: translate(-50%, -50%) rotate(-45deg);
}

.vw-popup-body
{
	padding: 20px 24px 24px 24px;
	overflow: auto;
}

.vw-popup-body > :first-child
{
	margin-top: 0;
}

/* Editor: the popup is shown where it is placed, with a label. */
.vw-popup-editor
{
	border: 1px dashed var(--wp--preset--color--accent, #3393bd);
	border-radius: 14px;
	padding: 0 !important;
}

.vw-popup-editor-label
{
	padding: 6px 12px;
	font-size: 12px;
	color: var(--wp--preset--color--accent, #3393bd);
	background: var(--wp--preset--color--accent-soft, #e3f0f7);
	border-radius: 14px 14px 0 0;
}

.vw-popup-editor .vw-popup-head .vw-popup-title
{
	flex: 1;
}

/* The popup is placed inside page content; the content width rules must not apply to it. */
.vw-popup,
.is-layout-constrained > .vw-popup,
.wp-block-post-content > .vw-popup
{
	max-width: none !important;
	margin: 0 !important;
}

/* No focus ring for mouse clicks; keyboard focus keeps a visible ring. */
.vw-popup-box:focus,
.vw-popup-close:focus
{
	outline: none;
}

.vw-popup-close:focus-visible
{
	outline: 2px solid var(--wp--preset--color--accent, #3393bd);
	outline-offset: 2px;
}
