/* A research paper's figures (figures.js): drawn live on a canvas, on the
   page's own background, which their green ramp was validated against, in
   M3's outlined container (1px outline, 12px corners). */

.figure-art {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	min-height: 200px;
	max-height: 380px;
	border: 1px solid var(--hairline);
	border-radius: var(--s3);
	background: var(--bg);
	overflow: hidden;
}

.figure-art canvas {
	display: block;
	width: 100%;
	height: 100%;
}

/* A thumbnail or a hero: as big as what holds it. */
.figure-compact {
	aspect-ratio: auto;
	min-height: 0;
	max-height: none;
	height: 100%;
	border: 0;
	border-radius: inherit;
	background: none;
}

/* The values under the pointer: M3's plain tooltip, on the menus' glass,
   a row for each series. */
.figure-tip {
	position: absolute;
	z-index: 1;
	display: grid;
	gap: 2px;
	min-width: 120px;
	padding: var(--s2) var(--s3);
	border-radius: var(--s2);
	background: color-mix(in srgb, var(--popup) 88%, transparent);
	-webkit-backdrop-filter: blur(16px);
	backdrop-filter: blur(16px);
	box-shadow:
		inset 0 0 0 1px color-mix(in srgb, var(--text) 9%, transparent),
		0 1px 2px rgb(0 0 0 / 0.3),
		0 2px 6px 2px rgb(0 0 0 / 0.15);
	font-size: 12px;
	line-height: 16px;
	pointer-events: none;
	white-space: nowrap;
}

.figure-tip[hidden] {
	display: none;
}

.figure-tip > span {
	display: flex;
	justify-content: space-between;
	gap: var(--s4);
	color: var(--muted);
}

.figure-tip > span > :last-child {
	color: var(--text);
	font-variant-numeric: tabular-nums;
}

/* The figure's numbers, under a disclosure beneath it. */
.markdown .figure-data {
	margin: var(--s2) 0 0;
	padding: 0;
	border: 0;
	font-size: 13px;
}

.markdown .figure-data > summary {
	width: fit-content;
	color: var(--muted);
}

.markdown .figure-data .md-table {
	margin-top: var(--s2);
}

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
	.figure-tip {
		background: var(--popup);
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}
}
