/* ==========================================================================
   SHROOMS SOCIAL - COMMUNITIES & GUILDS (HUB & DETAIL PAGES)
   Pixel-accurate styling matching design reference screenshots
   ========================================================================== */

/* Layout & Page Container */
.communities-page-main {
  padding: 20px 28px 60px;
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 900px) {
  .communities-page-main {
    padding: 14px 14px 80px;
  }
}

/* ==========================================================================
   LEFT SIDEBAR REFINEMENTS (Matching Screenshots)
   ========================================================================== */
/* ==========================================================================
   PAGE 1: COMMUNITIES HUB HEADER & TABS
   ========================================================================== */
.communities-header-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-card, #e8eee8);
  border-radius: 16px;
  padding: 24px 28px 0;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.comm-header-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.comm-title-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.comm-header-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #e6f4ea;
  color: #1b4332;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
[data-theme="dark"] .comm-header-icon-box {
  background: #1b3827;
  color: #74c69d;
}
.comm-header-icon-box svg {
  width: 24px;
  height: 24px;
}

.comm-main-heading {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main, #18221b);
  letter-spacing: -0.3px;
  margin: 0;
}

.btn-create-community {
  background-color: var(--primary, #1b4332);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-create-community:hover {
  background-color: var(--primary-hover, #143326);
  transform: translateY(-1px);
}
[data-theme="dark"] .btn-create-community {
  background-color: #2d6a4f;
  color: #ffffff;
}
[data-theme="dark"] .btn-create-community:hover {
  background-color: #40916c;
}

.comm-header-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary, #57655c);
  margin: 4px 0 18px;
  line-height: 1.5;
}

/* Category Underline Tabs */
.comm-filter-tabs {
  display: flex;
  align-items: center;
  gap: 28px;
  border-top: 1px solid var(--border-light, #eef2ef);
  overflow-x: auto;
  scrollbar-width: none;
}
.comm-filter-tabs::-webkit-scrollbar {
  display: none;
}

.comm-tab-btn {
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  padding: 14px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #57655c);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.comm-tab-btn:hover {
  color: var(--text-main, #18221b);
}
.comm-tab-btn.active {
  color: var(--primary, #1b4332);
  border-bottom-color: var(--primary, #1b4332);
  font-weight: 700;
}
[data-theme="dark"] .comm-tab-btn.active {
  color: #74c69d;
  border-bottom-color: #74c69d;
}

/* ==========================================================================
   FEATURED COMMUNITY & GROWING THIS WEEK
   ========================================================================== */
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 14px;
}

.section-title {
  font-size: 16px;
  font-weight: 750;
  color: var(--text-main, #18221b);
  letter-spacing: -0.2px;
  margin: 0;
}

.section-link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary, #57655c);
  text-decoration: none;
  transition: color 0.15s ease;
}
.section-link:hover {
  color: var(--primary, #1b4332);
}
[data-theme="dark"] .section-link:hover {
  color: #74c69d;
}

.featured-split-layout {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 18px;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .featured-split-layout {
    grid-template-columns: 1fr;
  }
}

/* Featured Left Hero Card */
.featured-hero-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-card, #e8eee8);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.featured-hero-card:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

@media (max-width: 680px) {
  .featured-hero-card {
    grid-template-columns: 1fr;
  }
}

.featured-hero-banner {
  position: relative;
  min-height: 220px;
  background: #092c27;
  overflow: hidden;
}
.featured-hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.featured-hero-card:hover .featured-hero-banner img {
  transform: scale(1.03);
}

.featured-badge-pill {
  position: absolute;
  top: 14px;
  left: 14px;
  background: #ffffff;
  color: #18221b;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.featured-banner-caption {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.35;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.featured-hero-content {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.featured-hero-heading-row {
  margin-bottom: 6px;
}

.featured-hero-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main, #18221b);
  margin: 0 0 8px;
  letter-spacing: -0.2px;
}
.featured-hero-title a {
  color: inherit;
  text-decoration: none;
}
.featured-hero-title a:hover {
  color: var(--primary-light, #2d6a4f);
}

.tag-verified-science {
  display: inline-block;
  background: #e8f5ec;
  color: #2d6a4f;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 10px;
}
[data-theme="dark"] .tag-verified-science {
  background: #183324;
  color: #74c69d;
}

.featured-hero-desc {
  font-size: 12.5px;
  color: var(--text-secondary, #57655c);
  line-height: 1.5;
  margin: 0 0 16px;
}

.featured-hero-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
}

.hero-stats-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-muted, #7d8c82);
  font-weight: 600;
}

.online-dot-green {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2cb67d;
  display: inline-block;
  margin-right: 2px;
}

.btn-comm-join {
  background-color: var(--primary, #1b4332);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 7px 20px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-comm-join:hover {
  background-color: var(--primary-hover, #143326);
  transform: translateY(-1px);
}
.btn-comm-join.joined {
  background-color: var(--bg-subtle, #f0f4f0);
  color: var(--primary, #1b4332);
  border: 1px solid var(--border-light, #e5ece6);
}
[data-theme="dark"] .btn-comm-join {
  background-color: #2d6a4f;
}
[data-theme="dark"] .btn-comm-join.joined {
  background-color: #1a271e;
  color: #74c69d;
  border-color: #2a3d30;
}

/* Growing This Week Card */
.growing-week-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-card, #e8eee8);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.growing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.growing-header h3 {
  font-size: 15px;
  font-weight: 750;
  color: var(--text-main, #18221b);
  margin: 0;
}
.growing-header a {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #57655c);
  text-decoration: none;
}
.growing-header a:hover {
  color: var(--primary, #1b4332);
}

.growing-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.growing-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-circle-initials {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}

.avatar-wf { background-color: #3b6048; }
.avatar-gk { background-color: #8c6a38; }
.avatar-fp { background-color: #6a447c; }
.avatar-gc { background-color: #4a7758; }
.avatar-sr { background-color: #1e6c75; }
.avatar-mb { background-color: #7d5b3d; }
.avatar-pr { background-color: #1b4332; }
.avatar-my { background-color: #265d63; }
.avatar-cg { background-color: #556b2f; }
.avatar-fc { background-color: #2e5b44; }

.growing-info {
  flex: 1;
  min-width: 0;
}
.growing-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main, #18221b);
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.growing-title a {
  color: inherit;
  text-decoration: none;
}
.growing-title a:hover {
  color: var(--primary-light, #2d6a4f);
}
.growing-stats {
  font-size: 11.5px;
  color: var(--text-muted, #7d8c82);
}

.btn-growing-join {
  background: none;
  border: none;
  color: var(--text-main, #18221b);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-growing-join:hover {
  background: var(--bg-hover, #eaf1eb);
  color: var(--primary, #1b4332);
}
.btn-growing-join.joined {
  color: var(--primary-light, #2d6a4f);
}

/* ==========================================================================
   DISCOVER COMMUNITIES GRID (3 COLUMNS)
   ========================================================================== */
.discover-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

@media (max-width: 1024px) {
  .discover-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .discover-grid {
    grid-template-columns: 1fr;
  }
}

.comm-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-card, #e8eee8);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}
.comm-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.comm-card-thumb {
  height: 125px;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #1a2a22;
}
.comm-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.comm-card:hover .comm-card-thumb img {
  transform: scale(1.03);
}

.comm-card-avatar {
  position: absolute;
  bottom: 10px;
  left: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.comm-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.comm-card-name {
  font-size: 14.5px;
  font-weight: 750;
  color: var(--text-main, #18221b);
  margin: 0 0 6px;
  line-height: 1.35;
}
.comm-card-name a {
  color: inherit;
  text-decoration: none;
}
.comm-card-name a:hover {
  color: var(--primary-light, #2d6a4f);
}

.comm-tag-pill {
  display: inline-block;
  align-self: flex-start;
  background: var(--bg-subtle, #f0f4f0);
  color: var(--primary-light, #2d6a4f);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 10px;
}
[data-theme="dark"] .comm-tag-pill {
  background: #18261d;
  color: #74c69d;
}

.comm-card-text {
  font-size: 12px;
  color: var(--text-secondary, #57655c);
  line-height: 1.5;
  margin: 0 0 14px;
  flex: 1;
}

.comm-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light, #f0f4f0);
  padding-top: 12px;
  margin-top: auto;
}

.comm-members-inline {
  font-size: 11px;
  color: var(--text-muted, #7d8c82);
  font-weight: 600;
}

.btn-card-join {
  background: transparent;
  color: var(--text-main, #18221b);
  border: 1px solid var(--border-light, #d8e2da);
  border-radius: 999px;
  padding: 5px 16px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-card-join:hover {
  background: var(--bg-subtle, #f0f4f0);
  border-color: var(--primary, #1b4332);
  color: var(--primary, #1b4332);
}
.btn-card-join.joined {
  background: var(--bg-active-pill, #e6f3eb);
  color: var(--primary, #1b4332);
  border-color: transparent;
}
[data-theme="dark"] .btn-card-join {
  border-color: #2b3a30;
  color: #e0eae2;
}
[data-theme="dark"] .btn-card-join.joined {
  background: #1a3826;
  color: #74c69d;
}

.explore-all-btn-wrap {
  display: flex;
  justify-content: center;
  margin: 28px 0 10px;
}
.btn-explore-all {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-card, #d8e2da);
  color: var(--text-main, #18221b);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 24px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.btn-explore-all:hover {
  background: var(--bg-subtle, #f0f4f0);
  border-color: var(--primary-light, #2d6a4f);
  color: var(--primary, #1b4332);
}

/* ==========================================================================
   PAGE 2: SINGLE COMMUNITY DETAIL PAGE (Psilocybin Research)
   ========================================================================== */
.community-detail-container {
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
}

/* Community Top Hero Banner */
.comm-detail-hero {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-card, #e8eee8);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.comm-detail-banner-img {
  width: 100%;
  height: 190px;
  position: relative;
  background: #0b2f29;
  overflow: hidden;
}
.comm-detail-banner-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-overlay-tag {
  position: absolute;
  top: 14px;
  left: 18px;
  background: rgba(255, 255, 255, 0.95);
  color: #18221b;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: 999px;
  text-transform: uppercase;
}
[data-theme="dark"] .banner-overlay-tag {
  background: rgba(21, 29, 23, 0.92);
  color: #eff4f0;
}

.comm-detail-header-card {
  padding: 0 28px 0;
  position: relative;
}

.comm-detail-avatar-overlap {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3.5px solid var(--bg-card, #ffffff);
  margin-top: -34px;
  margin-bottom: 12px;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.comm-detail-title-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.comm-detail-title-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comm-detail-h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main, #18221b);
  letter-spacing: -0.3px;
  margin: 0;
}

.comm-detail-badges-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-verified-comm {
  background: #e8f5ec;
  color: #2d6a4f;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
[data-theme="dark"] .badge-verified-comm {
  background: #183324;
  color: #74c69d;
}

.badge-comm-category {
  background: var(--bg-subtle, #f0f4f0);
  color: var(--text-secondary, #57655c);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.comm-detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-comm-share {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-light, #d8e2da);
  color: var(--text-main, #18221b);
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.btn-comm-share:hover {
  background: var(--bg-subtle, #f0f4f0);
}
[data-theme="dark"] .btn-comm-share {
  border-color: #2a3a2f;
  color: #e0eae2;
}

.btn-comm-join-main {
  background: var(--primary, #1b4332);
  color: #ffffff;
  border: none;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-comm-join-main:hover {
  background: var(--primary-hover, #143326);
  transform: translateY(-1px);
}
.btn-comm-join-main.joined {
  background: var(--bg-subtle, #f0f4f0);
  color: var(--primary, #1b4332);
  border: 1px solid var(--border-light, #d8e2da);
}
[data-theme="dark"] .btn-comm-join-main {
  background: #2d6a4f;
}
[data-theme="dark"] .btn-comm-join-main.joined {
  background: #1a2a20;
  color: #74c69d;
  border-color: #2b3d30;
}

.comm-detail-desc {
  font-size: 13px;
  color: var(--text-secondary, #57655c);
  line-height: 1.5;
  margin: 4px 0 14px;
  max-width: 820px;
}

.comm-detail-stats-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 12.5px;
  color: var(--text-secondary, #57655c);
  margin-bottom: 14px;
}
.comm-detail-stats-bar strong {
  color: var(--text-main, #18221b);
  font-weight: 750;
}

.comm-detail-tabs-bar {
  display: flex;
  align-items: center;
  gap: 28px;
  border-top: 1px solid var(--border-light, #eef2ef);
  overflow-x: auto;
  scrollbar-width: none;
}
.comm-detail-tabs-bar::-webkit-scrollbar {
  display: none;
}

.comm-detail-tab {
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  padding: 13px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #57655c);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.comm-detail-tab:hover {
  color: var(--text-main, #18221b);
}
.comm-detail-tab.active {
  color: var(--primary, #1b4332);
  border-bottom-color: var(--primary, #1b4332);
  font-weight: 750;
}
[data-theme="dark"] .comm-detail-tab.active {
  color: #74c69d;
  border-bottom-color: #74c69d;
}

/* ==========================================================================
   DETAIL PAGE: TWO COLUMN LAYOUT (FEED + SIDEBAR WIDGETS)
   ========================================================================== */
.comm-detail-two-col {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1024px) {
  .comm-detail-two-col {
    grid-template-columns: 1fr;
  }
}

/* Feed Column */
.comm-feed-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Composer Card */
.comm-composer-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-card, #e8eee8);
  border-radius: 14px;
  padding: 16px 18px 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.comm-composer-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.comm-composer-input {
  flex: 1;
  background: var(--bg-subtle, #f0f4f0);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  color: var(--text-main, #18221b);
  outline: none;
  transition: all 0.2s ease;
}
.comm-composer-input:focus {
  background: #ffffff;
  border-color: var(--primary-light, #2d6a4f);
  box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.12);
}
[data-theme="dark"] .comm-composer-input:focus {
  background: #19241c;
}

.comm-composer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light, #f0f4f0);
  padding-top: 10px;
}

.composer-attach-tools {
  display: flex;
  align-items: center;
  gap: 18px;
}

.attach-btn {
  background: none;
  border: none;
  color: var(--text-secondary, #57655c);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease;
}
.attach-btn:hover {
  color: var(--primary, #1b4332);
}
[data-theme="dark"] .attach-btn:hover {
  color: #74c69d;
}

.btn-composer-post {
  background: var(--primary, #1b4332);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 6px 18px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-composer-post:hover {
  background: var(--primary-hover, #143326);
}
[data-theme="dark"] .btn-composer-post {
  background: #2d6a4f;
}

/* Pinned Post Card */
.pinned-post-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-card, #e8eee8);
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.pinned-badge-pill {
  display: inline-block;
  background: #e8f5ec;
  color: #2d6a4f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 8px;
}
[data-theme="dark"] .pinned-badge-pill {
  background: #183324;
  color: #74c69d;
}

.pinned-post-title {
  font-size: 15px;
  font-weight: 750;
  color: var(--text-main, #18221b);
  margin: 0 0 6px;
}

.pinned-post-body {
  font-size: 12.5px;
  color: var(--text-secondary, #57655c);
  line-height: 1.5;
  margin: 0 0 10px;
}

.pinned-post-footer {
  font-size: 11px;
  color: var(--text-muted, #7d8c82);
}

/* Discussions List */
.discussions-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 2px;
}

.discussions-heading {
  font-size: 15px;
  font-weight: 750;
  color: var(--text-main, #18221b);
  margin: 0;
}

.discussions-sort-btn {
  background: none;
  border: none;
  color: var(--text-secondary, #57655c);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Discussion Post Card */
.discussion-post-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-card, #e8eee8);
  border-radius: 14px;
  padding: 18px 20px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: border-color 0.15s ease;
}
.discussion-post-card:hover {
  border-color: var(--border-focus, #52b788);
}

.disc-author-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.disc-author-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.disc-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 11px;
}

.disc-author-names {
  line-height: 1.3;
}
.disc-author-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main, #18221b);
  margin: 0;
}
.disc-author-role {
  font-size: 11px;
  color: var(--text-muted, #7d8c82);
}

.disc-post-category-tag {
  background: var(--bg-subtle, #f0f4f0);
  color: var(--primary-light, #2d6a4f);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
[data-theme="dark"] .disc-post-category-tag {
  background: #18261d;
  color: #74c69d;
}

.disc-content-wrap {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
}

.disc-text-wrap {
  flex: 1;
}

.disc-post-title {
  font-size: 15px;
  font-weight: 750;
  color: var(--text-main, #18221b);
  margin: 0 0 6px;
  line-height: 1.35;
}

.disc-post-body {
  font-size: 12.5px;
  color: var(--text-secondary, #57655c);
  line-height: 1.5;
  margin: 0;
}

.disc-thumb-img {
  width: 140px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #092c27;
}
.disc-thumb-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 580px) {
  .disc-content-wrap {
    flex-direction: column-reverse;
  }
  .disc-thumb-img {
    width: 100%;
    height: 160px;
  }
}

/* Document Attachment Box */
.disc-document-box {
  background: var(--bg-subtle, #f4f6f4);
  border: 1px solid var(--border-light, #e2e8e3);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 12px;
}
.doc-icon-badge {
  background: #ffede8;
  color: #e04826;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 6px;
  border-radius: 4px;
}
.doc-info-block strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main, #18221b);
}
.doc-info-block span {
  font-size: 11px;
  color: var(--text-muted, #7d8c82);
}

/* Post Action Buttons (Upvote, Comment, Share, Save) */
.disc-actions-row {
  display: flex;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--border-light, #f0f4f0);
  padding-top: 10px;
}

.disc-action-btn {
  background: none;
  border: none;
  color: var(--text-secondary, #57655c);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.disc-action-btn:hover {
  color: var(--primary, #1b4332);
  background: var(--bg-hover, #eaf1eb);
}
.disc-action-btn.active {
  color: var(--primary-light, #2d6a4f);
}
[data-theme="dark"] .disc-action-btn:hover {
  color: #74c69d;
}

/* ==========================================================================
   DETAIL PAGE: RIGHT SIDEBAR WIDGETS
   ========================================================================== */
.comm-widgets-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.widget-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-card, #e8eee8);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.widget-card-title {
  font-size: 14px;
  font-weight: 750;
  color: var(--text-main, #18221b);
  margin: 0 0 10px;
}

.widget-card-desc {
  font-size: 12px;
  color: var(--text-secondary, #57655c);
  line-height: 1.5;
  margin: 0 0 12px;
}

.widget-subheading {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main, #18221b);
  margin: 12px 0 6px;
}

.widget-guidelines-list {
  padding-left: 18px;
  margin: 0 0 12px;
  font-size: 11.5px;
  color: var(--text-secondary, #57655c);
  line-height: 1.6;
}

.widget-text-link {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main, #18221b);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.widget-text-link:hover {
  color: var(--primary-light, #2d6a4f);
}

/* Upcoming Event Card */
.event-tag-pill {
  display: inline-block;
  background: #e6f4ea;
  color: #2d6a4f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}
[data-theme="dark"] .event-tag-pill {
  background: #183324;
  color: #74c69d;
}

.event-title {
  font-size: 13.5px;
  font-weight: 750;
  color: var(--text-main, #18221b);
  margin: 0 0 4px;
}

.event-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted, #7d8c82);
  margin-top: 6px;
}
.event-sub-row a {
  font-weight: 700;
  color: var(--text-main, #18221b);
  text-decoration: none;
}
.event-sub-row a:hover {
  color: var(--primary, #1b4332);
}

/* Moderators Card */
.moderators-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mod-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mod-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 11px;
}

.mod-info-block {
  line-height: 1.3;
}
.mod-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main, #18221b);
  margin: 0;
}
.mod-title {
  font-size: 11px;
  color: var(--text-muted, #7d8c82);
}

/* Related Communities Card */
.related-comm-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.related-comm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease;
}
.related-comm-row:hover {
  transform: translateX(2px);
}

.related-comm-row:hover .related-name {
  color: var(--primary-light, #2d6a4f);
}

.related-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 11px;
}

.related-info {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.related-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main, #18221b);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}

.related-members {
  font-size: 11px;
  color: var(--text-muted, #7d8c82);
}

.related-arrow {
  color: var(--text-muted, #7d8c82);
  font-size: 13px;
}

/* ==========================================================================
   CREATE COMMUNITY MODAL
   ========================================================================== */
.create-comm-modal-card {
  background: var(--bg-card, #ffffff);
  border-radius: 16px;
  padding: 24px;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-modal, 0 20px 48px rgba(0, 0, 0, 0.16));
  position: relative;
}

.create-comm-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main, #18221b);
  margin: 0 0 6px;
}
.create-comm-subtitle {
  font-size: 12.5px;
  color: var(--text-secondary, #57655c);
  margin: 0 0 18px;
  line-height: 1.45;
}


/* Community directory cards follow the cover-image reference. */
.discover-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.discover-grid .comm-card { min-width: 0; border-radius: 12px; box-shadow: none; }
.discover-grid .comm-card-thumb { height: 150px; flex-shrink: 0; }
.discover-grid .comm-card-thumb img { display: block; }
.discover-grid .comm-card-avatar { display: none; }
.discover-grid .comm-card-body { padding: 16px; min-width: 0; }
.discover-grid .comm-card-name { margin-bottom: 6px; font-size: 14px; line-height: 1.4; }
.discover-grid .comm-tag-pill { position: absolute; top: 115px; left: 14px; margin: 0; padding: 4px 9px; border-radius: 6px; background: #fff; color: #19566a; font-size: 10px; font-weight: 500; line-height: 15px; }
.discover-grid .comm-card-text { margin-bottom: 16px; font-size: 12px; line-height: 1.5; }
.discover-grid .comm-card-bottom { padding: 0; border: 0; }
.discover-grid .comm-members-inline { display: none; }
.discover-grid .btn-card-join { width: 100%; min-height: 34px; padding: 7px 12px; font-size: 11px; font-weight: 500; }
.comm-card-dismiss { position: absolute; top: 8px; right: 8px; z-index: 2; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 1px solid #dce5df; border-radius: 50%; background: #fffffff2; color: #7c8b81; cursor: pointer; }
.comm-card-dismiss:hover { background: #fff; color: #20382c; }
.comm-card-dismiss:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }
.comm-card-dismiss svg { width: 12px; height: 12px; }
@media (max-width: 1200px) { .discover-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .discover-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .discover-grid { grid-template-columns: minmax(0, 1fr); } }

/* Communities header matched to the supplied reference. */
.communities-header-card { position: relative; overflow: hidden; padding: 22px 24px 18px; border-radius: 18px; box-shadow: 0 2px 7px #173c2810; }
.communities-header-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, #1b4332, #40916c); }
.comm-header-top-row { align-items: center; margin-bottom: 10px; }
.comm-title-wrapper { gap: 14px; min-width: 0; }
.comm-header-icon-box { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-tint, #eaf3ed); }
.comm-main-heading { font-size: 23px; font-weight: 700; line-height: 1.3; }
.communities-header-card .btn-create-community { padding: 9px 20px; min-height: 35px; border-radius: 999px; font-size: 13px; flex-shrink: 0; }
.comm-header-subtitle { margin: 0 0 16px; font-size: 14px; line-height: 1.6; }
.comm-filter-tabs { gap: 6px; padding-top: 4px; }
.comm-tab-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex-shrink: 0; padding: 12px 10px; font-size: 12px; white-space: nowrap; }
.comm-tab-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
@media (max-width: 600px) { .communities-header-card { padding: 18px 16px 12px; } .comm-header-top-row { flex-wrap: wrap; gap: 12px; } .comm-main-heading { font-size: 20px; } .comm-header-subtitle { font-size: 13px; } }

/* Reference header spacing and typography. */
.communities-header-card { padding: 22px 24px 18px; }
.comm-header-subtitle { max-width: 750px; }
.comm-filter-tabs { gap: 6px; }
.comm-tab-btn { font-weight: 400; }
.comm-tab-btn.active { font-weight: 600; }
.create-community-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-sizing: border-box; border: 1px solid var(--border-light); border-radius: 18px; padding: 0; background: var(--bg-card); color: var(--text-main); overflow-y: auto; }
.create-community-dialog::backdrop { background: #10271d99; backdrop-filter: blur(3px); }
.create-community-dialog .create-comm-modal-card { position: relative; width: 100%; max-width: none; box-sizing: border-box; margin: 0; padding: 28px; border: 0; box-shadow: none; }
.create-community-dialog .create-comm-title { margin: 0 40px 10px 0; }
.create-community-dialog .create-comm-subtitle { margin-bottom: 22px; font-size: 13px; line-height: 1.6; color: var(--text-secondary); }
.create-community-dialog input, .create-community-dialog textarea, .create-community-dialog select { box-sizing: border-box; }
.create-community-dialog .modal-close-btn { position: absolute; top: 16px; right: 16px; }

.communities-header-card .comm-tab-btn { border-radius: 0; box-shadow: none; background: transparent; border-bottom-width: 2px; }

/* Community discovery sidebar: recommendations, spotlight, and shared standards. */
.communities-discovery-sidebar { width: 310px; flex: 0 0 310px; box-sizing: border-box; padding: 22px 24px; overflow-y: auto; background: var(--bg-app); }
.community-side-section { padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--border-light); }
.community-side-section:last-child { border-bottom: 0; margin-bottom: 0; }
.community-side-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.community-side-section h2 { font-size: 14px; line-height: 1.4; font-weight: 700; margin: 0; }
.community-side-heading > span { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.community-side-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.community-side-list li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.community-side-list li > img { width: 36px; height: 36px; object-fit: cover; border-radius: 50%; flex-shrink: 0; }
.community-side-list li > div { flex: 1; min-width: 0; }
.community-side-list a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-main); font-size: 12px; font-weight: 600; text-decoration: none; }
.community-side-list a:hover { text-decoration: underline; }
.community-side-list li > div > span { display: block; color: var(--text-muted); font-size: 11px; margin-top: 3px; }
.community-side-list .btn-join { flex-shrink: 0; min-width: 52px; min-height: 28px; padding: 4px 12px; border-radius: 999px; font-size: 11px; }
.community-side-eyebrow { margin: 0 0 12px; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.community-spotlight-cover { display: block; width: 100%; height: 108px; border-radius: 10px; object-fit: cover; margin-bottom: 12px; }
.community-spotlight > p:not(.community-side-eyebrow) { font-size: 12px; line-height: 1.6; color: var(--text-secondary); margin: 8px 0 14px; }
.community-spotlight-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 600; color: var(--primary); text-decoration: none; }
.community-spotlight-link svg { width: 16px; height: 16px; }
.community-side-standards { list-style: decimal; padding-left: 18px; margin: 16px 0 0; color: var(--text-secondary); font-size: 12px; line-height: 1.65; }
.community-side-standards li + li { margin-top: 12px; }
.communities-page-main { container-type: inline-size; }
@container (max-width: 900px) { .discover-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (max-width: 680px) { .discover-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 380px) { .discover-grid { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 1101px) { .communities-discovery-sidebar { display: block; } }
@media (max-width: 1100px) { .communities-discovery-sidebar { display: none; } }

/* Community detail views share a stable, responsive content layout. */
.community-detail-root { width: 100%; max-width: 1260px; box-sizing: border-box; padding: 24px 28px 48px; margin: 0 auto; }
.cd-back { display: inline-block; margin-bottom: 16px; color: var(--text-secondary); font-size: 13px; text-decoration: none; }
.cd-back:hover { color: var(--primary-light); text-decoration: underline; }
.cd-hero { border: 1px solid var(--border-light); border-radius: 18px; overflow: hidden; background: var(--bg-card); margin-bottom: 24px; }
.cd-cover { height: 210px; position: relative; background: #183b2a; overflow: hidden; }
.cd-cover > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cd-cover > span { position: absolute; left: 24px; top: 20px; padding: 6px 12px; border-radius: 999px; background: #fffffff0; color: #214a35; font-size: 11px; font-weight: 600; }
.cd-hero-body { padding: 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.cd-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cd-avatar { display: grid; place-items: center; width: 56px; height: 56px; flex-shrink: 0; border-radius: 16px; background: var(--primary-tint, #eaf3ed); color: var(--primary-light); font-weight: 700; font-size: 18px; }
.cd-identity h1 { font-size: clamp(22px, 2.3vw, 30px); line-height: 1.25; margin: 0; overflow-wrap: anywhere; }
.cd-eyebrow { color: var(--text-secondary); font-size: 11px; font-weight: 600; margin: 0 0 6px; }
.cd-hero-actions { display: flex; align-items: center; gap: 10px; }
.cd-hero-actions .btn { min-height: 38px; border-radius: 999px; padding: 9px 18px; }
.cd-description, .cd-stats { grid-column: 1 / -1; margin: 0; }
.cd-description { font-size: 14px; line-height: 1.7; max-width: 850px; color: var(--text-secondary); }
.cd-stats { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.cd-stats > span { margin-left: 12px; padding-left: 18px; border-left: 1px solid var(--border-light); }
.cd-tabs { display: flex; gap: 16px; padding: 0 24px; border-top: 1px solid var(--border-light); overflow-x: auto; scrollbar-width: none; }
.cd-tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 14px 8px; font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.cd-tabs button.active { color: var(--primary-light); border-bottom-color: var(--primary-light); font-weight: 600; }
.cd-tabs button:focus-visible, .cd-post button:focus-visible { outline: 2px solid var(--primary-light); outline-offset: -3px; }
.cd-columns { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 22px; align-items: start; }
.cd-content { min-width: 0; }
.community-detail-root [hidden] { display: none !important; }
.cd-panel-card { padding: 24px; border-radius: 14px; }
.cd-panel-card h2 { margin: 0 0 12px; font-size: 19px; line-height: 1.4; }
.cd-panel-card h3 { margin: 20px 0 8px; font-size: 15px; }
.cd-panel-card p, .cd-panel-card li { font-size: 13px; line-height: 1.7; color: var(--text-secondary); }
.cd-panel-card ul { list-style: disc; padding-left: 20px; margin: 12px 0 20px; }
.cd-panel-card a { color: var(--primary-light); font-size: 13px; }
.cd-sidebar { display: grid; gap: 18px; }
.cd-sidebar .cd-panel-card { padding: 20px; }
.cd-sidebar h2 { font-size: 14px; }
.cd-sidebar p { font-size: 12px; margin-bottom: 14px; }
.cd-related { display: flex; align-items: center; gap: 10px; padding: 12px 0; text-decoration: none; }
.cd-related + .cd-related { border-top: 1px solid var(--border-light); }
.cd-related img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.cd-related span:first-of-type { flex: 1; }
.cd-composer { padding: 20px; border-radius: 14px; margin-bottom: 24px; }
.cd-composer > label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.cd-composer textarea { width: 100%; box-sizing: border-box; min-height: 88px; resize: vertical; border: 1px solid var(--border-light); border-radius: 10px; background: var(--bg-input); padding: 12px; color: var(--text-main); font: inherit; font-size: 13px; line-height: 1.6; }
.cd-compose-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cd-compose-actions > button[type=submit] { margin-left: auto; }
.cd-compose-actions .btn { border-radius: 999px; min-height: 34px; font-size: 12px; }
.cd-attachment-list > div { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px; border: 1px solid var(--border-light); border-radius: 8px; font-size: 12px; }
.cd-attachment-list img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }
.cd-attachment-list span { flex: 1; overflow-wrap: anywhere; }
.cd-attachment-list button { padding: 6px 10px; background: var(--bg-subtle); border-radius: 50%; color: var(--text-main); }
.cd-post-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cd-post-heading h2 { margin: 0; font-size: 16px; }
.cd-post-heading label { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--text-secondary); }
.cd-post-heading select { padding: 6px 10px; border: 1px solid var(--border-light); border-radius: 8px; background: var(--bg-card); color: var(--text-main); font: inherit; }
.cd-posts { display: grid; gap: 16px; }
.cd-post { padding: 20px; border-radius: 14px; min-width: 0; }
.cd-post > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.cd-post-author { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-main); font-size: 12px; font-weight: 600; }
.cd-member-avatar { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; background: var(--primary-tint); color: var(--primary-light); font-size: 11px; }
.cd-post-author small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 10px; font-weight: 400; }
.cd-text-button { padding: 6px; color: var(--text-muted); font-size: 11px; background: transparent; }
.cd-post h3 { margin: 0 0 10px; font-size: 16px; line-height: 1.5; }
.cd-post h3:empty { display: none; }
.cd-post-text { font-size: 13px; line-height: 1.75; color: var(--text-secondary); white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 16px; }
.cd-post-image { display: block; width: 100%; max-height: 420px; object-fit: cover; border-radius: 10px; margin-bottom: 14px; }
.cd-document { display: block; padding: 16px; margin-bottom: 14px; border: 1px solid var(--border-light); border-radius: 10px; color: var(--primary-light); font-size: 13px; overflow-wrap: anywhere; }
.cd-post > footer { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding-top: 12px; border-top: 1px solid var(--border-light); }
.cd-post > footer button { padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; font-size: 12px; color: var(--text-secondary); }
.cd-post > footer button:hover { background: var(--bg-hover); }
.cd-post > footer button.active, .cd-post > footer button[aria-pressed=true] { color: var(--primary-light); background: var(--primary-tint); }
.cd-post > footer button:last-child { margin-left: auto; }
.cd-comments { margin-top: 16px; border-top: 1px solid var(--border-light); padding-top: 10px; }
.cd-comments p { font-size: 12px; padding: 10px; margin: 6px 0; border-radius: 8px; background: var(--bg-subtle); overflow-wrap: anywhere; }
.cd-comment-form { display: flex; gap: 8px; margin-top: 12px; }
.cd-comment-form input { min-width: 0; width: 100%; border: 1px solid var(--border-light); border-radius: 999px; padding: 10px 12px; background: var(--bg-input); color: var(--text-main); }
.cd-comment-form button { flex-shrink: 0; font-size: 12px; }
.cd-guidelines { list-style: decimal; padding-left: 24px; margin: 24px 0; }
.cd-guidelines > li { padding: 0 0 16px 6px; }
.cd-guidelines > li::marker { color: var(--primary-light); font-weight: 700; }
.cd-guidelines strong { display: block; font-size: 14px; color: var(--text-main); }
.cd-guidelines p { margin: 5px 0 0; }
.cd-guidelines-note { padding: 14px; background: var(--bg-subtle); border-radius: 10px; }
.cd-member-list { margin-top: 20px; }
.cd-member { display: flex; align-items: center; gap: 12px; padding: 16px 0; }
.cd-member + .cd-member { border-top: 1px solid var(--border-light); }
.cd-member > img { width: 44px; height: 44px; object-fit: cover; border-radius: 50%; }
.cd-member > div { min-width: 0; flex: 1; }
.cd-member > div a { font-weight: 600; text-decoration: none; }
.cd-member > div span { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.cd-member .btn { font-size: 12px; min-width: 82px; border-radius: 999px; }
.cd-empty { padding: 28px 12px; text-align: center; }
.cd-empty h3 { margin-top: 0; }
.cd-empty > a { display: block; margin-top: 18px; }
.cd-empty .btn { margin-top: 12px; }
.cd-media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.cd-media-grid > button { border: 0; padding: 0; background: #15251a; border-radius: 12px; overflow: hidden; aspect-ratio: 1; }
.cd-media-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cd-media-video { aspect-ratio: 1; background: #101b15; border-radius: 12px; overflow: hidden; }
.cd-media-video video { width: 100%; height: 100%; object-fit: contain; }
.cd-dialog { position: fixed; width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-sizing: border-box; border: 1px solid var(--border-light); border-radius: 18px; padding: 24px; background: var(--bg-card); color: var(--text-main); overflow-y: auto; }
.cd-dialog::backdrop { background: #10271d99; backdrop-filter: blur(3px); }
.cd-dialog h2 { margin: 0 24px 16px 0; font-size: 20px; }
.cd-dialog p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.cd-dialog input, .cd-dialog textarea { display: block; box-sizing: border-box; width: 100%; padding: 12px; border: 1px solid var(--border-light); border-radius: 8px; background: var(--bg-input); color: var(--text-main); }
.cd-dialog textarea { min-height: 100px; resize: vertical; }
.cd-dialog img { display: block; width: 100%; max-height: 65dvh; object-fit: contain; }
.cd-dialog-close { position: absolute; right: 12px; top: 10px; width: 30px; height: 30px; border-radius: 50%; background: transparent; color: var(--text-secondary); font-size: 22px; }
.cd-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
@media (max-width: 1150px) { .cd-columns { grid-template-columns: minmax(0, 1fr); } .cd-sidebar { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 768px) { .community-detail-root { padding: 16px 12px 84px; } .cd-cover { height: 160px; } .cd-hero-body { padding: 18px; grid-template-columns: minmax(0, 1fr); } .cd-hero-actions { grid-row: 3; } .cd-description { grid-row: 2; } .cd-tabs { padding-inline: 12px; gap: 8px; } .cd-sidebar { grid-template-columns: minmax(0, 1fr); } .cd-panel-card, .cd-post, .cd-composer { padding: 18px; } .cd-member { flex-wrap: wrap; } .cd-post-heading { flex-wrap: wrap; } }

.community-detail-root .cd-tabs button { border-radius: 0 !important; }
.community-filter-empty { padding: 24px; text-align: center; color: var(--text-secondary); font-size: 13px; line-height: 1.6; }
.community-filter-empty[hidden] { display: none !important; }

.showing-my-communities .comm-card-dismiss { display: none; }

/* Community interactions use the same compact icon language as Home. */
.cd-ui-icon { display: inline-block; width: 18px; height: 18px; flex: 0 0 18px; vertical-align: middle; }
.cd-post > footer button, .cd-hero-actions .btn, .cd-compose-actions .btn, .cd-member .btn, [data-cd-notify] { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.cd-post > footer button { min-height: 36px; font-size: 12px; font-weight: 500; }
.cd-post > footer button span { font-variant-numeric: tabular-nums; }
.cd-post > footer button[data-cd-action=like] { padding-left: 0; }
.cd-post > footer button[data-cd-action=like].active { background: transparent; color: var(--primary-light); }
.cd-post > footer button[data-cd-action=like].active .cd-ui-icon { color: var(--primary-light); }
.cd-post > footer button[data-cd-action=save][aria-pressed=true] .cd-ui-icon { fill: currentColor; }
.cd-text-button { display: inline-flex; align-items: center; gap: 5px; }
.cd-text-button .cd-ui-icon { width: 14px; height: 14px; flex-basis: 14px; }
.community-detail-root .cd-tabs button .cd-ui-icon { width: 14px; height: 14px; flex-basis: 14px; }
.cd-compose-actions [data-cd-attach=image] .cd-ui-icon { color: #0ea5e9; }
.cd-compose-actions [data-cd-attach=document] .cd-ui-icon { color: var(--text-secondary); }
.cd-composer, .cd-post, .cd-panel-card { border: 1px solid var(--border-card, #e4e6eb); border-radius: 12px; box-shadow: 0 1px 2px #00000008; }
@media (max-width: 480px) { .cd-post > footer { gap: 2px; } .cd-post > footer button { padding-inline: 6px; font-size: 11px; gap: 5px; } .cd-post > footer .cd-ui-icon { width: 16px; height: 16px; flex-basis: 16px; } }

.cd-membership-notice { display: flex; align-items: center; gap: 16px; justify-content: space-between; padding: 18px 20px; margin-bottom: 16px; border: 1px solid var(--border-light); border-radius: 12px; }
.cd-membership-notice strong { font-size: 14px; }
.cd-membership-notice p { margin: 5px 0 0; font-size: 12px; line-height: 1.6; color: var(--text-secondary); }
.cd-membership-notice .btn { flex-shrink: 0; }
.cd-composer-locked { opacity: .65; }
.cd-composer-locked :disabled { cursor: not-allowed; }
@media(max-width:480px) { .cd-membership-notice { flex-direction: column; align-items: flex-start; } }
