/*
 * Narrativa Fertil - Capa visual bbPress
 *
 * Reglas:
 * - Nunca modificar bbPress plugin.
 * - Todo estilo bbPress vive en el tema hijo.
 * - Este archivo se carga despues de `bbp-default`.
 */

:root {
  --paper: var(--nf-paper, #fbfaf7);
  --ink: var(--nf-ink, #111111);
  --ink-soft: #2a2826;
  --ink-mute: var(--nf-ink-mute, #6b6863);
  --line-soft: var(--nf-line-soft, #c9c5bc);
  --wine: var(--nf-wine, #722a47);
  --serif: var(--nf-serif, "Source Serif 4", "Iowan Old Style", Georgia, serif);
  --sans: var(--nf-sans, "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif);
}

/* ================================================
   BBPRESS - RESET COMPLET + INTEGRACIO
   ================================================ */
#bbpress-forums,
#bbpress-forums * {
  box-shadow: none !important;
  text-shadow: none !important;
}

#bbpress-forums li.bbp-header,
#bbpress-forums ul.bbp-lead-topic,
#bbpress-forums ul.bbp-topics,
#bbpress-forums ul.bbp-forums,
#bbpress-forums ul.bbp-replies {
  background: transparent;
  border: none;
  padding: 0;
}

#bbpress-forums li.bbp-header {
  border-bottom: 1px solid var(--ink);
}

#bbpress-forums li.bbp-body {
  border: none;
  background: transparent;
}

#bbpress-forums {
  font-family: var(--sans);
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.55;
}

#bbpress-forums .bbp-forum-title,
#bbpress-forums .bbp-topic-title a,
#bbpress-forums .bbp-reply-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border: none;
}

#bbpress-forums .bbp-topic-title a:hover,
#bbpress-forums .bbp-forum-title:hover,
#bbpress-forums .bbp-forum-title a:hover {
  border-bottom: 0.5px solid var(--ink);
}

#bbpress-forums .bbp-forum-info,
#bbpress-forums .bbp-topic-meta,
#bbpress-forums .bbp-reply-meta,
#bbpress-forums p.bbp-topic-meta {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
  line-height: 1.5;
}

/* bbPress usa #fbfbfb per a files .odd — substituïm pel warm beige de la plataforma */
#bbpress-forums div.odd,
#bbpress-forums ul.odd {
  background-color: #f4f0e6 !important;
}

/* bbPress default afegeix margin-left als blocs de contingut per deixar
   espai a la columna d'autor. El nostre disseny no té aquesta columna. */
#bbpress-forums div.bbp-forum-content,
#bbpress-forums div.bbp-reply-content,
#bbpress-forums div.bbp-topic-content {
  margin-left: 0 !important;
}

#bbpress-forums .bbp-forum-content {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.4;
}

#bbpress-forums .bbp-reply-content,
#bbpress-forums .bbp-topic-content {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
}

#bbpress-forums .bbp-reply-content p,
#bbpress-forums .bbp-topic-content p {
  margin-bottom: 0.85em;
}

/* Política UX: no mostrem cap icona/avatar de perfil al fòrum. */
#bbpress-forums .bbp-reply-author img.avatar,
#bbpress-forums .bbp-topic-author img.avatar,
#bbpress-forums .bbp-forum-freshness img.avatar,
#bbpress-forums .bbp-topic-freshness-author img.avatar {
  display: none;
}

#bbpress-forums .np-avatar {
  display: none !important;
}

#bbpress-forums ul.bbp-forums > li,
#bbpress-forums ul.bbp-topics > li,
#bbpress-forums ul.bbp-replies > li {
  border-bottom: 0.5px solid var(--line-soft);
  padding: 16px 0;
}

/*
 * Ocultem peces natives que no formen part del disseny objectiu.
 * Es manté la lògica funcional de bbPress i només es neteja la UI.
 */
#bbpress-forums .bbp-search-form,
#bbpress-forums .bbp-footer {
  display: none;
}

/* ================================================
   LAYOUT DIRECTORI FORUMS + LLISTA DE TOPICS
   ================================================ */
#bbpress-forums .bbp-forums .bbp-header .forum-titles,
#bbpress-forums .bbp-topics .bbp-header .forum-titles {
  display: grid;
  align-items: end;
}

#bbpress-forums .bbp-forums .bbp-header .forum-titles {
  grid-template-columns: minmax(0, 1fr) 92px 102px 160px;
  gap: 12px;
}

#bbpress-forums .bbp-topics .bbp-header .forum-titles {
  grid-template-columns: minmax(0, 1fr) 80px 110px 160px;
  gap: 16px;
}

#bbpress-forums .bbp-forums .bbp-header .forum-titles > li,
#bbpress-forums .bbp-topics .bbp-header .forum-titles > li {
  float: none !important;
  width: auto !important;
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

#bbpress-forums .bbp-forums .bbp-body > ul {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 102px 160px;
  gap: 12px;
  align-items: start;
}

#bbpress-forums .bbp-topics .bbp-body > ul {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px 110px 160px;
  gap: 16px;
  align-items: start;
}

#bbpress-forums .bbp-forums .bbp-body > ul > li,
#bbpress-forums .bbp-topics .bbp-body > ul > li {
  float: none !important;
  width: auto !important;
  margin: 0;
  padding: 0;
}

/* Valors numèrics destacats (temes, respostes, veus). */
#bbpress-forums .bbp-forums .bbp-body > ul > .bbp-forum-topic-count,
#bbpress-forums .bbp-forums .bbp-body > ul > .bbp-forum-reply-count,
#bbpress-forums .bbp-topics .bbp-body > ul > .bbp-topic-voice-count,
#bbpress-forums .bbp-topics .bbp-body > ul > .bbp-topic-reply-count {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  line-height: 1.1;
}

#bbpress-forums .bbp-forums .bbp-body > ul > .bbp-forum-topic-count::after,
#bbpress-forums .bbp-forums .bbp-body > ul > .bbp-forum-reply-count::after,
#bbpress-forums .bbp-topics .bbp-body > ul > .bbp-topic-voice-count::after,
#bbpress-forums .bbp-topics .bbp-body > ul > .bbp-topic-reply-count::after {
  display: block;
  margin-top: 3px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

#bbpress-forums .bbp-forums .bbp-body > ul > .bbp-forum-topic-count::after {
  content: "Temes";
}

#bbpress-forums .bbp-forums .bbp-body > ul > .bbp-forum-reply-count::after {
  content: "Respostes";
}

#bbpress-forums .bbp-topics .bbp-body > ul > .bbp-topic-voice-count::after {
  content: "Veus";
}

#bbpress-forums .bbp-topics .bbp-body > ul > .bbp-topic-reply-count::after {
  content: "Respostes";
}

#bbpress-forums .bbp-forums .bbp-body > ul > .bbp-forum-freshness > a,
#bbpress-forums .bbp-topics .bbp-body > ul > .bbp-topic-freshness > a {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-mute);
  text-decoration: none;
}

#bbpress-forums .bbp-forums .bbp-body > ul > .bbp-forum-freshness > a:hover,
#bbpress-forums .bbp-topics .bbp-body > ul > .bbp-topic-freshness > a:hover {
  color: var(--ink);
}

#bbpress-forums .bbp-forums .bbp-body > ul > .bbp-forum-freshness .bbp-topic-meta,
#bbpress-forums .bbp-topics .bbp-body > ul > .bbp-topic-freshness .bbp-topic-meta {
  margin-top: 8px;
}

#bbpress-forums .bbp-topics .bbp-body > ul > .bbp-topic-title .bbp-topic-meta {
  margin-top: 4px;
  font-size: 12px;
}

#bbpress-forums .bbp-topics .bbp-body > ul > .bbp-topic-title .bbp-topic-started-by,
#bbpress-forums .bbp-topics .bbp-body > ul > .bbp-topic-title .bbp-topic-started-in {
  display: block;
}

/* ================================================
   LAYOUT LLISTA DE RESPOSTES
   ================================================ */
#bbpress-forums .bbp-replies > .bbp-header,
#bbpress-forums .bbp-replies > .bbp-footer,
#bbpress-forums .bbp-replies > .bbp-body > .bbp-reply-header {
  display: none;
}

/* Reset agressiu dels estils per defecte de bbPress sobre .reply */
#bbpress-forums .bbp-replies .bbp-body .np-bbp-reply,
#bbpress-forums .bbp-replies .bbp-body .reply {
  display: block !important;
  float: none !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-bottom: 0.5px solid var(--line-soft) !important;
  box-shadow: none !important;
  padding: 24px 0 !important;
  margin: 0 !important;
}

#bbpress-forums .bbp-replies .bbp-body .np-bbp-reply > *,
#bbpress-forums .bbp-replies .bbp-body .reply > * {
  float: none !important;
  width: auto !important;
  margin-left: 0 !important;
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

.np-bbp-reply-author {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 10px;
}

#bbpress-forums .bbp-reply-content {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
  background: transparent !important;
}

#bbpress-forums .button,
#bbpress-forums button,
#bbpress-forums input[type="submit"] {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  border: 0.5px solid var(--ink);
  border-radius: 2px;
  padding: 10px 18px;
  cursor: pointer;
}

#bbpress-forums .button:hover,
#bbpress-forums button:hover,
#bbpress-forums input[type="submit"]:hover {
  background: transparent;
  color: var(--ink);
}

#bbpress-forums fieldset {
  border: 0.5px solid var(--line-soft);
  padding: 24px;
  border-radius: 2px;
  background: var(--paper);
  margin-top: 32px;
}

#bbpress-forums fieldset legend {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 0 8px;
}

#bbpress-forums input[type="text"],
#bbpress-forums textarea,
#bbpress-forums select {
  border: none;
  border-bottom: 0.5px solid var(--line-soft);
  padding: 8px 0;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink);
  background: transparent;
  outline: none;
  width: 100%;
  border-radius: 0;
}

#bbpress-forums input[type="text"]:focus,
#bbpress-forums textarea:focus,
#bbpress-forums select:focus {
  border-bottom-color: var(--ink);
}

#bbpress-forums textarea {
  border: 0.5px solid var(--line-soft);
  padding: 12px;
  border-radius: 2px;
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
  margin-top: 8px;
}

#bbpress-forums label {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  display: block;
  margin-bottom: 6px;
}

#bbpress-forums .bbp-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--sans);
}

#bbpress-forums .bbp-pagination a {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 0.5px solid var(--ink);
  padding: 6px 12px;
  border-radius: 2px;
  color: var(--ink);
  text-decoration: none;
}

#bbpress-forums .bbp-pagination a:hover {
  background: var(--ink);
  color: var(--paper);
}

#bbpress-forums .bbp-pagination .bbp-pagination-count,
#bbpress-forums #bbp-breadcrumb,
#bbpress-forums .bbp-topic-tags,
#bbpress-forums .bbp-forum-freshness img,
#bbpress-forums .bbp-author-role,
#bbpress-forums .bbp-author-subscription {
  display: none !important;
}

#bbpress-forums .np-bbp-topic-controls {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  margin: 0 0 16px;
}

#bbpress-forums .np-bbp-topic-controls a {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-decoration: none;
  border: 0.5px solid var(--line-soft);
  border-radius: 2px;
  padding: 6px 10px;
}

#bbpress-forums .np-bbp-topic-controls a:hover {
  border-color: var(--ink);
  color: var(--ink);
}

#bbpress-forums .bbp-reply-admin-links a,
#bbpress-forums .bbp-topic-admin-links a {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-decoration: none;
  border: none;
  margin-right: 12px;
}

#bbpress-forums .bbp-reply-admin-links a:hover,
#bbpress-forums .bbp-topic-admin-links a:hover {
  color: var(--ink);
  border-bottom: 0.5px solid var(--ink);
}

#bbpress-forums .bbp-reply-admin-links span.sep,
#bbpress-forums .bbp-topic-admin-links span.sep {
  display: none;
}

#bbpress-forums.bbp-forum-status-closed .bbp-reply-form {
  display: none;
}

#bbpress-forums li.super-sticky .bbp-topic-title a::before,
#bbpress-forums li.sticky .bbp-topic-title a::before {
  content: "Fixat · ";
  font-family: var(--serif);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
}

/* ================================================
   LAYOUT EXTRA - OVERRIDES LOOPS
   ================================================ */
.np-bbp-row {
  display: block;
}

.np-bbp-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.np-bbp-author {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}

.np-bbp-time {
  font-size: 11px;
  color: var(--ink-mute);
}

.np-bbp-body {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.np-bbp-actions {
  margin-top: 10px;
}

.np-bbp-stats {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ================================================
   WIDGET ELEMENTOR — APORTACIÓ RÀPIDA
   ================================================ */

.np-bbp-quick-reply {
  width: 100%;
}

.np-bbp-quick-reply__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 12px;
}

.np-bbp-quick-reply__textarea {
  display: block;
  width: 100%;
  min-height: 120px;
  border: 1.5px dashed var(--ink-mute);
  border-radius: 2px;
  padding: 14px 16px;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: transparent;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.np-bbp-quick-reply__textarea:focus {
  border-color: var(--ink);
  border-style: solid;
}

.np-bbp-quick-reply__error {
  font-family: var(--sans);
  font-size: 12px;
  color: #b00020;
  margin: 6px 0 0;
  min-height: 1.2em;
}

.np-bbp-quick-reply__submit {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  border: 0.5px solid var(--ink);
  border-radius: 2px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.np-bbp-quick-reply__submit:hover {
  background: transparent;
  color: var(--ink);
}

.np-bbp-quick-reply__submit:disabled {
  opacity: 0.45;
  cursor: default;
}

.np-bbp-quick-reply__success {
  padding: 8px 0;
}

.np-bbp-quick-reply__reply-author {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 12px 0 8px;
}

.np-bbp-quick-reply__reply-preview {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
  padding: 16px 0;
  border-top: 0.5px solid var(--line-soft);
  margin-bottom: 16px;
}

.np-bbp-quick-reply__reply-preview p {
  margin-bottom: 0.85em;
}

.np-bbp-quick-reply__reply-preview p:last-child {
  margin-bottom: 0;
}

.np-bbp-quick-reply__success-msg {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink);
  margin: 0 0 10px;
}

.np-bbp-quick-reply__footer {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 12px;
}

.np-bbp-quick-reply__edit-btn {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 0.5px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.np-bbp-quick-reply__edit-btn:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}


.np-bbp-quick-reply__link {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wine);
  text-decoration: none;
  border-bottom: 0.5px solid transparent;
  transition: border-color 0.15s;
}

.np-bbp-quick-reply__link:hover {
  border-bottom-color: var(--wine);
}

/* ================================================
   WIDGET ELEMENTOR — ENLLAÇ A FÒRUM / TEMA
   ================================================ */

.np-bbp-link-widget--button {
  display: inline-block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  border: 0.5px solid var(--ink);
  border-radius: 2px;
  padding: 10px 20px;
  transition: background 0.15s, color 0.15s;
}

.np-bbp-link-widget--button:hover {
  background: transparent;
  color: var(--ink);
}

.np-bbp-link-widget--link {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--wine);
  border-bottom: 0.5px solid transparent;
  transition: border-color 0.15s;
}

.np-bbp-link-widget--link:hover {
  border-bottom-color: var(--wine);
}

/* ================================================
   CAPÇALERA DEL TEMA (fòrum pare + autora)
   ================================================ */

.np-bbp-topic-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.03em;
}

.np-bbp-topic-forum-link {
  color: var(--wine);
  text-decoration: none;
  font-weight: 600;
}

.np-bbp-topic-forum-link:hover {
  text-decoration: underline;
}

.np-bbp-topic-header-sep {
  color: var(--line-soft);
}

.np-bbp-topic-itinerari-link {
  color: var(--ink-mute);
  text-decoration: none;
  font-weight: 400;
}

.np-bbp-topic-itinerari-link:hover {
  color: var(--wine);
}

.np-bbp-topic-header-author a {
  color: var(--ink-mute);
  text-decoration: none;
  text-transform: none;
  font-weight: 400;
  letter-spacing: normal;
}

/* ================================================
   SUBSCRIPCIÓ AL FÒRUM — SWITCH (track + knob)
   ================================================ */

/* bbPress posa float:right als toggles de subscripció i favorits per defecte */
#bbpress-forums #subscription-toggle,
#bbpress-forums #favorite-toggle {
  float: none !important;
  display: block;
}

.np-bbp-subscription {
  margin-bottom: 20px;
}

.np-bbp-subscription a {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--ink);
}

.np-bbp-subscription__switch {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
  border: 0.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.np-bbp-subscription__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--ink);
  transition: transform 0.18s ease, background-color 0.18s ease;
}

/* Estat subscrit: bbPress marca el contenidor amb .is-subscribed */
.np-bbp-subscription.is-subscribed .np-bbp-subscription__switch {
  background: var(--ink);
  border-color: var(--ink);
}

.np-bbp-subscription.is-subscribed .np-bbp-subscription__knob {
  background: var(--paper);
  transform: translateX(20px);
}

/* Nom de l'autora del tema: sense majúscules, pes normal */
#bbpress-forums .bbp-topic-started-by a,
#bbpress-forums .bbp-topic-started-in a {
  text-transform: none;
  font-weight: 400;
  letter-spacing: normal;
  font-size: 11px;
  color: var(--ink-mute);
  border: none;
}

/* ================================================
   TOPIC ROW — RESET BORDERS / COLORS DEFECTE
   ================================================ */

/* bbPress afegeix border/background a .odd .even; WordPress afegeix estils a .hentry */
#bbpress-forums ul.np-bbp-topic-row {
  border: none !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  background: transparent !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  outline: none !important;
}

/* La línia separadora va al contenidor, no al row */
#bbpress-forums .bbp-topics .bbp-body > ul.np-bbp-topic-row {
  border-bottom: 0.5px solid var(--line-soft) !important;
  padding-bottom: 16px !important;
  padding-top: 16px !important;
}

#bbpress-forums .bbp-topics .bbp-body > ul.np-bbp-topic-row:last-child {
  border-bottom: none !important;
}

@media (min-width: 768px) {
  #bbpress-forums .bbp-forum-content {
    max-width: 50%;
  }
}

@media (max-width: 767px) {
  #bbpress-forums li.bbp-header {
    display: none;
  }

  #bbpress-forums ul.bbp-forums > li,
  #bbpress-forums ul.bbp-topics > li,
  #bbpress-forums ul.bbp-replies > li {
    padding: 12px 0;
  }

  .np-bbp-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /*
   * En mobil simplifiquem totes les llistes a una columna.
   * Evita desbordaments i manté llegibilitat.
   */
  #bbpress-forums .bbp-forums .bbp-body > ul,
  #bbpress-forums .bbp-topics .bbp-body > ul {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #bbpress-forums .bbp-forums .bbp-body > ul > .bbp-forum-topic-count::after,
  #bbpress-forums .bbp-forums .bbp-body > ul > .bbp-forum-reply-count::after,
  #bbpress-forums .bbp-topics .bbp-body > ul > .bbp-topic-voice-count::after,
  #bbpress-forums .bbp-topics .bbp-body > ul > .bbp-topic-reply-count::after {
    display: inline;
    margin-left: 6px;
  }

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

  #bbpress-forums .np-bbp-topic-controls {
    display: flex;
    flex-wrap: wrap;
  }
}

/* ================================================
   BUDDYPRESS - FIX ALIGNWIDE (Hello Elementor theme.css)
   ================================================ */

/*
 * Hello Elementor aplica margin-inline:-80px a .alignwide.
 * Quan BuddyPress renderitza contingut via the_content(), el widget
 * "Post Content" d'Elementor rep la classe alignwide, trencant
 * la columna i fent "no fluir" el div de BP.
 */
body.buddypress .alignwide,
body.buddypress .alignfull {
  margin-inline: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* ================================================
   BUDDYPRESS - CONTENIDOR GLOBAL
   ================================================ */

/*
 * #buddypress és un block dins d'un flex item d'Elementor.
 * Sense width:100% i min-width:0 no omple l'espai disponible.
 * overflow:visible evita que el flex container talli contingut BP.
 */
#buddypress {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: visible;
}

/* Elementor "Post Content" widget: cap constraint de width al contenidor fill */
.elementor-widget-theme-post-content,
.elementor-widget-theme-post-content .elementor-widget-container {
  min-width: 0;
  width: 100%;
  overflow: visible;
}

/*
 * bp-wrap usa un clearfix de float amb display:table.
 * No el toquem — però assegurem que no col·lapsi dins del flex d'Elementor
 * fent-lo display:flow-root (conté floats sense pseudo-elements extra).
 */
.bp-wrap {
  display: flow-root;
}

/* ================================================
   BUDDYPRESS - DIRECTORI DE MEMBRES
   ================================================ */

/* Nav de tipus (All Members, etc.) */
nav.bp-navs ul.component-navigation {
  display: flex;
  gap: 0;
  border-bottom: 0.5px solid var(--ink);
  margin-bottom: 24px;
  list-style: none;
  padding: 0;
  background: transparent;
}

nav.bp-navs ul.component-navigation li {
  background: transparent;
}

nav.bp-navs ul.component-navigation li a {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 16px 12px;
  color: var(--ink-mute);
  border: none;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  display: block;
  text-decoration: none;
}

nav.bp-navs ul.component-navigation li a,
nav.bp-navs ul.component-navigation li.selected a,
nav.bp-navs ul.component-navigation li.current a {
  background: transparent !important;
}

nav.bp-navs ul.component-navigation li.selected a,
nav.bp-navs ul.component-navigation li.current a {
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
}

nav.bp-navs ul.component-navigation li a .count {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0;
  background: var(--ink);
  color: var(--paper);
  border-radius: 2px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
}

nav.bp-navs ul.component-navigation li.selected a .count {
  background: var(--ink);
}

/* Barra de cerca + filtres */
.subnav-filters {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  border-bottom: 0.5px solid var(--line-soft);
  padding-bottom: 16px;
}

.subnav-search {
  flex: 1;
}

.subnav-search form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.subnav-search input[type="text"],
.subnav-search input[type="search"] {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
  border: 0.5px solid var(--line-soft);
  border-radius: 2px;
  padding: 8px 12px;
  background: var(--paper);
  width: 100%;
  max-width: 280px;
  outline: none;
  box-shadow: none;
}

.subnav-search input[type="text"]:focus,
.subnav-search input[type="search"]:focus {
  border-color: var(--ink);
}

.subnav-search button[type="submit"],
.subnav-search input[type="submit"] {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 14px;
  border: 0.5px solid var(--ink);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

/* Select de filtre (Alfabètic, etc.) */
#dir-filters {
  flex-shrink: 0;
}

#dir-filters .component-filters {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}

#dir-filters .select-wrap {
  position: relative;
  display: inline-block;
}

#dir-filters select {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border: 0.5px solid var(--line-soft);
  border-radius: 2px;
  padding: 7px 28px 7px 10px;
  background: var(--paper);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
}

#dir-filters .select-arrow {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--ink-mute);
  pointer-events: none;
}

/* Llista de membres — classes BP reals */
#members-list.members {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 0.5px solid var(--line-soft);
}

/* Fila individual — reset complet del card per defecte de BP */
#members-list li.item-entry {
  border: none !important;
  border-bottom: 0.5px solid var(--line-soft) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 14px 0 !important;
  margin: 0 !important;
}

#members-list li.item-entry:last-child {
  border-bottom: none !important;
}

/* list-wrap: grid horitzontal avatar + info */
#members-list .list-wrap {
  display: grid !important;
  grid-template-columns: 48px 1fr !important;
  gap: 16px !important;
  align-items: center !important;
}

/* Avatar: fix 48px quadrat */
#members-list .item-avatar {
  width: 48px !important;
  flex-shrink: 0;
}

#members-list .item-avatar img {
  width: 48px !important;
  height: 48px !important;
  border-radius: 2px !important;
  display: block;
  object-fit: cover;
}

/* Bloc de text */
#members-list .item {
  min-width: 0;
}

#members-list .item-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Nom */
#members-list h2.list-title.member-name {
  font-family: var(--serif) !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: var(--ink) !important;
  margin: 0 !important;
  padding: 0 !important;
}

#members-list h2.list-title.member-name a {
  color: inherit !important;
  text-decoration: none !important;
  border: none !important;
}

/* Meta (última activitat) */
#members-list .item-meta.last-activity {
  font-family: var(--sans) !important;
  font-size: 11px !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: var(--ink-mute) !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Oculta botons d'acció (seguir, etc.) que no volem al directori */
#members-list .item-entry .action {
  display: none !important;
}

/* Si el template override carrega (nf-member-row), aplica el mateix */
li.nf-member-row {
  border: none !important;
  border-bottom: 0.5px solid var(--line-soft) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 14px 0 !important;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  align-items: center;
}

li.nf-member-row .nf-member-avatar img {
  width: 48px;
  height: 48px;
  border-radius: 2px;
  display: block;
  object-fit: cover;
}

li.nf-member-row .nf-member-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border: none;
}

li.nf-member-row .nf-member-meta {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* Paginació */
.bp-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 0.5px solid var(--line-soft);
  margin-bottom: 0;
}

.bp-pagination .pag-count {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.bp-pagination .pagination-links a,
.bp-pagination .pagination-links span {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border: none;
  padding: 4px 8px;
  text-decoration: none;
}

.bp-pagination .pagination-links a:hover,
.bp-pagination .pagination-links span.current {
  color: var(--ink);
}

/* Feedback / llista buida */
.bp-feedback.info {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-mute);
  padding: 24px 0;
  background: transparent;
  border: none;
}

/* ================================================
   BUDDYPRESS - PERFIL DE MEMBRE
   ================================================ */

#buddypress #item-header.users-header,
#buddypress #item-header.single-headers {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  margin: 0 0 16px !important;
  padding: 0 !important;
  min-height: 0 !important;
}

#buddypress #item-header-cover-image,
#buddypress #header-cover-image,
#buddypress #cover-image-container {
  background: transparent !important;
  border: none !important;
  min-height: 0 !important;
  padding: 0 !important;
}

.nf-profile-head {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px 0 18px;
  border-bottom: 0.5px solid var(--ink);
}

.nf-profile-avatar {
  display: block;
  width: 88px;
  height: 88px;
  border: 0.5px solid var(--ink);
  border-radius: 2px;
  overflow: hidden;
  background: var(--paper);
}

.nf-profile-avatar img.avatar,
.nf-profile-avatar__image {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  border: 0 !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

.nf-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0.5px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  flex-shrink: 0;
}

.nf-avatar--xl {
  width: 72px;
  height: 72px;
  font-size: 28px;
}

.nf-profile-main {
  min-width: 0;
}

.nf-profile-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  color: var(--ink);
  margin: 0;
}

.nf-profile-handle {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 8px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.nf-profile-handle span + span::before {
  content: "·";
  margin-right: 10px;
  color: var(--ink-mute);
}

.nf-profile-bio {
  max-width: 62ch;
  margin: 12px 0 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.nf-profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 12px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.nf-profile-stats strong {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.nf-profile-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 12px;
}

.nf-profile-btn,
.nf-profile-actions .generic-button a,
.nf-profile-actions button,
.nf-profile-actions .button,
.nf-profile-follow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 12px;
  border: 0.5px solid var(--ink) !important;
  border-radius: 2px !important;
  background: transparent !important;
  color: var(--ink) !important;
  font-family: var(--serif) !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  letter-spacing: 0.06em !important;
  line-height: 1.2 !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  box-shadow: none !important;
  cursor: pointer;
}

.nf-profile-btn:hover,
.nf-profile-actions .generic-button a:hover,
.nf-profile-actions button:hover,
.nf-profile-actions .button:hover,
.nf-profile-follow:hover {
  background: var(--ink) !important;
  color: var(--paper) !important;
}

.nf-profile-nav {
  margin: 0 0 32px;
  border-bottom: 0.5px solid var(--ink);
}

.nf-profile-nav__list,
.nf-profile-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  background: transparent;
}

.nf-profile-nav__list li,
.nf-profile-subnav li {
  margin: 0;
  padding: 0;
  background: transparent;
}

.nf-profile-nav__list li a,
.nf-profile-subnav li a {
  display: block;
  padding: 10px 16px 12px;
  border: none;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  color: var(--ink-mute);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.nf-profile-nav__list li.selected a,
.nf-profile-nav__list li.current a,
.nf-profile-nav__list li a:hover,
.nf-profile-subnav li.selected a,
.nf-profile-subnav li.current a,
.nf-profile-subnav li a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.nf-profile-nav__list .count,
.nf-profile-subnav .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
}

.nf-profile-section {
  margin-top: 0;
}

.nf-profile-composer {
  margin: 0 0 28px;
}

.nf-profile-section__head {
  border-bottom: 0.5px solid var(--line-soft);
  padding-bottom: 8px;
  margin-bottom: 20px;
}

.nf-profile-section__head h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nf-profile-fields {
  border-top: 0.5px solid var(--line-soft);
}

.nf-profile-field {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  padding: 14px 0;
  border-bottom: 0.5px solid var(--line-soft);
}

.nf-profile-field__label {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.nf-profile-field__value {
  min-width: 0;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
}

.nf-profile-field__value p:last-child {
  margin-bottom: 0;
}

.nf-profile-empty {
  margin: 0;
  padding: 16px 0;
  color: var(--ink-mute);
  font-family: var(--sans);
  font-size: 13px;
}

@media (max-width: 700px) {
  .nf-profile-head {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 0 16px;
  }

  .nf-avatar--xl {
    width: 56px;
    height: 56px;
    font-size: 22px;
  }

  .nf-profile-avatar {
    width: 56px;
    height: 56px;
  }

  .nf-profile-name {
    font-size: 23px;
  }

  .nf-profile-actions {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nf-profile-nav__list li a,
  .nf-profile-subnav li a {
    padding: 10px 10px 12px;
    font-size: 11px;
  }

  .nf-profile-field {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* ================================================
   SHORTCODE [ns_forum_activity]
   ================================================ */

.ns-forum-activity {
  width: 100%;
}

.ns-forum-activity__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 0.5px solid var(--ink);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.ns-forum-activity__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.ns-forum-activity__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 0.5px solid var(--line-soft);
}

.ns-forum-activity__row {
  border-bottom: 0.5px solid var(--line-soft);
}

.ns-forum-activity__link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  text-decoration: none;
  border: none;
  color: inherit;
}

.ns-forum-activity__link:hover .ns-forum-activity__topic {
  color: var(--ink);
}

.ns-forum-activity__topic {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ns-forum-activity__meta {
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-shrink: 0;
}

.ns-forum-activity__badge {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink-mute);
  border-radius: 2px;
  padding: 2px 6px;
  line-height: 1.4;
}

.ns-forum-activity__row--topic .ns-forum-activity__badge {
  background: var(--ink);
}

.ns-forum-activity__forum,
.ns-forum-activity__date {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
  white-space: nowrap;
}

.ns-forum-activity__footer {
  padding-top: 12px;
  text-align: right;
}

.ns-forum-activity__all {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-decoration: none;
  border: none;
}

.ns-forum-activity__all:hover {
  color: var(--ink);
}

.ns-forum-activity-empty {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-mute);
  padding: 16px 0;
}

.ns-notifications {
  margin-top: 24px;
}

.ns-notifications__text {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-soft);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.ns-notifications__link:hover .ns-notifications__text {
  color: var(--ink);
}

@media (max-width: 600px) {
  .ns-forum-activity__link {
    flex-direction: column;
    gap: 6px;
  }
  .ns-forum-activity__meta {
    flex-wrap: wrap;
    gap: 8px;
  }
}
