/* The comment section under a video. Ordinary and familiar on purpose — the
   wall above it is the unusual surface. */

.comments { margin: 26px 0 40px; }
.comments[hidden] { display: none; }

.comments__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.comments__head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.comments__count { font-size: 13px; color: var(--app-dim); }

.comments__sorts { margin-left: auto; display: flex; gap: 4px; }
.comments__sort {
  padding: 5px 12px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--app-dim);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.comments__sort:hover { background: rgba(127, 127, 127, .14); }
.comments__sort.is-active { color: inherit; background: rgba(127, 127, 127, .18); }

.comments__msg { min-height: 16px; margin: 8px 0 0; font-size: 12.5px; font-weight: 600; }
.comments__msg--error { color: #d1344b; }

.comments__empty {
  margin: 18px 0;
  font-size: 13.5px;
  color: var(--app-dim);
}

.comments__list { margin-top: 18px; display: flex; flex-direction: column; gap: 18px; }

/* ---- Composer ------------------------------------------------------------ */

.comment-composer { margin-top: 4px; }
.comment-composer__text {
  display: block;
  width: 100%;
  padding: 8px 2px;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  color: inherit;
  background: none;
  border: 0;
  /* Underline rather than a box: it reads as "start typing" instead of "fill in
     this form", which is the difference between a comment and a submission. */
  border-bottom: 1px solid rgba(127, 127, 127, .35);
  resize: none;
  overflow: hidden;
}
.comment-composer__text:focus {
  outline: 0;
  border-bottom-color: #16c8d2;
  border-bottom-width: 2px;
}

.comment-composer__row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}
.comment-composer__count {
  margin-right: auto;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--app-dim);
  font-variant-numeric: tabular-nums;
}
.comment-composer__actions { display: flex; gap: 8px; }

.comment-btn {
  height: 34px;
  padding: 0 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.comment-btn:hover { background: rgba(127, 127, 127, .14); }
.comment-btn--solid { color: #062238; background: #43dced; }
.comment-btn--solid:hover:not(:disabled) { background: #2fcede; }
.comment-btn--solid:disabled { opacity: .6; cursor: default; }

.comment-composer--reply { margin-top: 10px; }

/* ---- A comment ----------------------------------------------------------- */

.comment { display: flex; gap: 12px; align-items: flex-start; }
.comment__body { flex: 1; min-width: 0; }

.comment__avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
  background: rgba(127, 127, 127, .2);
}
.comment__avatar--letter {
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  color: #062238;
  background: #43dced;
}

.comment__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
}
.comment__who { font-size: 13px; font-weight: 700; }
.comment__when { font-size: 12px; color: var(--app-dim); }
.comment__badge {
  padding: 1px 7px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #fff;
  background: #0a8b9a;
  border-radius: 999px;
}

.comment__text {
  margin: 4px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  /* Paragraphs are preserved by the model, so they have to render. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}
.comment__action,
.comment__like {
  padding: 5px 10px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--app-dim);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.comment__action:hover,
.comment__like:hover { background: rgba(127, 127, 127, .14); color: inherit; }
.comment__like.is-liked { color: #d1344b; }
.comment__action--danger:hover { color: #d1344b; }
.comment__action--replies { color: #0a8b9a; }

.comment__replies { margin-top: 6px; }
.comment__reply-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}
.comment__reply-list[hidden] { display: none; }

.comment--reply .comment__avatar { width: 28px; height: 28px; font-size: 12px; }

.comment--removed .comment__removed {
  margin: 0;
  font-size: 12.5px;
  font-style: italic;
  color: var(--app-dim);
}

@media (max-width: 520px) {
  .comment { gap: 9px; }
  .comment__avatar { width: 30px; height: 30px; font-size: 13px; }
  .comments__sorts { margin-left: 0; width: 100%; }
  .comments__head { flex-wrap: wrap; }
}

/* A comment held locally between "posted" and "the listener delivered it".
   Dimmed rather than hidden: it is real, it is just not confirmed yet. */
.comment--pending { opacity: .62; }
.comment--pending .comment__actions { pointer-events: none; opacity: .5; }
