/* =========================================================================
   LocalBuddy — Forum / Community (forum.php)
   Its layout rules were lost when style.css was slimmed down (only in
   stylebackup.css). Same look as the app's Forum screen: green #0b6b34,
   Plus Jakarta Sans, cards. Loaded last in <head>; the page's own inline
   <style> (replies) is aligned to the brand colours below.
   ========================================================================= */
body:has(.community-hero-area) { background: #f5f8f6; }
.community-hero-area, .community-stats-area, .community-main-layout {
  --cf-green: #0b6b34;
  --cf-green-2: #10843f;
  --cf-soft: #eef8f1;
  --cf-yellow: #f8c51c;
  --cf-ink: #101828;
  --cf-text: #475467;
  --cf-muted: #667085;
  --cf-line: #eaecf0;
  --cf-shadow: 0 8px 24px rgba(16, 24, 40, .07);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.community-hero-area *, .community-stats-area *, .community-main-layout * { box-sizing: border-box; }

/* ---------------- hero + search ---------------- */
.community-hero-area {
  padding: 48px 20px 78px;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(420px 260px at 92% 0%, rgba(248, 197, 28, .3), transparent 70%),
    radial-gradient(380px 260px at 0% 100%, rgba(255, 255, 255, .1), transparent 70%),
    linear-gradient(135deg, var(--cf-green), var(--cf-green-2));
}
.community-hero-content { max-width: 720px; margin: 0 auto; }
.community-hero-title { margin: 0; font-weight: 800; font-size: clamp(28px, 6vw, 44px); letter-spacing: -.02em; line-height: 1.12; color: #fff; }
.community-hero-subtitle { margin: 12px auto 22px; max-width: 560px; font-size: 15.5px; line-height: 1.6; color: rgba(255, 255, 255, .9); }
.community-search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 560px;
  margin: 0 auto;
  padding: 6px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .18);
}
.community-search-input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: var(--cf-ink);
  outline: none;
}
.community-search-btn {
  flex: none;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--cf-yellow);
  color: #0d3b1f;
  font-size: 16px;
  cursor: pointer;
}

/* ---------------- stats ---------------- */
.community-stats-area { max-width: 1120px; margin: -46px auto 0; padding: 0 16px; position: relative; z-index: 1; }
.community-stats-wrapper { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.community-stat-block {
  background: #fff;
  border: 1px solid var(--cf-line);
  border-radius: 18px;
  padding: 14px 12px;
  text-align: center;
  box-shadow: var(--cf-shadow);
}
.community-stat-value { font-weight: 800; font-size: 24px; letter-spacing: -.02em; color: var(--cf-green); }
.community-stat-label { margin-top: 2px; font-size: 12.5px; font-weight: 700; color: var(--cf-muted); }
@media (min-width: 720px) { .community-stats-wrapper { grid-template-columns: repeat(4, 1fr); gap: 14px; } }

/* ---------------- layout ---------------- */
.community-main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);   /* never wider than the screen */
  gap: 16px;
  max-width: 1120px;
  margin: 20px auto 56px;
  padding: 0 16px;
  align-items: start;
}
@media (min-width: 1000px) {
  .community-main-layout { grid-template-columns: 240px minmax(0, 1fr) 280px; gap: 20px; }
}

/* categories: list on desktop, scrolling pills on phones */
.community-left-sidebar { background: #fff; border: 1px solid var(--cf-line); border-radius: 18px; padding: 14px; box-shadow: var(--cf-shadow); }
.community-sidebar-heading, .community-widget-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--cf-muted);
}
.community-widget-title i { color: #ef6820; }
.community-category-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.community-category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--cf-text);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.community-category-item:hover { background: #f5f8f6; color: var(--cf-green); }
.community-category-item.active { background: var(--cf-soft); color: var(--cf-green); }
.community-category-count {
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f2f4f7;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  color: var(--cf-text);
}
.community-category-item.active .community-category-count { background: var(--cf-green); color: #fff; }
@media (max-width: 999px) {
  .community-left-sidebar { padding: 0; background: transparent; border: 0; box-shadow: none; }
  .community-sidebar-heading { display: none; }
  .community-category-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .community-category-list::-webkit-scrollbar { display: none; }
  .community-category-item { flex: none; min-height: 40px; background: #fff; border: 1px solid var(--cf-line); border-radius: 999px; white-space: nowrap; }
  .community-category-item.active { background: var(--cf-green); border-color: var(--cf-green); color: #fff; }
  .community-category-item.active .community-category-count { background: rgba(255, 255, 255, .25); }
}

/* ---------------- posts ---------------- */
.community-forum-section { min-width: 0; }
.community-forum-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.community-forum-title { margin: 0; font-weight: 800; font-size: 21px; color: var(--cf-ink); }
.community-newpost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cf-green), var(--cf-green-2));
  color: #fff;
  font-weight: 800;
  font-size: 14.5px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(11, 107, 52, .22);
}
.community-newpost-btn:hover { color: #fff; filter: brightness(1.06); }
.community-newpost-btn span:first-child { font-size: 18px; line-height: 1; }

.community-post-card {
  background: #fff;
  border: 1px solid var(--cf-line);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--cf-shadow);
}
.community-post-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.community-post-avatar, .community-forum-section .inline-reply-avatar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cf-green), var(--cf-green-2));
  color: #fff;
  font-weight: 800;
}
.community-post-avatar { width: 42px; height: 42px; font-size: 15px; }
.community-post-meta { flex: 1; min-width: 0; }
.community-post-author { font-weight: 800; font-size: 14.5px; color: var(--cf-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.community-post-time { font-size: 12.5px; color: var(--cf-muted); }
.community-post-category {
  flex: none;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--cf-soft);
  color: var(--cf-green);
  font-size: 12px;
  font-weight: 800;
}
.community-post-title { margin: 0 0 6px; font-weight: 800; font-size: 17px; line-height: 1.35; color: var(--cf-ink); }
.community-forum-section .post-clickable-title:hover { color: var(--cf-green); }
.community-post-excerpt { margin: 0 0 10px; font-size: 14.5px; line-height: 1.6; color: var(--cf-text); word-break: break-word; }
.community-post-stats { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; font-weight: 600; color: var(--cf-muted); }
.community-stat-item { display: inline-flex; align-items: center; gap: 6px; }
.community-stat-item i { color: var(--cf-green); }

/* replies (brand colours over the page's inline styles) */
.community-forum-section .inline-replies-wrap { border-top-color: var(--cf-line); }
.community-forum-section .inline-reply-item { background: #f9fafb; border-color: var(--cf-line); }
.community-forum-section .inline-reply-form textarea { border: 1.5px solid #d0d5dd; font-family: inherit; font-size: 15px; }
.community-forum-section .inline-reply-form textarea:focus { border-color: var(--cf-green); box-shadow: 0 0 0 4px rgba(11, 107, 52, .12); }
.community-forum-section .inline-reply-btn { background: var(--cf-green); min-height: 42px; font-weight: 800; }
.community-forum-section .inline-reply-btn:hover { background: var(--cf-green-2); }
.community-forum-section .inline-show-more { color: var(--cf-green); font-weight: 800; }

/* trending */
.community-widget { background: #fff; border: 1px solid var(--cf-line); border-radius: 18px; padding: 14px; box-shadow: var(--cf-shadow); }
.community-trending-topic {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 4px;
  border-top: 1px solid #f2f4f7;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--cf-ink);
}
.community-trending-topic:first-of-type { border-top: 0; }
.community-trend-number { flex: none; font-weight: 800; color: var(--cf-green); }

/* inside the mobile app */
.lb-in-app .community-hero-area { padding: 30px 18px 70px; }
