/* =========================================================
   forum.css — bbPress + ListingPro (solo pagine forum)
   Obiettivo: stile “card” + header rosso + griglie pulite
   ========================================================= */

/* ---------- Variabili (facili da cambiare) ---------- */
:root{
  --pf-red: #e30614;
  --pf-red-dark: #c10512;
  --pf-bg: #f6f6f6;
  --pf-card: #ffffff;
  --pf-text: #111;
  --pf-muted: #666;
  --pf-border: #eeeeee;
  --pf-radius: 16px;
  --pf-shadow: 0 10px 30px rgba(0,0,0,.08);
}

/* ---------- Wrapper / Reset base ---------- */
#bbpress-forums.bbpress-wrapper{
  width: 100%;
  background: transparent;
  border: 0;
  box-shadow: none;
}

#bbpress-forums.bbpress-wrapper ul,
#bbpress-forums.bbpress-wrapper li{
  list-style: none;
  margin: 0;
  padding: 0;
}

/* nascondi breadcrumb bbPress (se vuoi tenerlo: commenta questa regola) */
#bbpress-forums.bbpress-wrapper .bbp-breadcrumb{ display:none; }

/* nascondi la search “interna” bbPress dentro al wrapper (hai la tua search custom) */
#bbpress-forums.bbpress-wrapper > .bbp-search-form{ display:none; }

/* ---------- Notice / info box (blu, gialle ecc.) ---------- */
#bbpress-forums.bbpress-wrapper .bbp-template-notice{
  border-radius: 12px;
  border: 1px solid #d9e7ff;
  background: #eef6ff;
  color: #0b3a69;
  padding: 12px 14px;
  margin: 12px 0 16px;
  font-size: 14px;
  line-height: 1.4;
}
#bbpress-forums.bbpress-wrapper .bbp-template-notice a{ color: inherit; font-weight: 700; }

#bbpress-forums.bbpress-wrapper .bbp-template-notice.warning{
  border-color: #f3d36b;
  background: #fff7d6;
  color: #6a4b00;
}

/* ---------- Link “Iscriviti / Preferiti” (in alto a destra) ---------- */
#bbpress-forums.bbpress-wrapper .bbp-topic-subscription-link a,
#bbpress-forums.bbpress-wrapper .bbp-topic-favorite-link a{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--pf-border);
  background: #fff;
  color: var(--pf-text);
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
}
#bbpress-forums.bbpress-wrapper .bbp-topic-subscription-link a:hover,
#bbpress-forums.bbpress-wrapper .bbp-topic-favorite-link a:hover{
  border-color: var(--pf-red);
  color: var(--pf-red);
}

/* =========================================================
   1) FORUM INDEX (lista forum)
   ========================================================= */
#bbpress-forums.bbpress-wrapper ul.bbp-forums{
  background: var(--pf-card);
  border-radius: var(--pf-radius);
  box-shadow: var(--pf-shadow);
  overflow: hidden;
}

/* Header rosso */
#bbpress-forums.bbpress-wrapper ul.bbp-forums > li.bbp-header{
  background: var(--pf-red);
  color: #fff;
  padding: 14px 18px;
  text-transform: uppercase;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .04em;
}

#bbpress-forums.bbpress-wrapper ul.bbp-forums > li.bbp-header > ul.forum-titles{
  display: grid;
  grid-template-columns: minmax(0,1fr) 90px 90px 1px;
  align-items: center;
}
#bbpress-forums.bbpress-wrapper ul.bbp-forums > li.bbp-header > ul.forum-titles > li{
  text-align: center;
  white-space: nowrap;
}
#bbpress-forums.bbpress-wrapper ul.bbp-forums > li.bbp-header > ul.forum-titles > li.bbp-forum-info{
  text-align: left;
}

/* Righe forum (ogni riga è una UL#bbp-forum-xxx) */
#bbpress-forums.bbpress-wrapper ul.bbp-forums > li.bbp-body > ul[id^="bbp-forum-"]{
  display: grid;
  grid-template-columns: minmax(0,1fr) 90px 90px 1px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--pf-border);
  transition: background .18s ease;
}

/* Override ListingPro: spesso usa float/width */
#bbpress-forums.bbpress-wrapper ul.bbp-forums > li.bbp-body > ul[id^="bbp-forum-"] > li{
  float: none !important;
  width: auto !important;
}

#bbpress-forums.bbpress-wrapper ul.bbp-forums > li.bbp-body > ul[id^="bbp-forum-"]:hover{
  background: #fff7f5;
}
#bbpress-forums.bbpress-wrapper ul.bbp-forums > li.bbp-body > ul[id^="bbp-forum-"]:last-child{
  border-bottom: 0;
}

/* Titolo + descrizione */
#bbpress-forums.bbpress-wrapper .bbp-forum-title{
  font-size: 18px;
  font-weight: 900;
  color: var(--pf-text);
  text-decoration: none;
}
#bbpress-forums.bbpress-wrapper .bbp-forum-content{
  margin-top: 6px;
  color: var(--pf-muted);
  font-size: 13px;
  line-height: 1.45;
}

/* Contatori centrati */
#bbpress-forums.bbpress-wrapper .bbp-forum-topic-count,
#bbpress-forums.bbpress-wrapper .bbp-forum-reply-count{
  text-align: center;
  font-weight: 900;
  color: var(--pf-text);
}

/* Freshness */
#bbpress-forums.bbpress-wrapper .bbp-forum-freshness{
  font-size: 12px;
  color: var(--pf-muted);
}
#bbpress-forums.bbpress-wrapper .bbp-forum-freshness a{
  color: var(--pf-text);
  text-decoration: none;
  font-weight: 800;
}

/* =========================================================
   2) TOPICS LIST (dentro un forum)
   ========================================================= */
#bbpress-forums.bbpress-wrapper ul.bbp-topics{
  background: var(--pf-card);
  border-radius: var(--pf-radius);
  box-shadow: var(--pf-shadow);
  overflow: hidden;
  margin-top: 14px;
}

/* Header rosso topics */
#bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-header{
  background: var(--pf-red);
  color: #fff;
  padding: 14px 18px;
  text-transform: uppercase;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .04em;
}

#bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-header > ul.topic-titles{
  display: grid;
  grid-template-columns: minmax(0,1fr) 110px 90px 240px; /* topic | partecipanti | post | ultimo */
  align-items: center;
}
#bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-header > ul.topic-titles > li{
  text-align: center;
  white-space: nowrap;
}
#bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-header > ul.topic-titles > li.bbp-topic-title{
  text-align: left;
}

/* Riga topic: UL#bbp-topic-xxx */
#bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-body > ul[id^="bbp-topic-"]{
  display: grid;
  grid-template-columns: minmax(0,1fr) 110px 90px 240px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--pf-border);
  transition: background .18s ease;
}
#bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-body > ul[id^="bbp-topic-"] > li{
  float: none !important;
  width: auto !important;
}
#bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-body > ul[id^="bbp-topic-"]:hover{
  background: #fff7f5;
}
#bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-body > ul[id^="bbp-topic-"]:last-child{
  border-bottom: 0;
}

/* Titolo topic + meta */
#bbpress-forums.bbpress-wrapper .bbp-topic-permalink{
  font-weight: 900;
  color: var(--pf-text);
  text-decoration: none;
}
#bbpress-forums.bbpress-wrapper .bbp-topic-meta{
  margin-top: 6px;
  font-size: 12px;
  color: var(--pf-muted);
}
#bbpress-forums.bbpress-wrapper .bbp-topic-voice-count,
#bbpress-forums.bbpress-wrapper .bbp-topic-reply-count{
  text-align: center;
  font-weight: 900;
  color: var(--pf-text);
}
#bbpress-forums.bbpress-wrapper .bbp-topic-freshness{
  font-size: 12px;
  color: var(--pf-muted);
}
#bbpress-forums.bbpress-wrapper .bbp-topic-freshness a{
  color: var(--pf-text);
  text-decoration: none;
  font-weight: 800;
}

/* =========================================================
   3) SINGLE TOPIC — Replies (stile più pulito, senza stravolgere)
   ========================================================= */

/* Lista risposte: bbPress usa spesso ul.bbp-replies */
#bbpress-forums.bbpress-wrapper ul.bbp-replies{
  background: var(--pf-card);
  border-radius: var(--pf-radius);
  box-shadow: var(--pf-shadow);
  overflow: hidden;
  margin-top: 14px;
}

/* Header “Autore / Post” */
#bbpress-forums.bbpress-wrapper ul.bbp-replies > li.bbp-header{
  background: #f2f2f2;
  padding: 12px 18px;
  font-weight: 900;
  color: var(--pf-text);
}
#bbpress-forums.bbpress-wrapper ul.bbp-replies > li.bbp-header .bbp-reply-author,
#bbpress-forums.bbpress-wrapper ul.bbp-replies > li.bbp-header .bbp-reply-content{
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Ogni reply */
#bbpress-forums.bbpress-wrapper div.bbp-reply-header{
  background: #f7f7f7;
  border-top: 1px solid var(--pf-border);
  border-bottom: 1px solid var(--pf-border);
  padding: 10px 18px;
  font-size: 12px;
  color: var(--pf-muted);
}
#bbpress-forums.bbpress-wrapper div.bbp-reply-header a{
  color: var(--pf-text);
  font-weight: 800;
  text-decoration: none;
}

/* Corpo reply: colonna autore + contenuto */
#bbpress-forums.bbpress-wrapper div.bbp-reply-author{
  padding: 16px 18px;
  border-right: 1px solid var(--pf-border);
}
#bbpress-forums.bbpress-wrapper div.bbp-reply-content{
  padding: 16px 18px;
}
#bbpress-forums.bbpress-wrapper div.bbp-reply-content p{
  margin: 0 0 10px;
  line-height: 1.6;
  color: #333;
}
#bbpress-forums.bbpress-wrapper .bbp-author-name{
  font-weight: 900;
}
#bbpress-forums.bbpress-wrapper img.avatar{
  border-radius: 999px;
}

/* Azioni (modifica/spam ecc.) meno “urlate” */
#bbpress-forums.bbpress-wrapper .bbp-admin-links a{
  color: #777;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
}
#bbpress-forums.bbpress-wrapper .bbp-admin-links a:hover{
  color: var(--pf-red);
}

/* =========================================================
   4) FORMS (nuovo topic / risposta)
   ========================================================= */
#bbpress-forums.bbpress-wrapper fieldset.bbp-form{
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  padding: 16px;
  background: #fff;
  box-shadow: var(--pf-shadow);
}

#bbpress-forums.bbpress-wrapper fieldset.bbp-form legend{
  font-weight: 900;
  color: var(--pf-text);
  padding: 0 8px;
}

#bbpress-forums.bbpress-wrapper input[type="text"],
#bbpress-forums.bbpress-wrapper input[type="email"],
#bbpress-forums.bbpress-wrapper input[type="url"],
#bbpress-forums.bbpress-wrapper textarea{
  width: 100%;
  border: 1px solid var(--pf-border);
  border-radius: 12px;
  padding: 12px 12px;
  outline: none;
  box-sizing: border-box;
}

#bbpress-forums.bbpress-wrapper input[type="text"]:focus,
#bbpress-forums.bbpress-wrapper textarea:focus{
  border-color: rgba(227,6,20,.45);
  box-shadow: 0 0 0 4px rgba(227,6,20,.08);
}

/* Pulsanti submit */
#bbpress-forums.bbpress-wrapper #bbp_reply_submit,
#bbpress-forums.bbpress-wrapper #bbp_topic_submit{
  background: var(--pf-red);
  border: 1px solid var(--pf-red);
  color: #fff;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 900;
  cursor: pointer;
}
#bbpress-forums.bbpress-wrapper #bbp_reply_submit:hover,
#bbpress-forums.bbpress-wrapper #bbp_topic_submit:hover{
  background: var(--pf-red-dark);
  border-color: var(--pf-red-dark);
}

/* =========================================================
   5) SIDEBAR widgets (solo su pagine forum, ok)
   ========================================================= */
.widget{
  background: #fff;
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  box-shadow: var(--pf-shadow);
  padding: 16px;
  margin-bottom: 18px;
}
.widget .widget-title{
  margin: 0 0 12px;
  font-weight: 900;
  color: var(--pf-text);
}

/* Widget search bbPress in sidebar (se presente) */
.widget #bbp-search-form > div{
  display: flex;
  gap: 10px;
}
.widget #bbp_search{
  flex: 1;
  border: 1px solid var(--pf-border);
  border-radius: 12px;
  padding: 10px 12px;
}
.widget #bbp_search_submit{
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid var(--pf-border);
  background: #f3f3f3;
  font-weight: 800;
  cursor: pointer;
}
.widget #bbp_search_submit:hover{
  border-color: var(--pf-red);
  color: var(--pf-red);
}

/* =========================================================
   MOBILE (<= 767)
   ========================================================= */
@media (max-width: 767px){

  /* FORUM INDEX: testo a sinistra (2 righe), Topic/Post a destra (fissi) */
  #bbpress-forums.bbpress-wrapper ul.bbp-forums > li.bbp-header > ul.forum-titles{
    display: grid !important;
    grid-template-columns: 1fr 64px 64px !important;
  }
  #bbpress-forums.bbpress-wrapper ul.bbp-forums > li.bbp-header > ul.forum-titles > li.bbp-forum-freshness{
    display: none !important;
  }

  #bbpress-forums.bbpress-wrapper ul.bbp-forums > li.bbp-body > ul[id^="bbp-forum-"]{
    display: grid !important;
    grid-template-columns: 1fr 64px 64px !important;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 6px;
  }
  #bbpress-forums.bbpress-wrapper ul.bbp-forums > li.bbp-body > ul[id^="bbp-forum-"] > li.bbp-forum-info{
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
  }
  #bbpress-forums.bbpress-wrapper ul.bbp-forums > li.bbp-body > ul[id^="bbp-forum-"] > li.bbp-forum-topic-count{
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    justify-self: center;
    align-self: center;
  }
  #bbpress-forums.bbpress-wrapper ul.bbp-forums > li.bbp-body > ul[id^="bbp-forum-"] > li.bbp-forum-reply-count{
    grid-column: 3 !important;
    grid-row: 1 / span 2 !important;
    justify-self: center;
    align-self: center;
  }
  #bbpress-forums.bbpress-wrapper ul.bbp-forums > li.bbp-body > ul[id^="bbp-forum-"] > li.bbp-forum-freshness{
    display: none !important;
  }

  /* TOPICS LIST: in header togli “Ultimo articolo”, nel body lo metti sotto al titolo */
  #bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-header > ul.topic-titles{
    display: grid !important;
    grid-template-columns: 1fr 64px 64px !important; /* topic | partecipanti | post */
  }
  #bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-header > ul.topic-titles > li.bbp-topic-freshness{
    display: none !important;
  }

  #bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-body > ul[id^="bbp-topic-"]{
    display: grid !important;
    grid-template-columns: 1fr 64px 64px !important;
    grid-template-rows: auto auto; /* titolo sopra, freshness sotto */
    column-gap: 10px;
    row-gap: 6px;
  }
  #bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-body > ul[id^="bbp-topic-"] > li.bbp-topic-title{
    grid-column: 1 !important;
    grid-row: 1 !important;
  }
  #bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-body > ul[id^="bbp-topic-"] > li.bbp-topic-freshness{
    grid-column: 1 !important;
    grid-row: 2 !important;
  }
  #bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-body > ul[id^="bbp-topic-"] > li.bbp-topic-voice-count{
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    justify-self: center;
    align-self: center;
  }
  #bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-body > ul[id^="bbp-topic-"] > li.bbp-topic-reply-count{
    grid-column: 3 !important;
    grid-row: 1 / span 2 !important;
    justify-self: center;
    align-self: center;
  }

  /* Replies: su mobile evita colonne troppo strette */
  #bbpress-forums.bbpress-wrapper div.bbp-reply-author{
    border-right: 0;
    border-bottom: 1px solid var(--pf-border);
  }
}

/* =========================================================
   bbPress replies: fix autore/avatar sovrapposti (mobile)
   ========================================================= */
@media (max-width: 767px){

  /* annulla impostazioni tema che possono rompere */
  #bbpress-forums.bbpress-wrapper .bbp-reply-author,
  #bbpress-forums.bbpress-wrapper .bbp-reply-content,
  #bbpress-forums.bbpress-wrapper .bbp-reply-author *{
    float: none !important;
  }

  /* BOX autore: avatar + testo affiancati */
  #bbpress-forums.bbpress-wrapper div.bbp-reply-author{
    display: grid !important;
    grid-template-columns: 56px 1fr;  /* avatar | testo */
    column-gap: 12px;
    align-items: center;
    padding: 14px 14px 12px !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--pf-border);
  }

  /* avatar */
  #bbpress-forums.bbpress-wrapper div.bbp-reply-author .bbp-author-avatar{
    width: 56px;
    height: 56px;
    margin: 0 !important;
  }
  #bbpress-forums.bbpress-wrapper div.bbp-reply-author .bbp-author-avatar img.avatar{
    width: 56px !important;
    height: 56px !important;
    border-radius: 999px;
    display: block;
  }

  /* testo autore (nome/ruolo) */
  #bbpress-forums.bbpress-wrapper div.bbp-reply-author .bbp-author-name,
  #bbpress-forums.bbpress-wrapper div.bbp-reply-author .bbp-author-role,
  #bbpress-forums.bbpress-wrapper div.bbp-reply-author .bbp-user-nicename{
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.25;
    min-width: 0;
    word-break: break-word;
  }

  #bbpress-forums.bbpress-wrapper div.bbp-reply-author .bbp-author-name{
    font-weight: 900;
    color: var(--pf-text);
  }

  #bbpress-forums.bbpress-wrapper div.bbp-reply-author .bbp-author-role{
    font-size: 12px;
    color: var(--pf-muted);
    margin-top: 2px !important;
  }

  /* se il tema stampa anche l’IP o info extra, non farle “spingere” layout */
  #bbpress-forums.bbpress-wrapper div.bbp-reply-author .bbp-author-ip{
    display: none !important;
  }

  /* contenuto reply: padding coerente */
  #bbpress-forums.bbpress-wrapper div.bbp-reply-content{
    padding: 14px 14px 16px !important;
  }
}

/* =========================================================
   bbPress – Topics list (dentro un forum): header + righe allineati
   Markup reale:
   ul.bbp-topics#bbp-forum-XXX
     li.bbp-header > ul.forum-titles > li...
     li.bbp-body   > ul#bbp-topic-XXX > li...
   ========================================================= */

/* DESKTOP/TABLET */
@media (min-width: 768px){

  /* HEADER: 4 colonne in una riga, niente a capo */
  #bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-header > ul.forum-titles{
    display: grid !important;
    grid-template-columns: minmax(0,1fr) 140px 90px 240px !important; /* Topic | Partecipanti | Post | Ultimo articolo */
    align-items: center !important;
    gap: 0 !important;
  }

  #bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-header > ul.forum-titles > li{
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    white-space: nowrap !important;
    line-height: 1 !important;
    text-align: center !important;
  }

  /* allinea la prima colonna a sinistra */
  #bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-header > ul.forum-titles > li.bbp-topic-title{
    justify-content: flex-start !important;
    text-align: left !important;
  }
  /* opzionale: anche "Ultimo articolo" allineato a sinistra */
  #bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-header > ul.forum-titles > li.bbp-topic-freshness{
    justify-content: flex-start !important;
    text-align: left !important;
  }

  /* RIGHE: usa la stessa griglia del header */
  #bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-body > ul[id^="bbp-topic-"]{
    display: grid !important;
    grid-template-columns: minmax(0,1fr) 140px 90px 240px !important;
    align-items: center !important;
    gap: 0 !important;
  }

  /* annulla float/width del tema sui LI riga */
  #bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-body > ul[id^="bbp-topic-"] > li{
    float: none !important;
    width: auto !important;
  }

  /* Colonne: centratura contatori */
  #bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-body > ul[id^="bbp-topic-"] > li.bbp-topic-voice-count,
  #bbpress-forums.bbpress-wrapper ul.bbp-topics > li.bbp-body > ul[id^="bbp-topic-"] > li.bbp-topic-reply-count{
    text-align: center !important;
    justify-self: center;
  }
}

/* =========================================================
   TOPIC (replies) – UI più chiara
   Markup:
   ul.bbp-replies > li.bbp-header/footer
   div.bbp-reply-header (meta)
   div.reply (contiene .bbp-reply-author + .bbp-reply-content)
   ========================================================= */

/* 1) Via la tabella "Autore/Post" in cima e in fondo */
#bbpress-forums.bbpress-wrapper ul.bbp-replies > li.bbp-header,
#bbpress-forums.bbpress-wrapper ul.bbp-replies > li.bbp-footer{
  display: none !important;
}

/* 2) Nascondi IP (rumore) */
#bbpress-forums.bbpress-wrapper .bbp-reply-ip,
#bbpress-forums.bbpress-wrapper .bbp-author-ip{
  display: none !important;
}

/* 3) Meta header (data + rispondi) più “pulito” */
#bbpress-forums.bbpress-wrapper .bbp-reply-header{
  background: #f7f7f7;
  border-top: 1px solid var(--pf-border);
  border-bottom: 1px solid var(--pf-border);
  padding: 10px 18px;
  border-radius: 12px 12px 0 0;
}

#bbpress-forums.bbpress-wrapper .bbp-reply-header .bbp-meta{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#bbpress-forums.bbpress-wrapper .bbp-reply-post-date{
  color: var(--pf-muted);
  font-weight: 700;
}

/* ID post più discreto */
#bbpress-forums.bbpress-wrapper .bbp-reply-permalink{
  color: var(--pf-muted);
  text-decoration: none;
  font-weight: 800;
}

/* 4) Evidenzia "Rispondi" e rendi gli altri link meno evidenti */
#bbpress-forums.bbpress-wrapper .bbp-admin-links{
  margin-left: auto;
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

#bbpress-forums.bbpress-wrapper .bbp-admin-links a{
  color: #888;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

#bbpress-forums.bbpress-wrapper .bbp-admin-links a.bbp-topic-reply-link,
#bbpress-forums.bbpress-wrapper .bbp-admin-links a.bbp-reply-to-link,
#bbpress-forums.bbpress-wrapper .bbp-admin-links a.bbp-reply-reply-link{
  color: #fff !important;
  background: var(--pf-red);
  border: 1px solid var(--pf-red);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
#bbpress-forums.bbpress-wrapper .bbp-admin-links a.bbp-topic-reply-link:hover{
  background: var(--pf-red-dark);
  border-color: var(--pf-red-dark);
}

/* 5) Reply body come “card” */
#bbpress-forums.bbpress-wrapper .bbp-body > .reply,
#bbpress-forums.bbpress-wrapper .bbp-body > div[class*="bbp-reply-position"]{
  background: #fff;
  border: 1px solid var(--pf-border);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 0px 1fr; /* autore | contenuto (desktop) */
}

/* Autore */
#bbpress-forums.bbpress-wrapper .bbp-reply-author{
  padding: 16px 18px;
  border-right: 1px solid var(--pf-border);
}

#bbpress-forums.bbpress-wrapper .bbp-reply-author .bbp-author-avatar img{
  border-radius: 999px;
  display: block;
}

#bbpress-forums.bbpress-wrapper .bbp-reply-author .bbp-author-name{
  display: block;
  margin-top: 10px;
  font-weight: 900;
  color: var(--pf-text);
  text-decoration: none;
}

#bbpress-forums.bbpress-wrapper .bbp-reply-author .bbp-author-role{
  margin-top: 4px;
  font-size: 12px;
  color: var(--pf-muted);
}

/* Contenuto */
#bbpress-forums.bbpress-wrapper .bbp-reply-content{
  padding: 16px 18px;
}
#bbpress-forums.bbpress-wrapper .bbp-reply-content p{
  line-height: 1.65;
  margin: 0 0 10px;
}

/* 6) Mobile: autore sopra, testo sotto (leggibilità massima) */
@media (max-width: 767px){
  #bbpress-forums.bbpress-wrapper .bbp-body > .reply,
  #bbpress-forums.bbpress-wrapper .bbp-body > div[class*="bbp-reply-position"]{
    grid-template-columns: 1fr;
  }

  #bbpress-forums.bbpress-wrapper .bbp-reply-author{
    border-right: 0;
    border-bottom: 1px solid var(--pf-border);
    display: grid;
    grid-template-columns: 56px 1fr;
    column-gap: 12px;
    align-items: center;
  }

  #bbpress-forums.bbpress-wrapper .bbp-reply-author .bbp-author-avatar img{
    width: 56px;
    height: 56px;
  }

  #bbpress-forums.bbpress-wrapper .bbp-reply-author .bbp-author-name{
    margin-top: 0;
  }
}

/* OVERRIDE HERO FORUM: titolo + cerca + accedi sulla stessa riga */
.pizza-forum-hero .pf-inner{
  position: relative;
}

.pizza-forum-hero .forum-header-line{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-right: 130px; /* spazio riservato al bottone Accedi */
  margin-bottom: 24px;
}

.pizza-forum-hero .forum-header-line h1{
  margin: 0;
}

.pizza-forum-hero .forum-search-form{
  margin-left: auto;
  width: 100%;
  max-width: 280px; /* regola se vuoi il cerca più largo o più stretto */
}

.pizza-forum-hero .pf-tabs{
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pizza-forum-hero .pf-tab{
  white-space: nowrap;
  margin: 0;
}

/* Mobile/tablet */
@media (max-width: 768px){
  .pizza-forum-hero .forum-header-line{
    padding-right: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .pizza-forum-hero .forum-search-form{
    max-width: 100%;
  }

  .pizza-forum-hero .pf-tabs{
    position: static;
    margin-top: 12px;
    justify-content: flex-start;
  }
}


/* ===== SIDEBAR FORUM - allineata alla sidebar di riferimento ===== */

.forum-sidebar-wrap{
  width: 100%;
}

/* widget sidebar */
.forum-sidebar-wrap .widget{
  margin: 0 0 30px 0;
  padding: 30px;
  background: #fff;
  border: 1px solid #e4e4e4;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

/* titolo widget */
.forum-sidebar-wrap .imo-widget-title-container{
  margin-bottom: 24px;
}

.forum-sidebar-wrap .widget-title{
  margin: 0;
  color: #111;
  font-size: 18px;
  line-height: 1.2;
  text-transform: uppercase;
}

/* liste */
.forum-sidebar-wrap .widget ul{
  margin: 0;
  padding: 0;
  list-style: none;
}

.forum-sidebar-wrap .widget ul li{
  padding: 14px 0;
  border-bottom: 1px solid #ececec;
}

.forum-sidebar-wrap .widget ul li:last-child{
  border-bottom: 0;
  padding-bottom: 0;
}

.forum-sidebar-wrap .widget a{
  color: #111;
  text-decoration: none;
}

.forum-sidebar-wrap .widget a:hover{
  color: #111;
}

/* ===== form cerca ===== */

.forum-sidebar-wrap .bbp-search-form{
  margin: 0;
}

.forum-sidebar-wrap .bbp-search-form form > div{
  display: flex;
  align-items: center;
  gap: 10px;
}

.forum-sidebar-wrap .bbp-search-form input[type="text"],
.forum-sidebar-wrap .bbp-search-form input[type="search"],
.forum-sidebar-wrap #bbp_search{
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #e3e3e3;
  border-radius: 14px;
  background: #fff;
  color: #333;
  box-shadow: none;
}

/* bottone normale: come il riferimento "spento" */
.forum-sidebar-wrap .bbp-search-form .button,
.forum-sidebar-wrap .bbp-search-form input[type="submit"],
.forum-sidebar-wrap #bbp_search_submit{
  height: 44px;
  padding: 0 18px;
  border: 1px solid #e3e3e3;
  border-radius: 14px;
  background: #f3f3f3;
  color: #dcdcdc;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
}

/* hover: qui metti la versione attiva */
.forum-sidebar-wrap .bbp-search-form .button:hover,
.forum-sidebar-wrap .bbp-search-form input[type="submit"]:hover,
.forum-sidebar-wrap #bbp_search_submit:hover{
  background: #c7463a;
  border-color: #c7463a;
  color: #fff;
}

/* focus input */
.forum-sidebar-wrap .bbp-search-form input[type="text"]:focus,
.forum-sidebar-wrap .bbp-search-form input[type="search"]:focus,
.forum-sidebar-wrap #bbp_search:focus{
  outline: none;
  border-color: #d8d8d8;
  box-shadow: none;
}

/* ===== FORM NUOVO TOPIC BBPRESS - versione lineare ===== */

#new-post{
  margin-top: 10px;
}

#new-post .bbp-form{
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

#new-post .bbp-form > div{
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 22px;
  padding: 30px 30px 22px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

/* titolo blocco */
#new-post .bbp-form legend{
  padding: 0;
  margin: 0 0 24px 6px;
  border: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  color: #111;
}

/* notice */
#new-post .bbp-template-notice{
  margin: 0 0 24px 0;
  border: 1px solid #cfe0f2;
  background: #eaf4ff;
  border-radius: 14px;
  padding: 16px 18px;
}

#new-post .bbp-template-notice ul{
  margin: 0;
  padding: 0;
  list-style: none;
}

#new-post .bbp-template-notice li{
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: #1d4f7a;
}

/* spaziature generali */
#new-post p{
  margin: 0 0 20px;
}

#new-post label{
  display: inline-block;
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 500;
  color: #666;
}

/* input testo */
#new-post input[type="text"],
#new-post input[type="url"],
#new-post input[type="email"],
#new-post input[type="search"],
#new-post input[type="password"]{
  width: 100% !important;
  height: 52px !important;
  padding: 0 16px !important;
  border: 1px solid #dddddd !important;
  border-radius: 14px !important;
  background: #fff;
  color: #333;
  box-shadow: none;
  outline: none !important;
}

#new-post input[type="text"]:focus,
#new-post input[type="url"]:focus,
#new-post input[type="email"]:focus,
#new-post input[type="search"]:focus,
#new-post input[type="password"]:focus{
  border-color: #c7463a;
}

/* editor */
#new-post .bbp-the-content-wrapper{
  margin: 0 0 20px;
}

#new-post .wp-editor-wrap,
#new-post .wp-editor-container{
  border-radius: 0;
  box-shadow: none;
}

/* toolbar quicktags */
#new-post .quicktags-toolbar{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid #dcdcdc;
  border-bottom: 0;
  background: #f7f7f7;
  border-radius: 14px 14px 0 0;
}

#new-post .quicktags-toolbar .ed_button{
  min-height: 28px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: #444;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .02em;
  box-shadow: none;
}

#new-post .quicktags-toolbar .ed_button:hover{
  color: #c7463a;
  background: transparent;
}

/* textarea */
#new-post textarea.bbp-the-content,
#new-post textarea.wp-editor-area{
  width: 100%;
  min-height: 240px;
  padding: 14px 16px;
  border: 1px solid #dcdcdc;
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background: #fff;
  color: #333;
  resize: vertical;
  box-shadow: none;
  outline: none;
}

#new-post textarea.bbp-the-content:focus,
#new-post textarea.wp-editor-area:focus{
  border-color: #c7463a;
  border-top-color: #dcdcdc;
}

/* select */
#new-post select{
  width: 100%;
  max-width: 220px;
  height: 44px !important;
  padding: 0 12px !important;
  border: 1px solid #cccccc;
  border-radius: 10px;
  background: #fff;
  color: #555;
  box-shadow: none;
  outline: none;
}

#new-post select:focus{
  border-color: #c7463a;
}

/* checkbox */
#new-post input[type="checkbox"]{
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: middle;
}

#new-post #bbp_topic_subscription + label{
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  color: #666;
}

/* submit */
#new-post .bbp-submit-wrapper{
  margin-top: 40px;
  text-align: right;
}

#new-post .button.submit,
#new-post button[type="submit"]{
  min-width: 98px;
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: #eb1c10;
  color: #fff;
  font-weight: 700;
  box-shadow: none;
  transition: .2s ease;
}

#new-post .button.submit:hover,
#new-post button[type="submit"]:hover{
  background: #c9160d;
}

/* mobile */
@media (max-width: 767px){
  #new-post .bbp-form > div{
    padding: 22px 18px 18px;
  }

  #new-post .bbp-form legend{
    font-size: 20px;
  }

  #new-post textarea.bbp-the-content,
  #new-post textarea.wp-editor-area{
    min-height: 180px;
  }

  #new-post select{
    max-width: 100%;
  }
}