/* Scoped styles leave the rest of the theme untouched. */
html.vf-popup-open {
	overflow: hidden;
}

#vf-popup.vf-popup {
	box-sizing: border-box;
	position: fixed;
	inset: 0;
	margin: auto;
	width: fit-content;
	min-width: min(20rem, calc(100vw - 2rem));
	max-width: min(44rem, calc(100vw - 2rem));
	height: fit-content;
	max-height: calc(100vh - 2rem);
	max-height: calc(100dvh - 2rem);
	padding: clamp(1.5rem, 4vw, 2.5rem);
	border: 1px solid currentColor;
	border-radius: 0.75rem;
	background: var(--vf-background, #fff);
	color: var(--vf-foreground, #222);
	font-family: var(--vf-font, inherit);
	font-size: var(--vf-font-size, 1rem);
	line-height: 1.6;
	text-align: start;
	overflow: auto;
	overscroll-behavior: contain;
	overflow-wrap: anywhere;
	box-shadow: 0 1.5rem 5rem rgb(0 0 0 / 25%);
}

/* Also remain invisible when scripts are blocked or the notice was dismissed. */
#vf-popup:not([open]) {
	display: none !important;
}

#vf-popup::backdrop {
	background: rgb(0 0 0 / 45%);
}

#vf-popup .vf-popup__close {
	box-sizing: border-box;
	position: absolute;
	inset-block-start: 0.5rem;
	inset-inline-end: 0.5rem;
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	min-width: 0;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 0.375rem;
	background: transparent;
	color: inherit;
	font: 2rem/1 sans-serif;
	box-shadow: none;
	text-decoration: none;
	cursor: pointer;
}

#vf-popup .vf-popup__close:hover {
	background: rgb(128 128 128 / 15%);
}

#vf-popup :focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

#vf-popup .vf-popup__title {
	margin: 0 2rem 1rem 0;
	margin-inline: 0 2rem;
	color: inherit;
	font-family: inherit;
	font-size: clamp(1.25rem, 3vw, 1.75rem);
	font-weight: 700;
	line-height: 1.3;
	text-transform: none;
}

#vf-popup .vf-popup__content {
	padding-block-start: 0.5rem;
}

#vf-popup .vf-popup__title[hidden] + .vf-popup__content {
	padding-block-start: 1.75rem;
}

#vf-popup .vf-popup__content > :first-child {
	margin-block-start: 0;
}

#vf-popup .vf-popup__content > :last-child {
	margin-block-end: 0;
}

#vf-popup .vf-popup__content a {
	color: var(--vf-link, inherit);
	text-decoration: underline;
}

#vf-popup .vf-popup__content :is(img, video, iframe, table) {
	max-width: 100%;
}

#vf-popup .vf-popup__content :is(img, video) {
	height: auto;
}

#vf-popup .vf-popup__content pre {
	white-space: pre-wrap;
}
