/**
 * Comments as a timeline of updates: avatars on a rail, a card per comment.
 */

.dl-comments { display: grid; gap: var(--space-4); }
.dl-comments__title { margin: 0; font: 600 15px/22px var(--font-sans); letter-spacing: 0; }

.dl-comments__list { position: relative; display: grid; }
.dl-comments__list::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 15px;
  width: 2px;
  background: var(--border);
}
.dl-comments__list .indented {
  margin-left: calc(32px + var(--space-3));
  display: grid;
}

.dl-comment {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: var(--space-3);
  padding-block: var(--space-2);
}
/* The avatar covers the rail with a ring of the page color. */
.dl-comment > .dl-avatar { position: relative; box-shadow: 0 0 0 4px var(--bg); border-radius: 50%; }

.dl-comment__card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-lg) var(--radius-lg) var(--radius-lg);
}
.dl-comment__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-3);
  min-height: 20px;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-subtle);
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-lg) 0 0;
}
.dl-comment__head strong { color: var(--text); font-weight: 600; }
.dl-comment__head strong a { color: inherit; text-decoration: none; }
.dl-comment__date { color: var(--text-subtle); font-size: 12px; text-decoration: none; }
.dl-comment__date:hover { text-decoration: underline; }

/* Links (edit, delete, reply) show on hover, always on touch screens. */
.dl-comment__head ul.links {
  display: flex;
  gap: var(--space-1);
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.12s;
}
.dl-comment__head ul.links a {
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
}
.dl-comment__head ul.links a:hover { background: var(--surface); color: var(--text); }
.dl-comment:hover .dl-comment__head ul.links,
.dl-comment:focus-within .dl-comment__head ul.links { opacity: 1; }
@media (hover: none) {
  .dl-comment__head ul.links { opacity: 1; }
}

.dl-comment__content {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3);
  font-size: 14px;
  line-height: 22px;
}
.dl-comment__content > .field:last-child > :last-child { margin-bottom: 0; }

.dl-comments__form {
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.dl-comment__content p { margin: 0; }
.dl-comment__content p + p { margin-top: var(--space-2); }
