/* Community Feed — single-column post cards, built on the site.css tokens. */
.cfeed-screen { padding: 32px 0 88px; }
.cfeed-screen.is-single { padding-top: 120px; }
.cfeed { width: min(100% - 2 * var(--gutter, 20px), 620px); margin-inline: auto; }
.cfeed-chips { margin-bottom: 20px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.cfeed-chips::-webkit-scrollbar { display: none; }
.cfeed-chips .filter-chip { flex-shrink: 0; }
.cfeed-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; font-weight: 700; font-size: 14px; color: var(--blue); }
.cfeed-end { padding: 28px 0; text-align: center; color: var(--muted); font-size: 14px; }
.cfeed-note { margin: 0 0 14px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--danger-50); color: var(--danger); font-size: 14px; font-weight: 600; }
.cfeed-note.is-ok { background: var(--teal-50); color: #0c6f66; }

.cpost { margin-bottom: 18px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.cpost-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cpost-avatar { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--gradient-brand); color: #fff; font-weight: 800; }
.cpost-avatar.is-sm { width: 32px; height: 32px; font-size: 13px; }
.cpost-meta { min-width: 0; margin-right: auto; display: grid; line-height: 1.3; }
.cpost-meta strong { font-size: 14.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cpost-meta time { font-size: 12.5px; color: var(--muted); }
.cpost-badge, .cpost-pin { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.cpost-badge { background: var(--blue-50); color: var(--blue); max-width: 46%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
.cpost-pin { background: var(--teal-50); color: #0c6f66; }
.cpost-title { margin: 0 0 8px; font-size: 19px; line-height: 1.3; font-weight: 800; color: var(--ink); }
h1.cpost-title { font-size: clamp(22px, 4vw, 28px); }
.cpost-title a { color: inherit; }
.cpost-title a:hover { color: var(--blue); }
.cpost-body { font-size: 15.5px; line-height: 1.65; color: var(--text); overflow-wrap: anywhere; }
.cpost-body:not(.is-open) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.cpost-more { margin-top: 4px; padding: 4px 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 700; color: var(--blue); cursor: pointer; }
.cpost-img-link { display: block; margin: 14px -18px 0; }
.cpost-img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--tint); }
h1.cpost-title ~ .cpost-img { margin-top: 14px; aspect-ratio: auto; height: auto; border-radius: var(--radius-sm); }
.cpost-tags { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 14px; font-weight: 600; color: var(--blue); }
.cpost-actions { display: flex; align-items: center; gap: 4px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.cpost-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 999px; background: none; font: inherit; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; transition: background .2s, color .2s; }
.cpost-btn:hover { background: var(--tint); color: var(--ink); }
.cpost-btn:focus-visible, .cpost-more:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.cpost-btn[aria-pressed="true"] { color: var(--danger); }
.cpost-btn[aria-pressed="true"] svg { fill: currentColor; }
.cpost-btn[data-react$="/save"][aria-pressed="true"] { color: var(--blue); }
.cpost-btn.is-end { margin-left: auto; }
@media (max-width: 420px) { .cpost-btn-label { display: none; } }

/* Skeleton shown while the next batch loads */
.cskel { margin-bottom: 18px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cskel span { display: block; height: 14px; margin-bottom: 12px; border-radius: 8px; background: linear-gradient(90deg, var(--tint) 25%, #e6ebf0 50%, var(--tint) 75%); background-size: 200% 100%; animation: cskel 1.2s linear infinite; }
.cskel span:nth-child(1) { width: 40%; }
.cskel span:nth-child(2) { width: 85%; }
.cskel span:nth-child(3) { width: 65%; }
.cskel .is-img { height: 180px; margin-bottom: 0; }
@keyframes cskel { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .cskel span { animation: none; } }

/* Comments */
.ccomments { margin-top: 26px; }
.ccomments h2 { margin: 0 0 14px; font-size: 18px; font-weight: 800; color: var(--ink); }
.ccomments h2 span { margin-left: 4px; padding: 2px 9px; border-radius: 999px; background: var(--tint); font-size: 13px; color: var(--muted); }
.ccomment-form { display: grid; gap: 10px; margin-bottom: 22px; justify-items: start; }
.ccomment-form textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font: inherit; font-size: 15px; resize: vertical; }
.ccomment-form textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.ccomment-login { margin-bottom: 22px; padding: 14px; border-radius: var(--radius-sm); background: var(--tint); font-size: 14.5px; }
.ccomment-login a { font-weight: 700; color: var(--blue); }
.ccomment { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.ccomment p { margin: 0; }
.ccomment-meta { font-size: 13px; color: var(--muted); }
.ccomment-meta strong { color: var(--ink); font-size: 14px; }

/* Desktop: topics on the left, popular posts and hashtags on the right */
.cside { display: none; }
.cfeed-filter { margin: 0 0 14px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--blue-50); font-size: 14.5px; color: var(--text); }
.cfeed-filter a { margin-left: 8px; font-weight: 700; color: var(--blue); }
.cpost-tags a { color: inherit; }
.cpost-tags a:hover { text-decoration: underline; }
.cbox { margin-bottom: 16px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); font-size: 14.5px; line-height: 1.55; color: var(--text); }
.cbox-title { display: flex; align-items: center; gap: 7px; margin: 0 0 12px; font-size: 15px; font-weight: 800; color: var(--ink); }
.cbox p { margin: 0 0 14px; }
.cbox .btn { width: 100%; justify-content: center; }
.cbox-link { display: block; margin-top: 10px; text-align: center; font-size: 13.5px; font-weight: 700; color: var(--blue); }
.cbox.is-join { background: linear-gradient(160deg, var(--blue-50), var(--surface) 70%); }
.cbox.is-promo { background: var(--navy); border-color: var(--navy); color: #dbe6f5; }
.cbox.is-promo .cbox-title { color: #fff; }
.ctopics { display: grid; gap: 2px; }
.ctopics a { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 12px; font-weight: 600; color: var(--text); transition: background .2s; }
.ctopics a svg { flex: none; color: var(--muted); }
.ctopics a span { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: var(--tint); font-size: 12px; font-weight: 700; color: var(--muted); }
.ctopics a:hover { background: var(--tint); }
.ctopics a.is-active { background: var(--blue-50); color: var(--blue); }
.ctopics a.is-active svg { color: var(--blue); }
.cpopular { margin: 0; padding: 0; list-style: none; counter-reset: pop; display: grid; gap: 12px; }
.cpopular li { counter-increment: pop; position: relative; padding-left: 30px; }
.cpopular li::before { content: counter(pop); position: absolute; left: 0; top: 0; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-50); font-size: 12px; font-weight: 800; color: var(--blue); }
.cpopular a { display: block; font-weight: 700; line-height: 1.35; color: var(--ink); }
.cpopular a:hover { color: var(--blue); }
.cpopular small { color: var(--muted); font-size: 12.5px; }
.ctagcloud { margin: 0 !important; display: flex; flex-wrap: wrap; gap: 6px; }
.ctagcloud a { padding: 5px 11px; border-radius: 999px; background: var(--tint); font-size: 13px; font-weight: 700; color: var(--blue); }
.ctagcloud a:hover, .ctagcloud a.is-active { background: var(--blue); color: #fff; }
.cmore { margin-top: 26px; }
.cmore h2 { margin: 0 0 10px; font-size: 18px; font-weight: 800; color: var(--ink); }
.cmore a { display: block; padding: 12px 0; border-top: 1px solid var(--line); }
.cmore strong { display: block; color: var(--ink); line-height: 1.35; }
.cmore a:hover strong { color: var(--blue); }
.cmore small { color: var(--muted); font-size: 12.5px; }
@media (min-width: 1100px) {
    .cwrap { display: grid; grid-template-columns: 250px minmax(0, 620px) 300px; gap: 28px; justify-content: center; align-items: start; padding-inline: var(--gutter, 20px); }
    .cwrap .cfeed { width: 100%; margin: 0; }
    .cwrap .cfeed-chips { display: none; }
    .cside { display: block; position: sticky; top: 96px; max-height: calc(100vh - 110px); overflow-y: auto; scrollbar-width: none; }
    .cside::-webkit-scrollbar { display: none; }
}

/* Card header: name and time keep their room; the Pinned / category labels drop to their own line on narrow cards */
.cpost-head { flex-wrap: wrap; row-gap: 8px; }
.cpost-meta { flex: 1 1 150px; margin-right: 0; }
.cpost-meta time { white-space: nowrap; }
.cpost-labels { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; margin-left: auto; }
.cpost-badge { max-width: 100%; flex: 0 1 auto; }
@media (max-width: 520px) {
    .cpost-labels { flex-basis: 100%; margin-left: 0; }
    .cpost { padding: 16px; }
    .cpost-img-link { margin-inline: -16px; }
}
/* Body paragraphs: spacing comes from margins, so the 4-line preview never ends on an empty line */
.cpost-body p { margin: 0; }
.cpost-body p + p { margin-top: .7em; }
