/* FHNB Chapter Discussions: scoped to bbPress, mobile friendly. */
#bbpress-forums {
  --fhnb-accent: var(--e-global-color-primary, #34338f);
  --fhnb-border: #dfe5ea;
  --fhnb-muted: #5d6977;
  font-size: 15px;
  line-height: 1.55;
  color: #303943;
  width: 100%;
  max-width: 100%;
  overflow-wrap: anywhere;
}
#bbpress-forums * { box-sizing: border-box; }
#bbpress-forums a { color: var(--fhnb-accent); }
#bbpress-forums .bbp-breadcrumb, #bbpress-forums .bbp-template-notice,
#bbpress-forums .bbp-pagination { font-size: 13px; }
#bbpress-forums .bbp-template-notice { border-radius: 8px; padding: 10px 14px; }
#bbpress-forums ul.bbp-forums, #bbpress-forums ul.bbp-topics,
#bbpress-forums ul.bbp-replies { border: 1px solid var(--fhnb-border); border-radius: 10px; overflow: hidden; }
#bbpress-forums li.bbp-header { background: #edf3f6; border-color: var(--fhnb-border); padding: 12px 16px; }
#bbpress-forums li.bbp-footer { display: none; }
#bbpress-forums li.bbp-body ul.forum, #bbpress-forums li.bbp-body ul.topic,
#bbpress-forums li.bbp-body div.hentry { background: #fff; border-color: var(--fhnb-border); padding: 14px 16px; }
#bbpress-forums li.bbp-body ul.forum:nth-child(even),
#bbpress-forums li.bbp-body ul.topic:nth-child(even) { background: #f9fbfc; }
#bbpress-forums .bbp-forum-title, #bbpress-forums .bbp-topic-permalink { font-weight: 700; font-size: 15px; text-decoration: none; }
#bbpress-forums .bbp-topic-meta, #bbpress-forums .bbp-forum-content,
#bbpress-forums .bbp-topic-started-by, #bbpress-forums .bbp-topic-freshness-author { color: var(--fhnb-muted); font-size: 12px; }
#bbpress-forums div.bbp-topic-author, #bbpress-forums div.bbp-reply-author { width: 145px; padding: 4px 12px 4px 0; text-align: left; }
#bbpress-forums div.bbp-topic-content, #bbpress-forums div.bbp-reply-content { margin-left: 155px; padding: 6px 0; font-size: 15px; line-height: 1.65; min-height: 70px; }
#bbpress-forums div.bbp-topic-author .bbp-author-avatar, #bbpress-forums div.bbp-reply-author .bbp-author-avatar { display: block; margin-bottom: 6px; }
#bbpress-forums div.bbp-topic-author img.avatar, #bbpress-forums div.bbp-reply-author img.avatar { width: 44px; height: 44px; border-radius: 50%; margin: 0; float: none; }
#bbpress-forums div.bbp-topic-author a.bbp-author-name, #bbpress-forums div.bbp-reply-author a.bbp-author-name { display: block; clear: none; font-size: 14px; line-height: 1.3; font-weight: 700; text-decoration: none; word-break: break-word; }
#bbpress-forums .bbp-author-role { display: none; }
#bbpress-forums .fhnb-discussions-author-chapter { color: var(--fhnb-muted); font-size: 12px; margin-top: 5px; overflow-wrap: anywhere; }
#bbpress-forums div.bbp-topic-header, #bbpress-forums div.bbp-reply-header { background: #f5f7f9; border-color: var(--fhnb-border); padding: 9px 14px; font-size: 12px; }
#bbpress-forums .bbp-topic-content p, #bbpress-forums .bbp-reply-content p { margin: 0 0 12px; }
#bbpress-forums .bbp-topic-content p:last-child, #bbpress-forums .bbp-reply-content p:last-child { margin-bottom: 0; }
#bbpress-forums fieldset.bbp-form { border: 1px solid var(--fhnb-border); border-radius: 10px; padding: 18px; margin-top: 18px; }
#bbpress-forums fieldset.bbp-form legend { font-size: 16px; font-weight: 700; padding: 0 6px; }
#bbpress-forums fieldset.bbp-form label { font-size: 14px; }
#bbpress-forums fieldset.bbp-form input[type="text"],
#bbpress-forums fieldset.bbp-form input[type="email"],
#bbpress-forums fieldset.bbp-form select,
#bbpress-forums fieldset.bbp-form textarea { width: 100%; max-width: 100%; padding: 10px 12px; border: 1px solid #cbd4dc; border-radius: 6px; background: #fff; color: #303943; font-size: 15px; }
#bbpress-forums fieldset.bbp-form textarea { min-height: 155px; resize: vertical; }
#bbpress-forums .quicktags-toolbar { background: #f5f7f9; border: 1px solid var(--fhnb-border); border-bottom: 0; border-radius: 6px 6px 0 0; padding: 5px; }
#bbpress-forums .wp-editor-container { border-color: var(--fhnb-border); }
#bbpress-forums input[type="submit"], #bbpress-forums button[type="submit"] { background: var(--fhnb-accent); border: 1px solid var(--fhnb-accent); border-radius: 6px; color: #fff; padding: 10px 20px; font-size: 14px; font-weight: 700; cursor: pointer; }
#bbpress-forums input[type="submit"]:hover, #bbpress-forums button[type="submit"]:hover { filter: brightness(.88); }
#bbpress-forums input:focus-visible, #bbpress-forums textarea:focus-visible, #bbpress-forums button:focus-visible, #bbpress-forums a:focus-visible { outline: 2px solid var(--fhnb-accent); outline-offset: 2px; }
#bbpress-forums .bbp-topic-tags { display: none; }
@media (max-width: 640px) {
  #bbpress-forums { font-size: 14px; }
  #bbpress-forums li.bbp-header, #bbpress-forums li.bbp-body div.hentry { padding: 10px; }
  #bbpress-forums div.bbp-topic-author, #bbpress-forums div.bbp-reply-author { float: none; width: 100%; min-height: 0; padding: 0 0 10px; text-align: left; border-bottom: 1px solid var(--fhnb-border); margin-bottom: 10px; }
  #bbpress-forums div.bbp-topic-author .bbp-author-avatar, #bbpress-forums div.bbp-reply-author .bbp-author-avatar { float: left; margin: 0 10px 0 0; }
  #bbpress-forums div.bbp-topic-author img.avatar, #bbpress-forums div.bbp-reply-author img.avatar { width: 36px; height: 36px; }
  #bbpress-forums div.bbp-topic-content, #bbpress-forums div.bbp-reply-content { margin-left: 0; padding: 0; clear: both; min-height: 0; }
  #bbpress-forums fieldset.bbp-form { padding: 12px; }
  #bbpress-forums fieldset.bbp-form textarea { min-height: 120px; }
  #bbpress-forums .bbp-reply-ip { display: none; }
}

/* v0.3.1: compact bbPress topic/reply header and author columns. */
#bbpress-forums ul.bbp-replies > li.bbp-header { padding: 9px 14px !important; min-height: 0 !important; line-height: 1.5; }
#bbpress-forums ul.bbp-replies > li.bbp-header .bbp-reply-author,
#bbpress-forums ul.bbp-replies > li.bbp-header .bbp-reply-content { padding: 0 !important; margin: 0 !important; min-height: 0 !important; }
#bbpress-forums div.bbp-topic-author,
#bbpress-forums div.bbp-reply-author { min-height: 0 !important; }
#bbpress-forums div.bbp-topic-content,
#bbpress-forums div.bbp-reply-content { min-height: 0; }
/* IP addresses are not helpful in the public-facing discussion experience. */
#bbpress-forums .bbp-reply-ip,
#bbpress-forums .bbp-topic-ip { display: none !important; }
/* Don't show administrator-only unrestricted HTML notice in discussion forms. */
#bbpress-forums .bbp-template-notice.bbp-admin-links { display: none; }
#bbpress-forums fieldset.bbp-form > div.bbp-template-notice.warning { font-size: 13px; }
#bbpress-forums .bbp-topic-admin-links,
#bbpress-forums .bbp-reply-admin-links { font-size: 11px; opacity: .65; }
#bbpress-forums .bbp-topic-admin-links:hover,
#bbpress-forums .bbp-reply-admin-links:hover { opacity: 1; }
@media (max-width: 640px) {
  #bbpress-forums ul.bbp-replies > li.bbp-header .bbp-reply-author,
  #bbpress-forums ul.bbp-replies > li.bbp-header .bbp-reply-content { width: auto; float: none; }
}


/* FHNB Chapter Portal layout — Elementor controls the outer page width. */
.fhnb-portal-layout { --fhnb-accent: var(--e-global-color-primary, #34338f); display: grid; grid-template-columns: minmax(190px, 245px) minmax(0,1fr); gap: 26px; align-items: start; width: 100%; max-width: 100%; }
.fhnb-portal-sidebar { width: 100%; max-width: 100%; padding: 22px 16px; border: 1px solid #dfe5ea; border-radius: 12px; background: #f5f8fa; }
.fhnb-portal-sidebar-heading { font-size: 19px; font-weight: 750; line-height: 1.3; margin-bottom: 9px; color: #303943; }
.fhnb-portal-chapter { font-size: 13px; color: #647181; margin-bottom: 20px; }
.fhnb-portal-links { display: flex; flex-direction: column; gap: 5px; }
.fhnb-portal-links a { display: block; border-radius: 7px; padding: 10px 12px; color: #303943; text-decoration: none; font-size: 15px; font-weight: 650; }
.fhnb-portal-links a:hover { background: #e8edf2; color: var(--fhnb-accent); }
.fhnb-portal-links a[aria-current="page"] { background: var(--fhnb-accent); color: #fff; }
.fhnb-portal-links a:focus-visible, .fhnb-portal-primary-link:focus-visible { outline: 2px solid var(--fhnb-accent); outline-offset: 3px; }
.fhnb-portal-main { min-width: 0; width: 100%; max-width: 100%; }
.fhnb-portal-welcome { padding: 4px 0 25px; }
.fhnb-portal-welcome h2 { margin: 0 0 14px; font-size: clamp(25px, 3vw, 34px); line-height: 1.2; }
.fhnb-portal-welcome p { margin: 0 0 22px; line-height: 1.7; }
.fhnb-portal-primary-link { display: inline-block; padding: 12px 18px; border-radius: 7px; color: #fff !important; background: var(--fhnb-accent); text-decoration: none !important; font-weight: 700; }
.fhnb-portal-primary-link:hover { filter: brightness(.9); }
@media(max-width: 767px) { .fhnb-portal-layout { grid-template-columns: 1fr; gap: 18px; } .fhnb-portal-sidebar { padding: 15px; } .fhnb-portal-links { flex-direction: row; flex-wrap: wrap; } .fhnb-portal-links a { padding: 9px 11px; } }

/* v0.4.1: consistent topic navigation, inside WordPress's existing topic template. */
.fhnb-portal-topic-back { margin: 0 0 16px !important; font-size: 14px; }
.fhnb-portal-topic-back a { color: var(--e-global-color-primary, #34338f); font-weight: 700; text-decoration: none; }
.fhnb-portal-topic-back a:hover { text-decoration: underline; }
.fhnb-portal-main > #bbpress-forums { max-width: 100%; }

/* v0.4.2: consistent sidebar on native single topic routes. */
#bbpress-forums .fhnb-portal-topic-layout { display:grid; grid-template-columns:minmax(200px, 275px) minmax(0, 1fr); gap:30px; align-items:start; width:100%; max-width:100%; }
#bbpress-forums .fhnb-portal-topic-layout .fhnb-portal-main { min-width:0; width:100%; }
#bbpress-forums .fhnb-portal-topic-layout .fhnb-portal-sidebar { box-sizing:border-box; }
@media(max-width:767px) { #bbpress-forums .fhnb-portal-topic-layout { grid-template-columns:minmax(0,1fr); gap:18px; } }

/* v0.4.3: native bbPress topics should match Chapter Portal navigation.
   bbPress's default link color was overriding the active white label. */
#bbpress-forums .fhnb-portal-topic-layout .fhnb-portal-links a[aria-current="page"],
#bbpress-forums .fhnb-portal-topic-layout .fhnb-portal-links a[aria-current="page"]:link,
#bbpress-forums .fhnb-portal-topic-layout .fhnb-portal-links a[aria-current="page"]:visited,
#bbpress-forums .fhnb-portal-topic-layout .fhnb-portal-links a[aria-current="page"]:hover,
#bbpress-forums .fhnb-portal-topic-layout .fhnb-portal-links a[aria-current="page"]:focus {
  color: #fff !important;
  background-color: var(--fhnb-accent, #34338f);
}

/* v0.4.4: Move the native topic heading into the portal content column.
   The JavaScript moves the existing H1, preserving its text and semantics. */
body.single-topic #bbpress-forums .fhnb-portal-topic-title {
  margin: 0 0 18px !important;
  padding: 0;
  max-width: 100%;
  font-size: clamp(26px, 2.7vw, 36px);
  line-height: 1.2;
  color: #303943;
}
body.single-topic .fhnb-portal-relocated-heading { display: none !important; }
@media (max-width: 767px) {
  body.single-topic #bbpress-forums .fhnb-portal-topic-title { font-size: clamp(25px, 6vw, 32px); }
}

/* v0.4.5: dedicated Chapter Leader login form. */
.fhnb-portal-login { width:100%; max-width:480px; margin: 12px auto 38px; padding:28px; background:#f5f8fa; border:1px solid #dfe5ea; border-radius:12px; color:#303943; }
.fhnb-portal-login h2 { font-size:clamp(25px,3vw,32px); margin:0 0 12px; }
.fhnb-portal-login p { line-height:1.6; }
.fhnb-portal-login-form { display:flex; flex-direction:column; gap:10px; }
.fhnb-portal-login-form > label:not(.fhnb-portal-login-remember) { font-weight:650; margin-top:9px; }
.fhnb-portal-login-form > input { width:100%; border:1px solid #cbd4dc; border-radius:7px; padding:12px; background:#fff; min-height:44px; }
.fhnb-portal-login-remember { display:flex; align-items:center; gap:8px; margin:10px 0 4px; }
.fhnb-portal-login-form button { width:100%; border-radius:7px; border:0; padding:13px 18px; font-weight:700; color:#fff; background:var(--e-global-color-primary,#34338f); cursor:pointer; }
.fhnb-portal-login-form button:hover { filter:brightness(.9); }
.fhnb-portal-login-help { margin:15px 0 0; }
.fhnb-portal-login-error { border:1px solid #e4b8b8; background:#fff1f1; padding:12px; border-radius:6px; }
@media(max-width:600px){ .fhnb-portal-login { padding:18px; } }

/* v0.4.9: usable, compact bbPress visual editor in the portal. */
#bbpress-forums .wp-editor-wrap { max-width: 100%; width: 100%; }
#bbpress-forums .wp-editor-container { border: 1px solid #dfe5ea; border-radius: 0 0 8px 8px; overflow: hidden; }
#bbpress-forums .mce-toolbar-grp { background: #f5f8fa; border-bottom: 1px solid #dfe5ea; }
#bbpress-forums .mce-tinymce { border: 0; box-shadow: none; }
#bbpress-forums .wp-editor-area { min-height: 150px; }


/* v0.5.0: keep Elementor global button rules out of the TinyMCE toolbar. */
#bbpress-forums .mce-toolbar .mce-btn,
#bbpress-forums .mce-toolbar .mce-btn button,
#bbpress-forums .mce-toolbar .mce-btn:not(.mce-disabled) button {
  background: #fff !important;
  background-image: none !important;
  color: #303943 !important;
  border-radius: 4px;
  box-shadow: none !important;
  text-shadow: none !important;
}
#bbpress-forums .mce-toolbar .mce-btn {
  border: 1px solid #cbd4dc !important;
  margin: 2px !important;
}
#bbpress-forums .mce-toolbar .mce-btn button {
  padding: 6px 8px !important;
  min-width: 28px;
  min-height: 28px;
  border: 0 !important;
}
#bbpress-forums .mce-toolbar .mce-btn .mce-ico,
#bbpress-forums .mce-toolbar .mce-btn .mce-txt {
  color: #303943 !important;
  text-shadow: none !important;
}
#bbpress-forums .mce-toolbar .mce-btn:hover,
#bbpress-forums .mce-toolbar .mce-btn:hover button,
#bbpress-forums .mce-toolbar .mce-btn.mce-active,
#bbpress-forums .mce-toolbar .mce-btn.mce-active button {
  background: #e9eef5 !important;
}
#bbpress-forums .mce-toolbar .mce-btn.mce-disabled,
#bbpress-forums .mce-toolbar .mce-btn.mce-disabled button {
  background: #f3f5f7 !important;
  cursor: default;
}
#bbpress-forums .mce-toolbar .mce-btn.mce-disabled .mce-ico {
  color: #9ca5af !important;
}
