/* CFan References: citations in the text, the References list, and the hover card. Colours come from the
   theme's presets when it has them (Yukimi switches them for its dark mode), with plain fallbacks. */

.cfan-cites {
	white-space: nowrap;
}
.cfan-cites > a.cfan-cite {
	color: var(--wp--preset--color--accent, #1b7fa0);
	font-variant-numeric: tabular-nums;
	text-decoration: none;
	border-radius: 4px;
}
.cfan-cites > a.cfan-cite:hover,
.cfan-cites > a.cfan-cite:focus-visible {
	text-decoration: underline;
	text-underline-offset: 0.18em;
}
.cfan-cite-missing {
	color: #b3261e;
	cursor: help;
}

.cfan-refs .cfan-refs-list {
	margin: 0.8rem 0 0;
	padding: 0;
	list-style: none;
	font-size: var(--wp--preset--font-size--small, 0.9rem);
	line-height: 1.6;
}
.cfan-refs .cfan-ref {
	display: grid;
	grid-template-columns: 2.4em 1fr;
	gap: 0.35em;
	margin: 0;
	padding: 0.35em 0.5em;
	border-radius: 8px;
	scroll-margin-top: calc(1.5rem + var(--wp-admin--admin-bar--height, 0px));
	transition: background-color 0.4s ease;
}
.cfan-refs .cfan-ref + .cfan-ref {
	margin-top: 0.15em;
}
.cfan-refs .cfan-ref:target {
	background: color-mix(in srgb, var(--wp--preset--color--ice, #48c2dc) 18%, transparent);
}
.cfan-refs .cfan-ref-num {
	color: var(--wp--preset--color--muted, #5b6478);
	font-variant-numeric: tabular-nums;
}
.cfan-refs .cfan-ref-text {
	min-width: 0;
	overflow-wrap: anywhere;
}
/* English references on a Chinese page: when a CJK font draws the Latin text, its quotes are full width unless
   asked for proportional ones */
.cfan-ref-text[lang="en"] {
	font-feature-settings: "pwid" 1;
}
.cfan-refs .cfan-ref-text a {
	overflow-wrap: anywhere;
}
.cfan-refs .cfan-ref-back {
	margin-left: 0.15em;
	color: var(--wp--preset--color--muted, #5b6478);
	text-decoration: none;
}
.cfan-refs .cfan-ref-back:hover {
	color: var(--wp--preset--color--accent, #1b7fa0);
}
.cfan-refs .cfan-ref-back sup {
	font-size: 0.7em;
}
.cfan-refs .cfan-ref-key {
	font-size: 0.85em;
	white-space: nowrap;
}
.cfan-refs .cfan-refs-problems {
	margin: 0.8rem 0 0;
	padding: 0.6rem 0.9rem 0.6rem 1.8rem;
	border-radius: 8px;
	background: #fdf1e3;
	color: #8a4a12;
	font-size: var(--wp--preset--font-size--small, 0.9rem);
}
html[data-theme="dark"] .cfan-refs .cfan-refs-problems {
	background: rgba(253, 241, 227, 0.12);
	color: #f3c58f;
}
.cfan-refs .cfan-refs-help {
	margin: 0.8rem 0 0;
	color: var(--wp--preset--color--muted, #5b6478);
	font-size: var(--wp--preset--font-size--small, 0.9rem);
}
.cfan-refs-editor .cfan-refs-bibtex textarea {
	font-family: var(--wp--preset--font-family--mono, ui-monospace, Consolas, monospace);
	font-size: 12.5px;
	line-height: 1.5;
	white-space: pre;
}

.cfan-cite-card {
	position: fixed;
	z-index: 80;
	max-width: min(26rem, calc(100vw - 24px));
	padding: 0.7rem 0.9rem;
	border: 1px solid var(--wp--preset--color--line, rgba(31, 45, 77, 0.12));
	border-radius: 12px;
	background: var(--wp--preset--color--surface-solid, #fff);
	box-shadow: var(--yk-shadow, 0 12px 32px -8px rgba(35, 55, 105, 0.22));
	color: var(--wp--preset--color--text, #1f2d4d);
	font-size: 0.85rem;
	line-height: 1.55;
	overflow-wrap: anywhere;
}
.cfan-cite-card[hidden] {
	display: none;
}
.cfan-cite-card a {
	color: var(--wp--preset--color--accent, #1b7fa0);
}
@media (prefers-reduced-motion: reduce) {
	.cfan-refs .cfan-ref {
		transition: none;
	}
}
@media print {
	.cfan-cite-card,
	.cfan-ref-backs {
		display: none;
	}
}
