/* ── Comments ────────────────────────────────────────────────
   At the end of an essay, on the paper. Drawn by src/client/comments.js;
   hidden entirely without JavaScript.

   The essay's own three voices and no others: the display face for
   headings and names, the reading serif for anything anyone says (and the
   small print around it), and the mono call-sheet labels for dates,
   counts and buttons. */
.comments {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--pad) 72px;
  color: #222;
  font-family: var(--font-serif);
}
.comments-h {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: #111;
}
.comments-intro, .comments-empty, .comments-error,
.composer-hint, .composer-note, .composer-error {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-dim);
}
.comments-intro { margin-top: 6px; }
.comments-empty { margin-top: 22px; }
.comments-error, .composer-error { color: #9c3a2f; }
.comments-error { margin-top: 22px; }

.comments-list, .comment-replies { list-style: none; margin: 0; padding: 0; }
.comments-list { margin-top: 30px; }
.comment { outline: none; }
.comments-list > .comment { padding: 22px 0; border-top: 1px solid #e3e0d8; }
.comments-list > .comment:first-child { padding-top: 0; border-top: 0; }
.comment-replies { margin: 18px 0 0 22px; padding-left: 20px; border-left: 1px solid #d8d4ca; }
.comment-replies > .comment + .comment { margin-top: 18px; }

/* A comment someone arrived at by its link, or just posted: a mark in the
   margin, beside the comment only, never shifting the words. */
.comment-body { position: relative; }
.comment.is-target > .comment-body::before,
.comment.is-new > .comment-body::before {
  content: '';
  position: absolute;
  left: -16px; top: 2px; bottom: 2px;
  width: 3px;
  background: #b04a3e;
}

.comment-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.comment-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: #111;
  overflow-wrap: anywhere;
}
.comment-badge, .comment-time, .composer-progress,
.comment-reply, .comments-start, .composer button {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.comment-badge { font-size: 10px; color: #fff; background: #b04a3e; padding: 2px 7px 1px; border-radius: 2px; }
.comment-time { font-size: 10.5px; color: var(--ink-dim); }
.comment-text {
  margin-top: 6px;
  font-size: 18px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.comment-actions { margin-top: 6px; }

.comment-reply, .comments-start, .composer button { font-size: 11px; cursor: pointer; border-radius: 2px; }
.comment-reply { background: none; border: 0; padding: 6px 0; color: var(--ink-dim); }
.comment-reply:hover { color: #111; }
.comments-start-row { margin-top: 30px; }
.comments-start, .composer-next { background: #111; color: #f5f3ee; border: 1px solid #111; padding: 12px 20px; }
.comments-start:hover, .composer-next:hover { background: #b04a3e; border-color: #b04a3e; }
.composer-next:disabled { opacity: .6; cursor: default; }
.composer-cancel, .composer-back { background: none; color: var(--ink-dim); border: 1px solid #d8d4ca; padding: 12px 16px; }
.composer-cancel:hover, .composer-back:hover { color: #111; border-color: #111; }
.composer-cancel { margin-right: auto; }

/* The box for writing. Under a comment it sits where the reply will. */
.composer {
  margin-top: 16px;
  padding: 22px 24px 20px;
  background: #fff;
  border: 1px solid #e3e0d8;
  border-top: 2px solid #b04a3e;
}
.comment > .composer { margin-left: 42px; }
.composer-progress { font-size: 10px; color: var(--ink-dim); }
.composer-step[hidden] { display: none; }
.composer-label {
  display: block;
  margin: 6px 0 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.3;
  color: #111;
}
.composer-field {
  display: block;
  width: 100%;
  font: 17px/1.6 var(--font-serif);
  color: #111;
  background: #fbfaf7;
  border: 1px solid #d8d4ca;
  border-radius: 2px;
  padding: 10px 12px;
}
textarea.composer-field { resize: vertical; min-height: 140px; }
.composer-field:focus { outline: none; border-color: #b04a3e; box-shadow: 0 0 0 3px rgba(176,74,62,.14); }
.composer-hint { margin-top: 8px; font-size: 15px; }
.composer-error { margin-top: 12px; }
.composer-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.composer-note { margin-top: 14px; font-size: 14.5px; }
.comments-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 520px) {
  .comment-replies { margin-left: 4px; padding-left: 14px; }
  .comment > .composer { margin-left: 0; }
  .composer { padding: 18px 16px; }
  .comment.is-target > .comment-body::before,
  .comment.is-new > .comment-body::before { left: -12px; }
}
@media print { .comments { display: none !important; } }

