/* =========================================================
   Fabio bbPress
   ========================================================= */

/* Scope général bbPress */
.bbpress,
.bbp-forum-index,
.bbp-topic-index,
.bbp-user-page,
.bbp-replies,
.bbp-single-forum,
.bbp-single-topic,
#bbpress-forums {
  color: var(--fabio-text);
}

/* Container général */
#bbpress-forums {
  margin-top: 32px;
  font-size: 16px;
  line-height: 1.7;
}

#bbpress-forums * {
  box-sizing: border-box;
}

/* Liens */
#bbpress-forums a {
  color: var(--fabio-blue);
  text-decoration: none;
  transition: color var(--fabio-transition-fast);
}

#bbpress-forums a:hover {
  color: var(--fabio-blue-hover);
  text-decoration: underline;
}

/* =========================================================
   Breadcrumb + petites actions
   ========================================================= */

#bbpress-forums .bbp-breadcrumb,
#bbpress-forums .bbp-topic-tags,
#bbpress-forums .bbp-template-notice,
#bbpress-forums .bbp-pagination,
#bbpress-forums .bbp-single-topic .bbp-topic-meta {
  margin-bottom: 20px;
}

#bbpress-forums .bbp-breadcrumb {
  font-size: 14px;
  color: var(--fabio-text-muted);
}

#bbpress-forums .bbp-breadcrumb a {
  font-weight: 500;
}

#bbpress-forums .bbp-topic-tags p {
  margin: 0;
  font-size: 14px;
  color: var(--fabio-text-soft);
}

.bbp-topic-freshness a,
.bbp-forum-freshness a {
  font-weight: 600;
}

/* Subscribe / Favorite */
#bbpress-forums .subscription-toggle,
#bbpress-forums .favorite-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  padding: 8px 14px;
  border: 1px solid var(--fabio-border);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

#bbpress-forums .subscription-toggle:hover,
#bbpress-forums .favorite-toggle:hover {
  background: #f8fafc;
  text-decoration: none;
}

/* =========================================================
   Notices / alertes / infos
   ========================================================= */

#bbpress-forums .bbp-template-notice {
  border: 1px solid var(--fabio-info-border);
  background: var(--fabio-info-bg);
  color: #334155;
  border-radius: var(--fabio-radius-sm);
  padding: 14px 16px;
  box-shadow: var(--fabio-shadow-sm);
}

#bbpress-forums .bbp-template-notice p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
}

#bbpress-forums div.indicator-hint {
  border: 1px solid #fde68a;
  background: #fefce8;
  color: #854d0e;
  border-radius: var(--fabio-radius-sm);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.7;
  box-shadow: var(--fabio-shadow-sm);
}

/* =========================================================
   Tables bbPress
   ========================================================= */

#bbpress-forums ul.bbp-forums,
#bbpress-forums ul.bbp-topics,
#bbpress-forums ul.bbp-replies {
  border: 1px solid var(--fabio-border-soft);
  border-radius: var(--fabio-radius-lg);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--fabio-shadow-sm);
  margin: 0 0 28px;
}

#bbpress-forums li.bbp-header,
#bbpress-forums li.bbp-footer {
  background: #f8fafc;
  color: var(--fabio-text);
  border-top: 0;
  font-weight: 700;
}

#bbpress-forums li.bbp-header {
  border-bottom: 1px solid var(--fabio-border);
}

#bbpress-forums li.bbp-footer {
  border-top: 1px solid var(--fabio-border);
}

#bbpress-forums li.bbp-body ul.forum,
#bbpress-forums li.bbp-body ul.topic,
#bbpress-forums li.bbp-body ul.reply {
  border-top: 1px solid var(--fabio-border-soft);
  transition: background var(--fabio-transition-fast);
}

#bbpress-forums li.bbp-body ul.forum:hover,
#bbpress-forums li.bbp-body ul.topic:hover,
#bbpress-forums li.bbp-body ul.reply:hover {
  background: #fbfdff;
}

#bbpress-forums .bbp-forum-header,
#bbpress-forums .bbp-topic-header,
#bbpress-forums .bbp-reply-header {
  background: #f8fafc;
  border-top: 1px solid var(--fabio-border-soft);
  border-bottom: 1px solid var(--fabio-border-soft);
  padding: 14px 20px;
  font-size: 14px;
  color: var(--fabio-text-muted);
}

#bbpress-forums .bbp-forum-header a,
#bbpress-forums .bbp-topic-header a,
#bbpress-forums .bbp-reply-header a {
  font-weight: 600;
}

/* Colonnes */
#bbpress-forums .bbp-forum-title,
#bbpress-forums .bbp-topic-title {
  font-size: 16px;
}

#bbpress-forums .bbp-forum-info .bbp-forum-title,
#bbpress-forums .bbp-topic-title a {
  font-weight: 700;
  line-height: 1.5;
}

#bbpress-forums .bbp-forum-info,
#bbpress-forums .bbp-topic-content,
#bbpress-forums .bbp-reply-content {
  color: var(--fabio-text);
}

#bbpress-forums .bbp-forum-content,
#bbpress-forums .bbp-topic-content p,
#bbpress-forums .bbp-reply-content p {
  color: var(--fabio-text-soft);
}

#bbpress-forums .bbp-forum-content,
#bbpress-forums .bbp-topic-content,
#bbpress-forums .bbp-reply-content {
  font-size: 15px;
  line-height: 1.85;
}

#bbpress-forums .bbp-forum-info .bbp-forum-content {
  margin-top: 10px;
}

#bbpress-forums .bbp-topic-meta {
  margin-top: 8px;
  font-size: 13px;
  color: var(--fabio-text-muted);
}

#bbpress-forums .bbp-topic-meta a {
  font-weight: 600;
}

/* Dernier post / freshness */
#bbpress-forums .bbp-topic-freshness,
#bbpress-forums .bbp-forum-freshness {
  font-size: 14px;
  color: var(--fabio-text-soft);
}

#bbpress-forums .bbp-topic-freshness .bbp-author-avatar,
#bbpress-forums .bbp-forum-freshness .bbp-author-avatar {
  vertical-align: middle;
  border-radius: 999px;
  margin-right: 6px;
}

/* =========================================================
   Forum / Topic unique
   ========================================================= */

#bbpress-forums .bbp-topic-form,
#bbpress-forums .bbp-reply-form,
#bbpress-forums .bbp-login-form,
#bbpress-forums fieldset.bbp-form {
  border: 1px solid var(--fabio-border-soft);
  border-radius: var(--fabio-radius-lg);
  background: #fff;
  padding: 24px;
  box-shadow: var(--fabio-shadow-sm);
}

#bbpress-forums fieldset.bbp-form legend {
  padding: 0 10px;
  font-size: 24px;
  font-weight: 700;
  color: var(--fabio-text);
}

#bbpress-forums .bbp-topic-form,
#bbpress-forums .bbp-reply-form,
#bbpress-forums .bbp-login-form {
  margin-top: 28px;
}

#bbpress-forums .bbp-topic-content ul,
#bbpress-forums .bbp-reply-content ul,
#bbpress-forums .bbp-topic-content ol,
#bbpress-forums .bbp-reply-content ol {
  margin: 16px 0 16px 22px;
}

#bbpress-forums .bbp-topic-content strong,
#bbpress-forums .bbp-reply-content strong {
  color: var(--fabio-text);
}

/* =========================================================
   Auteur / avatar / contenu reply-topic
   ========================================================= */

#bbpress-forums .bbp-body div.bbp-reply-author,
#bbpress-forums .bbp-body div.bbp-topic-author {
  width: 180px;
  padding: 24px 20px;
  text-align: center;
  border-right: 1px solid var(--fabio-border-soft);
  background: #fcfdff;
}

#bbpress-forums .bbp-body div.bbp-reply-content,
#bbpress-forums .bbp-body div.bbp-topic-content {
  margin-left: 180px;
  padding: 32px;
}

#bbpress-forums .bbp-author-avatar img {
  border-radius: 999px;
  box-shadow: var(--fabio-shadow-sm);
}

#bbpress-forums .bbp-author-name {
  display: block;
  margin-top: 10px;
  font-weight: 700;
  color: var(--fabio-text);
}

#bbpress-forums .bbp-author-role,
#bbpress-forums .bbp-author-ip {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--fabio-text-muted);
}

#bbpress-forums .bbp-topic-post-date,
#bbpress-forums .bbp-reply-post-date {
  font-weight: 500;
}

#bbpress-forums .bbp-topic-permalink,
#bbpress-forums .bbp-reply-permalink {
  font-weight: 700;
}

/* Actions admin / reply links */
#bbpress-forums .bbp-topic-header .bbp-admin-links,
#bbpress-forums .bbp-reply-header .bbp-admin-links {
  float: right;
  color: var(--fabio-text-muted);
  font-size: 12px;
}

#bbpress-forums .bbp-admin-links a {
  font-weight: 600;
}

/* =========================================================
   Pagination / counts
   ========================================================= */

#bbpress-forums .bbp-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 24px;
  font-size: 14px;
  color: var(--fabio-text-soft);
}

#bbpress-forums .bbp-pagination-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#bbpress-forums .bbp-pagination-links .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--fabio-border);
  background: #fff;
  color: var(--fabio-text);
  font-weight: 600;
  text-decoration: none;
}

#bbpress-forums .bbp-pagination-links .page-numbers.current,
#bbpress-forums .bbp-pagination-links .page-numbers:hover {
  background: var(--fabio-blue);
  border-color: var(--fabio-blue);
  color: #fff;
  text-decoration: none;
}

/* =========================================================
   Search bbPress
   ========================================================= */

#bbpress-forums #bbp-search-form {
  margin: 0 0 24px;
}

#bbpress-forums #bbp-search-form > div {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

#bbpress-forums #bbp_search,
#bbpress-forums input[type="text"],
#bbpress-forums input[type="password"],
#bbpress-forums input[type="email"],
#bbpress-forums input[type="url"],
#bbpress-forums select,
#bbpress-forums textarea {
  width: 100%;
  border: 1px solid var(--fabio-border);
  border-radius: 16px;
  background: #fff;
  color: var(--fabio-text);
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.5;
  transition: border-color var(--fabio-transition-fast), box-shadow var(--fabio-transition-fast);
}

#bbpress-forums textarea {
  min-height: 220px;
  resize: vertical;
}

#bbpress-forums #bbp_search:focus,
#bbpress-forums input[type="text"]:focus,
#bbpress-forums input[type="password"]:focus,
#bbpress-forums input[type="email"]:focus,
#bbpress-forums input[type="url"]:focus,
#bbpress-forums select:focus,
#bbpress-forums textarea:focus {
  outline: none;
  border-color: var(--fabio-blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* Boutons */
#bbpress-forums button,
#bbpress-forums input[type="submit"],
#bbpress-forums .button,
#bbpress-forums .bbp-submit-wrapper button,
#bbpress-forums .bbp-submit-wrapper input {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 24px;
  border-radius: 20px;
  border: 1px solid transparent;
  background: var(--fabio-blue);
  color: #fff;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform var(--fabio-transition-fast), background var(--fabio-transition-fast);
  box-shadow: var(--fabio-shadow-blue);
}

#bbpress-forums button:hover,
#bbpress-forums input[type="submit"]:hover,
#bbpress-forums .button:hover,
#bbpress-forums .bbp-submit-wrapper button:hover,
#bbpress-forums .bbp-submit-wrapper input:hover {
  background: var(--fabio-blue-hover);
  transform: translateY(-1px);
}

/* Login form */
#bbpress-forums .bbp-login-form fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

#bbpress-forums .bbp-login-form .bbp-username,
#bbpress-forums .bbp-login-form .bbp-password,
#bbpress-forums .bbp-login-form .bbp-remember-me,
#bbpress-forums .bbp-login-form .bbp-submit-wrapper {
  margin-bottom: 18px;
}

#bbpress-forums .bbp-login-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--fabio-text);
}

#bbpress-forums .bbp-login-form .bbp-remember-me label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 500;
  color: var(--fabio-text-soft);
}

#bbpress-forums .bbp-login-form input[type="checkbox"],
#bbpress-forums .bbp-topic-form input[type="checkbox"],
#bbpress-forums .bbp-reply-form input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--fabio-blue);
}

/* =========================================================
   Toolbar éditeur bbPress
   ========================================================= */

#bbpress-forums div.quicktags-toolbar {
  padding: 10px 12px;
  border: 1px solid var(--fabio-border);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  background: #f8fafc;
}

#bbpress-forums div.quicktags-toolbar input.button.button-small {
  min-height: auto;
  padding: 6px 10px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  color: var(--fabio-text-soft);
  font-size: 12px;
  font-weight: 700;
}

#bbpress-forums div.quicktags-toolbar input.button.button-small:hover {
  background: #fff;
  border-color: var(--fabio-border);
  color: var(--fabio-text);
  transform: none;
}

#bbpress-forums .wp-editor-container textarea,
#bbpress-forums textarea.bbp-the-content {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* =========================================================
   Formulaires topic / reply
   ========================================================= */

#bbpress-forums .bbp-form p {
  margin-bottom: 18px;
}

#bbpress-forums .bbp-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--fabio-text);
}

#bbpress-forums .bbp-submit-wrapper {
  margin-top: 20px;
  text-align: right;
}

#bbpress-forums .bbp-form select {
  max-width: 320px;
}

#bbpress-forums .bbp-the-content-wrapper {
  margin-top: 6px;
}

/* =========================================================
   Avatars mini + meta
   ========================================================= */

#bbpress-forums img.avatar {
  border-radius: 999px;
}

#bbpress-forums .bbp-author-avatar,
#bbpress-forums .bbp-topic-started-by img,
#bbpress-forums .bbp-topic-freshness-author img {
  vertical-align: middle;
}

/* =========================================================
   États vides
   ========================================================= */

#bbpress-forums .bbp-no-reply,
#bbpress-forums .bbp-no-topic,
#bbpress-forums .bbp-forum-content p:last-child,
#bbpress-forums .bbp-topic-content p:last-child,
#bbpress-forums .bbp-reply-content p:last-child {
  margin-bottom: 0;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1024px) {
  #bbpress-forums .bbp-body div.bbp-reply-author,
  #bbpress-forums .bbp-body div.bbp-topic-author {
    width: 150px;
  }

  #bbpress-forums .bbp-body div.bbp-reply-content,
  #bbpress-forums .bbp-body div.bbp-topic-content {
    margin-left: 150px;
    padding: 24px;
  }
}

@media (max-width: 768px) {
  #bbpress-forums {
    font-size: 15px;
  }

  #bbpress-forums .bbp-pagination {
    flex-direction: column;
    align-items: flex-start;
  }

  #bbpress-forums .bbp-body div.bbp-topic-author,
  #bbpress-forums .bbp-body div.bbp-reply-author {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--fabio-border-soft);
    text-align: left;
    padding: 20px;
  }

  #bbpress-forums .bbp-body div.bbp-topic-content,
  #bbpress-forums .bbp-body div.bbp-reply-content {
    margin-left: 0;
    padding: 20px;
  }

  #bbpress-forums li.bbp-header {
    display: none;
  }

  #bbpress-forums ul.forum,
  #bbpress-forums ul.topic {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 18px 16px;
  }

  #bbpress-forums ul.forum li,
  #bbpress-forums ul.topic li {
    width: 100%;
    margin: 0;
    text-align: left;
  }

  #bbpress-forums .bbp-forum-info,
  #bbpress-forums .bbp-topic-title {
    margin-bottom: 8px;
  }

  #bbpress-forums .bbp-topic-voice-count::before {
    content: "Voices: ";
    font-weight: 700;
    color: var(--fabio-text);
  }

  #bbpress-forums .bbp-topic-reply-count::before {
    content: "Posts: ";
    font-weight: 700;
    color: var(--fabio-text);
  }

  #bbpress-forums .bbp-forum-topic-count::before {
    content: "Topics: ";
    font-weight: 700;
    color: var(--fabio-text);
  }

  #bbpress-forums .bbp-forum-reply-count::before {
    content: "Posts: ";
    font-weight: 700;
    color: var(--fabio-text);
  }

  #bbpress-forums .bbp-topic-freshness::before,
  #bbpress-forums .bbp-forum-freshness::before {
    content: "Last post: ";
    display: inline-block;
    margin-right: 4px;
    font-weight: 700;
    color: var(--fabio-text);
  }

  #bbpress-forums .bbp-topic-form,
  #bbpress-forums .bbp-reply-form,
  #bbpress-forums .bbp-login-form,
  #bbpress-forums fieldset.bbp-form {
    padding: 20px;
    border-radius: 24px;
  }

  #bbpress-forums .bbp-submit-wrapper {
    text-align: left;
  }

  #bbpress-forums button,
  #bbpress-forums input[type="submit"],
  #bbpress-forums .button,
  #bbpress-forums .bbp-submit-wrapper button,
  #bbpress-forums .bbp-submit-wrapper input {
    width: 100%;
  }
}