/* NeuroCases — front-end styles for listing, specialty archive, single case,
 * and author profile. Scoped under .nwbnc-* class names so we don't fight the
 * active theme's own styles.
 */

/* ── Layout shell ─────────────────────────────────────────────────────── */
.nwbnc-listing-wrap,
.nwbnc-single-wrap,
.nwbnc-author-wrap {
	max-width: 1080px;
	margin: 32px auto;
	padding: 0 18px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #1e293b;
}

/* ── Listing header ───────────────────────────────────────────────────── */
.nwbnc-listing-header {
	margin-bottom: 26px;
}
.nwbnc-eyebrow {
	margin: 0 0 6px;
	color: #5b6b85;
	font-size: 12px;
	letter-spacing: .08em;
	text-transform: uppercase;
}
.nwbnc-h1 {
	margin: 0 0 6px;
	font-size: 30px;
	line-height: 1.15;
	color: #13233b;
}
.nwbnc-listing-intro {
	margin: 0 0 18px;
	color: #475569;
	font-size: 15px;
	line-height: 1.55;
	max-width: 720px;
}
.nwbnc-listing-actions {
	margin-bottom: 14px;
}
.nwbnc-btn-primary {
	display: inline-block;
	padding: 10px 18px;
	background: #0f3d52;
	color: #fff !important;
	border-radius: 8px;
	text-decoration: none;
	font-weight: 700;
	font-size: 14px;
}
.nwbnc-btn-primary:hover { background: #0c2f40; }

/* ── Filter chips ─────────────────────────────────────────────────────── */
.nwbnc-filter-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 14px 0 0;
}
.nwbnc-chip {
	display: inline-flex;
	align-items: center;
	padding: 5px 11px;
	background: #eef2f7;
	color: #334155 !important;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
	transition: background .12s, color .12s;
}
.nwbnc-chip:hover { background: #dbe6f0; }
.nwbnc-chip.is-active {
	background: #0f3d52;
	color: #fff !important;
}

/* ── Card grid ────────────────────────────────────────────────────────── */
.nwbnc-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 18px;
	margin: 0;
	align-items: stretch;
}
.nwbnc-card {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow .15s, transform .15s;
	height: 100%;
}
.nwbnc-card-link {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
}
.nwbnc-card:hover {
	box-shadow: 0 6px 20px rgba(15,23,42,.08);
	transform: translateY(-1px);
}

/* Byline strip at the top of the card — the visibility hook */
.nwbnc-byline {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	text-decoration: none !important;
	color: inherit !important;
	border-bottom: 1px solid #f1f5f9;
}
.nwbnc-byline-avatar {
	border-radius: 50%;
	object-fit: cover;
	flex: 0 0 auto;
	border: 1px solid #e2e8f0;
}
.nwbnc-byline-text { min-width: 0; line-height: 1.25; }
.nwbnc-byline-name {
	font-size: 13px;
	font-weight: 700;
	color: #0f172a;
	display: block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.nwbnc-byline-position {
	display: inline-block;
	font-size: 11px;
	color: #64748b;
	margin-right: 6px;
}
.nwbnc-byline-time {
	font-size: 11px;
	color: #94a3b8;
}

/* Card body link (everything under the byline) */
.nwbnc-card-link {
	display: flex;
	flex-direction: column;
	color: inherit !important;
	text-decoration: none !important;
	flex: 1 1 auto;
}
.nwbnc-card-cover {
	display: block;
	height: 120px;
	background: #f1f5f9;
	overflow: hidden;
	flex: 0 0 auto;
}
.nwbnc-card-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .25s;
}
.nwbnc-card:hover .nwbnc-card-cover img { transform: scale(1.03); }
.nwbnc-card-body {
	padding: 14px 16px 6px;
	flex: 1 1 auto;
	min-height: 0;
}
.nwbnc-card-title {
	margin: 0 0 6px;
	font-size: 15px;
	line-height: 1.35;
	color: #0f172a;
	font-weight: 700;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: calc(15px * 1.35 * 2);
}
.nwbnc-card-excerpt {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	color: #475569;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.nwbnc-card-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	font-size: 12px;
	color: #64748b;
	gap: 8px;
}
.nwbnc-card-counts {
	display: inline-flex;
	gap: 10px;
	color: #94a3b8;
}

/* ── Empty + pagination ───────────────────────────────────────────────── */
.nwbnc-empty {
	margin: 36px 0;
	text-align: center;
	color: #64748b;
}
.nwbnc-pagination {
	display: flex;
	gap: 4px;
	justify-content: center;
	margin: 28px 0 12px;
}
.nwbnc-pagination a,
.nwbnc-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	padding: 0 10px;
	border-radius: 7px;
	font-size: 13px;
	color: #334155;
	text-decoration: none;
	border: 1px solid #e2e8f0;
	background: #fff;
}
.nwbnc-pagination span.current {
	background: #0f3d52;
	color: #fff;
	border-color: #0f3d52;
}

/* ── Single-case page ─────────────────────────────────────────────────── */
.nwbnc-single-hero {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	padding: 18px 0 22px;
	border-bottom: 1px solid #e2e8f0;
	margin-bottom: 22px;
}
.nwbnc-byline-large {
	display: flex;
	gap: 14px;
	align-items: center;
	text-decoration: none !important;
	color: inherit !important;
}
.nwbnc-byline-large .nwbnc-byline-avatar {
	width: 64px;
	height: 64px;
}
.nwbnc-byline-body { display: flex; flex-direction: column; gap: 2px; }
.nwbnc-byline-job, .nwbnc-byline-institution {
	font-size: 12px;
	color: #64748b;
}
.nwbnc-single-title {
	margin: 0 0 8px;
	font-size: 28px;
	line-height: 1.2;
	color: #0f172a;
}
.nwbnc-single-tagstrip {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-bottom: 12px;
}
.nwbnc-single-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 8px;
	margin: 16px 0 22px;
}
.nwbnc-single-gallery a {
	display: block;
	aspect-ratio: 4/3;
	background: #f1f5f9;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid #e2e8f0;
}
.nwbnc-single-gallery img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.nwbnc-single-body {
	max-width: 760px;
	font-size: 16px;
	line-height: 1.65;
	color: #1e293b;
}
.nwbnc-single-body p { margin: 0 0 14px; }
.nwbnc-phi-footnote {
	margin: 24px 0;
	padding: 12px 14px;
	background: #f8fafc;
	border-left: 4px solid #cbd5e1;
	border-radius: 8px;
	font-size: 12px;
	color: #64748b;
	line-height: 1.5;
}

/* ── Related cases footer ────────────────────────────────────────────── */
.nwbnc-related {
	margin: 36px 0 12px;
	padding-top: 26px;
	border-top: 1px solid #e2e8f0;
}
.nwbnc-related-title {
	margin: 0 0 16px;
	font-size: 18px;
	color: #0f172a;
	font-weight: 700;
}

/* Lightbox-thumb cursor hint (inherits .nwb-sci-shot click handler site-wide). */
.nwbnc-single-gallery a.nwb-sci-shot { cursor: zoom-in; }

/* ── Comments block ──────────────────────────────────────────────────── */
.nwbnc-comments {
	margin: 36px 0 8px;
	padding-top: 26px;
	border-top: 1px solid #e2e8f0;
}
.nwbnc-comments-title {
	margin: 0 0 16px;
	font-size: 18px;
	color: #0f172a;
	font-weight: 700;
}
.nwbnc-comments-count {
	color: #64748b;
	font-weight: 500;
	margin-left: 4px;
}
.nwbnc-comments-empty,
.nwbnc-comments-locked {
	margin: 8px 0 0;
	color: #64748b;
	font-size: 14px;
}
.nwbnc-comments-locked a { color: #0f3d52; font-weight: 600; }

.nwbnc-comment-form {
	margin: 14px 0 22px;
}
.nwbnc-comment-form textarea {
	width: 100%;
	min-height: 64px;
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 14px;
	font-family: inherit;
	line-height: 1.5;
	resize: vertical;
	box-sizing: border-box;
}
.nwbnc-comment-form textarea:focus {
	outline: 2px solid #0f3d52;
	outline-offset: 1px;
}
.nwbnc-comment-form-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 8px;
}
.nwbnc-comment-form-status {
	font-size: 12px;
	color: #64748b;
}
.nwbnc-comment-form-status.is-error { color: #b91c1c; }
.nwbnc-comment-cancel {
	background: transparent;
	border: 0;
	color: #64748b;
	font-size: 13px;
	cursor: pointer;
	padding: 6px 10px;
}
.nwbnc-comment-cancel:hover { color: #0f172a; text-decoration: underline; }

.nwbnc-comment-list,
.nwbnc-comment-list .children {
	list-style: none;
	padding: 0;
	margin: 0;
}
.nwbnc-comment-list .children {
	margin: 10px 0 0 26px;
	border-left: 2px solid #f1f5f9;
	padding-left: 14px;
}
.nwbnc-comment {
	margin: 12px 0;
}
.nwbnc-comment-body {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 12px 14px;
}
.nwbnc-comment.is-pending .nwbnc-comment-body {
	background: #fffbeb;
	border-color: #fde68a;
}
.nwbnc-comment .nwbnc-byline {
	border-bottom: 0;
	padding: 0 0 6px;
}
.nwbnc-comment-text {
	color: #1e293b;
	font-size: 14px;
	line-height: 1.55;
}
.nwbnc-comment-text p { margin: 0 0 6px; }
.nwbnc-comment-pending em { color: #92400e; font-size: 12px; }
.nwbnc-comment-actions {
	margin-top: 6px;
}
.nwbnc-reply-btn {
	background: transparent;
	border: 0;
	color: #0f3d52;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	padding: 4px 0;
}
.nwbnc-reply-btn:hover { text-decoration: underline; }
.nwbnc-reply-form {
	margin-top: 10px;
}

/* ── Poll block ──────────────────────────────────────────────────────── */
.nwbnc-poll {
	margin: 28px 0;
	padding: 18px 18px 14px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
}
.nwbnc-poll-title {
	margin: 0 0 4px;
	font-size: 12px;
	color: #5b6b85;
	letter-spacing: .08em;
	text-transform: uppercase;
	font-weight: 700;
}
.nwbnc-poll-question {
	margin: 0 0 12px;
	font-size: 16px;
	color: #0f172a;
	font-weight: 600;
	line-height: 1.4;
}
.nwbnc-poll-form { margin: 0; }
.nwbnc-poll-choice {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	margin-bottom: 6px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	color: #1e293b;
}
.nwbnc-poll-choice:hover { border-color: #0f3d52; background: #f0f9ff; }
.nwbnc-poll-choice input { margin: 0; }
.nwbnc-poll-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 8px;
}
.nwbnc-poll-status { font-size: 12px; color: #64748b; }
.nwbnc-poll-locked {
	margin: 0 0 12px;
	font-size: 13px;
	color: #64748b;
}
.nwbnc-poll-locked a { color: #0f3d52; font-weight: 600; }

.nwbnc-poll-results { margin: 4px 0 0; }
.nwbnc-poll-result { margin-bottom: 10px; }
.nwbnc-poll-result-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px;
	font-size: 13px;
	color: #1e293b;
	margin-bottom: 4px;
}
.nwbnc-poll-result.is-mine .nwbnc-poll-result-label { font-weight: 700; }
.nwbnc-poll-result-label em { color: #0f3d52; font-style: normal; font-size: 11px; font-weight: 600; }
.nwbnc-poll-result-count { color: #64748b; font-size: 12px; font-variant-numeric: tabular-nums; }
.nwbnc-poll-bar {
	background: #e2e8f0;
	border-radius: 6px;
	height: 8px;
	overflow: hidden;
}
.nwbnc-poll-bar span {
	display: block;
	height: 100%;
	background: #0f3d52;
	border-radius: 6px;
	transition: width .3s ease;
}
.nwbnc-poll-result.is-mine .nwbnc-poll-bar span { background: #075985; }
.nwbnc-poll-total {
	margin: 8px 0 0;
	font-size: 11px;
	color: #94a3b8;
}

/* ── Author edit button + modal ──────────────────────────────────────── */
.nwbnc-single-hero { position: relative; }
.nwbnc-edit-btn {
	background: #fff;
	border: 1px solid #cbd5e1;
	color: #0f3d52;
	padding: 6px 14px;
	border-radius: 7px;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	margin-left: auto;
}
.nwbnc-edit-btn:hover { background: #f0f9ff; border-color: #0f3d52; }
.nwbnc-edit-modal {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, .55);
	z-index: 10000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 40px 16px;
	overflow-y: auto;
}
.nwbnc-edit-modal[hidden] { display: none; }
.nwbnc-edit-dialog {
	background: #fff;
	border-radius: 12px;
	max-width: 720px;
	width: 100%;
	padding: 22px 24px 20px;
	box-shadow: 0 24px 60px rgba(15, 23, 42, .35);
	position: relative;
}
.nwbnc-edit-close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: transparent;
	border: 0;
	font-size: 26px;
	color: #64748b;
	cursor: pointer;
	line-height: 1;
}
.nwbnc-edit-dialog h2 { margin: 0 0 16px; font-size: 18px; color: #0f172a; }
.nwbnc-edit-form label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #374151;
	margin-bottom: 14px;
}
.nwbnc-edit-form input,
.nwbnc-edit-form textarea {
	display: block;
	width: 100%;
	margin-top: 5px;
	padding: 9px 12px;
	border: 1.5px solid #e2e8f0;
	border-radius: 7px;
	font-size: 14px;
	font-family: inherit;
	box-sizing: border-box;
}
.nwbnc-edit-form textarea { resize: vertical; line-height: 1.5; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
.nwbnc-edit-form input:focus,
.nwbnc-edit-form textarea:focus { outline: 2px solid #0f3d52; outline-offset: 1px; }
.nwbnc-edit-hint { color: #94a3b8; font-weight: 400; font-size: 11px; margin-left: 4px; }
.nwbnc-edit-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 8px;
}
.nwbnc-edit-cancel {
	background: transparent;
	border: 0;
	color: #64748b;
	font-size: 13px;
	cursor: pointer;
	padding: 8px 12px;
}
.nwbnc-edit-cancel:hover { color: #0f172a; text-decoration: underline; }
.nwbnc-edit-status { font-size: 12px; color: #64748b; }

/* ── Report button (front-end moderation) ────────────────────────────── */
.nwbnc-report-row {
	margin: 18px 0 4px;
	display: flex;
	align-items: center;
	gap: 12px;
}
.nwbnc-report-btn {
	background: transparent;
	border: 1px solid #e2e8f0;
	color: #64748b;
	padding: 5px 10px;
	border-radius: 6px;
	font-size: 12px;
	cursor: pointer;
}
.nwbnc-report-btn:hover { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.nwbnc-report-btn:disabled { opacity: .5; cursor: default; }
.nwbnc-report-status { font-size: 12px; color: #64748b; }

/* ── Author profile ──────────────────────────────────────────────────── */
.nwbnc-author-hero {
	display: flex;
	flex-wrap: wrap;
	gap: 18px 28px;
	align-items: center;
	padding: 20px 0 22px;
	border-bottom: 1px solid #e2e8f0;
	margin-bottom: 22px;
}
.nwbnc-author-hero .nwbnc-byline-large .nwbnc-byline-avatar {
	width: 96px;
	height: 96px;
}
.nwbnc-author-tally {
	display: flex;
	flex-wrap: wrap;
	gap: 18px 28px;
	margin-left: auto;
}
.nwbnc-tally-item {
	display: flex;
	flex-direction: column;
	min-width: 80px;
}
.nwbnc-tally-item strong {
	font-size: 22px;
	color: #0f172a;
	line-height: 1.1;
}
.nwbnc-tally-item span {
	font-size: 12px;
	color: #64748b;
	margin-top: 2px;
}
.nwbnc-author-actions {
	width: 100%;
	margin-top: 4px;
}

/* ── Mobile tweaks ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
	.nwbnc-h1 { font-size: 24px; }
	.nwbnc-grid { grid-template-columns: 1fr; }
	.nwbnc-single-title { font-size: 22px; }
	.nwbnc-byline-large .nwbnc-byline-avatar { width: 52px; height: 52px; }
}
