/* ============================================================
   Starlit comment zone — ported from the approved v4 mockup.
   Loaded on chapter pages and novel pages only.
   Palette comes from style.css: --gold --purple --pink --line
   --ink --muted --headings --card --card2 --input and the tints.
   ============================================================ */

/* ---- the comments window (same treatment as the note windows) ---- */
.commentzone {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius, 20px);
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
	padding: 26px clamp(16px, 4vw, 40px) 30px;
	/* Same width cap and centering as .chapter-box and .notewindow. The
	   cap is 44rem + 110px everywhere, written out rather than computed
	   from --fs-chapter, so the A+/A- buttons grow the story text without
	   widening (or rewrapping) this window under the reader. */
	max-width: calc(44rem + 110px);
	margin-left: auto;
	margin-right: auto;
	margin-top: 26px;
}
.commentzone h2 {
	font-family: 'Questrial', 'Outfit', sans-serif;
	font-weight: 400;
	font-size: 1.18rem;
	letter-spacing: 0.02em;
	display: flex;
	align-items: center;
	gap: 9px;
	color: var(--headings);
	margin: 0 0 4px;
}
.commentzone h2 .spark { font-size: 0.9em; color: var(--gold); }
.commentzone h2 .count {
	font-size: 0.78rem;
	color: var(--muted);
	font-family: 'Outfit', sans-serif;
	letter-spacing: 0.06em;
	margin-left: 2px;
}
.commentzone .closing {
	font-size: 0.8rem;
	color: var(--muted);
	margin-bottom: 18px;
}

/* ---- one comment ----
   Header row: name, date, badge ... flag at the far right.
   Body: the comment words.
   Action row: the likes tally and Reply. Nothing else. */
.clist {
	list-style: none;
	padding: 0;
	margin: 0;
}
.comment {
	padding: 16px 0 6px;
	border-top: 1px dashed var(--line);
}
.clist > .comment:first-child { border-top: none; }
.crow { display: flex; gap: 14px; }
.crow .cmain { flex: 1; min-width: 0; }

.avatar {
	flex: 0 0 42px;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-family: 'Questrial', sans-serif;
	font-size: 1.05rem;
	border: 1px solid var(--gold);
}
.avatar.a-gold { background: var(--goldtint); color: var(--golddeep); }
.avatar.a-pink { background: var(--pinktint); color: var(--pinkdeep); border-color: var(--pink); }
.avatar.a-purple { background: var(--purpletint); color: var(--purpledeep); border-color: var(--purple); }

.chead {
	display: flex;
	align-items: baseline;
	gap: 10px;
	flex-wrap: wrap;
}
.cname { font-weight: 600; color: var(--purpledeep); }
.cdate { font-size: 0.76rem; color: var(--muted); }
.cbadge {
	font-size: 0.64rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--golddeep);
	background: var(--goldtint);
	border: 1px solid var(--line);
	border-radius: 999px;
	padding: 2px 9px;
}
.cbody { margin: 4px 0 8px; font-size: 0.98rem; line-height: 1.7; }
.cbody p { margin-bottom: 0.6em; }
.cbody p:last-child { margin-bottom: 0; }

.cactions {
	margin-bottom: 10px;
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

/* Likes tally: a soft gold pill that reads as a count first, a button
   second. Shipped by the Starlit tally add-on. */
.likebtn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	cursor: pointer;
	font-family: inherit;
	font-size: 0.8rem;
	color: var(--muted);
	background: none;
	border: 1px solid var(--line);
	border-radius: 999px;
	padding: 3px 14px;
	transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.likebtn .lstar { font-size: 0.95em; }
.likebtn:hover { color: var(--gold); border-color: var(--gold); background: var(--goldtint); }
.likebtn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.likebtn.on { color: var(--golddeep); border-color: var(--gold); background: var(--goldtint); }
.likebtn.on .lstar { text-shadow: 0 0 7px rgba(207, 163, 83, 0.7); }
.likednote { font-size: 0.74rem; color: var(--muted); }

/* Reply. comment_reply_link() prints the comment-reply-link class. */
.cactions .comment-reply-link {
	background: none;
	border: none;
	cursor: pointer;
	padding: 2px 4px;
	font-family: inherit;
	font-size: 0.8rem;
	letter-spacing: 0.05em;
	color: var(--muted);
	text-decoration: none;
	border-bottom: 1px solid transparent;
}
.cactions .comment-reply-link:hover {
	color: var(--gold);
	border-bottom-color: var(--gold);
}
.cactions .comment-reply-link:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 3px;
	border-radius: 4px;
}

/* Edit: only Really and the team see it, so it stays almost invisible. */
.cactions .edit-link a {
	font-size: 0.74rem;
	color: var(--muted);
	opacity: 0.6;
	text-decoration: none;
}
.cactions .edit-link a:hover { color: var(--purpledeep); opacity: 1; }

/* Flag: lives at the end of the header row, quiet until needed,
   pink when used. Kept out of the action row so the conversation
   stays just likes and replies. */
.flagbtn {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 5px 8px;
	font-family: inherit;
	font-size: 0.74rem;
	color: var(--muted);
	opacity: 0.75;
	border-radius: 6px;
	transition: color 0.2s, opacity 0.2s;
}
.flagbtn:hover { color: var(--pinkdeep); opacity: 1; }
.flagbtn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.flagbtn.on { color: var(--pinkdeep); opacity: 1; }

/* ---- replies: indented, a dotted gold thread down the left ---- */
.children {
	list-style: none;
	padding: 0 0 0 22px;
	margin: 0 0 0 21px;
	border-left: 1px dashed var(--line);
}
.children .comment:first-child { border-top: none; padding-top: 12px; }

/* ---- waiting for moderation ---- */
.pending .cbody { font-style: italic; color: var(--muted); }
.pendingnote {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 0.78rem;
	color: var(--muted);
	background: var(--goldtint);
	border: 1px dashed var(--line);
	border-radius: 999px;
	padding: 2px 12px;
}

/* Older / newer comments between pages. WordPress prints these
   classes itself when comment paging is on, so they're styled
   defensively even though the theme's markup never writes them. */
.commentzone .comment-navigation {
	display: flex;
	gap: 18px;
	margin: 10px 0;
}
.commentzone .comment-navigation .nav-previous,
.commentzone .comment-navigation .nav-next { flex: 1; }
.commentzone .comment-navigation a {
	font-size: 0.8rem;
	letter-spacing: 0.05em;
	color: var(--muted);
	text-decoration: none;
	border-bottom: 1px solid transparent;
}
.commentzone .comment-navigation a:hover {
	color: var(--gold);
	border-bottom-color: var(--gold);
}
.commentzone .nav-next { text-align: right; }

/* ---- the form (comment_form() prints the <form id="respond">) ---- */
.commentzone #respond {
	margin-top: 22px;
	border-top: 1px solid var(--line);
	padding-top: 22px;
}
.commentzone #reply-title {
	font-family: 'Questrial', 'Outfit', sans-serif;
	font-weight: 400;
	font-size: 1.05rem;
	letter-spacing: 0.02em;
	color: var(--headings);
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 14px;
}
.commentzone #reply-title .spark { color: var(--pink); font-size: 0.9em; }
.commentzone #cancel-comment-reply-link {
	font-size: 0.78rem;
	color: var(--muted);
	text-decoration: none;
	border-bottom: 1px solid var(--line);
}
.commentzone #cancel-comment-reply-link:hover { color: var(--gold); border-bottom-color: var(--gold); }

.whoami {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 14px;
	background: var(--card2);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 9px 14px;
	font-size: 0.92rem;
}
.whoami .wname { font-weight: 600; color: var(--purpledeep); }
.whoami .wsub { font-size: 0.74rem; color: var(--muted); }
.whoami .wout {
	margin-left: auto;
	font-size: 0.78rem;
	color: var(--muted);
	text-decoration: none;
	border-bottom: 1px solid var(--line);
}
.whoami .wout:hover { color: var(--gold); border-bottom-color: var(--gold); }

.commentzone .comment-form-comment,
.commentzone .comment-form-author,
.commentzone .comment-form-email,
.commentzone .comment-form-url,
.commentzone .comment-form-cookies-consent {
	margin: 0 0 14px;
}
.commentzone label {
	display: block;
	font-size: 0.82rem;
	color: var(--muted);
	margin-bottom: 6px;
}
.commentzone label .req { color: var(--pink); margin-left: 2px; }
.commentzone textarea,
.commentzone input[type="text"],
.commentzone input[type="email"],
.commentzone input[type="url"] {
	width: 100%;
	background: var(--input);
	color: var(--ink);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 11px 14px;
	font-family: inherit;
	font-size: 0.95rem;
	line-height: 1.6;
	/* The theme adds its own outline and shadow; keep exactly one ring. */
	box-shadow: none;
}
.commentzone textarea {
	min-height: 110px;
	resize: vertical;
}
.commentzone textarea:focus,
.commentzone input[type="text"]:focus,
.commentzone input[type="email"]:focus,
.commentzone input[type="url"]:focus {
	outline: none;
	border-color: var(--gold);
	box-shadow: 0 0 0 3px rgba(207, 163, 83, 0.18);
}
.commentzone textarea::placeholder { color: var(--muted); opacity: 0.7; }

.commentzone .comment-form-cookies-consent input[type="checkbox"] {
	width: auto;
	accent-color: var(--purple);
	margin-right: 7px;
}
.commentzone .comment-form-cookies-consent label {
	display: inline;
	font-size: 0.8rem;
	margin: 0;
}

.commentzone .nl-submit {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	margin-top: 4px;
}
.postbtn {
	font-family: 'Questrial', 'Outfit', sans-serif;
	letter-spacing: 0.04em;
	font-size: 1rem;
	color: #fff;
	cursor: pointer;
	background: linear-gradient(160deg, #8A4BB8, #AE62D9);
	border: 1px solid var(--purple);
	border-radius: 999px;
	padding: 11px 30px;
	transition: background 0.25s, color 0.25s;
}
.postbtn:hover {
	background: linear-gradient(160deg, #B8863B, #CFA353);
	color: #1D1735;
}
.postbtn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.formnote { font-size: 0.78rem; color: var(--muted); margin: 0; }
.gatenote { font-size: 0.8rem; color: var(--muted); margin: 16px 0 8px; }

/* ---- narrow screens ---- */
@media (max-width: 600px) {
	.commentzone { padding: 20px 16px 24px; }
	.avatar { flex-basis: 34px; width: 34px; height: 34px; font-size: 0.9rem; }
	.crow { gap: 10px; }
	.children { padding-left: 14px; margin-left: 10px; }
	.whoami { flex-wrap: wrap; }
	.whoami .wout { margin-left: 0; }
}
