/* ===========================================================================
   Comments & engagement — Lemonade Notes + newsletter issues
   Uses the global design tokens (css/global.css). Icons are inline SVG (no
   emoji). Scoped under #comments so it never leaks into the rest of the page.
   =========================================================================== */

#comments {
  margin: 64px auto 0;
  padding: 48px 24px 24px;
  border-top: 1px solid rgba(47, 58, 46, 0.12);
  font-family: var(--font-body);
  color: var(--text);
}

#comments .comments-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

#comments .comments-title {
  font-family: var(--font-headline);
  font-weight: 400;
  font-size: 2rem;
  line-height: 1.1;
  margin: 0;
  color: var(--forest);
}

#comments .comments-intro {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 28px;
  line-height: 1.6;
}

/* --- Post-level "resonate" --------------------------------------------- */

.resonate-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(47, 58, 46, 0.18);
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.resonate-btn:hover {
  border-color: var(--lemon-gold);
  background: rgba(var(--lemon-gold-rgb), 0.08);
}

.resonate-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  transition: fill 0.18s ease, stroke 0.18s ease, transform 0.18s ease;
}

.resonate-btn.is-liked {
  border-color: var(--lemon-gold);
  color: var(--lemon-gold);
}

.resonate-btn.is-liked svg {
  fill: var(--lemon-gold);
  stroke: var(--lemon-gold);
  transform: scale(1.08);
}

.resonate-btn .resonate-count {
  font-variant-numeric: tabular-nums;
  min-width: 0.7em;
}

#comments .post-resonate {
  margin-bottom: 40px;
}

/* --- Comment form ------------------------------------------------------ */

.comment-form {
  background: rgba(47, 58, 46, 0.03);
  border: 1px solid rgba(47, 58, 46, 0.08);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 40px;
}

.comment-form-title {
  font-family: var(--font-headline);
  font-weight: 400;
  font-size: 1.4rem;
  margin: 0 0 16px;
  color: var(--forest);
}

.comment-form .field-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.comment-form .field-row > * {
  flex: 1;
  min-width: 0;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  border: 1px solid rgba(47, 58, 46, 0.18);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 0.18s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--lemon-gold);
}

.comment-form textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
  margin-bottom: 12px;
}

/* Honeypot — visually hidden, off-screen, not announced. */
.comment-form .hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.comment-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.comment-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--lemon-gold);
  color: #2F3A2E;
  border: none;
  border-radius: 9999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 28px;
  cursor: pointer;
  transition: filter 0.18s ease, opacity 0.18s ease;
}

.comment-submit:hover { filter: brightness(1.05); }
.comment-submit:disabled { opacity: 0.6; cursor: default; }

.comment-form .form-note {
  font-size: 0.8rem;
  color: var(--text-subtle);
}

/* --- Status / notice banners ------------------------------------------ */

.comment-notice {
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 0.92rem;
  line-height: 1.55;
  margin-bottom: 20px;
}

.comment-notice.is-success {
  background: rgba(var(--sage-rgb), 0.18);
  color: var(--forest);
  border: 1px solid rgba(var(--sage-rgb), 0.5);
}

.comment-notice.is-error {
  background: rgba(var(--anger-rgb), 0.08);
  color: var(--anger);
  border: 1px solid rgba(var(--anger-rgb), 0.3);
}

/* --- Thread ------------------------------------------------------------ */

.comment-list { list-style: none; margin: 0; padding: 0; }

.comment {
  padding: 20px 0;
  border-top: 1px solid rgba(47, 58, 46, 0.08);
}

.comment:first-child { border-top: none; }

.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.comment-author {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--forest);
}

.comment-date {
  font-size: 0.8rem;
  color: var(--text-subtle);
}

.comment-body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0 0 10px;
}

.comment-body a { color: var(--lemon-gold); text-decoration: underline; }

.comment-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.comment-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  transition: color 0.18s ease;
}

.comment-action:hover { color: var(--lemon-gold); }
.comment-action svg { width: 15px; height: 15px; display: block; fill: none; stroke: currentColor; stroke-width: 1.6; }
.comment-action.is-liked { color: var(--lemon-gold); }
.comment-action.is-liked svg { fill: var(--lemon-gold); stroke: var(--lemon-gold); }
.comment-action .resonate-count { font-variant-numeric: tabular-nums; }

/* Replies — one level of nesting. */
.comment-replies {
  list-style: none;
  margin: 14px 0 0 0;
  padding-left: 20px;
  border-left: 2px solid rgba(var(--sage-rgb), 0.4);
}

.comment-replies .comment { padding: 14px 0; border-top: 1px dashed rgba(47, 58, 46, 0.08); }
.comment-replies .comment:first-child { border-top: none; }

/* Inline reply form sits under the comment being replied to. */
.reply-form { margin: 14px 0 4px; }

.comment-empty {
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 8px 0 16px;
}

@media (max-width: 600px) {
  #comments { padding-left: 20px; padding-right: 20px; }
  .comment-form .field-row { flex-direction: column; gap: 12px; }
  #comments .comments-title { font-size: 1.7rem; }
}
