/* 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; }

/* ---- Subscriber since -----------------------------------------------------
   "@kenyon · Subscriber since May 2026".

   Deliberately quieter than the name and much quieter than the sentence: it is
   provenance, not the point of the row. The head is already a wrapping flex
   line, so on a narrow column this drops under the username on its own — which
   is the layout the spec asks for on mobile, achieved by not fighting it. */
.comment__since {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--app-dim);
  font: inherit;
  font-size: 12px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}
/* The separator belongs to the badge rather than to the markup, so a comment
   without one never renders a dangling dot. */
.comment__since::before {
  content: "·";
  /* --app-line is a border colour at 12% black: as a separator between two
     pieces of text it is invisible. This has to read as punctuation. */
  color: var(--app-dim);
  opacity: .7;
}
.comment__since:hover { color: var(--app-fg); }
.comment__since:focus-visible {
  outline: 2px solid rgba(34, 211, 122, .6);
  outline-offset: 2px;
  border-radius: 4px;
}
/* One of the two is always in the DOM for a screen reader; CSS only decides
   which one is painted. The short form is aria-hidden, so what is announced is
   always the full sentence. */
.comment__since-short { display: none; }

@media (max-width: 520px) {
  .comment__since-long { display: none; }
  .comment__since-short { display: inline; }
  /* A long username must not push the date off the screen: the badge takes its
     own line under the name rather than squeezing both. */
  .comment__who { max-width: 100%; overflow-wrap: anywhere; }
}

/* ---- The relationship card ------------------------------------------------
   Opened by clicking the badge — not a hover tooltip, because a phone has no
   hover and a keyboard has no pointer. Positioned in the document rather than
   inside the comment so a row with overflow cannot clip it. */
.sub-since-card {
  position: absolute;
  z-index: 400;
  display: grid;
  gap: 6px;
  min-width: 232px;
  max-width: min(300px, calc(100vw - 16px));
  padding: 12px 14px;
  border: 1px solid var(--app-line);
  border-radius: 12px;
  background: var(--app-bg, #fff);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .18);
  font-size: 12.5px;
}
.sub-since-card__head {
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.sub-since-card__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.sub-since-card__label { color: var(--app-dim); }
.sub-since-card__value { font-weight: 700; text-align: right; }
