/**
 * Curatery comment threads — the rebrand.
 *
 * The discussion on a Nook article, and its preview on a Nook's Discussion
 * tab. Markup is inc/comment-thread.php; both places wrap it in .cur-comments.
 *
 * The .nook-* class names are kept because the script at the foot of
 * single-nook-article.php drives the reply boxes and the fold buttons by them.
 */

.cur-comments {
	--theme-link-initial-color: currentColor;
	--theme-link-hover-color: var(--cur-tomato);
	color: var(--cur-ink);
	font-family: var(--cur-sans);
}

.cur-comments :where(a) {
	text-decoration: none;
}

/* .nook-comment-replies sets display, which would otherwise beat [hidden]. */
.cur-comments [hidden] {
	display: none !important;
}

.cur-comments :is(h2, h3) {
	color: inherit;
	font-family: var(--cur-serif);
	font-weight: 400;
}

.cur-comments .nook-comments-title {
	margin: 0.4rem 0 1.6rem;
	font-size: 2.2rem;
	line-height: 1;
}

.cur-comments .nook-comment-form textarea,
.cur-comments .nook-reply-form textarea {
	display: block;
	width: 100%;
	min-height: 110px;
	padding: 1rem;
	border: 1px solid var(--cur-line);
	border-radius: var(--cur-radius);
	background: var(--cur-cream);
	color: var(--cur-ink);
	font: 400 0.95rem/1.6 var(--cur-sans);
	resize: vertical;
}

.cur-comments .nook-reply-form textarea {
	min-height: 80px;
}

.cur-comments :is(.nook-comment-form textarea, .nook-reply-form textarea):focus {
	border-color: var(--cur-mustard);
	outline: 2px solid var(--cur-ink);
	outline-offset: 2px;
}

.cur-comments .nook-comment-form-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.8rem;
	margin-top: 0.8rem;
}

.cur-comments .nook-comment-form-actions p {
	margin: 0;
	color: var(--cur-ink-muted);
	font-size: 0.78rem;
}

.cur-comments :is(.nook-comment-submit, .nook-reply-form button) {
	min-height: 44px;
	padding: 0.7rem 1.2rem;
	border: 2px solid var(--cur-tomato);
	border-radius: 0;
	background: var(--cur-tomato);
	color: #ffffff;
	font: 700 0.68rem/1.2 var(--cur-sans);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
}

.cur-comments :is(.nook-comment-submit, .nook-reply-form button):hover {
	border-color: var(--cur-tomato-hover);
	background: var(--cur-tomato-hover);
}

/* The script opens one by setting its display, which beats this. */
.cur-comments .nook-reply-form {
	display: none;
	margin-top: 1rem;
}

.cur-comments .nook-login-prompt {
	padding: 1.2rem 1.3rem;
	border: 1px dashed var(--cur-line);
	border-radius: var(--cur-radius);
	color: var(--cur-ink-muted);
	font-size: 0.9rem;
}

.cur-comments .nook-login-prompt a {
	color: var(--cur-tomato);
	font-weight: 700;
}

.cur-comments .nook-comments-list {
	display: flex;
	flex-direction: column;
	gap: 1.2rem;
	margin-top: 2rem;
}

.cur-comments .nook-comment {
	padding: 1.3rem 1.4rem;
	border: 1px solid var(--cur-line);
	border-radius: var(--cur-radius);
	background: var(--cur-cream);
}

.cur-comments .nook-comment__meta {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-bottom: 0.7rem;
}

.cur-comments .nook-comment__avatar {
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	overflow: hidden;
	border-radius: 50%;
	background: var(--cur-butter);
}

.cur-comments .nook-comment__avatar img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cur-comments .nook-comment__author {
	font-size: 0.88rem;
	font-weight: 700;
}

.cur-comments .nook-comment__date {
	color: var(--cur-ink-muted);
	font-size: 0.7rem;
}

.cur-comments .nook-comment__text {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.6;
}

.cur-comments .nook-comment__reply-btn {
	margin-top: 0.8rem;
	padding: 0;
	border: 0;
	border-bottom: 2px solid var(--cur-ink);
	background: none;
	color: var(--cur-ink);
	font: 700 0.62rem/1.2 var(--cur-sans);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: pointer;
}

/* A reply sits inside its parent, with a line down the side showing what
   belongs to what. Four levels deep; see inc/comment-thread.php. */
.cur-comments .nook-comment-replies {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-top: 1.1rem;
	padding-left: 1.1rem;
	border-left: 2px solid var(--cur-line);
}

.cur-comments .nook-comment-replies .nook-comment {
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
}

.cur-comments .nook-comment__panel {
	padding-left: 2.7rem;
}

/* The fold button, which the page's own script drives. */
.cur-comments .nook-comment__fold {
	display: grid;
	flex: 0 0 20px;
	place-items: center;
	width: 20px;
	height: 20px;
	padding: 0;
	border: 1px solid var(--cur-line);
	border-radius: 50%;
	background: var(--cur-paper);
	color: var(--cur-ink-muted);
	font: 700 0.8rem/1 var(--cur-sans);
	cursor: pointer;
}

.cur-comments .nook-comment__fold:hover {
	border-color: var(--cur-ink);
	color: var(--cur-ink);
}

/* Without a fold button the row still lines up with one that has it. */
.cur-comments .nook-comment__meta {
	padding-left: 28px;
}

.cur-comments .nook-comment__meta:has( .nook-comment__fold ) {
	padding-left: 0;
}

.cur-comments .nook-comment__badge {
	padding: 0.15rem 0.5rem;
	border-radius: 20px;
	background: var(--cur-green-pale);
	color: var(--cur-green-deep);
	font-size: 0.6rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.cur-comments .nook-comment__hidden {
	color: var(--cur-ink-muted);
	font-size: 0.72rem;
}

.cur-comments .nook-no-comments {
	margin-top: 2rem;
	padding: 2.2rem;
	border-radius: var(--cur-radius);
	background: var(--cur-cream);
	color: var(--cur-ink-muted);
	text-align: center;
}


/* ── Preview, on a Nook's Discussion tab ──────────────────── */

.cur-comments--preview .nook-comments-list {
	gap: 0.7rem;
	margin-top: 0.9rem;
}

.cur-comments--preview .nook-comment {
	padding: 0.9rem 1rem;
}

.cur-comments--preview .nook-comment__text {
	font-size: 0.9rem;
}
