/**
 * plugins/generic/scholarlyReader/styles/scholarlyReader.css
 *
 * Theme-neutral styles for inline full text, citation links and popovers.
 * Colours come from the theme's CSS custom properties when available
 * (Meridian defines --m-*), with neutral fallbacks for other themes.
 */

.sr-fulltext {
	margin: 0 0 3rem;
}

.sr-fulltext__body {
	font-size: 1.0625rem;
	line-height: 1.75;
}

.sr-fulltext__body h2 {
	font-size: 1.5rem;
	line-height: 1.25;
	margin: 2.5rem 0 1rem;
	scroll-margin-top: 90px;
}

.sr-fulltext__body h3 {
	font-size: 1.1875rem;
	line-height: 1.3;
	margin: 2rem 0 0.75rem;
	scroll-margin-top: 90px;
}

.sr-fulltext__body p {
	margin: 0 0 1.1rem;
}

.sr-fulltext__body img {
	max-width: 100%;
	height: auto;
}

.sr-table {
	overflow-x: auto;
	margin: 2rem 0;
	-webkit-overflow-scrolling: touch;
}

.sr-table table {
	min-width: 480px;
	margin: 0;
}

/* In-text citation links */
a.sr-xref {
	color: var(--m-accent, #0f5c63);
	text-decoration: none;
	font-weight: 600;
	border-bottom: 1px dotted currentColor;
	padding: 0 1px;
}

a.sr-xref:hover,
a.sr-xref:focus {
	background: var(--m-accent-tint, #eef5f5);
	border-bottom-style: solid;
}

/* Popover */
.sr-popover {
	position: absolute;
	z-index: 90;
	max-width: 360px;
	padding: 0.875rem 1rem;
	background: var(--m-bg, #fff);
	color: var(--m-text, #222);
	border: 1px solid var(--m-rule, #e8e8e8);
	border-top: 2px solid var(--m-accent, #0f5c63);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
	font-family: var(--m-font-ui, system-ui, sans-serif);
	font-size: 0.875rem;
	line-height: 1.5;
}

.sr-popover[hidden] {
	display: none;
}

.sr-popover__label {
	display: block;
	margin-bottom: 0.375rem;
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--m-muted, #6b6b6b);
}

.sr-popover__text a {
	word-break: break-word;
}

.sr-popover__go {
	display: inline-block;
	margin-top: 0.5rem;
	font-weight: 600;
}

/* Reference look-up links */
.sr-ref-links {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0 0.875rem;
	margin-left: 0.5rem;
	font-family: var(--m-font-ui, system-ui, sans-serif);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	vertical-align: 1px;
}

.sr-ref-links a {
	color: var(--m-muted, #6b6b6b);
	text-decoration: none;
}

.sr-ref-links a:hover,
.sr-ref-links a:focus {
	color: var(--m-accent, #0f5c63);
	text-decoration: underline;
}

[id^="ref-"].sr-flash {
	animation: sr-flash 1.6s ease-out;
}

@keyframes sr-flash {
	0%, 40% { background: var(--m-accent-tint, #eef5f5); }
	100% { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
	[id^="ref-"].sr-flash { animation: none; }
}
