/*
 * PreScholar theme overrides.
 *
 * Brand tokens copied verbatim from the React site's src/index.css and
 * tailwind.config.ts (see PHASE0-REPORT.md §5) so the two properties match:
 *
 *   teal / primary   hsl(172 85% 32%)      navy / foreground  hsl(215 28% 17%)
 *   amber / accent   hsl(37 91% 55%)       background         hsl(210 20% 98%)
 *   border           hsl(214 20% 88%)      radius             0.5rem
 *
 * Typography matches too: Inter for UI/body, Merriweather for headings — the same
 * pairing, and the same Google Fonts source, the React app uses.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Merriweather:wght@400;700;900&display=swap');

:root {
	--ps-navy: hsl(215 28% 17%);
	--ps-teal: hsl(172 85% 32%);
	--ps-teal-dark: hsl(172 85% 26%);
	--ps-teal-light: hsl(172 60% 94%);
	--ps-amber: hsl(37 91% 55%);
	--ps-amber-light: hsl(37 80% 94%);
	--ps-bg: hsl(210 20% 98%);
	--ps-muted: hsl(215 14% 46%);
	--ps-border: hsl(214 20% 88%);
	--ps-radius: 0.5rem;
	--ps-sans: 'Inter', system-ui, -apple-system, sans-serif;
	--ps-serif: 'Merriweather', Georgia, serif;
}

/* ---------- Base typography ---------- */

body,
.pkp_structure_page {
	font-family: var(--ps-sans);
	background: var(--ps-bg);
	color: var(--ps-navy);
}

h1, h2, h3, h4,
.pkp_structure_head .pkp_site_name,
.obj_preprint_summary .title,
.page_preprint .page_title {
	font-family: var(--ps-serif);
	color: var(--ps-navy);
}

a {
	color: var(--ps-teal-dark);
}

a:hover,
a:focus {
	color: var(--ps-teal);
}

/* Keyboard focus must stay visible — the default theme's outline is easy to lose
   against the teal. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 2px solid var(--ps-teal);
	outline-offset: 2px;
}

/* ---------- Masthead ---------- */

.pkp_structure_head {
	background: #fff;
	border-bottom: 1px solid var(--ps-border);
}

.pkp_site_name,
.pkp_site_name .is_img img {
	font-family: var(--ps-serif);
	font-weight: 700;
}

.pkp_site_name a {
	color: var(--ps-navy);
}

/* Navigation */
.pkp_navigation_primary > li > a,
.pkp_navigation_user > li > a {
	color: var(--ps-navy);
	font-family: var(--ps-sans);
	font-weight: 500;
}

.pkp_navigation_primary > li > a:hover,
.pkp_navigation_user > li > a:hover {
	color: var(--ps-teal-dark);
}

/* ---------- Buttons ---------- */

.pkp_button,
.cmp_button,
button.pkp_button_primary,
.pkp_block .cmp_button {
	background: var(--ps-teal);
	border-color: var(--ps-teal);
	color: #fff;
	border-radius: var(--ps-radius);
	font-family: var(--ps-sans);
	font-weight: 600;
}

.pkp_button:hover,
.cmp_button:hover,
button.pkp_button_primary:hover {
	background: var(--ps-teal-dark);
	border-color: var(--ps-teal-dark);
	color: #fff;
}

/* ---------- Preprint listings and landing pages ---------- */

.obj_preprint_summary .title a {
	font-family: var(--ps-serif);
	color: var(--ps-navy);
}

.obj_preprint_summary .title a:hover {
	color: var(--ps-teal-dark);
}

.obj_preprint_summary .subtitle,
.obj_preprint_summary .meta,
.obj_preprint_details .meta {
	color: var(--ps-muted);
}

/* Section label chips (Original Research, Systematic Review, ...) */
.obj_preprint_summary .section_title,
.obj_preprint_details .item.section {
	display: inline-block;
	background: var(--ps-teal-light);
	color: var(--ps-teal-dark);
	border-radius: var(--ps-radius);
	padding: 0.15em 0.6em;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.02em;
}

/* Download / PDF button on landing pages — the primary action for a reader. */
.obj_preprint_details .galleys .obj_galley_link,
.obj_preprint_summary .galleys .obj_galley_link {
	background: var(--ps-teal);
	border-color: var(--ps-teal);
	color: #fff;
	border-radius: var(--ps-radius);
	font-weight: 600;
}

.obj_preprint_details .galleys .obj_galley_link:hover {
	background: var(--ps-teal-dark);
	border-color: var(--ps-teal-dark);
	color: #fff;
}

/* Licence block — CC BY 4.0 must be obvious on every landing page. */
.obj_preprint_details .item.copyright,
.obj_preprint_details .item.licence {
	border-top: 1px solid var(--ps-border);
	padding-top: 1rem;
	color: var(--ps-muted);
	font-size: 0.9rem;
}

/* ---------- The non-clinical-advice disclaimer ---------- */
/*
 * Rendered in the site/context footer (set via the API) and injected onto every
 * preprint landing page by templates/frontend/objects/preprint_details.tpl.
 * Amber rather than red: this is a standing caveat, not an error state.
 */

.prescholar-disclaimer {
	background: var(--ps-amber-light);
	border: 1px solid var(--ps-amber);
	border-left-width: 4px;
	border-radius: var(--ps-radius);
	padding: 0.9rem 1.1rem;
	margin: 1.5rem 0;
	color: var(--ps-navy);
	font-size: 0.92rem;
	line-height: 1.55;
	font-family: var(--ps-sans);
}

.prescholar-disclaimer strong {
	color: hsl(25 80% 32%);
}

/* On the landing page, put it above the abstract so it is read before the science. */
.obj_preprint_details .prescholar-disclaimer {
	margin-top: 0;
}

/* ---------- Footer ---------- */

.pkp_structure_footer_wrapper {
	background: #fff;
	border-top: 1px solid var(--ps-border);
	color: var(--ps-muted);
}

.pkp_structure_footer a {
	color: var(--ps-teal-dark);
}

/* ---------- Blocks / sidebar ---------- */

.pkp_block .title {
	font-family: var(--ps-serif);
	color: var(--ps-navy);
}
