﻿/* === Контейнер и заголовок секции === */
#comments.comments-area {
  margin-top: 32px;
  padding: 20px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  color: #222222;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
}
#comments .comments-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e5e7eb;
  color: #111111;
}

/* === Блок приглашения к авторизации === */
.comment-row .user-container {
  padding: 16px;
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}
.header-but { display: flex; gap: 10px; margin-top: 10px; }
.header-but .btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 14px; border-radius: 10px;
  border: 1px solid #e5e7eb; background: #f5f7fb; color: #111;
  cursor: pointer; text-decoration: none;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.header-but .btn:hover { background: #eef2f7; border-color: #d1d5db; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.header-but .grad { background: linear-gradient(135deg, #4da9ff, #3a8de0); color: #fff; border: none; }
.header-but .grad:hover { background: linear-gradient(135deg, #3a8de0, #2c73c9); }

/* === reCAPTCHA === */
#g-recaptcha, #recaptcha-comment, .g-recaptcha { margin-top: 10px; }

/* === Форма комментария === */
.comment-form p { margin-bottom: 14px; }
.comment-form label { display: block; font-size: 0.9rem; color: #444; margin-bottom: 6px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 10px;
  background: #fbfbfc; font-size: 0.95rem;
  transition: border .2s, background .2s, box-shadow .2s;
}
.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form textarea:focus {
  border-color: #66afe9; background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(102,175,233,.15);
}
.comment-form input[type="submit"] {
  background: linear-gradient(135deg, #4da9ff, #3a8de0); color: #fff; border: none;
  padding: 10px 18px; border-radius: 10px; font-weight: 600; cursor: pointer;
  transition: background .2s, box-shadow .2s, transform .05s;
}
.comment-form input[type="submit"]:hover { background: linear-gradient(135deg, #3a8de0, #2c73c9); box-shadow: 0 2px 6px rgba(58,141,224,.25); }
.comment-form input[type="submit"]:active { transform: translateY(1px); }

/* === Панель сортировки === */
.comment-sorting { display: flex; gap: 8px; margin: 20px 0 10px; }
.comment-sorting button {
  padding: 7px 12px; border: 1px solid #e5e7eb; background: #f7f7f8; border-radius: 10px;
  cursor: pointer; font-size: 0.9rem; transition: background .2s, border-color .2s, box-shadow .2s;
}
.comment-sorting button:hover { background: #eef2f7; border-color: #d1d5db; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
#commentsSortTitle { font-size: 1.05rem; font-weight: 600; color: #111; margin: 0 0 10px; }

/* === Секция вывода комментариев (дефолтный wp_list_comments) === */
#tabComments { margin-top: 18px; }
#tabComments .comment-list { list-style: none; margin: 0; padding: 0; }

#tabComments .comment-list > .comment {
  margin: 0 0 14px 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.06);
  border: 1px solid #e7ecf2;
  transition: box-shadow .2s ease, transform .06s ease;
}
#tabComments .comment-list > .comment:hover { box-shadow: 0 10px 28px rgba(15,23,42,.08); }
#tabComments .comment-list > .comment:active { transform: translateY(1px); }

/* Тело комментария */
#tabComments .comment-body { position: relative; padding: 16px 16px 14px; }

/* Шапка: автор + время */
#tabComments .comment-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
#tabComments .comment-author {
  display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 12px;
}
#tabComments .comment-author .avatar {
  width: 48px; height: 48px; border-radius: 50%; display: block; object-fit: cover;
  background: #eef2f7; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(2,6,23,.06);
}
#tabComments .comment-author .fn { font-weight: 700; color: #0f172a; margin-right: 8px; font-size: .98rem; }
#tabComments .comment-author .says { color: #94a3b8; font-size: .9rem; }

/* Метаданные */
#tabComments .comment-metadata { white-space: nowrap; font-size: .9rem; }
#tabComments .comment-metadata a {
  color: #64748b; text-decoration: none; border-bottom: 1px dashed transparent;
  transition: color .15s, border-color .15s;
}
#tabComments .comment-metadata a:hover { color: #334155; border-color: #cbd5e1; }
#tabComments .comment-metadata .edit-link a { margin-left: 10px; font-weight: 600; }

/* Контент */
#tabComments .comment-content { margin-top: 6px; color: #1f2937; line-height: 1.6; font-size: .98rem; }
#tabComments .comment-content p { margin: 0 0 10px; }
#tabComments .comment-content a {
  color: #2563eb; text-decoration: none; border-bottom: 1px solid rgba(37,99,235,.25);
  transition: border-color .15s, color .15s;
}
#tabComments .comment-content a:hover { color: #1d4ed8; border-color: rgba(37,99,235,.5); }
#tabComments .comment-content blockquote {
  margin: 10px 0; padding: 10px 12px; background: #f8fafc;
  border-left: 3px solid #cbd5e1; border-radius: 8px; color: #334155;
}
#tabComments .comment-content code,
#tabComments .comment-content pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  background: #0f172a0d; border: 1px solid #e2e8f0; border-radius: 8px; padding: 2px 6px;
}
#tabComments .comment-content pre { padding: 10px 12px; overflow: auto; }

/* Reply */
#tabComments .reply { margin-top: 10px; }
#tabComments .reply .comment-reply-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: .92rem; font-weight: 600; color: #0f172a;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; text-decoration: none;
  transition: background .2s, border-color .2s, box-shadow .2s, transform .05s;
}
#tabComments .reply .comment-reply-link:hover { background: #eff6ff; border-color: #bfdbfe; box-shadow: 0 2px 8px rgba(59,130,246,.15); }
#tabComments .reply .comment-reply-link:active { transform: translateY(1px); }

/* Вложенные ветки */
#tabComments .comment .children {
  list-style: none; margin: 10px 0 0; padding-left: 54px; position: relative;
}
#tabComments .comment .children::before {
  content: ""; position: absolute; left: 26px; top: -8px; bottom: 8px; width: 2px;
  background: #e5e7eb; opacity: .85;
}
#tabComments .comment .children > .comment {
  margin: 8px 0; border-radius: 12px; background: #fff; border: 1px solid #edf2f7;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

/* Бейджи */
#tabComments .comment.bypostauthor .comment-author .fn::after {
  content: " • author"; margin-left: 6px; padding: 2px 6px; font-size: .72rem; font-weight: 700;
  color: #075985; background: #e0f2fe; border: 1px solid #bae6fd; border-radius: 999px;
}
#tabComments .comment.byuser .comment-author .fn::after {
  content: " • member"; margin-left: 6px; padding: 2px 6px; font-size: .72rem; font-weight: 700;
  color: #14532d; background: #dcfce7; border: 1px solid #bbf7d0; border-radius: 999px;
}

/* Модерация */
#tabComments .comment-awaiting-moderation,
#tabComments .comment-moderation-message {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px; padding: 6px 10px;
  background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12;
  border-radius: 10px; font-size: .9rem;
}

/* Навигация */
.comment-navigation {
  display: flex; justify-content: space-between; gap: 10px; margin: 16px 0 0;
}
.comment-navigation .nav-previous a,
.comment-navigation .nav-next a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 10px;
  background: #f8fafc; color: #0f172a; text-decoration: none; font-weight: 600;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.comment-navigation .nav-previous a:hover,
.comment-navigation .nav-next a:hover {
  background: #eff6ff; border-color: #bfdbfe; box-shadow: 0 2px 8px rgba(59,130,246,.15);
}

.comment-reply-title {
    color: #5e5e5e;
    font-size: 15px;
    line-height: 17px;
    font-weight: 500;
    margin: 0 0 10px;
    display: block;
    font-size: 1.35rem;
}

/* Декоративная иконка */
.icon-mars { opacity: .6; }

/* ====== Card-стиль комментария ====== */
.comment-body {
  background: #ffffff;
  border: 1px solid #e7ecf2;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  padding: 16px;
  transition: box-shadow .2s ease, transform .06s ease;
}
.comment-body:hover {
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.09);
}
.comment-body:active {
  transform: translateY(1px);
}

/* Верхний блок: автор + время */
.comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

/* Автор */
.comment-author.vcard {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 12px;
}
.comment-author .avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #eef2f7;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(2, 6, 23, 0.06);
}
.comment-author .fn {
  font-weight: 800;
  font-size: .98rem;
  color: #0f172a;
}
.comment-author .says {
  margin-left: 6px;
  color: #94a3b8;
  font-size: .9rem;
}

/* Метаданные: дата/редактирование */
.comment-metadata {
  white-space: nowrap;
  font-size: .92rem;
}
.comment-metadata a {
  color: #64748b;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: color .15s ease, border-color .15s ease;
}
.comment-metadata a:hover {
  color: #334155;
  border-color: #cbd5e1;
}
.comment-metadata .edit-link a {
  margin-left: 10px;
  font-weight: 700;
}

/* Текст комментария */
.comment-content {
  color: #1f2937;
  font-size: .98rem;
  line-height: 1.6;
  margin-top: 6px;
}
.comment-content p { margin: 0 0 10px; }
.comment-content a {
  color: #2563eb;
  text-decoration: none;
  border-bottom: 1px solid rgba(37, 99, 235, .25);
  transition: border-color .15s ease, color .15s ease;
}
.comment-content a:hover {
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, .5);
}

/* ====== Действия: лайк/дизлайк/ответ ====== */
.comment-actions {
  display: flex;
  align-items: center;
  gap: 10px 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Базовая кнопка */
.comment-actions .like-comment,
.comment-actions .dislike-comment,
.comment-actions .comment-reply-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
  font-size: .92rem;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .05s ease;
}

/* Иконки-эмодзи */
.comment-actions .like-comment img.emoji,
.comment-actions .dislike-comment img.emoji {
  width: 18px; height: 18px;
}

/* Состояния наведения */
.comment-actions .like-comment:hover,
.comment-actions .comment-reply-link:hover {
  background: #eaf5ff;
  border-color: #c7e2ff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, .15);
}
.comment-actions .dislike-comment:hover {
  background: #fff1f2;
  border-color: #fecdd3;
  box-shadow: 0 2px 8px rgba(244, 63, 94, .15);
}
.comment-actions .like-comment:active,
.comment-actions .dislike-comment:active,
.comment-actions .comment-reply-link:active {
  transform: translateY(1px);
}

/* Бейджи-счётчики */
.comment-likes-count,
.comment-dislikes-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
  background: #edf2f7;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}

/* Цветовые акценты рядом с кнопками */
.comment-actions .like-comment + .comment-likes-count {
  background: #e7f8ef;
  border-color: #cceedd;
  color: #0f5132;
}
.comment-actions .dislike-comment + .comment-dislikes-count {
  background: #fdecec;
  border-color: #ffd1d1;
  color: #7f1d1d;
}

/* Кнопка Reply — как action */
.comment-actions .comment-reply-link {
  background: #f8fafc;
  border-color: #e2e8f0;
}
.comment-actions .comment-reply-link:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

/* Сообщение модерации (если есть) */
.comment-moderation-message {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #7c2d12;
  font-size: .9rem;
}

/* ====== Адаптив ====== */
@media (max-width: 720px) {
  .comment-author.vcard { grid-template-columns: 40px 1fr; gap: 10px; }
  .comment-author .avatar { width: 40px; height: 40px; }
  .comment-meta { flex-direction: column; align-items: flex-start; gap: 6px; }
}
@media (max-width: 420px) {
  .comment-content { font-size: .95rem; }
  .comment-author .fn { font-size: .96rem; }
}

/* Доступность: фокус */
.comment-body a:focus-visible,
.comment-actions .like-comment:focus-visible,
.comment-actions .dislike-comment:focus-visible,
.comment-actions .comment-reply-link:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .35);
  outline-offset: 2px;
  border-radius: 10px;
}



/* === Адаптив === */
@media (max-width: 720px) {
  #comments.comments-area { padding: 16px; }
  #tabComments .comment-author { grid-template-columns: 40px 1fr; gap: 10px; }
  #tabComments .comment-author .avatar { width: 40px; height: 40px; }
  #tabComments .comment-meta { flex-direction: column; align-items: flex-start; gap: 6px; }
  #tabComments .comment .children { padding-left: 44px; }
  #tabComments .comment .children::before { left: 22px; }
}
@media (max-width: 420px) {
  #tabComments .comment-content { font-size: .95rem; }
  #tabComments .comment-author .fn { font-size: .96rem; }
}

/* Фокус для доступности */
#tabComments a:focus-visible,
#tabComments .comment-reply-link:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .35);
  outline-offset: 2px;
  border-radius: 10px;
}
