/**
 * Whitepaper modal (Interfor).
 *
 * Trigger uses .interfor-btn. Overlay is a fixed div (no <dialog>).
 */

.interfor-whitepaper-modal-widget {
	display: inline-block;
}

.interfor-whitepaper-modal__trigger {
	cursor: pointer;
}

/* ---- Overlay ----------------------------------------------------------- */

.interfor-whitepaper-modal {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	inset: 0;
	z-index: 999999;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	overflow: auto;
	color: inherit;
}

.interfor-whitepaper-modal[hidden] {
	display: none;
}

.interfor-whitepaper-modal:not([hidden]) {
	animation: interfor-whitepaper-modal-in 0.22s ease;
}

.interfor-whitepaper-modal__backdrop {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	inset: 0;
	background: rgba(1, 7, 11, 0.7);
	animation: interfor-whitepaper-modal-backdrop-in 0.22s ease;
}

@keyframes interfor-whitepaper-modal-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes interfor-whitepaper-modal-backdrop-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.interfor-whitepaper-modal:not([hidden]),
	.interfor-whitepaper-modal__backdrop {
		animation: none;
	}
}

/* ---- Panel ------------------------------------------------------------- */

.interfor-whitepaper-modal__panel {
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	width: 100%;
	max-width: 520px;
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	overflow: auto;
	padding: 28px 28px 32px;
	border-radius: 0;
	background: var(--color-panel-light-1, #f6f3ec);
	color: var(--color-dark-text, #0b1118);
}

.interfor-whitepaper-modal--dark .interfor-whitepaper-modal__panel {
	background: var(--color-ink, #01070b);
	color: var(--color-cream-text, #f8f0e6);
}

.interfor-whitepaper-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
}

.interfor-whitepaper-modal__title {
	margin: 0;
	flex: 1 1 auto;
	font-family: var(--font-display, Georgia, serif);
	letter-spacing: -0.4px;
	color: var(--color-dark-text, #0b1118);
}

.interfor-whitepaper-modal--dark .interfor-whitepaper-modal__title {
	color: var(--color-cream-text, #f8f0e6);
}

.interfor-whitepaper-modal__close {
	appearance: none;
	-webkit-appearance: none;
	flex: 0 0 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 36px;
	min-width: 36px;
	height: 36px;
	min-height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: var(--color-red-primary, #A71111);
	color: var(--color-cream-text, #f8f0e6);
	font-size: 0;
	line-height: 0;
	overflow: visible;
	cursor: pointer;
}

.interfor-whitepaper-modal__close:hover {
	opacity: 0.88;
}

.interfor-whitepaper-modal__close:focus {
	opacity: 1;
	outline: 2px solid var(--color-cream-text, #f8f0e6);
	outline-offset: 2px;
}

.interfor-whitepaper-modal__close:focus:not(:focus-visible) {
	outline: none;
}

.interfor-whitepaper-modal__close:focus-visible {
	opacity: 1;
	outline: 2px solid var(--color-cream-text, #f8f0e6);
	outline-offset: 2px;
}

.interfor-whitepaper-modal__close-icon {
	display: block;
	flex: 0 0 12px;
	width: 12px;
	min-width: 12px;
	height: 12px;
	overflow: visible;
	color: inherit;
	stroke: currentColor;
}

.interfor-whitepaper-modal__body {
	min-width: 0;
}

.interfor-whitepaper-modal__placeholder {
	margin: 0;
	opacity: 0.7;
	font-family: var(--font-body, Roboto, Helvetica, Arial, sans-serif);
	font-size: 15px;
}

@media (max-width: 600px) {
	.interfor-whitepaper-modal {
		padding: 16px 12px;
	}

	.interfor-whitepaper-modal__panel {
		padding: 22px 18px 24px;
		max-height: calc(100vh - 32px);
		max-height: calc(100dvh - 32px);
	}
}
