/**
 * Novel Comments — Front-end styles.
 *
 * Matches the Otherworldstone theme (dark/light mode via CSS variables).
 */

/* ── Paragraph Markers ─────────────────────────────────────────────── */

.nc-marker {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 700;
	cursor: pointer;
	vertical-align: middle;
	margin-left: 6px;
	transition: background 0.2s, transform 0.1s;
	user-select: none;
}

.nc-no-comments {
	background: transparent;
	color: var(--accent, #c9a84c);
	border: 1px solid var(--accent, #c9a84c);
	font-size: 14px;
	line-height: 1;
	padding: 0 4px;
}

.nc-no-comments:hover {
	background: var(--accent, #c9a84c);
	color: #fff;
	transform: scale(1.1);
}

.nc-has-comments {
	background: var(--accent, #c9a84c);
	color: #fff;
}

.nc-has-comments:hover {
	transform: scale(1.05);
}

/* ── Overlay ───────────────────────────────────────────────────────── */

.nc-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.35);
	z-index: 9998;
	display: none;
}

.nc-overlay.visible { display: block; }

/* ── Side Panel ────────────────────────────────────────────────────── */

.nc-panel {
	position: fixed;
	right: -420px;
	top: 0;
	width: 400px;
	height: 100vh;
	background: var(--ows-cream, #0c0e1a);
	border-left: 1px solid var(--ows-line, rgba(168,184,208,0.1));
	box-shadow: -4px 0 20px rgba(0,0,0,0.2);
	transition: right 0.3s ease;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.nc-panel.open { right: 0; }

.nc-panel-header {
	padding: 16px 20px;
	border-bottom: 1px solid var(--ows-line, rgba(168,184,208,0.1));
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}

.nc-panel-header h3 {
	font-size: 14px;
	font-weight: 600;
	color: var(--ows-muted, #8888a8);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-family: "Inter", sans-serif;
	margin: 0;
}

.nc-close {
	background: none;
	border: none;
	font-size: 22px;
	color: var(--ows-muted, #8888a8);
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 4px;
	line-height: 1;
	font-family: inherit;
}

.nc-close:hover {
	background: var(--ows-line, rgba(168,184,208,0.1));
	color: var(--ows-text, #c8c8e0);
}

/* ── Comment List ──────────────────────────────────────────────────── */

.nc-panel-body {
	flex: 1;
	overflow-y: auto;
	padding: 16px 20px;
}

/* ── Paragraph Blocks ──────────────────────────────────────────────── */

.nc-para-block {
	border-bottom: 1px solid var(--ows-line, rgba(168,184,208,0.08));
	padding-bottom: 16px;
	margin-bottom: 16px;
}

.nc-para-block:last-child { border-bottom: none; }

.nc-para-text {
	font-family: "Noto Serif", Georgia, serif;
	font-size: 13px;
	line-height: 1.7;
	color: var(--ows-text, #c8c8e0);
	margin-bottom: 12px;
	font-style: italic;
}

.nc-para-comments {
	margin-top: 8px;
}

.nc-empty {
	font-size: 14px;
	color: var(--ows-muted, #8888a8);
	text-align: center;
	padding: 30px 0;
	font-family: "Inter", sans-serif;
}

/* ── Comment Card ──────────────────────────────────────────────────── */

.nc-card {
	margin-bottom: 16px;
	border-bottom: 1px solid var(--ows-line, rgba(168,184,208,0.06));
	padding-bottom: 16px;
}

.nc-card:last-child { border-bottom: none; }

.nc-card-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 4px;
}

.nc-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 10px;
	font-weight: 700;
	flex-shrink: 0;
	font-family: "Inter", sans-serif;
}

.nc-author {
	font-size: 13px;
	font-weight: 600;
	color: var(--ows-text, #c8c8e0);
	font-family: "Inter", sans-serif;
}

.nc-time {
	font-size: 11px;
	color: var(--ows-muted, #8888a8);
	margin-left: auto;
	font-family: "Inter", sans-serif;
}

.nc-card-body {
	font-size: 14px;
	line-height: 1.5;
	color: var(--ows-text, #c8c8e0);
	padding-left: 36px;
	margin-bottom: 4px;
	font-family: "Inter", sans-serif;
}

.nc-card-actions {
	padding-left: 36px;
	display: flex;
	gap: 12px;
	font-size: 12px;
	margin-bottom: 8px;
	font-family: "Inter", sans-serif;
}

.nc-card-actions button,
.nc-like {
	background: none;
	border: none;
	color: var(--ows-muted, #8888a8);
	cursor: pointer;
	transition: color 0.2s;
}

.nc-card-actions button:hover,
.nc-like:hover { color: var(--accent, #c9a84c); }

.nc-like.liked { color: var(--accent, #c9a84c) !important; }

.nc-reply-btn { background: none; border: none; color: var(--ows-muted, #8888a8); cursor: pointer; font-family: "Inter", sans-serif; }

/* ── Replies ───────────────────────────────────────────────────────── */

.nc-replies {
	margin-left: 36px;
	padding-left: 12px;
	border-left: 2px solid var(--ows-line, rgba(168,184,208,0.1));
	margin-top: 8px;
	margin-bottom: 12px;
}

.nc-reply { margin-bottom: 12px; }

.nc-reply-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 4px;
	padding-left: 36px;
}

.nc-reply-to {
	font-size: 13px;
	font-weight: 600;
	color: var(--accent, #c9a84c);
	font-family: "Inter", sans-serif;
}

.nc-reply-body {
	font-size: 13px;
	line-height: 1.5;
	color: var(--ows-text, #c8c8e0);
	padding-left: 36px;
	margin-bottom: 4px;
	font-family: "Inter", sans-serif;
}

.nc-reply-actions {
	padding-left: 36px;
	display: flex;
	gap: 12px;
	font-size: 11px;
	margin-bottom: 4px;
	font-family: "Inter", sans-serif;
}

.nc-reply-actions button {
	background: none;
	border: none;
	color: var(--ows-muted, #8888a8);
	cursor: pointer;
	font-family: "Inter", sans-serif;
}

.nc-reply-actions button:hover { color: var(--accent, #c9a84c); }

/* ── Comment Input ─────────────────────────────────────────────────── */

.nc-panel-input {
	border-top: 1px solid var(--ows-line, rgba(168,184,208,0.1));
	padding: 12px 20px;
	flex-shrink: 0;
}

.nc-panel-input textarea,
.nc-chapter-form textarea {
	width: 100%;
	border: 1px solid var(--ows-line, rgba(168,184,208,0.15));
	border-radius: 8px;
	padding: 10px 12px;
	font-family: "Inter", sans-serif;
	font-size: 13px;
	resize: vertical;
	min-height: 60px;
	background: var(--ows-cream-soft, #0a1020);
	color: var(--ows-text, #c8c8e0);
	outline: none;
	transition: border-color 0.2s;
}

.nc-panel-input textarea:focus,
.nc-chapter-form textarea:focus {
	border-color: var(--accent, #c9a84c);
}

.nc-panel-input textarea::placeholder,
.nc-chapter-form textarea::placeholder {
	color: var(--ows-muted, #8888a8);
	opacity: 0.6;
}

.nc-input-actions {
	display: flex;
	justify-content: flex-end;
	margin-top: 8px;
}

.nc-submit {
	background: var(--accent, #c9a84c);
	border: none;
	color: #fff;
	padding: 7px 16px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	font-family: "Inter", sans-serif;
	transition: background 0.2s;
}

.nc-submit:hover { background: var(--accent-dark, #b8943f); }

.nc-submit-row {
	display: flex;
	justify-content: flex-end;
	margin-top: 10px;
}

/* ── Chapter Comments Section ──────────────────────────────────────── */

.nc-chapter-section {
	max-width: 65ch;
	margin: 20px auto 60px;
	padding: 0 16px;
}

.nc-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 0;
	border-bottom: 1px solid var(--ows-line, rgba(168,184,208,0.1));
	cursor: pointer;
	user-select: none;
}

.nc-section-header h3 {
	font-size: 16px;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: "Inter", sans-serif;
	color: var(--ows-text, #c8c8e0);
	margin: 0;
}

.nc-icon {
	transition: transform 0.2s;
	font-size: 12px;
	color: var(--ows-muted, #8888a8);
}

.nc-section-body { padding: 16px 0; }
.nc-section-body.hidden { display: none; }

.nc-login-link {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--ows-line, rgba(168,184,208,0.1));
	font-size: 14px;
	font-family: "Inter", sans-serif;
}

.nc-login-link a { color: var(--accent, #c9a84c); text-decoration: none; }
.nc-login-link a:hover { text-decoration: underline; }

/* ── Responsive ────────────────────────────────────────────────────── */

@media ( max-width: 768px ) {
	.nc-panel { width: 100%; right: -100%; }

	.nc-card-body,
	.nc-card-actions,
	.nc-reply-body,
	.nc-reply-actions,
	.nc-reply-header {
		padding-left: 0;
	}

	.nc-replies {
		margin-left: 0;
		padding-left: 0;
		border-left: none;
	}

	.nc-chapter-section { padding: 0 16px; }
}
