/* =======================================================================
   Nexus – Publications: Viewer & Cards
   ======================================================================= */

/* ── Archive Grid ─────────────────────────────────────────────────────── */
.nexus-pub-archive {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 24px;
	padding: 24px 0;
}

.nexus-pub-card {
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 16px rgba(0,0,0,0.08);
	display: flex;
	flex-direction: column;
	transition: transform .18s ease, box-shadow .18s ease;
}

.nexus-pub-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 32px rgba(0,0,0,0.13);
}

.nexus-pub-card__cover {
	height: 180px;
	background: linear-gradient(135deg, #e8f0fe 0%, #d0e4ff 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.nexus-pub-card__cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nexus-pub-card__cover-placeholder {
	font-size: 56px;
	opacity: .45;
}

.nexus-pub-card__body {
	padding: 18px;
	display: flex;
	flex-direction: column;
	flex: 1;
	gap: 8px;
}

.nexus-pub-card__title {
	font-size: 1rem;
	font-weight: 700;
	color: #1a2644;
	margin: 0;
	line-height: 1.4;
}

.nexus-pub-card__author {
	font-size: .85rem;
	color: #5a6a8a;
	margin: 0;
}

.nexus-pub-card__abstract {
	font-size: .85rem;
	color: #6b7280;
	margin: 0;
	flex: 1;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.nexus-pub-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #1a4fcf;
	color: #fff !important;
	padding: 10px 20px;
	border-radius: 8px;
	font-size: .9rem;
	font-weight: 600;
	text-decoration: none;
	border: none;
	cursor: pointer;
	transition: background .15s;
	margin-top: auto;
	width: fit-content;
}

.nexus-pub-btn:hover {
	background: #1440b0;
}

.nexus-pub-btn--sm {
	padding: 7px 16px;
	font-size: .82rem;
}

/* ── Single Viewer Layout ─────────────────────────────────────────────── */
.nexus-pub-single {
	display: grid;
	grid-template-columns: 1fr 360px;
	gap: 28px;
	align-items: start;
	padding: 24px 0;
}

@media (max-width: 900px) {
	.nexus-pub-single {
		grid-template-columns: 1fr;
	}
}

.nexus-pub-viewer-wrap {
	position: sticky;
	top: 20px;
}

.nexus-pub-viewer-shell {
	background: #1a1a2e;
	border-radius: 12px;
	overflow: hidden;
	height: 80vh;
	min-height: 500px;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}

.nexus-pub-viewer-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	color: #cbd5e1;
}

.nexus-pub-spinner {
	width: 40px;
	height: 40px;
	border: 4px solid rgba(255,255,255,.15);
	border-top-color: #3b82f6;
	border-radius: 50%;
	animation: nexus-spin .8s linear infinite;
}

@keyframes nexus-spin {
	to { transform: rotate(360deg); }
}

.nexus-pub-iframe {
	width: 100%;
	height: 100%;
	position: absolute;
	top: 0;
	left: 0;
	/* Block right-click and selection via CSS */
	-webkit-user-select: none;
	-moz-user-select: none;
	user-select: none;
	pointer-events: auto;
}

/* Overlay to catch right-click */
.nexus-pub-viewer-shell::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 10;
	pointer-events: none; /* allow scroll, but we block via JS */
}

/* ── Metadata Panel ───────────────────────────────────────────────────── */
.nexus-pub-meta-panel {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.nexus-pub-title {
	font-size: 1.4rem;
	font-weight: 700;
	color: #1a2644;
	margin: 0;
	line-height: 1.35;
}

.nexus-pub-date {
	font-size: .85rem;
	color: #94a3b8;
	margin: 0;
}

.nexus-pub-abstract {
	background: #f8fafc;
	border-left: 4px solid #3b82f6;
	border-radius: 0 8px 8px 0;
	padding: 14px 16px;
	font-size: .92rem;
	color: #374151;
}

.nexus-pub-abstract h4 {
	margin: 0 0 8px;
	font-size: .8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: #3b82f6;
}

/* ── Author Card ──────────────────────────────────────────────────────── */
.nexus-pub-author-card {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 16px;
}

.nexus-pub-author-avatar {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.nexus-pub-author-info {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.nexus-pub-author-name {
	font-size: 1rem;
	font-weight: 700;
	color: #1e293b;
}

.nexus-pub-author-inst {
	font-size: .83rem;
	color: #64748b;
}

.nexus-pub-author-bio {
	font-size: .83rem;
	color: #64748b;
	margin: 4px 0 0;
}

.nexus-pub-disclaimer {
	font-size: .8rem;
	color: #94a3b8;
	border: 1px dashed #e2e8f0;
	border-radius: 8px;
	padding: 10px 14px;
	margin: 0;
}

/* ── Access Denied ────────────────────────────────────────────────────── */
.nexus-pub-access-denied {
	text-align: center;
	padding: 60px 24px;
	max-width: 500px;
	margin: 0 auto;
}

.nexus-pub-access-icon {
	font-size: 56px;
	margin-bottom: 16px;
}

.nexus-pub-access-denied h3 {
	font-size: 1.5rem;
	color: #1a2644;
	margin: 0 0 10px;
}

.nexus-pub-access-denied p {
	color: #64748b;
	margin: 0 0 20px;
}

.nexus-pub-access-note {
	font-size: .85rem;
	background: #fef9ec;
	border: 1px solid #fde68a;
	border-radius: 8px;
	padding: 10px 14px !important;
}

/* ── Empty / Error ────────────────────────────────────────────────────── */
.nexus-pub-empty,
.nexus-pub-error,
.nexus-pub-no-pdf {
	padding: 40px 24px;
	text-align: center;
	color: #64748b;
	background: #f8fafc;
	border-radius: 10px;
}
