/* Yleinen kontti */
.comments-container {
  margin-bottom: 2rem;
}

/* Yksittäinen kommentti */
.comment {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

#comments-root a {
  text-decoration: underline !important;
}

#comments-root a:hover {
  text-decoration: underline;
  filter: brightness(0.85);
}

#comments-root .comment-author a {
  font-weight: 600;
  text-decoration: underline;
}

#comments-root .comment-content a {
  text-decoration: underline;
}

.comment-author a:hover {
  text-decoration: underline;
}

.comment-avatar {
  border-radius: 50%;
}

.comment-author {
  font-weight: 600;
}

.comment-date {
  color: #777;
  font-size: 0.85rem;
}

.comment-body p {
  margin: 0.25rem 0 0.5rem;
}

/* Ei kommentteja -teksti */
.no-comments {
  font-style: italic;
  color: #666;
}

/* Lomake */
.comment-form {
  margin-top: 2rem;
  max-width: 40rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.comment-form-info {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.comment-form label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Tekstikentät */
.comment-form input[type='text'],
.comment-form input[type='email'],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.6rem;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 4px;
  font: inherit;
  background-color: #fff;
}

/* Tekstilaatikko */
.comment-form textarea {
  resize: vertical;
  min-height: 5rem;
}

/* Statusviesti */
.comment-form-status {
  font-size: 0.9rem;
  min-height: 1.2rem;
  margin-top: 0.25rem;
}

/* Lähetysnappi */
.comment-submit-button {
  align-self: flex-start;
  margin-top: 0.75rem;
  padding: 0.5rem 1.2rem;
  border: none;
  border-radius: 4px;
  font: inherit;
  cursor: pointer;
  background-color: #333;
  color: #fff;
}

.comment-submit-button:hover {
  background-color: #555;
}

.comment-submit-button:disabled {
  opacity: 0.6;
  cursor: default;
}
/* Mainroad layout and narrow screens. */
#comments-root {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: #fff;
}
#comments-root .comment-header { flex-wrap: wrap; }
#comments-root .comment-body { white-space: pre-wrap; overflow-wrap: anywhere; }
#comments-root .comment-avatar { flex-shrink: 0; }
#comments-root input:focus-visible,
#comments-root textarea:focus-visible,
#comments-root button:focus-visible { outline: 2px solid #e22d30; outline-offset: 2px; }

/* Keep thread structure while reserving room for the editor on narrow screens. */
#comments-root .comment-replies:not(:empty) {
  margin-top: 0.75rem;
  margin-left: clamp(0.5rem, 3vw, 1.5rem);
  padding-left: 0.75rem;
  border-left: 2px solid #ddd;
}
/* Two visible indentation levels; deeper replies keep their actual parent. */
#comments-root .comment-replies .comment-replies .comment-replies {
  margin-left: 0;
  padding-left: 0;
  border-left: none;
}
#comments-root .comment-reply-button,
#comments-root .comment-cancel-reply {
  padding: 0.4rem 0.6rem;
  border: 1px solid #aaa;
  border-radius: 4px;
  background: #fff;
  color: #333;
  font: inherit;
  cursor: pointer;
}
#comments-root .comment-reply-button:disabled,
#comments-root .comment-cancel-reply:disabled { opacity: 0.6; cursor: default; }
#comments-root .comment-form-panel { margin-top: 1rem; }
#comments-root .comment-reply-slot .comment-form { margin-top: 0.75rem; }
#comments-root .comment-cancel-reply[hidden] { display: none; }

#comments-root .comment-reply-to {
  margin: 0.25rem 0;
  color: #666;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}
