.ch-forums-core-shell,
.ch-forums-page {
  width: min(100%, 980px);
  margin: 0 auto;
  box-sizing: border-box;
}

.ch-forums-page *,
.ch-forums-page *::before,
.ch-forums-page *::after { box-sizing: border-box; }

.ch-forums-page { color: #1f2937; }
.ch-forums-page a { color: inherit; }

.ch-forums-page-header,
.ch-forum-row,
.ch-forum-topic-row,
.ch-forum-post-card,
.ch-forum-composer,
.ch-forums-empty,
.ch-forum-login-note {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 14px;
}

.ch-forums-page-header { padding: 22px; margin-bottom: 16px; }
.ch-forums-page-header h1 { margin: 4px 0 6px; font-size: clamp(1.55rem, 3vw, 2rem); line-height: 1.1; }
.ch-forums-page-header p { margin: 0; color: #6b7280; }
.ch-forums-eyebrow { display: block; color: #6b7280; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.ch-forums-list,
.ch-forum-topic-list,
.ch-topic-thread { display: grid; gap: 10px; }

.ch-forum-row { overflow: hidden; }
.ch-forum-row-main { display: flex; align-items: center; gap: 14px; padding: 16px; text-decoration: none; }
.ch-forum-row-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; background: #f3f4f6; font-weight: 900; }
.ch-forum-row-copy { display: grid; gap: 3px; min-width: 0; }
.ch-forum-row-copy strong { font-size: 1rem; }
.ch-forum-row-copy span,
.ch-forum-row-copy small { color: #6b7280; }
.ch-forum-row-stats { display: flex; gap: 18px; padding: 0 16px 14px 72px; }
.ch-forum-row-stats span { display: grid; font-size: .72rem; color: #6b7280; }
.ch-forum-row-stats strong { color: #111827; font-size: .9rem; }
.ch-forum-children { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 16px 72px; }
.ch-forum-children a,
.ch-forum-group-link { border: 1px solid #e5e7eb; border-radius: 999px; padding: 6px 10px; text-decoration: none; font-size: .78rem; }

.ch-forums-breadcrumb { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: 0 0 12px; color: #6b7280; font-size: .8rem; }
.ch-forums-breadcrumb a { text-decoration: none; font-weight: 700; }

.ch-forum-composer { display: grid; gap: 12px; padding: 16px; margin-bottom: 16px; }
.ch-forum-composer-heading { display: grid; gap: 2px; }
.ch-forum-composer-heading span { color: #6b7280; font-size: .82rem; }
.ch-forum-composer label { display: grid; gap: 6px; font-weight: 700; font-size: .82rem; }
.ch-forum-composer input,
.ch-forum-composer textarea { width: 100%; border: 1px solid #d1d5db; border-radius: 10px; padding: 10px 12px; background: #fff; color: #111827; font: inherit; }
.ch-forum-composer textarea { resize: vertical; min-height: 110px; }
.ch-forum-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.ch-forum-form-actions button { border: 0; border-radius: 999px; padding: 9px 15px; background: #2563eb; color: #fff; font-weight: 800; cursor: pointer; }
.ch-forum-form-actions button:disabled { opacity: .6; cursor: wait; }
.ch-forum-form-status { margin-right: auto; color: #64748b; font-size: .8rem; }
.ch-forum-form-status.is-error { color: #b91c1c; }

.ch-forum-topic-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; }
.ch-forum-topic-main { display: flex; align-items: center; gap: 11px; min-width: 0; text-decoration: none; }
.ch-forum-topic-avatar img,
.ch-forum-post-avatar img { display: block; border-radius: 50%; }
.ch-forum-topic-copy { display: grid; gap: 3px; min-width: 0; }
.ch-forum-topic-copy strong { overflow-wrap: anywhere; }
.ch-forum-topic-copy span { color: #6b7280; font-size: .76rem; }
.ch-forum-topic-meta { display: grid; min-width: 90px; justify-items: end; color: #6b7280; font-size: .72rem; }
.ch-forum-topic-meta strong { color: #111827; font-size: .9rem; }
.ch-forum-topic-meta small { margin-top: 3px; }

.ch-forum-post-card { padding: 16px; }
.ch-forum-post-author { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ch-forum-post-author > div { display: grid; gap: 1px; }
.ch-forum-post-author a { text-decoration: none; }
.ch-forum-post-author span { color: #6b7280; font-size: .74rem; }
.ch-forum-original-post { margin-left: auto; border-radius: 999px; padding: 5px 8px; background: #f3f4f6; font-weight: 800; }
.ch-forum-post-content { overflow-wrap: anywhere; line-height: 1.6; }
.ch-forum-post-content > :first-child { margin-top: 0; }
.ch-forum-post-content > :last-child { margin-bottom: 0; }
.ch-forums-empty,
.ch-forum-login-note { padding: 22px; text-align: center; }
.ch-forums-empty h1,
.ch-forums-empty h2 { margin-top: 0; }
.ch-forums-empty p,
.ch-forum-login-note { color: #6b7280; }

@media (max-width: 700px) {
  .ch-forums-page-header { padding: 17px; }
  .ch-forum-row-main { padding: 14px; }
  .ch-forum-row-stats,
  .ch-forum-children { padding-left: 14px; }
  .ch-forum-topic-row { align-items: flex-start; }
  .ch-forum-topic-meta small { display: none; }
}

/* v1.0.13 forum detail compatibility + subforum presentation */
.ch-forum-header-stats { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.ch-forum-header-stats span { display:inline-flex; align-items:baseline; gap:5px; padding:6px 9px; border:1px solid #e5e7eb; border-radius:999px; background:#f8fafc; color:#64748b; font-size:.76rem; }
.ch-forum-header-stats strong { color:#111827; }
.ch-forum-section { display:grid; gap:10px; margin-bottom:16px; }
.ch-forum-section-heading { display:flex; align-items:end; justify-content:space-between; gap:12px; padding:0 2px; }
.ch-forum-section-heading > div { display:grid; gap:2px; }
.ch-forum-section-heading span { color:#64748b; font-size:.7rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.ch-forum-section-heading h2 { margin:0; font-size:1.08rem; line-height:1.25; }
.ch-forum-section-heading > strong { display:grid; place-items:center; min-width:32px; height:28px; padding:0 8px; border:1px solid #dbeafe; border-radius:999px; background:#eff6ff; color:#2563eb; font-size:.78rem; }

/* v1.0.14 forum image compatibility
   BuddyBoss stores forum pictures as featured images and may fall back to
   linked BuddyPress group cover/avatar media. CommunityHub renders those
   sources without requiring the CommunityHub Theme. */
.ch-forum-row-media {
  display: block;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  overflow: hidden;
  border-radius: 14px;
  background: #eef2f7;
}
.ch-forum-row-media img,
.ch-forum-row-media .avatar,
.ch-forum-header-cover img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  border: 0;
}
.ch-forum-single-header.has-forum-image {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  align-items: flex-end;
  padding: 0;
  background: #111827;
}
.ch-forum-header-cover {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.ch-forum-header-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, .90) 0%, rgba(15, 23, 42, .48) 58%, rgba(15, 23, 42, .12) 100%);
}
.ch-forum-header-content {
  position: relative;
  z-index: 1;
  width: 100%;
}
.ch-forum-single-header.has-forum-image .ch-forum-header-content {
  padding: 24px;
  color: #fff;
}
.ch-forum-single-header.has-forum-image h1,
.ch-forum-single-header.has-forum-image .ch-forums-eyebrow,
.ch-forum-single-header.has-forum-image p {
  color: inherit;
}
.ch-forum-single-header.has-forum-image .ch-forum-header-stats span,
.ch-forum-single-header.has-forum-image .ch-forum-group-link {
  border-color: rgba(255,255,255,.24);
  background: rgba(15,23,42,.46);
  color: #fff;
  backdrop-filter: blur(8px);
}
.ch-forum-single-header.has-forum-image .ch-forum-header-stats strong {
  color: #fff;
}

@media (max-width: 700px) {
  .ch-forum-row-media {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
    border-radius: 12px;
  }
  .ch-forum-single-header.has-forum-image {
    min-height: 190px;
  }
  .ch-forum-single-header.has-forum-image .ch-forum-header-content {
    padding: 18px;
  }
}



/* v1.0.15 engagement + moderation */
.ch-forum-header-actions,.ch-forum-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.ch-forum-action-button{appearance:none;border:1px solid #d7dee8;background:#fff;color:#243244;border-radius:999px;padding:8px 12px;font:inherit;font-weight:700;line-height:1;cursor:pointer}.ch-forum-action-button:hover{border-color:#9fb2c8;background:#f6f9fc}.ch-forum-action-button.is-active{border-color:#8fb4ef;background:#edf5ff;color:#1459a6}.ch-forum-action-button.is-danger{color:#a62b2b}.ch-forum-action-button:disabled{opacity:.55;cursor:wait}.ch-forum-action-icon{margin-right:5px}.ch-forum-action-status{font-size:13px}.ch-topic-header{gap:16px}.ch-topic-header .ch-forum-actions{justify-content:flex-end}.ch-forum-header-actions{margin-top:14px}.ch-group-forum-panel{display:grid;gap:18px}.ch-group-forum-intro{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;padding:22px;border:1px solid #dfe5ec;border-radius:16px;background:#fff}.ch-group-forum-intro h2{margin:4px 0 8px}.ch-group-forum-intro p{margin:0}.ch-group-primary-action{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:10px 16px;background:#1473e6;color:#fff;text-decoration:none;font-weight:700;white-space:nowrap}.ch-group-forum-stats{display:flex;gap:10px}.ch-group-forum-stats span{display:grid;gap:2px;min-width:90px;padding:12px 14px;border:1px solid #dfe5ec;border-radius:14px;background:#fff}.ch-group-forum-stats strong{font-size:20px}.ch-group-forum-recent{display:grid;gap:8px;padding:20px;border:1px solid #dfe5ec;border-radius:16px;background:#fff}.ch-group-forum-recent h3{margin:0 0 4px}.ch-group-forum-recent a{display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-top:1px solid #edf0f4;text-decoration:none}.ch-group-forum-recent a:first-of-type{border-top:0}.ch-group-forum-recent span{font-size:13px;color:#657487;white-space:nowrap}@media(max-width:700px){.ch-forum-header-actions,.ch-forum-actions{width:100%}.ch-topic-header .ch-forum-actions{justify-content:flex-start}.ch-group-forum-intro{display:grid}.ch-group-primary-action{width:100%}.ch-group-forum-recent a{display:grid;gap:3px}.ch-group-forum-recent span{white-space:normal}}


/* v1.0.77 — CommunityHub forum dark-mode readability */
html[data-ch-theme-mode="dark"] .ch-forums-page,
body.ch-theme-mode-dark .ch-forums-page,
body.ch-theme-dark-mode .ch-forums-page{color:#eef4fc}
html[data-ch-theme-mode="dark"] .ch-forum-row-stats span,
html[data-ch-theme-mode="dark"] .ch-forum-topic-meta span,
html[data-ch-theme-mode="dark"] .ch-forum-topic-meta small,
html[data-ch-theme-mode="dark"] .ch-forum-header-stats span,
body.ch-theme-mode-dark .ch-forum-row-stats span,
body.ch-theme-mode-dark .ch-forum-topic-meta span,
body.ch-theme-mode-dark .ch-forum-topic-meta small,
body.ch-theme-mode-dark .ch-forum-header-stats span{color:#b8c7da!important}
html[data-ch-theme-mode="dark"] .ch-forum-row-stats strong,
html[data-ch-theme-mode="dark"] .ch-forum-topic-meta strong,
html[data-ch-theme-mode="dark"] .ch-forum-header-stats strong,
body.ch-theme-mode-dark .ch-forum-row-stats strong,
body.ch-theme-mode-dark .ch-forum-topic-meta strong,
body.ch-theme-mode-dark .ch-forum-header-stats strong{color:#f8fbff!important}
html[data-ch-theme-mode="dark"] .ch-forum-header-stats span,
body.ch-theme-mode-dark .ch-forum-header-stats span{background:#172235!important;border-color:#334760!important}
