/* ========== ESTILOS PERSONALIZADOS BBPRESS ========== */

/* ========== BUSCADOR ==========
   Estilos comunes del buscador (foros, formación, noticias, blog)
   están definidos en wp-content/themes/erd/style.css. */
#bbpress-forums #bbp-search-form,
.bbp-search-form {
    margin-bottom: 25px !important;
}

/* ========== RESET GENERAL ========== */
#bbpress-forums {
    background: #fff !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

#bbpress-forums ul.bbp-forums {
    border: none !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ========== HEADER (Foros | Temas | Mensajes | Actividad) ========== */
#bbpress-forums li.bbp-header {
    background: #4EAED9 !important;
    color: white !important;
    padding: 0 !important;
    border: none !important;
    margin: 0 !important;
}

#bbpress-forums li.bbp-header ul.forum-titles {
    display: grid !important;
    grid-template-columns: 1fr 100px 100px 200px !important;
    gap: 0 !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 12px 20px !important;
    list-style: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

#bbpress-forums li.bbp-header ul.forum-titles li,
#bbpress-forums li.bbp-header ul.forum-titles li.bbp-forum-info,
#bbpress-forums li.bbp-header ul.forum-titles li.bbp-forum-topic-count,
#bbpress-forums li.bbp-header ul.forum-titles li.bbp-forum-reply-count,
#bbpress-forums li.bbp-header ul.forum-titles li.bbp-forum-freshness,
#bbpress-forums li.bbp-header ul.forum-titles li.bbp-topic-title,
#bbpress-forums li.bbp-header ul.forum-titles li.bbp-topic-voice-count,
#bbpress-forums li.bbp-header ul.forum-titles li.bbp-topic-reply-count,
#bbpress-forums li.bbp-header ul.forum-titles li.bbp-topic-freshness {
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 13px !important;
    letter-spacing: 0.5px !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    display: block !important;
    float: none !important;
    width: auto !important;
    color: inherit !important;
    background: none !important;
    text-align: center !important;
}

#bbpress-forums li.bbp-header ul.forum-titles li.bbp-forum-info,
#bbpress-forums li.bbp-header ul.forum-titles li.bbp-topic-title {
    text-align: left !important;
}

#bbpress-forums li.bbp-header ul.forum-titles li:before,
#bbpress-forums li.bbp-header ul.forum-titles li:after {
    display: none !important;
    content: none !important;
}

/* ========== BODY / FILAS ========== */
#bbpress-forums li.bbp-body {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

#bbpress-forums li.bbp-body > ul {
    display: grid !important;
    grid-template-columns: 1fr 100px 100px 200px !important;
    gap: 0 !important;
    align-items: center !important;
    padding: 20px !important;
    margin: 0 !important;
    border: none !important;
    border-bottom: 1px solid #e5e5e5 !important;
    list-style: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

#bbpress-forums li.bbp-body > ul > li,
#bbpress-forums li.bbp-body ul li.bbp-forum-info,
#bbpress-forums li.bbp-body ul li.bbp-forum-topic-count,
#bbpress-forums li.bbp-body ul li.bbp-forum-reply-count,
#bbpress-forums li.bbp-body ul li.bbp-forum-freshness,
#bbpress-forums li.bbp-body ul li.bbp-topic-title,
#bbpress-forums li.bbp-body ul li.bbp-topic-voice-count,
#bbpress-forums li.bbp-body ul li.bbp-topic-reply-count,
#bbpress-forums li.bbp-body ul li.bbp-topic-freshness {
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    display: block !important;
    float: none !important;
    width: auto !important;
}

#bbpress-forums li.bbp-body > ul > li:before,
#bbpress-forums li.bbp-body > ul > li:after {
    display: none !important;
    content: none !important;
}

/* ========== TÍTULO DEL FORO ========== */
#bbpress-forums .bbp-forum-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #4EAED9 !important;
    text-decoration: none !important;
    display: block !important;
    margin: 0 !important;
}

#bbpress-forums .bbp-forum-title:hover {
    color: #3a8eb5 !important;
}

/* Ocultar descripción */
#bbpress-forums .bbp-forum-content {
    display: none !important;
}

/* ========== CONTADORES ========== */
#bbpress-forums .bbp-forum-topic-count,
#bbpress-forums .bbp-forum-reply-count {
    text-align: center !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #333 !important;
}

/* ========== ACTIVIDAD: avatar + nombre + tiempo ========== */
/* Layout: avatar a la izquierda, nombre+tiempo apilados a la derecha */
#bbpress-forums .bbp-forum-freshness {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
}

#bbpress-forums .bbp-forum-freshness .bbp-topic-meta {
    margin: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
}

#bbpress-forums .bbp-forum-freshness .bbp-topic-freshness-author {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    order: 1 !important;
}

/* Avatar */
#bbpress-forums .bbp-forum-freshness img.avatar {
    width: 45px !important;
    height: 45px !important;
    border-radius: 50% !important;
    border: 2px solid #4EAED9 !important;
    flex-shrink: 0 !important;
}

#bbpress-forums .bbp-forum-freshness .bbp-author-avatar {
    display: inline-block !important;
    line-height: 0 !important;
    flex-shrink: 0 !important;
}

/* Nombre del autor */
#bbpress-forums .bbp-forum-freshness .bbp-author-name {
    color: #4EAED9 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    font-size: 13px !important;
    display: block !important;
}

#bbpress-forums .bbp-forum-freshness .bbp-author-name:hover {
    text-decoration: underline !important;
}

/* Tiempo de actividad: debajo del nombre */
#bbpress-forums .bbp-forum-freshness .erd-freshness-time {
    font-size: 12px !important;
    color: #888 !important;
    display: block !important;
}

/* ========== AVATARES EN LISTADOS DE FOROS Y TEMAS (sin aureola, avatar pequeño) ========== */
/* Solo aplica fuera de hilos individuales: en loop-forums, loop-topics, freshness */
#bbpress-forums .bbp-forum-freshness .erd-bbp-rank-frame-overlay,
#bbpress-forums .bbp-topic-freshness .erd-bbp-rank-frame-overlay,
#bbpress-forums .bbp-forums-list .erd-bbp-rank-frame-overlay,
#bbpress-forums .bbp-topics .erd-bbp-rank-frame-overlay {
    display: none !important;
}
#bbpress-forums .bbp-forum-freshness .erd-bbp-avatar-with-rank,
#bbpress-forums .bbp-topic-freshness .erd-bbp-avatar-with-rank,
#bbpress-forums .bbp-forums-list .erd-bbp-avatar-with-rank,
#bbpress-forums .bbp-topics .erd-bbp-avatar-with-rank {
    width: 45px !important;
    height: 45px !important;
    position: relative !important;
}
#bbpress-forums .bbp-forum-freshness .erd-bbp-avatar-with-rank img.avatar,
#bbpress-forums .bbp-topic-freshness .erd-bbp-avatar-with-rank img.avatar,
#bbpress-forums .bbp-forums-list .erd-bbp-avatar-with-rank img.avatar,
#bbpress-forums .bbp-topics .erd-bbp-avatar-with-rank img.avatar {
    position: static !important;
    transform: none !important;
    width: 45px !important;
    height: 45px !important;
    border-radius: 50% !important;
    border: 2px solid #4EAED9 !important;
}

/* ========== BREADCRUMB ========== */
.bbp-breadcrumb {
    margin-bottom: 20px !important;
    padding: 12px 0 !important;
    background: transparent !important;
    border: none !important;
    font-size: 14px !important;
}

.bbp-breadcrumb a {
    color: #4EAED9 !important;
    text-decoration: none !important;
}

.bbp-breadcrumb a:hover {
    text-decoration: underline !important;
}

/* ========== EXTRACTO DEL PRIMER MENSAJE EN LISTADO DE TEMAS ========== */
.erd-topic-excerpt {
    margin: 6px 0 0 0 !important;
    padding: 0 !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    color: #666 !important;
    font-weight: normal !important;
}

/* ========== BLOQUES DE AUTOR (inicio y actividad) ========== */
.erd-topic-author-block,
.erd-freshness-block {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.erd-topic-author-block .erd-author-avatar,
.erd-freshness-block .erd-author-avatar {
    flex-shrink: 0 !important;
}

.erd-topic-author-block .erd-author-avatar img,
.erd-freshness-block .erd-author-avatar img {
    border-radius: 50% !important;
    width: 30px !important;
    height: 30px !important;
}

.erd-author-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 1px !important;
}

.erd-author-name,
.erd-author-name a {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #333 !important;
    text-decoration: none !important;
    line-height: 1.3 !important;
}

.bbp-topic-started-date,
.erd-freshness-time,
.erd-freshness-time a {
    display: block !important;
    font-size: 12px !important;
    color: #999 !important;
    font-weight: normal !important;
    text-decoration: none !important;
    line-height: 1.3 !important;
}

/* ========== CONTENIDO DE RESPUESTAS / TEMAS ==========
   Normaliza encabezados del contenido migrado de Sitefinity. Algunos mensajes
   traen <h1>-<h6> (y <h2 class="elementor-heading-title"> / class="subtitulo")
   que el CSS de Astra/Elementor pinta a tamaño de cabecera de página (~50px),
   desbordando la columna estrecha del hilo y "desmaquetando" la respuesta.
   Los acotamos a tamaños sensatos DENTRO del contenido del foro (no toca datos:
   sirve para los ~21 mensajes afectados y para cualquier pegado futuro). */
#bbpress-forums .bbp-reply-content h1,
#bbpress-forums .bbp-topic-content h1,
#bbpress-forums .bbp-reply-content h2,
#bbpress-forums .bbp-topic-content h2,
#bbpress-forums .bbp-reply-content h3,
#bbpress-forums .bbp-topic-content h3,
#bbpress-forums .bbp-reply-content h4,
#bbpress-forums .bbp-topic-content h4,
#bbpress-forums .bbp-reply-content h5,
#bbpress-forums .bbp-topic-content h5,
#bbpress-forums .bbp-reply-content h6,
#bbpress-forums .bbp-topic-content h6,
#bbpress-forums .bbp-reply-content .elementor-heading-title,
#bbpress-forums .bbp-topic-content .elementor-heading-title {
    font-weight: 600 !important;
    line-height: 1.35 !important;
    margin: 14px 0 8px !important;
    padding: 0 !important;
    color: #1f2937 !important;
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
}
#bbpress-forums .bbp-reply-content h1,
#bbpress-forums .bbp-topic-content h1 { font-size: 20px !important; }
#bbpress-forums .bbp-reply-content h2,
#bbpress-forums .bbp-topic-content h2,
#bbpress-forums .bbp-reply-content .elementor-heading-title,
#bbpress-forums .bbp-topic-content .elementor-heading-title { font-size: 18px !important; }
#bbpress-forums .bbp-reply-content h3,
#bbpress-forums .bbp-topic-content h3 { font-size: 16px !important; }
#bbpress-forums .bbp-reply-content h4,
#bbpress-forums .bbp-topic-content h4,
#bbpress-forums .bbp-reply-content h5,
#bbpress-forums .bbp-topic-content h5,
#bbpress-forums .bbp-reply-content h6,
#bbpress-forums .bbp-topic-content h6 { font-size: 15px !important; }

/* Evitar que restos de markup de Elementor metan anchos/márgenes raros */
#bbpress-forums .bbp-reply-content .elementor-widget-container,
#bbpress-forums .bbp-topic-content .elementor-widget-container {
    margin: 0 !important;
    padding: 0 !important;
}

/* ========== FOOTER ========== */
#bbpress-forums li.bbp-footer {
    display: none !important;
}

/* ========== RESPONSIVE (≤ 768 px) — revisión del 2026-09-12 ==========
   El bloque responsive anterior (etiquetas "Temas:" / "Mensajes:") nunca se veía: la regla de escritorio de este mismo
   fichero `#bbpress-forums li.bbp-body > ul > li:before { display:none !important }` tiene más especificidad que
   `#bbpress-forums .bbp-forum-topic-count::before`. Las reglas de aquí llevan `html body #bbpress-forums.bbpress-wrapper`
   (id + clase del MISMO elemento: <div id="bbpress-forums" class="bbpress-wrapper">) para ganar. OJO: el Personalizador
   (CSS adicional, BBDD de cada entorno) lleva una copia de las reglas de escritorio con el prefijo
   `div.bbpress-wrapper #bbpress-forums …`, que no casa con nada (descendiente de sí mismo): código muerto salvo las
   reglas sueltas (`.bbpress-wrapper { padding: 40px }`, `legend { font-size: 22px }`, `.bbp-topic-permalink`…), que sí
   aplican y aquí se pisan. Medido con Chromium a 412 px (índice, un foro y un hilo). */
/* Miga unificada como primer hijo del contenedor de bbPress (índice /foros/, resultados de búsqueda, vistas, edición: donde
   la plantilla llama a bbp_breadcrumb() y el filtro de inc/breadcrumbs.php devuelve la unificada): la de bbPress llevaba
   12 px de padding y 20 de margen (CSS adicional del Personalizador, selector .bbp-breadcrumb) y la nueva salía pegada al
   buscador (0 px). Aire miga → contenido de toda la web: 32 px escritorio / 24 móvil (style.css, bloque de migas). En foro
   e hilo la miga va bajo el buscador (.erd-breadcrumb-above-title, inc/bbpress.php) y no pasa por aquí. */
html body #bbpress-forums.bbpress-wrapper > .erd-breadcrumbs { margin: 0 0 32px !important; }
@media (max-width: 768px) {
    html body #bbpress-forums.bbpress-wrapper > .erd-breadcrumbs { margin-bottom: 24px !important; }
}

/* Paginación de los foros (listado de debates, respuestas del hilo, búsqueda) con el FORMATO UNIFICADO de la web (el de
   /formacion/, ver style.css "PAGINACIÓN UNIFICADA"): centrada, Open Sans 22 px, 16 px entre números, la actual en un
   cuadrado amarillo; sin los recuadros de 12 px con borde de bbp-default. Solo se deja la paginación de ABAJO (la de
   /formacion/ es única): la copia que bbPress pinta encima del listado se oculta. Selectores con `html body` para ganar
   a bbp-default y al CSS adicional del Personalizador. */
html body #bbpress-forums.bbpress-wrapper .bbp-pagination { float: none !important; width: auto !important; margin: 30px 0 24px !important; padding: 0 !important; text-align: center !important; }
html body #bbpress-forums.bbpress-wrapper .bbp-pagination:has(+ .bbp-topics, + .bbp-replies, + .bbp-search-results, + .bbp-forums) { display: none !important; }
html body #bbpress-forums.bbpress-wrapper .bbp-pagination-links { float: none !important; display: block !important; text-align: center !important; }
html body #bbpress-forums.bbpress-wrapper .bbp-pagination-links .page-numbers {
    display: inline-block !important; float: none !important; margin: 0 8px !important; padding: 0 !important; border: 0 !important; background: transparent !important;
    font-family: 'Open Sans', sans-serif !important; font-size: 22px !important; font-weight: 400 !important; line-height: 1.3 !important; color: #222 !important; text-decoration: none !important;
}
html body #bbpress-forums.bbpress-wrapper .bbp-pagination-links a.page-numbers:hover { color: #36aae0 !important; }
html body #bbpress-forums.bbpress-wrapper .bbp-pagination-links .page-numbers.current { background: #F3A600 !important; color: #fff !important; border-radius: 4px !important; padding: 4px 11px !important; }
html body #bbpress-forums.bbpress-wrapper .bbp-pagination-links .page-numbers.dots { color: #8a94a0 !important; }
@media (max-width: 768px) {
    html body #bbpress-forums.bbpress-wrapper .bbp-pagination-links .page-numbers { margin: 0 5px !important; font-size: 18px !important; }
    html body #bbpress-forums.bbpress-wrapper .bbp-pagination-links .page-numbers.current { padding: 3px 9px !important; }
}

/* Índice /foros/ (todos los anchos): la fila de Astra (.ast-row, margen -20 px) va dentro de la plantilla a ancho completo
   (contenedor sin padding) y el documento medía 20 px más que la ventana por cada lado (en escritorio lo tapa
   `body { overflow-x: hidden }`, en móvil la página se movía de lado). Sin el margen de la fila ni el padding de la
   columna (article, 20 px) el contenedor de bbPress queda exactamente donde estaba (0 → 100 %). */
html body.bbpress .site-main > .ast-row { margin-left: 0 !important; margin-right: 0 !important; }
html body.bbpress .site-main > .ast-row > .ast-grid-common-col { padding-left: 0 !important; padding-right: 0 !important; }

@media (max-width: 768px) {
    /* Contenedor de bbPress y buscador sobre el título: 40 px de padding (CSS adicional) → 16 px. */
    html body div.bbpress-wrapper { padding: 16px !important; }
    html body .erd-search-above-title { padding-left: 16px !important; padding-right: 16px !important; }
    /* Título de foro / hilo: el h1 global de Astra va a 40 px en móvil (4 líneas). */
    html body.bbpress h1.entry-title { font-size: 28px !important; line-height: 1.2 !important; }
    html body #bbpress-forums .bbp-topic-permalink { font-size: 18px !important; line-height: 1.3 !important; }

    /* Cabecera azul (Foros | Temas | Mensajes | Actividad): apilaba las 4 columnas → solo la primera. */
    html body #bbpress-forums.bbpress-wrapper li.bbp-header ul.forum-titles { display: block !important; padding: 12px 16px !important; }
    html body #bbpress-forums.bbpress-wrapper li.bbp-header ul.forum-titles > li:not(:first-child) { display: none !important; }

    /* Filas de foros e hilos: título a todo el ancho; contadores en una línea, con etiqueta; actividad debajo. */
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul {
        display: flex !important; flex-wrap: wrap !important; align-items: center !important;
        gap: 6px 16px !important; padding: 16px !important;
    }
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-forum-info,
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-topic-title,
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-forum-freshness,
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-topic-freshness { flex: 0 0 100% !important; width: 100% !important; }
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-forum-freshness,
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-topic-freshness { padding-left: 0 !important; }
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-forum-topic-count,
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-forum-reply-count,
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-topic-voice-count,
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-topic-reply-count {
        flex: 0 0 auto !important; width: auto !important; text-align: left !important;
        font-size: 13px !important; font-weight: 600 !important; color: #555 !important; line-height: 1.4 !important;
    }
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-forum-topic-count::before,
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-forum-reply-count::before,
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-topic-voice-count::before,
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-topic-reply-count::before { display: inline !important; font-weight: 400 !important; color: #777 !important; }
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-forum-topic-count::before { content: "Temas: " !important; }
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-forum-reply-count::before { content: "Mensajes: " !important; }
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-topic-voice-count::before { content: "Usuarios: " !important; }
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-topic-reply-count::before { content: "Mensajes: " !important; }

    /* (La miga de pan es la unificada de toda la web: estilo y scroll horizontal en style.css, .erd-breadcrumbs.) */

    /* Hilo: la fila "fecha · votos | Citar | Responder" no cabía (Responder cortado) → dos líneas: fecha y votos en la
       primera (el contenedor de votos se estira para llenarla) y Citar + Responder juntos a la derecha en la segunda. */
    html body .erd-quote-reply-buttons { flex-wrap: wrap !important; row-gap: 8px !important; }
    html body .erd-quote-reply-buttons .erd-forum-vote-container { flex: 1 0 200px !important; }
    html body .erd-btn-quote, html body .erd-btn-respond { padding: 10px !important; font-size: 11px !important; }

    /* Listado de hilos: la celda "Actividad" (avatar + nombre del último que escribió) sin la cabecera de columna se
       confundía con el autor del hilo (dos avatares seguidos) → línea de texto "Última actividad: Nombre", sin avatar. */
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-topic-freshness .erd-freshness-block {
        display: block !important; text-align: left !important; font-size: 12px !important; color: #777 !important; line-height: 1.4 !important;
    }
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-topic-freshness .erd-freshness-block::before { content: "Última actividad: "; }
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-topic-freshness .erd-author-avatar { display: none !important; }
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-topic-freshness .erd-author-info { display: inline !important; }
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-topic-freshness .erd-author-name,
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-topic-freshness .erd-author-name a,
    html body #bbpress-forums.bbpress-wrapper li.bbp-body > ul > li.bbp-topic-freshness .erd-author-name .bbp-author-name {
        display: inline !important; font-size: 12px !important; font-weight: 600 !important; color: #555 !important;
    }

    /* Formularios (nuevo debate / respuesta): un <fieldset> tiene min-width: min-content y el editor lo empujaba 14 px
       fuera del contenedor; el título (legend, 22 px por el CSS adicional) llevaba line-height 18 px y se montaba. */
    html body #bbpress-forums fieldset.bbp-form { min-width: 0 !important; max-width: 100% !important; box-sizing: border-box !important; margin-left: 0 !important; margin-right: 0 !important; }
    html body #bbpress-forums fieldset.bbp-form legend { font-size: 18px !important; line-height: 1.3 !important; }
}

/* Cabecera de cada mensaje del hilo (autor) en móvil. bbPress (≤480 px) saca el avatar en absoluto arriba a la izquierda y
   deja 80 px de padding al bloque, pero el aro del rango del theme (.erd-bbp-avatar-with-rank) vuelve a colocar el avatar
   dentro de su envoltorio de 60×60, que al ser inline-block cae en la línea del nombre → avatar descolgado con el nombre a
   su derecha, "Participante" suelto y rango + Rincoins centrados en el hueco. Entre 481 y 600 px seguía la columna de autor
   de escritorio (115 px) con el texto del mensaje en 300 px. → Rejilla: avatar con aro (60 px) a la izquierda y a su
   derecha el nombre y, debajo, rango + Rincoins en una línea; el mensaje debajo a todo el ancho, separado por la línea de bbPress con aire a ambos lados (2.º pedido: "está pegado a la línea de abajo"). Los selectores llevan
   `html body` por delante para ganar al CSS adicional del Personalizador y a bbp-default sin depender del orden. */
@media (max-width: 600px) {
    html body #bbpress-forums.bbpress-wrapper .bbp-body div.bbp-reply-author,
    html body #bbpress-forums.bbpress-wrapper .bbp-body div.bbp-topic-author {
        display: grid !important; grid-template-columns: 60px minmax(0, 1fr) !important; column-gap: 12px !important; align-items: center !important;
        float: none !important; position: static !important; width: auto !important; min-height: 0 !important; box-sizing: border-box !important;
        /* bbp-default (≤480) cierra la cabecera con una línea (#efefef): se mantiene en todo el tramo (≤600) y con aire:
           12 px entre el avatar y la línea, 16 px hasta el mensaje; 6 px arriba (+8 px del padding del mensaje = 14 px
           desde el separador del mensaje anterior, el mismo aire que abajo). */
        padding: 0 0 12px !important; margin: 6px 10px 16px !important; border-bottom: 1px solid #efefef !important; text-align: left !important;
    }
    /* El enlace al perfil deja de generar caja: avatar y nombre pasan a ser celdas de la rejilla (sigue siendo clicable). */
    html body #bbpress-forums.bbpress-wrapper .bbp-body div.bbp-reply-author .bbp-author-link,
    html body #bbpress-forums.bbpress-wrapper .bbp-body div.bbp-topic-author .bbp-author-link { display: contents !important; }
    html body #bbpress-forums.bbpress-wrapper .bbp-body div.bbp-reply-author .bbp-author-avatar,
    html body #bbpress-forums.bbpress-wrapper .bbp-body div.bbp-topic-author .bbp-author-avatar {
        grid-column: 1 !important; grid-row: 1 / span 2 !important; display: block !important; line-height: 0 !important; margin: 0 !important;
    }
    html body #bbpress-forums.bbpress-wrapper .bbp-body div.bbp-reply-author .erd-bbp-avatar-with-rank,
    html body #bbpress-forums.bbpress-wrapper .bbp-body div.bbp-topic-author .erd-bbp-avatar-with-rank { display: block !important; width: 60px !important; height: 60px !important; }
    html body #bbpress-forums.bbpress-wrapper .bbp-body div.bbp-reply-author .bbp-author-name,
    html body #bbpress-forums.bbpress-wrapper .bbp-body div.bbp-topic-author .bbp-author-name {
        grid-column: 2 !important; grid-row: 1 !important; align-self: end !important; display: block !important; margin: 0 !important; padding: 0 !important;
        font-size: 14px !important; font-weight: 600 !important; color: #1f2937 !important; line-height: 1.3 !important; text-align: left !important;
    }
    html body #bbpress-forums.bbpress-wrapper .bbp-body div.bbp-reply-author .erd-bbp-user-meta,
    html body #bbpress-forums.bbpress-wrapper .bbp-body div.bbp-topic-author .erd-bbp-user-meta {
        grid-column: 2 !important; grid-row: 2 !important; align-self: start !important; display: flex !important; flex-wrap: wrap !important; align-items: center !important;
        gap: 2px 12px !important; margin: 3px 0 0 !important; text-align: left !important;
    }
    html body #bbpress-forums.bbpress-wrapper .bbp-body .erd-bbp-user-meta .erd-bbp-rank-title { margin: 0 !important; line-height: 1.4 !important; }
    html body #bbpress-forums.bbpress-wrapper .bbp-body .erd-bbp-user-meta .erd-bbp-rincoins { justify-content: flex-start !important; gap: 4px !important; font-size: 14px !important; line-height: 1.4 !important; }
    html body #bbpress-forums.bbpress-wrapper .bbp-body .erd-bbp-user-meta .erd-bbp-rincoins img { width: 16px !important; height: 16px !important; }
    /* El texto del mensaje debajo de la cabecera, a todo el ancho (bbp-default le ponía margin-left 130 px hasta 480 px). */
    html body #bbpress-forums.bbpress-wrapper .bbp-body div.bbp-reply-content,
    html body #bbpress-forums.bbpress-wrapper .bbp-body div.bbp-topic-content { clear: both !important; margin: 0 10px 5px !important; padding: 0 !important; }
}


/* ==========================================================================
   Bloque extraído de inc/bbpress.php (erd_bbpress_quote_reply_buttons) el
   2026-07-16: antes se imprimía inline en wp_footer de cada página de foro
   (~364 líneas por HTML, no cacheables). Mismo contenido, ahora cacheable.
   ========================================================================== */
    /* Avatar redondo en bbPress con aureola del rango (mismo patrón que comunidad-miembros) */
    .erd-bbp-avatar-with-rank {
        position: relative;
        display: inline-block;
        width: 60px;
        height: 60px;
    }

    /* !important + max-width:none replican el patrón del perfil UM (inc/integrations-um.php):
       bbp-default impone con MAYOR especificidad (selector con ID
       #bbpress-forums div.bbp-reply-author img.avatar) un margin:12px auto 0 + max-width
       sobre el avatar, que descoloca el aro respecto al avatar. Forzamos posición y tamaño. */
    .erd-bbp-avatar-with-rank .erd-bbp-rank-frame-overlay {
        position: absolute !important;
        top: 47% !important;
        left: 20% !important;
        transform: translate(-50%, -50%) !important;
        width: 56% !important;
        height: auto !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        z-index: 2 !important;
        pointer-events: none;
        border: none !important;
        border-radius: 0 !important;
    }

    #bbpress-forums .erd-bbp-avatar-with-rank img.avatar {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 58px !important;
        height: 58px !important;
        max-width: none !important;
        border-radius: 50% !important;
        border: 3px solid #f3a600 !important;
        box-sizing: border-box !important;
        z-index: 1 !important;
    }

    #bbpress-forums .bbp-author-avatar img {
        border-radius: 50% !important;
    }

    /* Ocultar aureola en listados de freshness/topic-title (avatar pequeño sin marco) */
    #bbpress-forums .bbp-forum-freshness .erd-bbp-rank-frame-overlay,
    #bbpress-forums .bbp-topic-freshness .erd-bbp-rank-frame-overlay,
    #bbpress-forums .bbp-body .bbp-topic-title .erd-bbp-rank-frame-overlay {
        display: none !important;
    }
    #bbpress-forums .bbp-forum-freshness .erd-bbp-avatar-with-rank,
    #bbpress-forums .bbp-topic-freshness .erd-bbp-avatar-with-rank,
    #bbpress-forums .bbp-body .bbp-topic-title .erd-bbp-avatar-with-rank {
        width: 45px !important;
        height: 45px !important;
    }
    #bbpress-forums .bbp-forum-freshness .erd-bbp-avatar-with-rank img.avatar,
    #bbpress-forums .bbp-topic-freshness .erd-bbp-avatar-with-rank img.avatar,
    #bbpress-forums .bbp-body .bbp-topic-title .erd-bbp-avatar-with-rank img.avatar {
        position: static !important;
        transform: none !important;
        width: 45px !important;
        height: 45px !important;
        border: 2px solid #4EAED9 !important;
    }

    /* Ocultar pestañas del editor bbPress (VISUAL y CÓDIGO) */
    #bbpress-forums .wp-editor-tabs {
        display: none !important;
    }

    /* Ocultar botón de imagen nativo de TinyMCE (solo pide URL, no permite subir) */
    #bbpress-forums .mce-i-image {
        display: none !important;
    }

    /* Botón Nueva discusión — amarillo de marca (#f3a600) con texto en gris,
       igual que los botones amarillos del resto de la web (p. ej. "Descargar"). */
    .erd-new-discussion-btn {
        display: inline-block;
        background: #f3a600;
        color: #54595F !important;
        font-weight: 600;
        font-size: 14px;
        padding: 10px 25px;
        border-radius: 4px;
        text-decoration: none !important;
        cursor: pointer;
        border: none;
        white-space: nowrap;
        transition: background 0.2s;
    }
    .erd-new-discussion-btn:hover {
        background: #d99500;
        color: #54595F !important;
    }
    
    /* Botones de Citar y Responder */
    /* Fecha relativa de la respuesta, a la izquierda de las votaciones. */
    .erd-reply-date {
        color: #6b7280;
        font-size: 13px;
        white-space: nowrap;
        margin-right: 2px;
    }
    /* Fila de acciones de cada respuesta (cliente, 2026-09-10): la fecha y el contador de votos
       ("2 +1") a la IZQUIERDA; el botón de votar (+1), Citar y Responder a la DERECHA. El contenedor
       de votos ocupa el hueco central (flex: 1) y reparte su contador a la izquierda y su botón a la
       derecha; sin votos (usuario sin sesión no tiene botón) Citar se empuja a la derecha con margin auto. */
    .erd-quote-reply-buttons {
        display: flex;
        gap: 8px;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #e5e7eb;
        justify-content: flex-start;
        align-items: center;
        width: 100%;
    }
    .erd-quote-reply-buttons .erd-btn-quote { margin-left: auto; }

    /* Navegación "← Debate anterior / Debate siguiente →" bajo el hilo: sin la línea de Astra encima
       (cliente, 2026-09-10). Astra pinta nav.post-navigation con border-top 1px #ddd. */
    body.bbpress nav.post-navigation, body.single-topic nav.post-navigation { border-top: 0 !important; }
    
    .erd-report-line {
        text-align: right;
        margin-top: 6px;
    }

    .erd-link-report {
        font-size: 11px;
        color: #999 !important;
        text-decoration: none !important;
        cursor: pointer;
        transition: color 0.2s;
    }

    .erd-link-report:hover {
        color: #666 !important;
        text-decoration: underline !important;
    }

    .erd-link-report .dashicons {
        font-size: 13px;
        width: 13px;
        height: 13px;
        vertical-align: middle;
    }

    .erd-link-report.erd-reported {
        color: #bbb !important;
        cursor: default;
        pointer-events: none;
    }
    
    .erd-btn-quote,
    .erd-btn-respond {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 14px 12px;
        border: none;
        border-radius: 4px;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        text-transform: uppercase;
    }
    
    .erd-btn-quote {
        background: #6c757d;
        color: #fff;
    }
    
    .erd-btn-quote:hover {
        background: #5a6268;
    }
    
    .erd-btn-respond {
        background: #22aae0;
        color: #fff;
    }
    
    .erd-btn-respond:hover {
        background: #1a8ab8;
    }
    
    .erd-btn-quote .dashicons,
    .erd-btn-respond .dashicons {
        font-size: 14px;
        width: 14px;
        height: 14px;
        line-height: 1;
    }
    
    /* Estilo para las citas en el contenido */
    .bbp-reply-content blockquote,
    .bbp-topic-content blockquote {
        background: #f3f4f6;
        border-left: 4px solid #22aae0;
        padding: 12px 16px;
        margin: 15px 0;
        border-radius: 4px;
    }
    
    .bbp-reply-content blockquote p,
    .bbp-topic-content blockquote p {
        margin: 0;
        color: #4b5563;
        font-style: italic;
    }
    
    /* Sistema de votación del foro */
    .erd-forum-vote-container {
        display: flex;
        flex: 1 1 auto;
        align-items: center;
        gap: 8px;
        padding: 0;
        background: transparent !important;
        margin: 0;
        vertical-align: middle;
    }
    /* Botón +1 a la derecha (junto a Citar); el contador "2 +1" se queda a la izquierda, junto a la fecha. */
    .erd-forum-vote-container .erd-forum-vote-button { margin-left: auto; }
    
    .erd-forum-vote-display {
        display: flex;
        align-items: center;
        gap: 5px;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
    }
    
    .erd-forum-vote-count {
        font-size: 18px !important;
        font-weight: 400 !important;
        color: #000 !important;
        line-height: 1 !important;
    }
    
    .erd-forum-vote-icon-svg {
        width: auto !important;
        height: 18px !important;
        display: inline-block !important;
        vertical-align: middle !important;
    }
    
    .erd-forum-vote-button {
        display: inline-flex;
        align-items: center;
        padding: 0;
        background: transparent;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .erd-forum-vote-button:hover:not(:disabled) {
        transform: scale(1.05);
    }
    
    .erd-forum-vote-button.erd-forum-voted {
        cursor: not-allowed;
        opacity: 1;
    }
    
    .erd-forum-vote-btn-img {
        max-width: 40px !important;
        width: 40px !important;
        height: auto !important;
        display: block !important;
    }
    
    .erd-forum-vote-message {
        font-size: 14px;
        font-weight: 500;
        padding: 8px 12px;
        border-radius: 4px;
        display: none;
    }
    
    .erd-forum-vote-message.success {
        display: block;
        background: #d4edda;
        color: #155724;
        border: 1px solid #c3e6cb;
    }
    
    /* Rol de bbPress ("Participante", "Moderador"…) oculto SIEMPRE: el <style> de erd_hide_reply_tags (inc/bbpress.php) solo
       se imprime junto al formulario de respuesta (con sesión); sin sesión (o hilo cerrado) el rol reaparecía. */
    #bbpress-forums .bbp-author-role { display: none !important; }

    /* Metadata debajo del autor */
    .erd-bbp-user-meta {
        margin-top: 10px;
        text-align: center;
    }
    
    .erd-bbp-rank-title {
        font-size: 11px;
        font-weight: 600;
        color: #22aae0;
        margin-bottom: 8px;
        letter-spacing: 0.5px;
    }
    
    .erd-bbp-rincoins {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        font-size: 16px;
        font-weight: 700;
        color: #1f2937;
    }
    
    .erd-bbp-rincoins img {
        width: 20px;
        height: 20px;
        border: none !important;
        border-radius: 0 !important;
        order: 2;
    }
    
    .erd-bbp-rincoins span {
        order: 1;
    }

    /* === CAMBIOS VISUALES EN HILOS === */

    /* Ocultar meta de autor "Por X /" del tema Astra en páginas de hilo */
    article.type-topic .entry-meta,
    article.type-topic .ast-author-meta,
    article.type-topic .posted-by {
        display: none !important;
    }

    /* Buscador encima del título en foro e hilo (lo pinta erd_bbpress_search_and_crumb_above_title, en el servidor,
       antes del entry-header). Fuera de #bbpress-forums perdía el diseño del índice: el CSS adicional del Personalizador
       le pone `padding: 0` (por eso salía a sangre, pegado a la cabecera) y las reglas del input del índice van con el
       prefijo `#bbpress-forums`. Aquí, con más especificidad, la misma separación (40 px, como la miga del índice) y el
       mismo input (padding, borde, radio, tamaño) que en /foros/. */
    html body .bbp-search-form.erd-search-above-title {
        display: block !important;
        width: auto !important;
        box-sizing: border-box !important;
        padding: 0 !important;
        margin: 40px 40px 30px !important;
    }
    /* Input del buscador de foros (índice, foro e hilo) = diseño UNIFICADO de style.css (44 px, #fafafa, borde #e7e7e7,
       sin radio, lupa a la derecha), el mismo de formación, noticias y blog. En el índice lo pisaba el CSS adicional del
       Personalizador (`#bbpress-forums .bbp-search-form input`: radio 4 px, borde #ddd, 14 px); con el id del form y
       `html body` esta regla gana a esa copia y a `body #bbp-search-form input` de style.css sin cambiar sus valores. */
    html body #bbpress-forums .bbp-search-form #bbp-search-form input[type="text"],
    html body .erd-search-above-title #bbp-search-form input[type="text"] {
        padding: 0 38px 0 15px !important;
        border: 1px solid #e7e7e7 !important;
        border-radius: 0 !important;
        font-size: 15px !important;
        height: 44px !important;
        line-height: 44px !important;
        background: #fafafa !important;
    }
    @media (max-width: 768px) {
        html body .bbp-search-form.erd-search-above-title { margin: 24px 16px 20px !important; }
    }

    /* 1+2. Subtítulo "Hilo iniciado por [Autor] el [fecha]" */
    .erd-topic-initiated-by {
        font-size: 13px;
        color: #6b7280;
        margin: -8px 0 18px 0;
        padding: 0;
        line-height: 1.5;
    }
    .erd-topic-initiated-by a {
        color: #22aae0;
        font-weight: 500;
        text-decoration: none;
    }
    .erd-topic-initiated-by a:hover {
        text-decoration: underline;
    }

    /* 3. Ocultar cabecera de cada respuesta (fecha + #ID) */
    #bbpress-forums .bbp-reply-header {
        display: none !important;
    }

    /* 3. Ocultar "Viendo X mensaje(s) (de X en total)" */
    #bbpress-forums .bbp-pagination-count {
        display: none !important;
    }

/* ========== ALINEACIÓN CABECERA ↔ FILAS DEL ÍNDICE DE FOROS (2026-09-02) ==========
   Cabecera y filas comparten rejilla (1fr 100px 100px 200px); aquí se fuerza el MISMO padding
   horizontal y la misma alineación por columna: nombre del foro a la izquierda bajo "FOROS",
   contadores centrados bajo TEMAS/MENSAJES y actividad a la izquierda bajo ACTIVIDAD. */
#bbpress-forums li.bbp-header,
#bbpress-forums li.bbp-body,
#bbpress-forums li.bbp-footer {
    padding-left: 0 !important;
    padding-right: 0 !important;
}
#bbpress-forums li.bbp-header ul.forum-titles,
#bbpress-forums li.bbp-body > ul {
    padding-left: 24px !important;
    padding-right: 24px !important;
}
#bbpress-forums li.bbp-header ul.forum-titles li.bbp-forum-info,
#bbpress-forums li.bbp-body ul li.bbp-forum-info {
    text-align: left !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}
#bbpress-forums li.bbp-body ul li.bbp-forum-info {
    display: flex !important;
    align-items: center !important;
    min-height: 45px !important;
}
#bbpress-forums li.bbp-header ul.forum-titles li.bbp-forum-topic-count,
#bbpress-forums li.bbp-header ul.forum-titles li.bbp-forum-reply-count,
#bbpress-forums li.bbp-body ul li.bbp-forum-topic-count,
#bbpress-forums li.bbp-body ul li.bbp-forum-reply-count {
    text-align: center !important;
    padding: 0 !important;
}
#bbpress-forums li.bbp-header ul.forum-titles li.bbp-forum-freshness,
#bbpress-forums li.bbp-body ul li.bbp-forum-freshness {
    text-align: left !important;
    justify-content: flex-start !important;
    padding-left: 12px !important;
}
/* La cabecera heredaba padding-left 16px de una regla más específica (medido con Chrome headless): se anula con
   selectores de mayor especificidad para que cabecera y filas arranquen en el mismo x. */
body #bbpress-forums ul.bbp-forums > li.bbp-header,
body #bbpress-forums ul.bbp-forums > li.bbp-body,
body #bbpress-forums ul.bbp-forums > li.bbp-footer,
body #bbpress-forums ul.bbp-topics > li.bbp-header,
body #bbpress-forums ul.bbp-topics > li.bbp-body,
body #bbpress-forums ul.bbp-topics > li.bbp-footer {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* ========== SIN "Por <autor> /" BAJO EL TÍTULO DE FOROS E HILOS (2026-09-02) ==========
   Astra pinta la meta de autor del post (forum/topic) bajo el título; el cliente no quiere ver quién creó el foro/hilo ahí. */
article.type-forum .entry-meta,
article.type-forum .ast-author-meta,
article.type-forum .posted-by,
article.type-topic .entry-meta,
article.type-topic .ast-author-meta,
article.type-topic .posted-by,
body.single-forum .entry-header .entry-meta,
body.single-topic .entry-header .entry-meta,
body.post-type-archive-forum .entry-header .entry-meta {
    display: none !important;
}
