/* SP Agora Comments Fix - layout responsivo para comentários */

#comments,
.comments-area,
.comment-respond,
.comment-list,
.post-comments,
.entry-comments {
  box-sizing: border-box;
}

#comments,
.comments-area,
.post-comments,
.entry-comments {
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.comment-list,
.comments-area ol,
.comments-area ul,
#comments ol,
#comments ul {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}

.comment-list li,
.comments-area .comment,
#comments .comment {
  width: 100%;
  max-width: 100%;
  clear: both;
}

.comment-body,
.comments-area .comment-body,
#comments .comment-body {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 18px 0;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.comment-author,
.comment-meta,
.comment-content,
.reply,
.comment-awaiting-moderation {
  min-width: 0;
  max-width: 100%;
}

.comment-author {
  grid-column: 1 / 3;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.comment-author .avatar,
.comment-author img.avatar,
.comment-avatar img,
.avatar {
  width: 54px !important;
  height: 54px !important;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 54px;
}

.comment-author .fn,
.comment-author cite,
.comment-author b {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}

.comment-meta {
  grid-column: 1 / 3;
  color: #8b0000;
  font-size: 14px;
  margin: -4px 0 4px 66px;
  line-height: 1.35;
}

.comment-content,
.comment-body > p,
.comment-text {
  grid-column: 2 / 3;
  font-size: 16px;
  line-height: 1.65;
  color: #333;
  overflow-wrap: anywhere;
  word-break: normal;
}

.comment-content p,
.comment-body > p {
  margin: 0 0 12px;
}

.reply {
  grid-column: 3 / 4;
  grid-row: 1 / 3;
  justify-self: end;
}

.comment-reply-link,
.reply a,
#cancel-comment-reply-link {
  display: inline-block;
  background: #333;
  color: #fff !important;
  border-radius: 4px;
  padding: 8px 13px;
  font-size: 14px;
  text-decoration: none !important;
  line-height: 1.2;
  white-space: nowrap;
}

.comment-respond {
  margin-top: 26px;
  padding-top: 10px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Remove/normaliza tags ou chips que alguns plugins injetam dentro dos comentários */
.comment-content .tag,
.comment-content .tags,
.comment-content .post-cat,
.comment-content .category,
.comment-content .cat-links,
.comment-content .entry-category,
.comment-body .tag,
.comment-body .post-cat,
.comment-body .category {
  display: none !important;
}

@media (max-width: 768px) {
  #comments,
  .comments-area,
  .post-comments,
  .entry-comments,
  .comment-respond {
    padding-left: 16px;
    padding-right: 16px;
  }

  .comment-body,
  .comments-area .comment-body,
  #comments .comment-body {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px 12px;
    padding: 18px 0;
  }

  .comment-author {
    grid-column: 1 / 3;
    gap: 10px;
  }

  .comment-author .avatar,
  .comment-author img.avatar,
  .comment-avatar img,
  .avatar {
    width: 48px !important;
    height: 48px !important;
    flex-basis: 48px;
  }

  .comment-author .fn,
  .comment-author cite,
  .comment-author b {
    font-size: 17px;
    line-height: 1.25;
  }

  .comment-meta {
    grid-column: 1 / 3;
    margin: -4px 0 2px 60px;
    font-size: 13px;
  }

  .comment-content,
  .comment-body > p,
  .comment-text {
    grid-column: 1 / 3;
    font-size: 16px;
    line-height: 1.65;
    margin-left: 0;
    width: 100%;
  }

  .reply {
    grid-column: 1 / 3;
    grid-row: auto;
    justify-self: start;
    margin-top: 4px;
  }

  .comment-reply-link,
  .reply a {
    padding: 8px 14px;
    font-size: 14px;
  }

  .comment-list .children,
  #comments .children {
    margin-left: 14px;
    padding-left: 12px;
    border-left: 2px solid rgba(0,0,0,.08);
  }
}

@media (max-width: 420px) {
  #comments h2,
  .comments-title,
  .comment-reply-title {
    font-size: 24px;
    line-height: 1.25;
  }

  .comment-body,
  .comments-area .comment-body,
  #comments .comment-body {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .comment-author .avatar,
  .comment-author img.avatar,
  .comment-avatar img,
  .avatar {
    width: 42px !important;
    height: 42px !important;
    flex-basis: 42px;
  }

  .comment-meta {
    margin-left: 54px;
  }
}
