/* The v2 forum and chat (Forum/forumlist.htm, forumthread.htm, forumedit.htm, Chat/chatpage.htm),
   and the comments and composer they share (_outer/v2/threadcomment.htm, composer.htm). */

.community { padding-bottom: 24px; }
.routesx-titlerow { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.community-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.community-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--header-h) + 16px); }
.community-side .home-badge img { height: 40px; width: auto; }
.community-side .home-badge.gp img { height: 58px; margin: -9px -8px; }
.community-search { margin-bottom: 16px; height: 48px; }
.routesx-pages { margin-top: 24px; display: flex; justify-content: center; }

/* ---- the topics ---- */
.topics { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.topic { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; background: var(--c-surface); border: 1px solid var(--c-outline); border-radius: var(--r-m); }
.topic.is-new { border-color: color-mix(in srgb, var(--c-accent) 45%, var(--c-outline)); }
.topic-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--c-surface-2); }
.topic-title { font-weight: 700; font-size: 16px; color: var(--c-text); line-height: 1.35; }
.topic-title:hover { color: var(--c-primary); }
.topic-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.topic-meta .chip { height: 24px; font-size: 12px; }
.topic-count { display: inline-flex; gap: 4px; align-items: center; font-weight: 700; font-size: 14px; color: var(--c-text-2); }
.topic-count.is-new { color: var(--c-accent-strong); }

/* ---- a thread ---- */
.thread-head { display: flex; flex-direction: column; gap: 14px; }
.thread-head .breadcrumb { margin: 0; }
.thread-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.thread-author { display: inline-flex; gap: 8px; align-items: center; color: var(--c-text); font-weight: 600; }
.thread-author img { border-radius: 50%; }
.thread-message { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; padding-top: 14px; border-top: 1px solid var(--c-outline); }
.thread-text { font-size: 17px; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; }
.thread-photo img { width: 240px; max-width: 100%; border-radius: var(--r-m); }
.thread-tools { flex-wrap: wrap; }
.thread-comments .h3 { margin-bottom: 14px; }

/* ---- a comment (forum and chat) ---- */
.tc-list { display: flex; flex-direction: column; margin-top: 14px; }
.tc { padding: 14px 0 14px calc(min(var(--depth, 0), 4) * 28px); border-top: 1px solid var(--c-outline); }
.tc.is-new .tc-meta time { color: var(--c-accent-strong); font-weight: 600; }
.tc.is-parent { background: var(--c-surface-2); border-radius: var(--r-m); padding: 10px 12px; margin: 6px 0; border: 0; }
.tc-context { margin: 0 0 8px 54px; color: var(--c-text-2); }
.tc-parent { margin: 0 0 8px 54px; padding: 6px 10px; background: var(--c-surface-2); border-radius: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tc-row { display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.tc-avatar img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--c-surface-2); }
.tc-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.tc-meta time { color: var(--c-text-2); font-size: 13px; }
.tc-pin { color: var(--c-text-2); display: inline-flex; }
.tc-tool.icon-btn { width: 28px; height: 28px; border: 0; background: none; }
.tc-text { margin-top: 4px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.tc.is-editing .tc-text, .tc.is-editing .tc-photo, .tc.is-editing > .tc-row .tc-actions { display: none; }
.tc-photo { display: inline-block; margin-top: 10px; border-radius: var(--r-m); overflow: hidden; }
.tc-photo img { width: 220px; max-width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.tc-actions { display: flex; gap: 4px; margin-top: 6px; margin-left: -10px; }
.tc-actions .btn { color: var(--c-text-2); }

/* ---- the composer ---- */
.tc-compose { background: var(--c-surface); border: 1px solid var(--c-outline); border-radius: var(--r-l); padding: 14px; }
.tc-slot .tc-form { margin-top: 10px; background: var(--c-surface); border: 1px solid var(--c-outline); border-radius: var(--r-m); padding: 10px; }
.tc-form-row { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start; }
.tc-form-me { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.tc-form textarea { min-height: 44px; resize: none; }
.tc-form-bar { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.tc-form-bar .grow { flex-grow: 1; }
.tc-file { cursor: pointer; max-width: 220px; overflow: hidden; }
.tc-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- chat ---- */
.chat-older { display: flex; justify-content: center; margin-top: 18px; }

/* ---- new and edited topics ---- */
.fe-section { border: 0; padding: 14px 0 0; margin: 0; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--c-outline); }
.fe-photo { align-items: center; gap: 14px; }
.fe-photo img { border-radius: 10px; }

@media (max-width: 1000px) {
  .community-grid { grid-template-columns: 1fr; }
  .community-side { position: static; }
}
@media (max-width: 560px) {
  .tc { padding-left: calc(min(var(--depth, 0), 3) * 14px); }
  .tc-context, .tc-parent { margin-left: 0; }
  .thread-message { grid-template-columns: 1fr; }
  .topic { grid-template-columns: 32px 1fr auto; padding: 12px; gap: 10px; }
  .topic-avatar { width: 32px; height: 32px; }
}
