/* Comments */
.comments {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.comments h2 {
  margin-bottom: 1.5rem;
}

#comment-list {
  margin-bottom: 2rem;
}

.comment {
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--border);
  border-radius: 8px;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.comment-author {
  font-weight: 600;
  color: var(--fg);
}

.comment-date {
  font-size: 0.8rem;
  color: var(--muted);
}

.comment-content {
  margin: 0;
  color: var(--fg);
}

.comment.hidden-comment {
  display: none;
}

#show-more-comments {
  background: var(--border);
  color: var(--fg);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  transition: background 0.15s;
}

#show-more-comments:hover {
  background: var(--muted);
}

#comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#comment-form input,
#comment-form textarea {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font-family: inherit;
  font-size: 1rem;
}

#comment-form textarea {
  resize: vertical;
  min-height: 80px;
}

#comment-form input:focus,
#comment-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

#comment-form button {
  align-self: flex-start;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.15s;
}

#comment-form button:hover {
  opacity: 0.9;
}

#comment-error {
  color: #e63946;
  font-size: 0.9rem;
  min-height: 1.25rem;
}

/* Comment delete button */
.comment-delete {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 0.25rem;
  transition: color 0.15s;
}

.comment-delete:hover {
  color: #e63946;
}

/* Reactions */
.reactions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.reaction-btn .emoji {
  font-size: 1.2rem;
}

.reaction-btn .count {
  font-size: 0.9rem;
  color: var(--muted);
  min-width: 1ch;
}

.reaction-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
}

.reaction-btn.selected .count {
  color: var(--white);
}

.reaction-btn.pulse {
  animation: pulse 0.3s ease-out;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }

  100% {
    transform: scale(1);
  }
}
