/* -------------- Comments -------------- */

/* Comments (site/comments/), in a frame (main.css): each in a box, replies boxed inside what they reply to. */

.comments {
  margin-top: 3rem;
}

.comments > :not(:first-child) {
  margin-left: 1rem;
  margin-right: 1rem;
}

.comments__title {
  margin: 1rem 1rem 1.25rem;
  font-size: 1.4rem;
}

.comments__form-title {
  margin-top: 1.5rem;
  font-size: 1rem;
  color: var(--link-color);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.comments__form-title::before {
  content: "$ " / "";
}

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

/* Each comment a box, its replies boxes inside it (as deep as the thread goes), lit on their left as replies. */
.comment {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
}

.comment + .comment {
  margin-top: 0.75rem;
}

.comments__list--replies {
  margin-top: 0.75rem;
}

.comments__list--replies > .comment {
  border-left: 2px solid var(--accent-dim);
}

/* Less room inside each box on narrow screens, so deep threads keep some width. */
@media (max-width: 767px) {
  .comment .comment {
    padding: 0.5rem 0.6rem;
  }
}

/* Linked to (#comment-<id>, as the emails do): */
.comment:target {
  border-color: var(--link-color);
  box-shadow: 0 0 8px var(--accent-dim);
}

.comment__header {
  color: var(--muted-text-color);
  font-size: 0.85rem;
}

.comment__name {
  color: var(--light-text-color);
  font-weight: 700;
}

.comment__name::before {
  content: "@" / "";
  color: var(--link-color);
}

.comment__text {
  margin-top: 0.35rem;
  overflow-wrap: anywhere;
}

.comment__text p {
  margin: 0 0 0.5rem;
}

.comment__reply:not(:empty) {
  margin-top: 0.75rem;
}

/* Embedded (a microblog post's, over its listing: microblog/microblog_post.html): under a rule, not in a frame. */
.comments--embedded {
  margin-top: 0.75rem;
  padding-top: 0.25rem;
  border-top: 1px dashed var(--border-color);
}

.comments--embedded > :not(:first-child),
.comments--embedded .comments__title {
  margin-right: 0;
  margin-left: 0;
}

.comments--embedded .comments__title {
  font-size: 1rem;
}

/*
 * A form scrolled to when it's loaded (comments/comment_form_button.html) stops under what's fixed over it: the
 * page's header; over the microblog's listing, the post's own words.
 */
.comment-form-slot {
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

.comments--embedded .comment-form-slot {
  scroll-margin-top: 9rem;
}

/* The comments' own slot (the button, then the form): off the comments above it and the frame's bottom edge. */
.comments > .comment-form-slot {
  margin-top: 1.25rem;
  margin-bottom: 1rem;
}
