/* ==========================================================================
   Nexus Publications – Homepage Latest Widget
   Shortcode: [nexus_latest_publications]

   Class reference
   ───────────────
   .nph-pub-wrap                 – outer container
   .nph-pub-list                 – vertical stack of cards
   .nph-pub-card                 – single publication row card
   .nph-pub-card--journal        – type modifier (border accent: blue)
   .nph-pub-card--research       – type modifier (border accent: teal)
   .nph-pub-card--case_report    – type modifier (border accent: amber)
   .nph-pub-card--guideline      – type modifier (border accent: purple)
   .nph-pub-card--review         – type modifier (border accent: rose)

   .nph-pub-cover                – fixed-size cover image container (left)
   .nph-pub-cover-link           – anchor wrapping the cover
   .nph-pub-cover-img            – the <img> inside
   .nph-pub-cover--placeholder   – shown when no cover image is set

   .nph-pub-body                 – flex-1 content area (right)
   .nph-pub-meta-row             – horizontal row: type badge + date + vol/issue
   .nph-pub-type-badge           – pill label (pub type)
   .nph-pub-type-badge--journal
   .nph-pub-type-badge--research
   .nph-pub-type-badge--case_report
   .nph-pub-type-badge--guideline
   .nph-pub-type-badge--review
   .nph-pub-date                 – calendar icon + "Jan 2025"
   .nph-pub-vol-issue            – "Vol. 3 · No. 1"

   .nph-pub-title                – <h3> publication title
   .nph-pub-title-link           – <a> inside the title

   .nph-pub-author               – author row (icon + name + institution)
   .nph-pub-author-name          – author display name
   .nph-pub-author-sep           – "·" separator
   .nph-pub-author-inst          – institution name (muted)

   .nph-pub-read-btn             – "Read Publication →" CTA link

   .nph-pub-footer               – wrapper for "View All" link
   .nph-pub-view-all             – "View All Publications →" anchor

   .nph-pub-empty                – "No publications found." paragraph
   ========================================================================== */

/* ── Design tokens ────────────────────────────────────────────────────────── */
.nph-pub-wrap {
	--nph-primary:      #1e40af;
	--nph-accent:       #3b82f6;
	--nph-teal:         #0b6e6e;
	--nph-amber:        #b45309;
	--nph-purple:       #6d28d9;
	--nph-rose:         #be185d;
	--nph-text:         #0f172a;
	--nph-muted:        #64748b;
	--nph-light:        #94a3b8;
	--nph-border:       #e2e8f0;
	--nph-bg:           #f8fafc;
	--nph-card:         #ffffff;
	--nph-radius:       12px;
	--nph-shadow:       0 1px 3px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.06);
	--nph-shadow-hv:    0 6px 24px rgba(0,0,0,.11), 0 2px 6px rgba(0,0,0,.06);
	--nph-trans:        .22s ease;
	--nph-cover-w:      80px;
	--nph-cover-h:      110px;

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--nph-text);
}

/* ── List ─────────────────────────────────────────────────────────────────── */
.nph-pub-list {
	display: flex;
	flex-direction: column;
	gap: 0;
	border: 1px solid var(--nph-border);
	border-radius: var(--nph-radius);
	overflow: hidden;
	box-shadow: var(--nph-shadow);
	background: var(--nph-card);
}

/* ── Card row ─────────────────────────────────────────────────────────────── */
.nph-pub-card {
	display: flex;
	align-items: stretch;
	gap: 0;
	border-bottom: 1px solid var(--nph-border);
	border-left: 4px solid transparent;
	transition: background var(--nph-trans), border-color var(--nph-trans), box-shadow var(--nph-trans);
	background: var(--nph-card);
	text-decoration: none;
}
.nph-pub-card:last-child {
	border-bottom: none;
}
.nph-pub-card:hover {
	background: var(--nph-bg);
	box-shadow: inset 4px 0 0 var(--nph-accent);
}

/* Type accent colours on the left border */
.nph-pub-card--journal     { border-left-color: var(--nph-primary); }
.nph-pub-card--research    { border-left-color: var(--nph-teal); }
.nph-pub-card--case_report { border-left-color: var(--nph-amber); }
.nph-pub-card--guideline   { border-left-color: var(--nph-purple); }
.nph-pub-card--review      { border-left-color: var(--nph-rose); }

/* ── Cover ────────────────────────────────────────────────────────────────── */
.nph-pub-cover-link {
	display: block;
	flex-shrink: 0;
	align-self: center;
	margin: 14px 0 14px 16px;
}

.nph-pub-cover {
	width: var(--nph-cover-w);
	height: var(--nph-cover-h);
	border-radius: 6px;
	overflow: hidden;
	background: var(--nph-bg);
	border: 1px solid var(--nph-border);
	flex-shrink: 0;
}

.nph-pub-cover-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	display: block;
	transition: transform var(--nph-trans);
}
.nph-pub-card:hover .nph-pub-cover-img {
	transform: scale(1.04);
}

.nph-pub-cover--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--nph-light);
	align-self: center;
	margin: 14px 0 14px 16px;
}

/* ── Body ─────────────────────────────────────────────────────────────────── */
.nph-pub-body {
	flex: 1;
	min-width: 0;
	padding: 16px 18px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

/* ── Meta row (badge + date + vol/issue) ──────────────────────────────────── */
.nph-pub-meta-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 2px;
}

/* Type badge */
.nph-pub-type-badge {
	display: inline-block;
	font-size: 10px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 1px;
	padding: 2px 8px;
	border-radius: 20px;
	line-height: 1.5;
}

.nph-pub-type-badge--journal {
	background: rgba(30,64,175,.1);
	color: var(--nph-primary);
}
.nph-pub-type-badge--research {
	background: rgba(11,110,110,.1);
	color: var(--nph-teal);
}
.nph-pub-type-badge--case_report {
	background: rgba(180,83,9,.1);
	color: var(--nph-amber);
}
.nph-pub-type-badge--guideline {
	background: rgba(109,40,217,.1);
	color: var(--nph-purple);
}
.nph-pub-type-badge--review {
	background: rgba(190,24,93,.1);
	color: var(--nph-rose);
}

/* Date chip */
.nph-pub-date {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 11px;
	color: var(--nph-muted);
}
.nph-pub-date svg {
	flex-shrink: 0;
	opacity: .7;
}

/* Vol / Issue */
.nph-pub-vol-issue {
	font-size: 11px;
	color: var(--nph-light);
	font-weight: 500;
}

/* ── Title ────────────────────────────────────────────────────────────────── */
.nph-pub-title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--nph-text);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.nph-pub-title-link {
	color: inherit;
	text-decoration: none;
	transition: color var(--nph-trans);
}
.nph-pub-title-link:hover {
	color: var(--nph-accent);
}

/* ── Author row ───────────────────────────────────────────────────────────── */
.nph-pub-author {
	display: flex;
	align-items: center;
	gap: 5px;
	flex-wrap: wrap;
}
.nph-pub-author svg {
	flex-shrink: 0;
	color: var(--nph-light);
}
.nph-pub-author-name {
	font-size: 12px;
	font-weight: 600;
	color: var(--nph-muted);
}
.nph-pub-author-sep {
	font-size: 12px;
	color: var(--nph-light);
}
.nph-pub-author-inst {
	font-size: 12px;
	color: var(--nph-light);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 200px;
}

/* ── Read button ──────────────────────────────────────────────────────────── */
.nph-pub-read-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-top: 4px;
	align-self: flex-start;
	font-size: 12px;
	font-weight: 700;
	color: var(--nph-accent);
	text-decoration: none;
	transition: gap var(--nph-trans), color var(--nph-trans);
}
.nph-pub-read-btn:hover {
	color: var(--nph-primary);
	gap: 8px;
}
.nph-pub-read-btn svg {
	flex-shrink: 0;
}

/* ── Footer / View All ────────────────────────────────────────────────────── */
.nph-pub-footer {
	margin-top: 16px;
	display: flex;
	justify-content: flex-end;
}

.nph-pub-view-all {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--nph-accent);
	text-decoration: none;
	transition: gap var(--nph-trans), color var(--nph-trans);
}
.nph-pub-view-all:hover {
	color: var(--nph-primary);
	gap: 10px;
}

/* ── Empty state ──────────────────────────────────────────────────────────── */
.nph-pub-empty {
	color: var(--nph-muted);
	font-size: 14px;
	text-align: center;
	padding: 32px 0;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
	.nph-pub-cover-link,
	.nph-pub-cover--placeholder {
		display: none;
	}

	.nph-pub-body {
		padding: 14px 16px;
	}

	.nph-pub-author-inst {
		display: none;
	}
}

@media (max-width: 400px) {
	.nph-pub-type-badge { font-size: 9px; }
	.nph-pub-title      { font-size: 14px; }
}
