/**
 * fssPinwheel: article detail page (header and related lists are shared with the search page).
 * Plain CSS (no Tailwind build needed), scoped to .page_article / .page_search.
 */

.page_article,
.page_search {
	--art-primary: #FE6019;
	--art-primary-soft: #FFF1EA;
	--art-text: #1f2937;
	--art-muted: #6b7280;
	--art-border: #EBEBEB;
	--art-card: #ffffff;
	--art-surface: #f8f9fb;
	padding-bottom: 3rem;
	color: var(--art-text);
}

.dark .page_article,
.dark .page_search {
	--art-primary-soft: rgba(254, 96, 25, 0.14);
	--art-text: #e5e7eb;
	--art-muted: #9ca3af;
	--art-border: #334155;
	--art-card: #1e293b;
	--art-surface: #0f172a;
}

/* ---------- Header ---------- */
:is(.page_article, .page_search) .article_header {
	margin: 1.75rem 0 1.5rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--art-border);
}

.page_article .article_section_badge {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.25rem 0.75rem;
	border-radius: 999px;
	background: var(--art-primary-soft);
	color: var(--art-primary);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

:is(.page_article, .page_search) .article_title {
	margin: 0.85rem 0 0;
	font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.35rem);
	line-height: 1.25;
	color: var(--art-text);
}

.page_article .subtitle {
	margin: -0.5rem 0 1.5rem;
	font-size: 1.15rem;
	font-weight: 500;
	color: var(--art-muted);
}

/* ---------- Layout ---------- */
.page_article .obj_article_details > .row {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2rem;
	margin: 0;
}

.page_article .obj_article_details > .row > * {
	width: auto;
	max-width: none;
	padding: 0;
	margin: 0;
}

@media (min-width: 1024px) {
	.page_article .obj_article_details > .row {
		grid-template-columns: minmax(0, 1fr) 320px;
		gap: 2.75rem;
		align-items: start;
	}

	.page_article .entry_details {
		position: sticky;
		top: 6.5rem;
	}

	/* The sidebar already shows these facts and the download links */
	.page_article .article_meta_bar,
	.page_article .mobile_galleys {
		display: none !important;
	}
}

.page_article ul.mobile_galleys {
	margin: -1rem 0 2rem;
}

/* ---------- Generic section headings ---------- */
.page_article .main_entry .item {
	margin-bottom: 2rem;
}

.page_article .main_entry .item > .label,
.page_article .main_entry .item summary.label {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	margin: 0 0 0.75rem;
	font-size: 1.2rem;
	color: var(--art-text);
}

.page_article .item .label > i,
.page_article .item summary.label > i {
	color: var(--art-primary);
	font-size: 0.95em;
}

/* ---------- Authors ---------- */
.page_article .authors ul.authors,
.page_article ul.authors {
	list-style: none;
	margin: 0;
	padding: 0;
}

.page_article .item.authors ul.authors {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 0.75rem;
}

.page_article .author {
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
	padding: 0.85rem 1rem;
	border: 1px solid var(--art-border);
	border-radius: 0.75rem;
	background: var(--art-card);
}

.page_article .author_icon {
	flex: 0 0 2.25rem;
	height: 2.25rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: var(--art-primary-soft);
	color: var(--art-primary);
	font-size: 0.9rem;
}

.page_article .author_info {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	min-width: 0;
}

.page_article .author .name {
	font-weight: 600;
	color: var(--art-text);
}

.page_article .author .userGroup {
	font-size: 0.78rem;
	color: var(--art-muted);
}

.page_article .author .affiliation,
.page_article .author .orcid {
	font-size: 0.85rem;
	color: var(--art-muted);
	overflow-wrap: anywhere;
}

.page_article .author .affiliation i {
	margin-right: 0.3rem;
}

.page_article .orcid_badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.05rem;
	height: 1.05rem;
	margin-right: 0.3rem;
	border-radius: 999px;
	background: #A6CE39;
	color: #fff;
	font-size: 0.55rem;
	font-weight: 700;
	vertical-align: middle;
}

/* ---------- Meta bar ---------- */
.page_article .article_meta_bar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	list-style: none;
	margin: 0 0 2rem;
	padding: 0.85rem 1.1rem;
	border-radius: 0.75rem;
	background: var(--art-surface);
	border: 1px solid var(--art-border);
	font-size: 0.9rem;
	color: var(--art-muted);
}

.page_article .article_meta_bar:empty {
	display: none;
}

.page_article .article_meta_bar li {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
}

.page_article .article_meta_bar i {
	color: var(--art-primary);
}

.page_article .article_meta_bar .meta_label {
	font-weight: 600;
}

.page_article .article_meta_bar a {
	color: var(--art-text);
	font-weight: 500;
}

/* ---------- Keywords ---------- */
.page_article .keyword_list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.page_article .keyword_list li {
	padding: 0.3rem 0.8rem;
	border-radius: 999px;
	border: 1px solid var(--art-border);
	background: var(--art-card);
	font-size: 0.85rem;
	color: var(--art-text);
}

/* ---------- Abstract ---------- */
.page_article .abstract .value {
	line-height: 1.75;
	text-align: justify;
	hyphens: auto;
}

.page_article .abstract .value p + p {
	margin-top: 0.85rem;
}

/* ---------- References ---------- */
.page_article .references details {
	border: 1px solid var(--art-border);
	border-radius: 0.75rem;
	background: var(--art-card);
}

.page_article .references summary.label {
	margin: 0;
	padding: 0.9rem 1.1rem;
	cursor: pointer;
	list-style: none;
}

.page_article .references summary::-webkit-details-marker {
	display: none;
}

.page_article .references summary::after {
	content: "\f078";
	margin-left: auto;
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	font-size: 0.8rem;
	color: var(--art-muted);
	transition: transform 0.2s;
}

.page_article .references details[open] summary::after {
	transform: rotate(180deg);
}

.page_article .references .count {
	font-weight: 400;
	font-size: 0.95rem;
	color: var(--art-muted);
}

.page_article .references .value {
	padding: 0 1.1rem 1rem;
	font-size: 0.9rem;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.page_article .references .value p {
	margin: 0 0 0.6rem;
}

/* ---------- Sidebar cards ---------- */
.page_article .entry_details > .item {
	margin: 0 0 1.25rem;
	padding: 1.1rem 1.2rem;
	border: 1px solid var(--art-border);
	border-radius: 0.85rem;
	background: var(--art-card);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.page_article .entry_details > .item > .label,
.page_article .entry_details .sub_item > .label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 0.85rem;
	font-size: 1.05rem;
	color: var(--art-text);
}

/* Downloads and details come first, the cover image is secondary */
.page_article .entry_details {
	display: flex;
	flex-direction: column;
}

.page_article .entry_details > .galleys {
	order: -2;
}

.page_article .entry_details > .article_facts {
	order: -1;
}

.page_article .entry_details .cover_image {
	padding: 0.75rem;
	text-align: center;
}

.page_article .entry_details .cover_image img {
	display: inline-block;
	width: 100%;
	max-width: 200px;
	border-radius: 0.5rem;
	box-shadow: 0 4px 14px rgba(16, 24, 40, 0.12);
}

/* Downloads */
.page_article .galleys_links,
.page_article .supplementary_galleys_links {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.page_article .supplementary_galleys_links {
	margin-top: 0.5rem;
}

.page_article .galleys_links a {
	display: flex !important;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	margin: 0 !important;
	padding: 0.7rem 1rem;
	border: 0;
	border-radius: 0.6rem;
	background: var(--art-primary);
	color: #fff !important;
	font-weight: 600;
	transition: filter 0.15s, transform 0.15s;
}

.page_article .galleys_links a:hover {
	filter: brightness(0.93);
	transform: translateY(-1px);
}

.page_article .supplementary_galleys_links a {
	display: flex;
	width: 100%;
	justify-content: center;
	border-radius: 0.6rem;
}

/* Details list */
.page_article .article_facts dl {
	margin: 0;
}

.page_article .article_facts .fact {
	display: grid;
	gap: 0.2rem;
	padding: 0.65rem 0;
	border-top: 1px dashed var(--art-border);
}

.page_article .article_facts .fact:first-child {
	padding-top: 0;
	border-top: 0;
}

.page_article .article_facts dt {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--art-muted);
}

.page_article .article_facts dt i {
	width: 1rem;
	text-align: center;
	color: var(--art-primary);
}

.page_article .article_facts dd {
	margin: 0 0 0 1.45rem;
	font-size: 0.92rem;
	color: var(--art-text);
	overflow-wrap: anywhere;
}

.page_article .article_facts dd ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.page_article .entry_details a {
	color: var(--art-primary);
}

/* License */
.page_article .copyright {
	font-size: 0.85rem;
	color: var(--art-muted);
	overflow-wrap: anywhere;
}

.page_article .copyright img {
	margin: 0.25rem 0 0.5rem;
}

/* How to cite (citationStyleLanguage plugin) */
.page_article .entry_details .item.citation .sub_item > .label::before {
	content: "\f10d";
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	font-size: 0.9em;
	color: var(--art-primary);
}

.page_article #citationOutput {
	padding: 0.75rem 0.85rem;
	border-radius: 0.5rem;
	background: var(--art-surface);
	font-size: 0.85rem;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.page_article .citation_formats {
	margin-top: 0.75rem;
	border: 1px solid var(--art-border);
	border-radius: 0.5rem;
}

.page_article .citation_formats_button {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	margin: 0;
	padding: 0.6rem 0.85rem;
	background: transparent;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--art-text);
	cursor: pointer;
}

/* Replaces the icon font glyph the plugin expects (not loaded by this theme) */
.page_article .citation_formats_button::after {
	content: "\f078" !important;
	font-family: "Font Awesome 6 Free" !important;
	font-weight: 900;
	font-size: 0.75rem;
	color: var(--art-muted);
}

.page_article .citation_formats_button[aria-expanded="true"]::after {
	content: "\f077" !important;
}

.page_article .citation_formats_list {
	padding: 0 0.85rem 0.6rem;
	font-size: 0.85rem;
}

.page_article .citation_formats_list ul {
	list-style: none;
	margin: 0 0 0.5rem;
	padding: 0;
}

.page_article .citation_formats_list li {
	padding: 0.25rem 0;
}

/* ---------- Related articles (similar / same author) ---------- */
.page_article .article_related {
	display: grid;
	gap: 1.5rem;
	margin-top: 1rem;
}

.page_article .article_related:empty {
	display: none;
}

/* The plugins always print their wrapper, even without results */
.page_article .article_related .related_articles:not(:has(.related_heading)) {
	display: none;
}

:is(.page_article, .page_search) .related_articles {
	padding: 1.5rem;
	border: 1px solid var(--art-border);
	border-radius: 0.85rem;
	background: var(--art-card);
}

:is(.page_article, .page_search) .related_heading {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	margin: 0 0 1rem;
	font-size: 1.25rem;
	color: var(--art-text);
}

:is(.page_article, .page_search) .related_heading i {
	color: var(--art-primary);
}

:is(.page_article, .page_search) .related_heading a {
	color: inherit;
}

:is(.page_article, .page_search) .related_list {
	list-style: none;
	margin: 0;
	padding: 0;
}

:is(.page_article, .page_search) .related_item {
	display: flex;
	gap: 0.85rem;
	padding: 0.85rem 0;
	border-top: 1px solid var(--art-border);
}

:is(.page_article, .page_search) .related_item:first-child {
	border-top: 0;
	padding-top: 0.25rem;
}

:is(.page_article, .page_search) .related_icon {
	flex: 0 0 2.25rem;
	height: 2.25rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 0.55rem;
	background: var(--art-primary-soft);
	color: var(--art-primary);
}

:is(.page_article, .page_search) .related_body {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
}

:is(.page_article, .page_search) .related_title {
	font-weight: 600;
	line-height: 1.4;
	color: var(--art-text);
}

:is(.page_article, .page_search) .related_title:hover {
	color: var(--art-primary);
}

:is(.page_article, .page_search) .related_meta {
	display: inline-flex;
	align-items: baseline;
	gap: 0.4rem;
	font-size: 0.85rem;
	color: var(--art-muted);
}

:is(.page_article, .page_search) .related_meta i {
	font-size: 0.8rem;
	color: var(--art-primary);
	opacity: 0.85;
}

:is(.page_article, .page_search) a.related_issue:hover {
	color: var(--art-primary);
}

:is(.page_article, .page_search) .related_pages {
	margin: 1rem 0 0;
	font-size: 0.85rem;
	color: var(--art-muted);
}

:is(.page_article, .page_search) .related_search {
	display: flex;
	align-items: baseline;
	gap: 0.45rem;
	margin: 0.75rem 0 0;
	padding-top: 0.75rem;
	border-top: 1px solid var(--art-border);
	font-size: 0.85rem;
	color: var(--art-muted);
}

:is(.page_article, .page_search) .related_search a {
	color: var(--art-primary);
	font-weight: 500;
}

@media (max-width: 640px) {
	:is(.page_article, .page_search) .related_articles {
		padding: 1.1rem;
	}

	.page_article .article_meta_bar {
		flex-direction: column;
	}

	.page_article .abstract .value {
		text-align: left;
	}
}
