/*
 * Styling for the publication list.
 *
 * Why explicit colours rather than inherited ones (corrected 28.07.2026):
 * the first version expressed everything as currentColor plus opacity, on the assumption
 * that inheriting from the theme is the polite thing to do. On the CAIMed site that
 * produced an unreadable page - the colibri page template renders body text in a very
 * light grey (its own paragraphs are barely visible too), and layering opacity 0.7 on top
 * of that leaves nothing. Secondary information has to carry its own contrast.
 *
 * So: a small palette of explicit greys, no opacity used for legibility. Links keep the
 * theme's colour, since that is genuinely a site-wide decision.
 *
 * EVERY colour in this file is a variable in the block below (since 0.3.4, 06.10.2026) -
 * to restyle the lists, change that block and nothing else. Design guide: wordpress/DESIGN.md.
 *
 * No dark mode (removed 06.10.2026): caimed.de has no dark theme, so the page background
 * stays light whatever the visitor's system says. A prefers-color-scheme block switched our
 * text to near-white on that light background and made the lists unreadable for every
 * visitor in dark mode. If the site ever gets a dark theme, add the block back here,
 * redefining the same variables.
 */

/* Poppins, the caimed.de font (since 0.3.6), served from the plugin itself: no request to
   Google, and independent of whatever fonts the theme of the host site happens to cache.
   Four weights, Latin plus Latin Extended (names like Vystrčilová); the browser fetches a
   file only when the page uses that weight and range. Licence: fonts/OFL.txt. A family name
   of our own, so it cannot collide with a theme's "Poppins" declarations. */
@font-face { font-family: "CAIMed Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/poppins-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "CAIMed Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/poppins-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "CAIMed Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/poppins-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "CAIMed Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/poppins-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "CAIMed Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/poppins-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "CAIMed Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/poppins-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "CAIMed Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/poppins-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "CAIMed Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/poppins-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* The palette. Declared on the intro paragraph too, because that paragraph sits on the page
   outside the shortcode's wrapper and would not inherit the variables otherwise.

   Since 0.3.6 the caimed.de colours (Yuliia Borovynska, 14.10.2026): text and headings
   #092342, clickable headings #20538E, secondary #8FAAC9, accent #DB3887, links and buttons
   #E1687A, secondary text #737373, background #FFFFFF. Lines and surfaces are light tints
   of the secondary colour. Contrast on white: #E1687A 3.8:1 and #DB3887 4.3:1, both below
   the 4.5:1 of WCAG AA for normal text - kept anyway because the site uses them (decided
   14.10.2026, the web team was told); #737373 is 4.7:1 and therefore also the faintest
   text colour here - nothing lighter may carry text. */
.caimed-pub,
.caimed-pub-intro {
	/* text */
	--caimed-text: #092342;          /* titles, year headings, body of the list, intro text */
	--caimed-muted: #737373;         /* authors, filter labels, counts, disclaimer, partners */
	--caimed-faint: #737373;         /* venue/year/DOI line, count next to a year heading */
	--caimed-sep: #8faac9;           /* the "·" between venue, year and DOI */

	/* links: a title is a "clickable heading", everything else a link */
	--caimed-title-link: #20538e;
	--caimed-link: #e1687a;
	--caimed-link-hover: #c74e61;

	/* lines and surfaces */
	--caimed-line: #d5dfeb;          /* filter box border, year heading rule, badge default */
	--caimed-line-soft: #edf2f7;     /* rule between two entries */
	--caimed-panel: #f6f8fb;         /* filter box, disclaimer, entry under the mouse */
	--caimed-highlight: rgba(143, 170, 201, 0.18); /* entry opened via its "#" link */

	/* accent and controls */
	--caimed-accent: #e1687a;        /* "Filtern" button, focus ring */
	--caimed-accent-hover: #c74e61;  /* "Filtern" button under the mouse */
	--caimed-mark: #db3887;          /* disclaimer bar, bar next to the entry under the mouse */
	--caimed-button-text: #fff;      /* text on the "Filtern" button */
	--caimed-input-bg: #fff;         /* dropdowns and search field */
	--caimed-input-line: #b9c9dc;    /* their border */

	/* badges: fg = text, bg = fill, line = border */
	--caimed-oa-fg: #0d6b43;         /* "Open Access" */
	--caimed-oa-bg: #e9f6ef;
	--caimed-oa-line: #b4ddc8;
	--caimed-top-fg: #20538e;        /* "Spitzenvenue" */
	--caimed-top-bg: #e8eef6;
	--caimed-top-line: #a9bed6;
	--caimed-type-fg: #8a6410;       /* record type, e.g. "Datensatz", "Preprint" */
	--caimed-type-bg: #fdf6e7;
	--caimed-type-line: #e2c893;
	--caimed-group-fg: #092342;      /* CAIMed group; border and fill come from its cluster */
	--caimed-group-bg: #f6f8fb;
	--caimed-group-line: #d5dfeb;

	/* the four clusters, as on caimed.de: colour = border, tint = fill. Text on the tints
	   stays --caimed-group-fg; white text on these colours would fail contrast badly. */
	--caimed-cluster-semantik: #8faac9;
	--caimed-cluster-semantik-tint: #eef3f8;
	--caimed-cluster-entscheidungen: #20538e;
	--caimed-cluster-entscheidungen-tint: #e6edf5;
	--caimed-cluster-wirkstoffe: #db3887;
	--caimed-cluster-wirkstoffe-tint: #fbe8f1;
	--caimed-cluster-signale: #e1687a;
	--caimed-cluster-signale-tint: #fcecee;
}

.caimed-pub {
	margin: 1.5em 0;
	color: var(--caimed-text);
	font-size: 1rem;
	line-height: 1.5;
}

/* Intro text placed on the page *outside* the shortcode. The stylesheet is loaded for the
   whole page once the shortcode runs, so giving that paragraph a class is enough to rescue
   it from the template's near-invisible body colour. */
.caimed-pub-intro {
	max-width: 62em;
	margin-bottom: 1.2em;
	color: var(--caimed-text);
	font-size: 1rem;
	line-height: 1.55;
}

/* ---------------------------------------------------------------- disclaimer */

.caimed-pub-disclaimer {
	margin: 0 0 1.5em;
	padding: 0.7em 1em;
	border-left: 3px solid var(--caimed-mark);
	background: var(--caimed-panel);
	color: var(--caimed-muted);
	font-size: 0.9rem;
}

/* ---------------------------------------------------------------- filters */

.caimed-pub-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.8em 1.1em;
	align-items: flex-end;
	padding: 1em 1.1em;
	margin-bottom: 1.3em;
	border: 1px solid var(--caimed-line);
	border-radius: 5px;
	background: var(--caimed-panel);
}

.caimed-pub-filter {
	display: flex;
	flex-direction: column;
	gap: 0.3em;
}

.caimed-pub-filter-label {
	color: var(--caimed-muted);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.caimed-pub-filters select,
.caimed-pub-filters input[type="search"] {
	font: inherit;
	font-size: 0.92rem;
	line-height: 1.3;
	padding: 0.45em 0.6em;
	border: 1px solid var(--caimed-input-line);
	border-radius: 3px;
	background: var(--caimed-input-bg);
	color: var(--caimed-text);
	max-width: 16em;
}

.caimed-pub-filters select:focus,
.caimed-pub-filters input[type="search"]:focus {
	outline: 2px solid var(--caimed-accent);
	outline-offset: 1px;
}

.caimed-pub-filter-search input {
	min-width: 13em;
}

.caimed-pub-filter-actions {
	display: flex;
	align-items: center;
	gap: 1em;
}

.caimed-pub-filters button {
	font: inherit;
	font-size: 0.92rem;
	font-weight: 600;
	padding: 0.5em 1.3em;
	border: 1px solid var(--caimed-accent);
	border-radius: 3px;
	background: var(--caimed-accent);
	color: var(--caimed-button-text);
	cursor: pointer;
}

.caimed-pub-filters button:hover {
	background: var(--caimed-accent-hover);
}

.caimed-pub-reset {
	font-size: 0.88rem;
	color: var(--caimed-muted);
}

/* ---------------------------------------------------------------- toolbar */

.caimed-pub-toolbar {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.4em 1.5em;
	align-items: baseline;
	padding-bottom: 0.6em;
	font-size: 0.9rem;
	color: var(--caimed-muted);
}

.caimed-pub-count {
	font-weight: 600;
}

.caimed-pub-export a {
	margin-left: 0.7em;
}

/* ---------------------------------------------------------------- year headings */

.caimed-pub-year {
	display: flex;
	align-items: baseline;
	gap: 0.6em;
	margin: 1.9em 0 0.3em;
	padding-bottom: 0.3em;
	border-bottom: 2px solid var(--caimed-line);
	color: var(--caimed-text);
	font-size: 1.3rem;
	font-weight: 700;
	line-height: 1.2;
}

.caimed-pub-year-count {
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--caimed-faint);
}

/* ---------------------------------------------------------------- list */

.caimed-pub-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.caimed-pub-item {
	padding: 0.9em 0 0.9em 0.9em;
	border-left: 3px solid transparent;
	border-bottom: 1px solid var(--caimed-line-soft);
}

.caimed-pub-item:last-child {
	border-bottom: none;
}

.caimed-pub-item:hover {
	border-left-color: var(--caimed-mark);
	background: var(--caimed-panel);
}

.caimed-pub-titleline {
	margin-bottom: 0.28em;
}

.caimed-pub-title {
	font-size: 1.02rem;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
}

a.caimed-pub-title:hover {
	text-decoration: underline;
}

/* Long titles are far easier to scan when the line does not run the full width of a
   wide theme container. */
.caimed-pub-titleline,
.caimed-pub-authors {
	max-width: 62em;
}

.caimed-pub-authors {
	margin-bottom: 0.3em;
	color: var(--caimed-muted);
	font-size: 0.9rem;
	cursor: help;
}

.caimed-pub-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45em;
	color: var(--caimed-faint);
	font-size: 0.85rem;
}

.caimed-pub-venue {
	font-style: italic;
	color: var(--caimed-muted);
}

.caimed-pub-sep {
	color: var(--caimed-sep);
}

.caimed-pub-doi {
	color: var(--caimed-faint);
	word-break: break-word;
}

.caimed-pub-badge {
	display: inline-block;
	padding: 0.12em 0.6em;
	border: 1px solid var(--caimed-line);
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	white-space: nowrap;
}

.caimed-pub-badge-oa {
	border-color: var(--caimed-oa-line);
	background: var(--caimed-oa-bg);
	color: var(--caimed-oa-fg);
}

/* Spitzenvenue. The one badge that is a judgement rather than a fact about the record, so
   it gets the strongest colour of the three - but still a badge, not a medal. */
.caimed-pub-badge-top {
	border-color: var(--caimed-top-line);
	background: var(--caimed-top-bg);
	color: var(--caimed-top-fg);
}

/* Kind of record - only shown when it is not a plain article or conference paper, so it
   reads as a qualifier ("this one is a dataset") rather than as decoration. Amber, because
   it is closer to a caveat than to a category. */
.caimed-pub-badge-type {
	border-color: var(--caimed-type-line);
	background: var(--caimed-type-bg);
	color: var(--caimed-type-fg);
}

/* The CAIMed group. Neutral by design: it is a fact about the entry, not a judgement, and
   it appears on roughly two thirds of the list. */
.caimed-pub-badge-group {
	border-color: var(--caimed-group-line);
	background: var(--caimed-group-bg);
	color: var(--caimed-group-fg);
	font-weight: 500;
}

/* Cluster colour (since 0.3.6), as caimed.de colours its four clusters. The group name
   carries the information; the colour only groups the badges, so it may stay subtle. */
.caimed-pub-badge-group.caimed-cluster-semantik {
	border-color: var(--caimed-cluster-semantik);
	background: var(--caimed-cluster-semantik-tint);
}

.caimed-pub-badge-group.caimed-cluster-entscheidungen {
	border-color: var(--caimed-cluster-entscheidungen);
	background: var(--caimed-cluster-entscheidungen-tint);
}

.caimed-pub-badge-group.caimed-cluster-wirkstoffe {
	border-color: var(--caimed-cluster-wirkstoffe);
	background: var(--caimed-cluster-wirkstoffe-tint);
}

.caimed-pub-badge-group.caimed-cluster-signale {
	border-color: var(--caimed-cluster-signale);
	background: var(--caimed-cluster-signale-tint);
}

/* ---------------------------------------------------------------- pagination */

.caimed-pub-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1.6em;
	margin-top: 2em;
	padding-top: 1.1em;
	border-top: 1px solid var(--caimed-line);
	font-size: 0.92rem;
}

.caimed-pub-pageinfo {
	color: var(--caimed-muted);
}

.caimed-pub-empty {
	padding: 1.3em 0;
	color: var(--caimed-muted);
	font-style: italic;
}

/* ---------------------------------------------------------------- narrow screens */

@media (max-width: 640px) {
	.caimed-pub-filters {
		flex-direction: column;
		align-items: stretch;
	}

	.caimed-pub-filters select,
	.caimed-pub-filters input[type="search"] {
		max-width: none;
	}

	.caimed-pub-toolbar {
		flex-direction: column;
	}
}

/* ---------------------------------------------------------------- projects
   The project list reuses the publication list's layout; only two lines are its
   own. Kept in the same stylesheet because the plugin ships one file and both
   lists appear on sibling pages -- a second stylesheet would drift in spacing. */

.caimed-prj-partners {
	display: block;
	margin-bottom: 0.3em;
	color: var(--caimed-muted);
	font-size: 0.85rem;
}

.caimed-prj-amount {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- anchors
   One copyable link per entry, so a reported finding ("the link on AID-PAIS
   is wrong") can be tied to the exact record instead of a title that occurs
   three times. Muted, but deliberately NOT hover-only: someone who is asked to
   report something has to be able to see that the handle exists. */

.caimed-pub-item {
	scroll-margin-top: 6rem;   /* the theme's sticky header would otherwise cover it */
}

.caimed-pub-anchor {
	margin-left: 0.4em;
	color: var(--caimed-muted);
	font-size: 0.8rem;
	text-decoration: none;
	opacity: 0.45;
}

.caimed-pub-anchor:hover,
.caimed-pub-anchor:focus {
	opacity: 1;
	text-decoration: none;
}

/* Sits next to the "#" and is deliberately quieter than the title it follows: on a page of
   1,300 entries a reporting link that competes for attention on every line is worse than no
   link at all. It comes forward on hover, like the anchor. */
.caimed-pub-report {
	margin-left: 0.5em;
	color: var(--caimed-muted);
	font-size: 0.75rem;
	text-decoration: none;
	opacity: 0.35;
}

.caimed-pub-report:hover,
.caimed-pub-report:focus {
	opacity: 1;
	text-decoration: underline;
}

/* The box a click on "melden" / "entfernen" opens under the entry (since 0.3.7): address,
   subject and text to copy by hand when no mail program opened. Quiet like the links that
   open it; the copy buttons are plain outlined buttons, not the "Filtern" accent. */
.caimed-pub-mailbox {
	max-width: 46em;
	margin: 0.7em 0 0.2em;
	padding: 0.7em 0.9em;
	border: 1px solid var(--caimed-line);
	border-radius: 4px;
	background: var(--caimed-panel);
	color: var(--caimed-muted);
	font-size: 0.85rem;
}

.caimed-pub-mailbox:focus {
	outline: 2px solid var(--caimed-accent);
	outline-offset: 1px;
}

.caimed-pub-mailbox-intro {
	margin: 0 0 0.6em;
}

.caimed-pub-mailbox-row {
	display: grid;
	grid-template-columns: 5em 1fr auto;
	gap: 0.3em 0.6em;
	align-items: start;
	margin-bottom: 0.45em;
}

.caimed-pub-mailbox-label {
	padding-top: 0.35em;
	font-weight: 600;
}

.caimed-pub-mailbox input,
.caimed-pub-mailbox textarea {
	width: 100%;
	box-sizing: border-box;
	font: inherit;
	padding: 0.3em 0.5em;
	border: 1px solid var(--caimed-input-line);
	border-radius: 3px;
	background: var(--caimed-input-bg);
	color: var(--caimed-text);
	resize: vertical;
}

.caimed-pub-mailbox button {
	font: inherit;
	padding: 0.3em 0.8em;
	border: 1px solid var(--caimed-input-line);
	border-radius: 3px;
	background: var(--caimed-input-bg);
	color: var(--caimed-text);
	cursor: pointer;
}

.caimed-pub-mailbox button:hover,
.caimed-pub-mailbox button:focus {
	border-color: var(--caimed-accent);
}

/* "kopiert" sits under the button of its row. */
.caimed-pub-mailbox-status {
	grid-column: 3;
	font-size: 0.8rem;
}

.caimed-pub-mailbox-status:empty {
	display: none;
}

/* The single line a click on "melden" / "entfernen" leaves (since 0.3.9); the box above opens
   only from its button. As quiet as the links themselves: muted text, buttons styled as links. */
.caimed-pub-mailhint {
	margin: 0.4em 0 0.1em;
	color: var(--caimed-muted);
	font-size: 0.8rem;
}

.caimed-pub-mailhint button {
	font: inherit;
	padding: 0;
	border: 0;
	background: none;
	color: var(--caimed-muted);
	text-decoration: underline;
	cursor: pointer;
}

.caimed-pub-mailhint .caimed-pub-mailhint-close {
	margin-left: 0.6em;
	text-decoration: none;
	opacity: 0.6;
}

.caimed-pub-mailhint button:hover,
.caimed-pub-mailhint button:focus {
	color: var(--caimed-text);
	opacity: 1;
}

@media (max-width: 640px) {
	.caimed-pub-mailbox-row {
		grid-template-columns: 1fr auto;
	}

	.caimed-pub-mailbox-label {
		grid-column: 1 / -1;
	}

	.caimed-pub-mailbox-status {
		grid-column: 2;
	}
}

.caimed-pub-item:target {
	background: var(--caimed-highlight);
	box-shadow: -0.6em 0 0 var(--caimed-highlight);
}

/* Embed mode (?cp_embed=1, since 0.3.5): the list alone in an iframe on caimed.de, with no
   theme around it. Two things the theme otherwise supplies come from here: the font and the
   link colours ("links keep the theme's colour" above has no theme to inherit from). Since
   0.3.6 both are the caimed.de values. */
body.caimed-embed {
	margin: 0;
	padding: 0 2px;
	background: #fff;
	font-family: "CAIMed Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

body.caimed-embed .caimed-pub {
	margin: 0;
}

/* :where() keeps this at zero specificity, so the plugin's own link rules ("melden",
   "entfernen", "#", the reset link) still win; only the browser's default blue is replaced. */
:where(body.caimed-embed .caimed-pub) a {
	color: var(--caimed-link);
}

:where(body.caimed-embed .caimed-pub) a:hover {
	color: var(--caimed-link-hover);
}

/* Titles are the "clickable headings" of the caimed.de palette, not links. */
body.caimed-embed a.caimed-pub-title,
body.caimed-embed .caimed-pub-title a {
	color: var(--caimed-title-link);
}
