/* Forum components adapted from the read-only cgca-child reference. */
.cgca-forum-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #ffffff;
  border: 1px solid #e3eaf0;
  border-radius: 12px;
  padding: 18px;
}

.cgca-forum-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid #eef2f5;
  gap: 12px;
}

.cgca-forum-list-title {
  font-size: 16px;
  font-weight: 600;
  color: #0d2438;
  margin: 0;
  letter-spacing: -0.01em;
}

.cgca-forum-list-viewall {
  font-size: 12px;
  font-weight: 600;
  color: #1a8fb8;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.cgca-forum-list-viewall:hover {
  color: #146a89;
  text-decoration: none;
}

/* Outer wrapper is a <div>, not an <a>.
   It hosts the hover state for the whole row. */
.cgca-forum-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #0d2438;
  transition: all 0.2s ease;
}

.cgca-forum-item:hover {
  background: #f7fafc;
  border-color: #e3eaf0;
  transform: translateX(2px);
}

.cgca-forum-item--active {
  background: #eef4f8;
  border-color: #d6e8ef;
}

/* Inner link wraps icon + text (the "main" clickable area).
   Takes up all available space so most of the row goes to the forum. */
.cgca-forum-item-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.cgca-forum-item-link:hover {
  text-decoration: none;
  color: inherit;
}

.cgca-forum-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eef4f8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a8fb8;
  font-size: 13px;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.cgca-forum-item:hover .cgca-forum-icon {
  background: #d6e8ef;
}

.cgca-forum-text {
  flex: 1;
  min-width: 0;
}

.cgca-forum-name {
  font-size: 14px;
  font-weight: 600;
  color: #0d2438;
  line-height: 1.3;
  margin-bottom: 1px;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cgca-forum-meta {
  font-size: 12px;
  color: #8a9aa6;
  line-height: 1.3;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === Last post block (an <a> tag, clickable to latest post) === */
.cgca-forum-lastpost {
  flex-shrink: 0;
  text-align: right;
  line-height: 1.3;
  margin-left: auto;
  padding: 4px 6px;
  margin-right: -6px; /* visually align with row edge while keeping click padding */
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s ease;
  display: block;
}

.cgca-forum-lastpost:hover {
  background: rgba(26, 143, 184, 0.08);
  text-decoration: none;
}

.cgca-forum-lastpost-time {
  font-size: 11px;
  font-weight: 500;
  color: #b8c4cd;
  white-space: nowrap;
  transition: color 0.2s ease;
  display: block;
}

.cgca-forum-lastpost-author {
  display: none;
}

.cgca-forum-lastpost--empty .cgca-forum-lastpost-time {
  color: #d6dde3;
  font-style: italic;
}

/* Row hover tints the timestamp */
.cgca-forum-item:hover .cgca-forum-lastpost-time {
  color: #1a8fb8;
}

/* Direct timestamp hover deepens the teal so the user knows it's its own link */
.cgca-forum-lastpost:hover .cgca-forum-lastpost-time {
  color: #146a89;
  font-weight: 600;
}

@media (max-width: 768px) {
  .cgca-forum-list {
    padding: 14px;
  }

  .cgca-forum-item {
    padding: 10px;
    gap: 10px;
  }

  .cgca-forum-icon {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .cgca-forum-name {
    font-size: 13px;
  }

  .cgca-forum-meta {
    font-size: 11px;
  }
}


/* =============================================================================
   3. COMMUNITY ACTIVITY FEED (.cgca-latest-activity / .cgca-bbp-*)
   ============================================================================= */
.cgca-latest-activity {
  background: #ffffff;
  border: 1px solid #e3eaf0;
  border-radius: 12px;
  padding: 24px 28px;
  font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

.cgca-activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.cgca-activity-title {
  font-size: 18px;
  font-weight: 600;
  color: #0d2438;
  margin: 0;
  letter-spacing: -0.01em;
}

.cgca-activity-viewall {
  font-size: 13px;
  font-weight: 600;
  color: #1a8fb8;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s ease;
}

.cgca-activity-viewall:hover {
  color: #146a89;
  text-decoration: none;
}

.cgca-activity-viewall .cgca-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.cgca-activity-viewall:hover .cgca-arrow {
  transform: translateX(3px);
}

/* ---- bbPress custom list ---- */
.cgca-bbp-wrapper {
  font-family: inherit;
  min-width: 0;
  overflow: hidden;
}

.cgca-bbp-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.cgca-bbp-item {
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr) !important;
  column-gap: 14px !important;
  padding: 18px 0 !important;
  margin: 0 !important;
  border-bottom: 1px solid #eef2f5 !important;
  list-style: none !important;
}

.cgca-bbp-item:first-child {
  padding-top: 0 !important;
}

.cgca-bbp-item:last-child {
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

/* Avatar */
.cgca-bbp-avatar img,
.cgca-bbp-avatar img.avatar {
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
  border: none !important;
}

/* Header line (author + action + topic + time) */
.cgca-bbp-content {
  min-width: 0;
}

.cgca-bbp-header {
  font-size: 14px;
  line-height: 1.5;
  color: #5a6b7a;
  margin-bottom: 8px;
}

.cgca-bbp-author {
  color: #0d2438 !important;
  font-weight: 600 !important;
}

.cgca-bbp-topic {
  color: #1a8fb8 !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  transition: color 0.2s ease;
}

.cgca-bbp-topic:hover {
  color: #146a89 !important;
  text-decoration: underline !important;
}

.cgca-bbp-action {
  margin: 0 4px;
}

.cgca-bbp-time {
  display: block;
  color: #8a9aa6;
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
}

/* Inner content excerpt */
.cgca-bbp-inner {
  padding: 12px 14px;
  background: #f7fafc;
  border-radius: 8px;
  border: 1px solid #eef2f5;
  font-size: 14px;
  line-height: 1.55;
  color: #0d2438;
  min-width: 0;
  overflow: hidden;
}

.cgca-bbp-inner p {
  margin: 0 0 8px 0;
  padding: 0;
}

.cgca-bbp-inner p:last-child {
  margin-bottom: 0;
}

.cgca-bbp-inner a {
  color: #1a8fb8 !important;
  text-decoration: none !important;
}

.cgca-bbp-inner a:hover {
  text-decoration: underline !important;
}

/* Responsive video embeds */
.cgca-bbp-inner iframe,
.cgca-bbp-inner embed,
.cgca-bbp-inner object,
.cgca-bbp-inner video {
  max-width: 100% !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  border-radius: 8px !important;
  display: block !important;
  margin: 8px 0 !important;
  border: none !important;
}

.cgca-bbp-inner img {
  max-width: 100% !important;
  height: auto !important;
}

/* ---- Reply action row ---- */
.cgca-bbp-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cgca-bbp-reply-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #1a8fb8 !important;
  text-decoration: none !important;
  padding: 6px 12px;
  border: 1px solid #d9e3eb;
  border-radius: 6px;
  background: #ffffff;
  transition: all 0.2s ease;
  line-height: 1;
}

.cgca-bbp-reply-btn:hover {
  color: #ffffff !important;
  background: #1a8fb8;
  border-color: #1a8fb8;
  text-decoration: none !important;
}

.cgca-bbp-reply-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.cgca-bbp-empty {
  color: #8a9aa6;
  font-size: 14px;
  margin: 0;
}

/* "Load more" button for [cgca-bbp-latest]. */
.cgca-bbp-loadmore-wrap {
  display: flex;
  justify-content: center;
  margin: 16px 0 0;
}

.cgca-bbp-loadmore-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #1a8fb8;
  background: #ffffff;
  border: 1px solid #d9e3eb;
  border-radius: 8px;
  padding: 10px 22px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.cgca-bbp-loadmore-btn:hover:not(:disabled) {
  color: #ffffff;
  background: #1a8fb8;
  border-color: #1a8fb8;
}

.cgca-bbp-loadmore-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

@media (max-width: 600px) {
  .cgca-latest-activity {
    padding: 20px;
    border-radius: 10px;
  }

  .cgca-activity-title {
    font-size: 17px;
  }

  .cgca-bbp-item {
    grid-template-columns: 40px minmax(0, 1fr) !important;
    column-gap: 12px !important;
    padding: 14px 0 !important;
  }

  .cgca-bbp-avatar img,
  .cgca-bbp-avatar img.avatar {
    width: 40px !important;
    height: 40px !important;
  }

  .cgca-bbp-header,
  .cgca-bbp-inner {
    font-size: 13px !important;
  }

  .cgca-bbp-reply-btn {
    font-size: 12px !important;
    padding: 5px 10px;
  }
}


/* =============================================================================
   6. SHARED HEADER HELPERS
   Used by both the Recent Topics and Recent Replies cards. Defined once here
   (the original Code Blocks duplicated these — consolidated, no conflict).
   ============================================================================= */
.cgca-recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}

.cgca-recent-title {
  font-size: 18px;
  font-weight: 600;
  color: #0d2438;
  margin: 0;
  letter-spacing: -0.01em;
}

.cgca-recent-viewall {
  font-size: 13px;
  font-weight: 600;
  color: #1a8fb8;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s ease;
}

.cgca-recent-viewall:hover {
  color: #146a89;
  text-decoration: none;
}

.cgca-recent-viewall .cgca-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.cgca-recent-viewall:hover .cgca-arrow {
  transform: translateX(3px);
}


/* =============================================================================
   4. RECENT TOPICS CARD
   ============================================================================= */
.cgca-recent-topics {
  background: #ffffff;
  border: 1px solid #e3eaf0;
  border-radius: 12px;
  padding: 24px 28px;
  font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

.cgca-recent-topic-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.cgca-recent-topic-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 14px 0 !important;
  margin: 0 !important;
  border-bottom: 1px solid #eef2f5 !important;
  list-style: none !important;
}

.cgca-recent-topic-item:last-child {
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

.cgca-recent-topic-item:first-child {
  padding-top: 0 !important;
}

.cgca-recent-topic-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef4f8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a8fb8;
  font-size: 12px;
  flex-shrink: 0;
}

.cgca-recent-topic-link {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #1a8fb8;
  text-decoration: none;
  line-height: 1.4;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.cgca-recent-topic-link:hover {
  color: #146a89;
  text-decoration: underline;
}

@media (max-width: 600px) {
  .cgca-recent-topics {
    padding: 20px;
    border-radius: 10px;
  }

  .cgca-recent-topics .cgca-recent-title {
    font-size: 17px;
  }

  .cgca-recent-topic-item {
    padding: 12px 0 !important;
    gap: 10px !important;
  }

  .cgca-recent-topic-link {
    font-size: 13px;
    white-space: normal;
  }
}


/* =============================================================================
   5. RECENT REPLIES CARD
   ============================================================================= */
.cgca-recent-replies {
  background: #ffffff;
  border: 1px solid #e3eaf0;
  border-radius: 12px;
  padding: 24px 28px;
  font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

.cgca-recent-reply-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.cgca-recent-reply-item {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  padding: 14px 0 !important;
  margin: 0 !important;
  border-bottom: 1px solid #eef2f5 !important;
  list-style: none !important;
}

.cgca-recent-reply-item:last-child {
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

.cgca-recent-reply-item:first-child {
  padding-top: 0 !important;
}

/* Avatar */
.cgca-recent-reply-avatar {
  flex-shrink: 0;
}

.cgca-recent-reply-avatar img,
.cgca-recent-reply-avatar-img {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 !important;
  border: none !important;
}

/* Text column */
.cgca-recent-reply-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cgca-recent-reply-author {
  font-size: 13px;
  font-weight: 600;
  color: #0d2438;
  line-height: 1.3;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cgca-recent-reply-link {
  font-size: 13px;
  color: #1a8fb8;
  text-decoration: none;
  line-height: 1.4;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.cgca-recent-reply-link:hover {
  color: #146a89;
  text-decoration: underline;
}

@media (max-width: 600px) {
  .cgca-recent-replies {
    padding: 20px;
    border-radius: 10px;
  }

  .cgca-recent-replies .cgca-recent-title {
    font-size: 17px;
  }

  .cgca-recent-reply-item {
    padding: 12px 0 !important;
    gap: 10px !important;
  }

  .cgca-recent-reply-avatar img,
  .cgca-recent-reply-avatar-img {
    width: 32px !important;
    height: 32px !important;
  }

  .cgca-recent-reply-author,
  .cgca-recent-reply-link {
    font-size: 12px;
  }

  .cgca-recent-reply-link {
    white-space: normal;
  }
}



.cgc-community-layout{display:grid;grid-template-columns:minmax(300px,0.9fr) minmax(0,1.5fr);gap:28px;align-items:start}.cgc-community-rail{display:grid;gap:22px}.cgc-community-search{display:flex;gap:10px;margin-bottom:24px}.cgc-community-search input{flex:1;min-width:0;background:white;border:1px solid #d4e1e8;border-radius:6px}.cgc-community-search button,.cgca-bbp-loadmore-btn{background:#147a91;color:white;border-radius:6px}.cgc-community-layout a{color:#147a91}.cgc-community-layout .cgca-forum-list,.cgc-community-layout .cgca-latest-activity{font-family:inherit}.cgca-forum-icon svg{width:20px;height:20px}.cgc-community-layout .cgca-forum-name{font-size:15px}.cgc-community-layout .cgca-forum-meta{font-size:12px}.cgc-community-layout .cgca-forum-item{padding:12px 6px}.cgc-community-layout .cgca-forum-lastpost{min-width:54px;font-size:11px}.cgc-community-layout .cgca-forum-lastpost-author{display:none}.cgc-community-layout .cgca-feature-card{border:1px solid #e3eaf0;border-radius:12px;padding:22px;background:#edf7f9}.cgc-community-layout h3{font-size:18px;margin:0 0 14px}.cgc-community-layout .cgca-bbp-time{color:#607580}.cgc-community-layout .cgca-bbp-inner{overflow-wrap:anywhere}.cgc-community-layout .cgc-initial-avatar{display:grid;place-items:center;width:44px;height:44px;background:#e8f2f6;color:#235369;border-radius:50%;font-weight:600}.cgc-community-layout .cgca-recent-topics,.cgc-community-layout .cgca-recent-replies{padding:22px}.cgc-community-layout .cgc-recent-list{margin:0;list-style:none}.cgc-recent-list li{padding:10px 0;border-top:1px solid #eef2f5;font-size:14px}.cgc-recent-list small{display:block;color:#526c7a}.cgc-community-layout a:focus-visible,.cgc-community-layout button:focus-visible{outline:3px solid #1f9ab6;outline-offset:3px}@media(max-width:850px){.cgc-community-layout{grid-template-columns:1fr}.cgca-latest-activity{padding:22px 18px}.cgc-community-search{flex-wrap:wrap}.cgc-community-layout .cgca-forum-item{padding:10px 4px}}
.cgc-community-rail,.cgc-community-layout .cgca-forum-list,.cgc-community-layout .cgca-latest-activity{min-width:0}.cgc-community-layout .cgca-forum-name,.cgc-community-layout .cgca-forum-meta{display:block;white-space:normal}.cgc-community-layout .cgca-forum-text{min-width:0}.cgc-community-search input,.cgc-community-search button{padding:12px 18px;font-size:15px}.cgc-community-search button{border:0}.cgc-community-layout .cgca-forum-lastpost{flex-shrink:0;max-width:65px;white-space:normal;line-height:1.4}
/* Match the original 1/3 directory and 2/3 community composition. */
.cgc-community-layout{grid-template-columns:minmax(0,1fr) minmax(0,2fr)}.cgc-community-main{display:grid;gap:24px;min-width:0}.cgc-community-recent{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}.cgc-community-recent>section{min-width:0;margin:0}.cgc-community-layout .cgca-feature-card{margin:0}.cgca-bbp-avatar img{object-fit:cover}.cgc-community-layout .cgc-recent-list a{overflow-wrap:anywhere}.cgc-community-layout .cgca-forum-icon{flex-shrink:0}
@media(max-width:850px){.cgc-community-layout{grid-template-columns:1fr}}@media(max-width:540px){.cgc-community-recent{grid-template-columns:1fr}}
