/* plg_content_reffootnotes — numbered {ref} footnotes. Colours inherit from the template where possible. */

.fn-ref {
	font-size: 75%;
	line-height: 0;
}

.fn-ref a {
	text-decoration: none;
	/* the back link (↑) jumps here: land 6rem below the top like the notes do, not under a sticky menu bar (wcf: 60px) */
	scroll-margin-top: 6rem;
}

.footnotes {
	border-top: 1px solid currentColor;
	margin-top: 2em;
	padding-top: 1em;
	font-size: 85%;
	opacity: .95;
}

.footnotes-list {
	margin: 0;
	padding-left: 2em;
}

.footnotes-list li {
	margin-bottom: .4em;
	scroll-margin-top: 6rem;
}

/* the note the reader jumped to (the old plugin highlighted it in #ffff99) */
.footnotes-list li:target {
	background: var(--fn-highlight, rgba(255, 230, 0, .3));
	outline: 3px solid var(--fn-highlight, rgba(255, 230, 0, .3));
}

.fn-ref a:target,
.fn-link:focus-visible,
.fn-back:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.fn-back {
	text-decoration: none;
	padding: 0 .25em;
}

/* hover / focus preview */
.fn-tip {
	position: absolute;
	z-index: 1000;
	max-width: min(24rem, calc(100vw - 2rem));
	padding: .5em .75em;
	font-size: .9rem;
	line-height: 1.4;
	color: #1a212b;
	background: #fff;
	border: 1px solid #c8cdd3;
	border-radius: 4px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}

@media (prefers-color-scheme: dark) {
	.fn-tip {
		color: #e6ebf0;
		background: #1a212b;
		border-color: #33414f;
	}
}

@media print {
	.fn-tip, .fn-back { display: none; }
}
