/* ==========================================================================
   bbPress – Single Topic (scope: .bbp-single-topic)
   ========================================================================== */

.bbp-single-topic {
  --bbp-canvas: #f5f7fb;
  /* lienzo suave detrás de las tarjetas */
  --bbp-card-bg: #fff;
  /* fondo tarjeta */
  --bbp-card-bd: #e6e8ef;
  /* borde sutil */
  --bbp-text: #0f172a;
  --bbp-muted: #64748b;
  --bbp-accent: #172EEB;
  /* azul marca */
  --bbp-chip-bg: #eef2ff;
  --bbp-quote-bg: #f8fafc;
  --bbp-code-bg: #0f172a;
  --bbp-code-fg: #e2e8f0;
  --bbp-shadow: 0 4px 18px rgba(2, 6, 23, .08);
  --radius-lg: 14px;
  --radius-sm: 10px;
}

/* ===== Lienzo detrás del hilo ===== */
.bbp-single-topic .bbp-replies-section {
  background: var(--bbp-canvas);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 16px 0 20px;
}

/* Quitamos cabecera tipo tabla (Autor / Entradas) */
.bbp-single-topic #bbpress-forums .bbp-replies .bbp-header {
  display: none;
}

/* Contador “Mostrando X respuestas …” fuera de la paginación */
.bbp-single-topic #bbpress-forums .bbp-pagination .bbp-pagination-count {
  display: none;
}

/* ===== Tarjetas de cada respuesta ===== */
.bbp-single-topic #bbpress-forums .bbp-replies .bbp-body .bbp-reply,
.bbp-single-topic #bbpress-forums .bbp-replies .bbp-body .topic {
  /* bbPress imprime el primer post como .topic */
  background: var(--bbp-card-bg);
  border: 1px solid var(--bbp-card-bd);
  border-radius: var(--radius-lg);
  box-shadow: var(--bbp-shadow);
  padding: 16px;
  margin: 14px 0;
  color: var(--bbp-text);

  /* Layout interno en desktop */
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
}

/* Móvil: stack */
@media (max-width: 799.98px) {

  .bbp-single-topic #bbpress-forums .bbp-replies .bbp-body .bbp-reply,
  .bbp-single-topic #bbpress-forums .bbp-replies .bbp-body .topic {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ===== Columna autor ===== */
.bbp-single-topic #bbpress-forums .bbp-reply-author,
.bbp-single-topic #bbpress-forums .bbp-topic-author {
  margin: 0;
  padding: 0;
  border: 0;
  /* resetea restos tipo tabla */
  color: var(--bbp-muted);
  font-size: 13px;
}

.bbp-single-topic #bbpress-forums .bbp-reply-author img.avatar,
.bbp-single-topic #bbpress-forums .bbp-topic-author img.avatar {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  display: block;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
  border: 3px solid #fff;
  margin-bottom: 8px;
}

.bbp-single-topic #bbpress-forums .bbp-author-name a,
.bbp-single-topic #bbpress-forums .bbp-author-name {
  font-weight: 800;
  color: var(--bbp-text);
  text-decoration: none;
}

.bbp-single-topic #bbpress-forums .bbp-author-role {
  display: inline-block;
  margin-top: 6px;
  background: var(--bbp-chip-bg);
  color: var(--bbp-text);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

/* ===== Columna contenido ===== */
.bbp-single-topic #bbpress-forums .bbp-reply-content {
  font-size: 16px;
  line-height: 1.7;
  color: var(--bbp-text);
}

.bbp-single-topic #bbpress-forums .bbp-reply-content p {
  margin: 0 0 12px;
}

/* Metadatos arriba del contenido (fecha, enlace permanente) */
.bbp-single-topic #bbpress-forums .bbp-reply-header {
  margin: -6px 0 8px;
  padding: 0;
  border: 0;
  color: var(--bbp-muted);
  font-size: 12px;
}

.bbp-single-topic #bbpress-forums .bbp-reply-permalink,
.bbp-single-topic #bbpress-forums .bbp-reply-post-date,
.bbp-single-topic #bbpress-forums .bbp-reply-post-date a {
  color: var(--bbp-muted);
  text-decoration: none;
}

.bbp-single-topic #bbpress-forums .bbp-reply-permalink:hover {
  color: var(--bbp-accent);
}

/* Citas y código dentro del post */
.bbp-single-topic #bbpress-forums .bbp-reply-content blockquote {
  background: var(--bbp-quote-bg);
  border-left: 4px solid var(--bbp-accent);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin: 10px 0;
  color: var(--bbp-text);
}

.bbp-single-topic #bbpress-forums .bbp-reply-content pre,
.bbp-single-topic #bbpress-forums .bbp-reply-content code {
  background: var(--bbp-code-bg);
  color: var(--bbp-code-fg);
  border-radius: 8px;
  padding: .5em .65em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* Estados/chips (moderación, cerrado, etc.) si aparecen en header */
.bbp-single-topic #bbpress-forums .bbp-reply-header .bbp-admin-links a {
  display: inline-block;
  margin-left: 8px;
  background: var(--bbp-chip-bg);
  color: var(--bbp-text);
  padding: 3px 8px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

/* ===== Paginación ===== */
.bbp-single-topic #bbpress-forums .bbp-pagination {
  display: flex;
  justify-content: center;
  margin: 18px 0 8px;
}

.bbp-single-topic #bbpress-forums .bbp-pagination .bbp-pagination-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bbp-single-topic #bbpress-forums .bbp-pagination .page-numbers,
.bbp-single-topic #bbpress-forums .bbp-pagination a,
.bbp-single-topic #bbpress-forums .bbp-pagination span {
  padding: 8px 12px;
  border: 1px solid var(--bbp-card-bd);
  border-radius: 8px;
  text-decoration: none;
  color: var(--bbp-text);
  background: #fff;
}

.bbp-single-topic #bbpress-forums .bbp-pagination .current {
  background: var(--bbp-accent);
  color: #fff;
  border-color: var(--bbp-accent);
}

/* ===== Formulario de respuesta (coherente con tarjetas) ===== */
.bbp-single-topic #bbpress-forums fieldset.bbp-form,
.bbp-single-topic #bbpress-forums form.bbp-topic-form,
.bbp-single-topic #bbpress-forums form.bbp-reply-form {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--bbp-shadow);
  border: 1px solid var(--bbp-card-bd);
  padding: 16px;
  margin: 16px 0;
}

.bbp-single-topic #bbpress-forums .bbp-submit-wrapper .button,
.bbp-single-topic #bbpress-forums button,
.bbp-single-topic #bbpress-forums input[type=submit] {
  background: var(--bbp-accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.bbp-single-topic #bbpress-forums input[type=text],
.bbp-single-topic #bbpress-forums input[type=email],
.bbp-single-topic #bbpress-forums textarea {
  width: 100%;
  border: 1px solid var(--bbp-card-bd);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}

.bbp-single-topic #bbpress-forums input:focus,
.bbp-single-topic #bbpress-forums textarea:focus {
  outline: 2px solid #cde1ff;
  outline-offset: 2px;
}

/* ===== Sidebar coherente ===== */
.bbp-single-topic .forums-sidebar .widget {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--bbp-shadow);
  border: 1px solid var(--bbp-card-bd);
  padding: 14px;
  margin-bottom: 16px;
}

/* Utilidades */
.bbp-single-topic a {
  color: var(--bbp-accent);
}

.bbp-single-topic a:hover {
  opacity: .9;
}


/* ========= Fondo suave del bloque de respuestas ========= */
.bbp-single-topic .bbp-replies-section {
  --bbp-bg: #f3f4f6;
  --bbp-card: #fff;
  --bbp-border: #e5e7eb;
  --bbp-shadow: 0 8px 20px rgba(16, 24, 40, .08);

  background: var(--bbp-bg);
  border-radius: 16px;
  padding: 16px;
  margin: 16px 0 24px;
}

/* Quitamos posibles restos tipo tabla si algún plugin los inyecta */
#bbpress-forums .bbp-replies .bbp-header,
#bbpress-forums .bbp-replies .bbp-footer {
  display: none !important;
}

/* ========= Card de cada respuesta ========= */
.bbp-replies .bbp-reply-card {
  background: var(--bbp-card);
  border: 1px solid var(--bbp-border);
  border-radius: 14px;
  box-shadow: var(--bbp-shadow);
  padding: 16px;
  margin: 16px 0;
  overflow: hidden;
}

/* Head */
.reply-card__head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--bbp-border);
}

.reply-card__avatar img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: block;
}

.reply-card__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.reply-card__line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.reply-card__author {
  font-weight: 800;
  color: #101828;
  text-decoration: none;
}

.reply-card__role {
  background: #042db1;
  color: #ffffff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

.reply-card__date {
  font-size: 12px;
  color: #000000;
}

.reply-card__permalink {
  margin-left: auto;
  font-size: 12px;
  color: #98A2B3;
  text-decoration: none;
}

/* Contenido */
.reply-card__content {
  color: #101828;
  line-height: 1.7;
}

.reply-card__content p {
  margin: 0 0 0.9rem;
}

/* Footer */
.reply-card__footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--bbp-border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: #667085;
}

/* ========= Responsive ========= */
@media (max-width: 640px) {
  .bbp-single-topic .bbp-replies-section {
    padding: 12px;
    border-radius: 12px;
  }

  .bbp-replies .bbp-reply-card {
    padding: 14px;
    margin: 12px 0;
  }

  .reply-card__avatar img {
    width: 48px;
    height: 48px;
  }
}


/* ===== 1) El wrapper NO es una tarjeta; es una franja gris con espacio ===== */
.bbp-single-topic .bbp-replies-section {
  --bbp-bg: #f3f4f6;
  background: var(--bbp-bg);
  /* sin borde ni radios para que no parezca una sola caja */
  border: 0;
  border-radius: 0;
  padding: 20px 0;
  /* espacio superior/inf. */
  margin: 16px 0 24px;
}

/* ===== 2) Las respuestas SÍ son tarjetas separadas (grid con gap) ===== */
#bbpress-forums .bbp-replies {
  display: grid;
  gap: 18px;
  /* separación clara entre cards */
  margin: 0;
  /* sin márgenes extras */
}

/* Tarjeta de respuesta (lo que ya tenías, con pequeños ajustes) */
#bbpress-forums .bbp-replies .bbp-reply-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(16, 24, 40, .08);
  padding: 16px;
  margin: 0;
  /* el gap del grid crea la separación */
  overflow: hidden;
}

/* Head */
#bbpress-forums .reply-card__head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

#bbpress-forums .reply-card__avatar img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: block;
}

/* Meta */
#bbpress-forums .reply-card__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

#bbpress-forums .reply-card__line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

#bbpress-forums .reply-card__author {
  font-weight: 800;
  color: #101828;
  text-decoration: none;
}

#bbpress-forums .reply-card__role {
  background: #EEF2FF;
  color: #223;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

#bbpress-forums .reply-card__date {
  font-size: 12px;
  color: #667085;
}

#bbpress-forums .reply-card__permalink {
  margin-left: auto;
  font-size: 12px;
  color: #98A2B3;
  text-decoration: none;
}

/* Contenido */
#bbpress-forums .reply-card__content {
  color: #101828;
  line-height: 1.7;
}

#bbpress-forums .reply-card__content p {
  margin: 0 0 .9rem;
}

/* Footer */
#bbpress-forums .reply-card__footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: #667085;
}

/* ===== 3) Anulamos estilos del core que “pegan” todo en un bloque ===== */
#bbpress-forums div.even,
#bbpress-forums div.odd,
#bbpress-forums ul.even,
#bbpress-forums ul.odd {
  background: transparent !important;
}

/* Si en algún contexto bbPress sigue imprimiendo <ul class="bbp-replies"> */
#bbpress-forums ul.bbp-replies {
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}

#bbpress-forums li.bbp-body ul.reply {
  border-top: 0 !important;
  padding: 0 !important;
}

/* ===== 4) Responsive ===== */
@media (max-width:640px) {
  .bbp-single-topic .bbp-replies-section {
    padding: 14px 0;
  }

  #bbpress-forums .bbp-replies {
    gap: 14px;
  }

  #bbpress-forums .bbp-replies .bbp-reply-card {
    padding: 14px;
  }

  #bbpress-forums .reply-card__avatar img {
    width: 48px;
    height: 48px;
  }
}


/* Fondo del bloque de respuestas */
.bbp-single-topic .bbp-replies-section {
  background: #d1d8eb;
  padding: 5%;
}

/* Ocultar cabecera "Autor / Entradas" (la de la tabla antigua) */
#bbpress-forums li.bbp-header {
  display: none;
}

/* Mantener paginación pero sin el texto "Mostrando X respuestas" si molesta */
.bbp-replies-section .bbp-pagination .bbp-pagination-count {
  display: none;
}

/* Quitar borde/caja global de bbPress para replies */
#bbpress-forums ul.bbp-replies {
  border: 0;
  background: transparent;
}

/* Item como card */
#bbpress-forums li.bbp-reply.bbp-card-reply {
  list-style: none;
  border: 0;
  background: transparent;
  margin: 0;
  padding: 0;
}

#bbpress-forums li.bbp-reply.bbp-card-reply>.bbp-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(16, 24, 40, .08);
  padding: 16px;
  margin: 16px 0;
}

/* Head de la card */
.bbp-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.bbp-card__author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bbp-card__author img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.bbp-card__name a {
  font-weight: 700;
  color: #0a2f66;
  text-decoration: none;
}

.bbp-card__role {
  font-size: 12px;
  color: #6b7280;
}

.bbp-card__date {
  text-align: right;
  font-size: 12px;
  color: #6b7280;
}

.bbp-card__permalink {
  margin-right: 6px;
  color: #6b7280;
  text-decoration: none;
}

/* Cuerpo y pie */
.bbp-card__body {
  padding: 12px 0;
  line-height: 1.7;
  color: #101828;
}

.bbp-card__foot {
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
  font-size: 12px;
  color: #6b7280;
}

/* Neutralizar layout viejo de bbPress dentro de la card */
#bbpress-forums div.bbp-reply-author,
#bbpress-forums div.bbp-reply-content,
#bbpress-forums div.bbp-reply-header {
  float: none;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

/* Responsive */
@media (max-width:640px) {
  .bbp-card__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .bbp-card__date {
    text-align: left;
  }

  .bbp-card__author img {
    width: 48px;
    height: 48px;
  }
}


.loop-item-1.user-id-307.bp-parent-forum-1592.bbp-parent-topic-49859.bbp-reply-position-2.even.post-50032.reply.type-reply.status-publish.hentry {
  margin-bottom: 5%;
}

/* ===== Estilos para respuestas anónimas ===== */

/* Avatar genérico/placeholder para anónimos */
.bbp-anonymous-reply .reply-card__avatar img {
  opacity: 0.5;
  filter: grayscale(100%);
}

/* Autor anónimo: sin hover, sin estilo de enlace */
.bbp-anonymous-reply .reply-card__author {
  cursor: default;
  color: #667085 !important;
  font-style: italic;
}

/* Ocultar rol para anónimos (ya se controla en PHP, pero refuerzo en CSS) */
.bbp-anonymous-reply .reply-card__role {
  display: none;
}

/* Estilos visuales sutiles para indicar contenido anónimo */
.bbp-anonymous-reply {
  background: #fafbfc !important;
  border-left: 3px solid #94a3b8 !important;
}

/* ===== Reposicionar botón "responder" y enlaces admin ===== */

/* Los enlaces admin (responder, editar, etc.) van en el footer de la card */
#bbpress-forums .reply-card__footer .reply-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Estilos para los enlaces de admin/acciones */
#bbpress-forums .reply-card__footer .bbp-admin-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#bbpress-forums .reply-card__footer .bbp-admin-links a,
#bbpress-forums .reply-card__footer .bbp-reply-to-link {
  font-size: 12px;
  color: #172EEB;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s ease;
}

#bbpress-forums .reply-card__footer .bbp-admin-links a:hover,
#bbpress-forums .reply-card__footer .bbp-reply-to-link:hover {
  background: #eef2ff;
}

/* Asegurar que el separador • se ve bien */
#bbpress-forums .reply-card__footer .bbp-admin-links .sep {
  color: #cbd5e1;
  margin: 0 4px;
}

/* Responsive: mantener acciones legibles en móvil */
@media (max-width: 640px) {
  #bbpress-forums .reply-card__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  #bbpress-forums .reply-card__footer .reply-card__actions {
    width: 100%;
  }
}

/* ========================================================================
   ESTILOS PARA FORMULARIOS DE BBPRESS (Nuevo Tema y Respuestas)
   ======================================================================== */

/* Wrapper general del formulario - MAYOR ESPECIFICIDAD */
#bbpress-forums .bbp-new-topic,
#bbpress-forums .bbp-new-reply,
.bbp-new-topic,
.bbp-new-reply,
div.bbp-new-topic,
div.bbp-new-reply {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.08) !important;
  padding: 24px !important;
  margin: 24px 0 !important;
}

/* Título del formulario */
#bbpress-forums .bbp-new-topic #bbp-new-topic-fieldset legend,
#bbpress-forums .bbp-new-reply #bbp-new-reply-fieldset legend,
.bbp-new-topic #bbp-new-topic-fieldset legend,
.bbp-new-reply #bbp-new-reply-fieldset legend {
  font-size: 20px;
  font-weight: 700;
  color: #101828;
  margin-bottom: 16px;
  display: block;
  width: 100%;
}

/* Campos del formulario */
.bbp-new-topic #bbpress-forums fieldset.bbp-form,
.bbp-new-reply #bbpress-forums fieldset.bbp-form {
  border: 0;
  padding: 0;
  margin: 0;
}

.bbp-new-topic #bbpress-forums .bbp-form>p,
.bbp-new-reply #bbpress-forums .bbp-form>p {
  margin-bottom: 16px;
}

/* Labels */
.bbp-new-topic #bbpress-forums label,
.bbp-new-reply #bbpress-forums label {
  display: block;
  font-weight: 600;
  color: #344054;
  margin-bottom: 6px;
  font-size: 14px;
}

/* Inputs y Textareas */
.bbp-new-topic #bbpress-forums input[type="text"],
.bbp-new-topic #bbpress-forums textarea,
.bbp-new-reply #bbpress-forums input[type="text"],
.bbp-new-reply #bbpress-forums textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #101828;
  background: #ffffff;
  transition: all 0.2s ease;
}

.bbp-new-topic #bbpress-forums input[type="text"]:focus,
.bbp-new-topic #bbpress-forums textarea:focus,
.bbp-new-reply #bbpress-forums input[type="text"]:focus,
.bbp-new-reply #bbpress-forums textarea:focus {
  outline: none;
  border-color: #172EEB;
  box-shadow: 0 0 0 3px rgba(23, 46, 235, 0.1);
}

/* Botones del formulario */
.bbp-new-topic #bbpress-forums button[type="submit"],
.bbp-new-topic #bbpress-forums input[type="submit"],
.bbp-new-reply #bbpress-forums button[type="submit"],
.bbp-new-reply #bbpress-forums input[type="submit"] {
  background: #172EEB;
  color: #ffffff;
  border: 0;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bbp-new-topic #bbpress-forums button[type="submit"]:hover,
.bbp-new-reply #bbpress-forums button[type="submit"]:hover {
  background: #0d1fb8;
  box-shadow: 0 4px 8px rgba(23, 46, 235, 0.25);
  transform: translateY(-1px);
}

/* Checkboxes de anonimato */
.fa-anonymous-field {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 12px;
  margin: 16px 0;
}

.fa-anonymous-field label {
  display: flex !important;
  align-items: center;
  cursor: pointer;
  font-weight: 500 !important;
  color: #0c4a6e !important;
}