/*
 * comments.css — Sección de comentarios del single post.
 */

.celi-comments {
  margin-top: var(--space-xl);
}

/* === Título === */
.celi-comments-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-dark);
  margin: 0 0 20px;
}
.celi-comments-title [data-lucide] {
  width: 22px;
  height: 22px;
  color: var(--color-primary);
  stroke-width: 2.25;
}

/* === Lista === */
.celi-comments-list {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Respuestas anidadas */
.celi-comments-list .children {
  list-style: none;
  padding-left: 48px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}
/* Línea vertical que conecta las respuestas con el comentario padre */
.celi-comments-list .children::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 16px;
  width: 2px;
  background: var(--color-border);
  border-radius: 1px;
}

/* === Tarjeta individual === */
.celi-comment {
  list-style: none;
}

.celi-comment-body {
  display: flex;
  gap: 14px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 16px 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.celi-comment-body:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.celi-comment.bypostauthor > .celi-comment-body {
  background: var(--color-primary-alpha);
  border-color: var(--color-primary);
}

.celi-comment-avatar {
  flex-shrink: 0;
}
.celi-comment-avatar img,
.entry-content .celi-comment-avatar img,
.celi-article-body .celi-comment-avatar img {
  width: 48px !important;
  height: 48px !important;
  max-width: 48px !important;
  border-radius: 50%;
  display: block;
  margin: 0;
  background: var(--color-gray-light);
}

.celi-comment-content {
  flex: 1;
  min-width: 0;
}

/* Header: autor · fecha */
.celi-comment-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 13px;
}
.celi-comment-author {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-dark);
}
.celi-comment-author a {
  color: inherit;
  text-decoration: none;
}
.celi-comment-author a:hover {
  color: var(--color-primary);
}
.celi-comment-sep {
  color: var(--color-gray);
  opacity: 0.6;
}
.celi-comment-date {
  font-size: 12px;
  color: var(--color-gray);
}

/* Aviso de moderación */
.celi-comment-pending {
  font-size: 13px;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 10px;
}

/* Texto */
.celi-comment-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-dark);
}
.celi-comment-text p {
  margin: 0 0 8px;
}
.celi-comment-text p:last-child {
  margin-bottom: 0;
}
.celi-comment-text a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Acciones (responder, editar) */
.celi-comment-actions {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 13px;
}
.celi-comment-actions a,
.celi-comment-actions .comment-reply-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}
.celi-comment-actions a:hover {
  color: var(--color-primary-dark);
}
.celi-comment-actions [data-lucide],
.celi-comment-actions svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.25;
}

/* === Paginación === */
.celi-comments-pagination {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 32px;
}
.celi-comments-pagination a,
.celi-comments-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  transition: all 0.15s ease;
}
.celi-comments-pagination a:hover {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

/* === Formulario === */
.comment-respond {
  background: var(--color-gray-light);
  border-radius: 14px;
  padding: 24px 28px;
  margin-top: 16px;
}

.comment-reply-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-dark);
  margin: 0 0 12px;
}
.comment-reply-title small {
  font-size: 13px;
  font-weight: 400;
  margin-left: 10px;
}
.comment-reply-title small a {
  color: var(--color-gray);
  text-decoration: none;
}
.comment-reply-title small a:hover {
  color: var(--color-primary);
}

.logged-in-as {
  font-size: 13px;
  color: var(--color-gray);
  margin: 0 0 14px;
}
.logged-in-as a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}
.logged-in-as a:hover {
  text-decoration: underline;
}

/* Textarea del comentario */
.comment-form-comment {
  margin: 0 0 16px;
}
.comment-respond textarea,
#comment {
  width: 100%;
  min-height: 140px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #ffffff;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.55;
  color: var(--color-dark);
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.comment-respond textarea:focus,
#comment:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(45, 122, 58, 0.15);
}

/* Inputs de nombre / email / web (cuando no estás logado) */
.comment-form-author,
.comment-form-email,
.comment-form-url {
  margin: 0 0 14px;
}
.comment-form-author label,
.comment-form-email label,
.comment-form-url label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-dark);
  margin-bottom: 6px;
}
.comment-form-author input,
.comment-form-email input,
.comment-form-url input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #ffffff;
  font-family: inherit;
  font-size: 14px;
  color: var(--color-dark);
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.comment-form-author input:focus,
.comment-form-email input:focus,
.comment-form-url input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(45, 122, 58, 0.15);
}

.comment-form-cookies-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0 14px;
  font-size: 13px;
  color: var(--color-gray);
}
.comment-form-cookies-consent input {
  margin-top: 2px;
}

/* Botón submit */
.form-submit {
  margin: 16px 0 0;
}
.form-submit .submit,
.celi-comments-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-primary);
  color: #ffffff;
  border: none;
  padding: 12px 26px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.form-submit .submit:hover,
.celi-comments-submit:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(45, 122, 58, 0.25);
}
.form-submit .submit:active,
.celi-comments-submit:active {
  transform: translateY(0);
}
.celi-comments-submit [data-lucide],
.celi-comments-submit svg {
  width: 16px;
  height: 16px;
}

/* Comentarios cerrados */
.celi-comments-closed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  background: var(--color-gray-light);
  border-radius: 12px;
  color: var(--color-gray);
  font-size: 14px;
  text-align: center;
}
.celi-comments-closed [data-lucide] {
  width: 18px;
  height: 18px;
}

/* === Responsive === */
@media (max-width: 640px) {
  .celi-comments-list .children {
    padding-left: 20px;
  }
  .celi-comments-list .children::before {
    left: 8px;
  }
  .celi-comment-body {
    padding: 14px 14px;
    gap: 10px;
  }
  .celi-comment-avatar img,
  .entry-content .celi-comment-avatar img,
  .celi-article-body .celi-comment-avatar img {
    width: 40px !important;
    height: 40px !important;
    max-width: 40px !important;
  }
  .celi-comment-author {
    font-size: 13px;
  }
  .celi-comment-text {
    font-size: 14px;
  }
  .comment-respond {
    padding: 20px 18px;
  }
  .comment-reply-title {
    font-size: 1.2rem;
  }
}
