/* community.html — forum home */
.forum-head { display: grid; gap: var(--sp-4); }
.forum-head__intro { display: grid; gap: var(--sp-2); min-width: 0; }
.forum-head__lede { color: var(--text-muted); max-width: 60ch; }
.forum-head__members { display: block; color: var(--text-faint); white-space: nowrap; }
.forum-head__tools { display: grid; gap: var(--sp-3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) {
  .forum-head { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .forum-head__tools { grid-template-columns: minmax(200px, 280px) auto; align-items: center; }
}
.forum-head .btn { white-space: nowrap; justify-content: center; }


/* toolbar: category chips (scroll) + sort, one row when it fits */
.forum-controls { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-3); min-width: 0; }
.forum-controls .tabs { min-width: 0; }
.forum-filters { padding-bottom: 2px; }
.forum-filters .chip { flex: none; }
.forum-livemark { background: var(--red); margin-left: 6px; vertical-align: middle; }
.forum-sort .tabs__list { overflow-x: auto; scrollbar-width: none; }
.forum-sort .tabs__tab { flex: 1 0 auto; justify-content: center; min-height: 40px; }
@media (min-width: 1100px) {
  .forum-controls { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--sp-4); }
  .forum-sort .tabs__tab { min-height: 32px; flex: none; }
}

/* compact thread row: avatar · title + one meta line · replies */
.frow { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3); min-height: 64px; padding: var(--sp-3) var(--sp-4); color: var(--text); text-decoration: none; transition: background-color var(--dur-fast); }
a.frow:hover { background: var(--surface-2); }
a.frow:hover .frow__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a.frow:focus-visible { outline-offset: -2px; }
.frow[hidden] { display: none; }
.frow.is-fresh { animation: forum-fresh 1.6s ease-out; }
@keyframes forum-fresh { from { background: var(--yellow-soft); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .frow.is-fresh { animation: none; } }
.frow.is-pinned { background: var(--surface-2); }
.frow.is-unread::before { content: ""; position: absolute; left: 5px; top: 22px; width: 6px; height: 6px; border-radius: var(--r-full); background: var(--red); }
.frow .avatar { align-self: start; margin-top: 2px; }
.frow__body { display: grid; gap: 3px; min-width: 0; }
.frow__title { font-weight: var(--fw-semibold); color: var(--text-strong); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.frow__meta { display: block; min-width: 0; line-height: 1.6; font-size: var(--fs-xs); color: var(--text-muted); }
.frow__meta .username { font-size: var(--fs-xs); }
.frow__sep { color: var(--text-faint); margin-inline: 5px; }
.frow__meta > * { vertical-align: middle; }
.frow__meta .level { margin-left: 4px; }
.frow__pin, .frow__lock { display: inline-block; margin-right: 4px; }
.frow__pin, .frow__lock { width: 13px; height: 13px; flex: none; color: var(--text-muted); }
.frow__side { display: grid; justify-items: end; gap: 4px; }
.frow__count { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.frow__count .icon { width: 16px; height: 16px; }
.frow__count b { font-weight: var(--fw-semibold); color: var(--text-strong); }
.frow__hot { fill: var(--yellow); stroke: var(--yellow-text); }
.frow__state { display: inline-flex; align-items: center; gap: 5px; font-weight: var(--fw-semibold); color: var(--text-muted); }
.frow__state--live { padding: 1px 6px; background: var(--red); color: var(--on-red); font-size: var(--fs-2xs); letter-spacing: .04em; text-transform: uppercase; border-radius: var(--r-sm); }
.frow__state--live .dot { width: 6px; height: 6px; background: currentColor; }
.frow__join { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--red-text, var(--red)); }
.frow__join::after { content: " \2192"; }
html[data-match="live"] .frow.is-live { box-shadow: inset 3px 0 0 var(--live); }
html[data-match="live"] .frow.is-live::before { display: none; }

.forum-more { display: flex; justify-content: center; margin-top: var(--sp-3); }
.forum-more[hidden], .forum-more .btn[hidden] { display: none; }
#latest-empty { margin-top: var(--sp-3); }
#latest-empty[hidden] { display: none; }

@media (max-width: 599px) {
  .frow__lr { display: none; }
  /* phone: title + reply count on line 1, meta gets the full width on line 2 as ONE line (no orphaned separators) */
  .frow { grid-template-rows: auto auto; row-gap: 4px; align-items: start; }
  .frow__body { display: contents; }
  .frow > .avatar { grid-column: 1; grid-row: 1 / span 2; }
  .frow__title { grid-column: 2; grid-row: 1; }
  .frow__side { grid-column: 3; grid-row: 1; }
  .frow__meta { grid-column: 2 / -1; grid-row: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.forum-livemark::after { content: none; }
.frow__when { white-space: nowrap; }
html:not([data-match="live"]) .forum-livemark { display: none; }
