/* NexMind Commenti
   Usa i token del child theme (--nx-*): chiaro/scuro automatico. */

#comments.nxc {
	--nxc-text: var(--nx-text, #1d1d1f);
	--nxc-muted: var(--nx-muted, #6e6e73);
	--nxc-border: var(--nx-border, rgba(0, 0, 0, .08));
	--nxc-surface: var(--nx-surface, #f5f5f7);
	--nxc-bg: var(--nx-bg, #fff);
	--nxc-accent: var(--nx-accent-text, #e65c00);
	--nxc-button: var(--nx-button, #d45500);
	--nxc-button-hover: var(--nx-button-hover, #bf4d00);
	--nxc-radius: 14px;
	color: var(--nxc-text);
	font-family: var(--nx-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
	font-size: 16px;
	line-height: 1.5;
	max-width: 770px; /* larghezza della colonna del testo dell'articolo */
	margin: 8px 0 40px;
	scroll-margin-top: 90px;
}
#comments.nxc *, #comments.nxc *::before, #comments.nxc *::after { box-sizing: border-box; }
#comments.nxc [hidden] { display: none !important; }

/* Titolo con barretta arancione, come i titoli di sezione del sito */
.nxc-head { margin-bottom: 18px; }
#comments.nxc .nxc-title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-size: 28px; /* come i titoli di sezione ("Correlati") */
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -.01em;
	color: var(--nxc-text);
}
#comments.nxc .nxc-title::before {
	content: "";
	width: 4px;
	height: 22px;
	border-radius: 2px;
	background: var(--nx-accent, #ff6a00);
}
.nxc-count {
	font-size: 15px;
	font-weight: 600;
	color: var(--nxc-muted);
	background: var(--nxc-surface);
	border-radius: 999px;
	padding: 2px 10px;
}

/* ---------- bottoni e campi ---------- */

#comments.nxc .nxc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 40px;
	padding: 0 18px;
	border: 0;
	border-radius: 999px;
	background: var(--nxc-button);
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	text-decoration: none;
	line-height: 1.2;
	box-shadow: none;
	transform: none;
	cursor: pointer;
	transition: background .15s ease, opacity .15s ease;
}
#comments.nxc .nxc-btn:hover { background: var(--nxc-button-hover); color: #fff; box-shadow: none; transform: none; }
#comments.nxc .nxc-btn:disabled { opacity: .45; cursor: default; background: var(--nxc-button); }
#comments.nxc .nxc-btn.is-busy { opacity: .6; cursor: progress; }
#comments.nxc .nxc-btn-ghost {
	background: transparent;
	color: var(--nxc-text) !important;
	border: 1px solid var(--nxc-border);
}
#comments.nxc .nxc-btn-ghost:hover { background: var(--nxc-surface); color: var(--nxc-text); }
#comments.nxc .nxc-btn-google {
	width: 100%;
	background: var(--nxc-bg);
	color: var(--nxc-text) !important;
	border: 1px solid var(--nxc-border);
}
#comments.nxc .nxc-btn-google:hover { background: var(--nxc-surface); color: var(--nxc-text); }

#comments.nxc .nxc-link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--nxc-accent);
	font: inherit;
	font-size: inherit;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
}
#comments.nxc .nxc-link:hover { text-decoration: underline; }
#comments.nxc .nxc-danger { color: #d70015; }
html.nx-dark #comments.nxc .nxc-danger { color: #ff6961; }

.nxc-field { display: block; margin: 0 0 14px; }
.nxc-field > span { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
#comments.nxc input[type=text],
#comments.nxc input[type=email],
#comments.nxc textarea {
	display: block;
	width: 100%;
	margin: 0;
	padding: 11px 14px;
	border: 1px solid var(--nxc-border);
	border-radius: 12px;
	background: var(--nxc-bg);
	color: var(--nxc-text);
	font: inherit;
	height: auto;
	font-size: 16px; /* 16px: iPhone non fa lo zoom sul campo */
	line-height: 1.45;
	box-shadow: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}
html.nx-dark #comments.nxc input[type=text],
html.nx-dark #comments.nxc input[type=email],
html.nx-dark #comments.nxc textarea { border-color: rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06); }
#comments.nxc input:focus,
#comments.nxc textarea:focus {
	outline: none;
	border-color: var(--nx-accent, #ff6a00);
	box-shadow: 0 0 0 3px rgba(255, 106, 0, .18);
}
#comments.nxc textarea { resize: none; min-height: 48px; overflow: hidden; }
#comments.nxc input::placeholder, #comments.nxc textarea::placeholder { color: var(--nxc-muted); opacity: 1; }
#comments.nxc .nxc-code { font-size: 24px; letter-spacing: .4em; font-variant-numeric: tabular-nums; max-width: 220px; }

.nxc-check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; font-size: 14px; cursor: pointer; }
.nxc-check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--nxc-button); flex: none; }
.nxc-check a { color: var(--nxc-accent); }

.nxc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.nxc-status { margin: 10px 0 0; font-size: 14px; color: var(--nxc-muted); min-height: 0; }
.nxc-status:empty { display: none; }
.nxc-status.is-error { color: #d70015; }
html.nx-dark .nxc-status.is-error { color: #ff6961; }
.nxc-hint, .nxc-legal { margin: 12px 0 0; font-size: 13px; color: var(--nxc-muted); }
.nxc-legal a { color: inherit; text-decoration: underline; }
.nxc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- pannello di accesso ---------- */

.nxc-panel {
	margin: 0 0 28px;
	padding: 22px;
	border-radius: var(--nxc-radius);
	background: var(--nxc-surface);
}
.nxc-auth.is-flash { animation: nxc-flash 1.2s ease; }
@keyframes nxc-flash {
	0%, 100% { box-shadow: 0 0 0 0 rgba(255, 106, 0, 0); }
	30% { box-shadow: 0 0 0 3px rgba(255, 106, 0, .45); }
}
#comments.nxc .nxc-auth-title { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
#comments.nxc .nxc-auth-sub { margin: 0 0 18px; font-size: 15px; color: var(--nxc-muted); }
.nxc-auth-form .nxc-field { max-width: 420px; }
#comments.nxc .nxc-sent { margin: 0 0 14px; font-size: 15px; }
.nxc-or {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 16px 0;
	font-size: 13px;
	color: var(--nxc-muted);
}
.nxc-or::before, .nxc-or::after { content: ""; flex: 1; height: 1px; background: var(--nxc-border); }
.nxc-turnstile { margin: 0 0 14px; }

/* ---------- utente connesso ---------- */

.nxc-me {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 6px 16px;
	margin: 0 0 12px;
	font-size: 14px;
	color: var(--nxc-muted);
}
.nxc-me strong { color: var(--nxc-text); }
.nxc-me-links { display: inline-flex; gap: 16px; }
.nxc-profile .nxc-field { max-width: 360px; }
.nxc-profile-email { margin: 0 0 16px; font-size: 13px; color: var(--nxc-muted); }

/* ---------- form commento ---------- */

.nxc-form { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 32px; }
.nxc-form-main { flex: 1; min-width: 0; }
.nxc-form-foot {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 16px;
	margin-top: 10px;
}
.nxc-counter { margin-right: auto; font-size: 13px; color: var(--nxc-muted); }
.nxc-form-reply, .nxc-form-edit { margin: 12px 0 4px; }
.nxc-closed, .nxc-empty { margin: 0 0 20px; color: var(--nxc-muted); }
/* Nessun commento: il messaggio sta subito sotto il modulo (prima 32px piu' in basso) */
.nxc-form + .nxc-list:empty + .nxc-empty { margin-top: -20px; }
.nxc-auth + .nxc-list:empty + .nxc-empty { margin-top: -12px; }

/* ---------- avatar ---------- */

#comments.nxc .nxc-av {
	flex: none;
	width: 40px;
	height: 40px;
	margin: 0;
	border-radius: 50%;
	object-fit: cover;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .02em;
	color: hsl(var(--nxc-h, 210) 55% 32%);
	background: hsl(var(--nxc-h, 210) 70% 91%);
	user-select: none;
}
html.nx-dark #comments.nxc .nxc-av:not(img) {
	color: hsl(var(--nxc-h, 210) 70% 82%);
	background: hsl(var(--nxc-h, 210) 30% 24%);
}

/* ---------- elenco ---------- */

.nxc-list, .nxc-children { list-style: none; margin: 0; padding: 0; }
.nxc-item { margin: 0; padding: 0; }
.nxc-list > .nxc-item { border-top: 1px solid var(--nxc-border); padding: 18px 0 4px; }
.nxc-list > .nxc-item:first-child { border-top: 0; padding-top: 0; }
.nxc-item.nxc-later { display: none; }
.nxc-children { margin-left: 52px; }
.nxc-children .nxc-children { margin-left: 44px; }
.nxc-children > .nxc-item { padding-top: 14px; }
.nxc-children .nxc-av { width: 32px; height: 32px; font-size: 13px; }

.nxc-c { display: flex; gap: 12px; align-items: flex-start; }
.nxc-main { flex: 1; min-width: 0; }
.nxc-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 8px;
	font-size: 14px;
	line-height: 1.4;
}
.nxc-name { font-weight: 700; color: var(--nxc-text); }
.nxc-badge {
	align-self: center;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--nx-accent, #ff6a00);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .03em;
	text-transform: uppercase;
}
.nxc-replyto, .nxc-time, .nxc-edited { color: var(--nxc-muted); font-size: 13px; }
#comments.nxc .nxc-replyto a { color: var(--nxc-muted); font-weight: 600; text-decoration: none; }
#comments.nxc .nxc-replyto a:hover { color: var(--nxc-accent); }
#comments.nxc .nxc-time { text-decoration: none; }
#comments.nxc .nxc-time:hover { color: var(--nxc-text); }

.nxc-body { margin-top: 4px; font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; }
#comments.nxc .nxc-body p { margin: 0 0 .6em; font-size: inherit; line-height: inherit; }
#comments.nxc .nxc-body p:last-child { margin-bottom: 0; }
#comments.nxc .nxc-body a { color: var(--nxc-accent); text-decoration: underline; text-underline-offset: 2px; }

.nxc-pending-note {
	display: inline-block;
	margin: 6px 0 2px;
	padding: 4px 10px;
	border-radius: 8px;
	background: rgba(255, 159, 10, .14);
	color: var(--nxc-text);
	font-size: 13px;
}
.nxc-item.is-pending > .nxc-c .nxc-body { opacity: .75; }

.nxc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin: 8px 0 10px; }
#comments.nxc .nxc-act {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	min-height: 28px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--nxc-muted);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
}
#comments.nxc .nxc-act:disabled { cursor: default; }
#comments.nxc .nxc-act-ok { color: #248a3d; }
html.nx-dark #comments.nxc .nxc-act-ok { color: #30d158; }
#comments.nxc .nxc-like.is-on { color: var(--nxc-accent); }
#comments.nxc .nxc-like.is-on svg path { fill: currentColor; }
.nxc-like-n { min-width: 1ch; font-variant-numeric: tabular-nums; }
@media (hover: hover) {
	#comments.nxc .nxc-act:not(:disabled):hover { color: var(--nxc-text); }
	#comments.nxc .nxc-like:not(:disabled):hover { color: var(--nxc-accent); }
}

.nxc-item.is-new > .nxc-c,
.nxc-item.is-target > .nxc-c { animation: nxc-new 2s ease; border-radius: 10px; }
@keyframes nxc-new {
	0% { background: rgba(255, 106, 0, .12); }
	100% { background: transparent; }
}
.nxc-item.is-removing { opacity: 0; transition: opacity .25s ease; }
#comments.nxc .nxc-more { margin-top: 20px; width: 100%; }

#comments.nxc :focus-visible { outline: 2px solid var(--nx-accent, #ff6a00); outline-offset: 2px; border-radius: 6px; }

/* ---------- mobile ---------- */

@media (max-width: 600px) {
	#comments.nxc .nxc-title { font-size: 24px; }
	.nxc-panel { padding: 18px 16px; }
	.nxc-form > .nxc-av { display: none; }
	.nxc-children { margin-left: 20px; padding-left: 12px; border-left: 2px solid var(--nxc-border); }
	.nxc-c { gap: 10px; }
	#comments.nxc .nxc-av { width: 34px; height: 34px; font-size: 13px; }
	.nxc-children .nxc-av { width: 28px; height: 28px; font-size: 12px; }
	.nxc-auth-form .nxc-btn { width: 100%; }
	.nxc-auth-form .nxc-row { flex-direction: column; align-items: stretch; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
	.nxc-item.is-new > .nxc-c, .nxc-item.is-target > .nxc-c, .nxc-auth.is-flash { animation: none; }
}
