/* Topluluk: one reading column. Posts are cards on the raised surface; comments sit inside one card and are
   separated by space, not lines. The only yellow is the button that publishes a comment. */
#view-topluluk { max-width: calc(var(--column) + 80px); gap: 16px; }
#view-topluluk .view-head { margin-bottom: 8px; }
.cm-feed { display: flex; flex-direction: column; gap: 16px; }
.cm-status { text-align: center; padding: 8px 0; }
.cm-more { align-self: center; }
.cm-back { align-self: flex-start; }
.cm-slot:empty { display: none; }
.cm-note { font: 500 13px/20px var(--font); }
.cm-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Post */
.cm-post { gap: 16px; }
.cm-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cm-avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--surface-sunken); color: var(--ink); font: 800 16px/1 var(--font); }
.cm-avatar.small { width: 36px; height: 36px; font-size: 14px; }
.cm-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cm-who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cm-name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font: 500 15px/22px var(--font); }
.cm-name strong { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-verified { flex: none; color: var(--success); }
.cm-sub { display: flex; flex-wrap: wrap; gap: 0 8px; font: 500 13px/20px var(--font); color: var(--ink-muted); }
.cm-sub > * + *::before { content: "·"; margin-right: 8px; }
.cm-time { font: 500 13px/20px var(--font); color: var(--ink-muted); white-space: nowrap; }

.cm-rich { font: 400 16px/26px var(--font); overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 10px; }
.cm-rich ul, .cm-rich ol { padding-left: 22px; display: grid; gap: 4px; }
.cm-rich ul { list-style: disc; }
.cm-rich ol { list-style: decimal; }
.cm-rich a { font-weight: 800; text-underline-offset: 3px; }
.cm-rich strong { font-weight: 800; }
.cm-rich .cm-heading { font: 500 18px/26px var(--font); }
.cm-rich blockquote { margin: 0; padding-left: 16px; box-shadow: inset 3px 0 0 var(--surface-sunken); color: var(--ink-muted); }
.cm-rich.is-folded { max-height: 156px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.cm-post > .link, .cm-textbox > .link { align-self: flex-start; margin-top: -8px; }

/* Images: one image, or a strip that snaps from image to image */
.cm-gallery { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.cm-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.cm-track::-webkit-scrollbar { display: none; }
.cm-slide { flex: 0 0 100%; scroll-snap-align: center; display: grid; place-items: center; min-height: 160px; }
.cm-slide img { width: 100%; max-height: 520px; object-fit: contain; }
.cm-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--surface-raised); color: var(--ink); display: grid; place-items: center; box-shadow: 0 2px 10px rgb(40 40 40 / .18); }
.cm-nav.prev { left: 12px; }
.cm-nav.next { right: 12px; }
.cm-nav:disabled { opacity: 0; pointer-events: none; }
.cm-count { position: absolute; right: 12px; bottom: 12px; padding: 2px 10px; border-radius: var(--r-pill); background: var(--coach-surface); color: var(--on-coach); font: 500 12px/18px var(--font); }

/* Related video */
.cm-video { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--r-lg); background: var(--surface); text-decoration: none; color: var(--ink); }
.cm-video-thumb { position: relative; flex: none; width: 160px; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden; background: var(--coach-surface); }
.cm-video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cm-play { position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; background: var(--surface-raised); color: var(--ink); display: grid; place-items: center; padding-left: 2px; }
.cm-video-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cm-video-title { font: 500 15px/22px var(--font); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Survey */
.cm-survey { padding: 16px; border-radius: var(--r-lg); background: var(--surface); }
.cm-survey-title { font: 500 16px/24px var(--font); }
.cm-question { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cm-survey-q { padding: 0; font: 500 14px/20px var(--font); margin-bottom: 8px; }
.cm-option { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 14px; border-radius: var(--r-md); background: var(--surface-raised); font: 500 15px/22px var(--font); cursor: pointer; }
.cm-option input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.cm-option input:disabled { cursor: default; }
.cm-option:has(input:disabled) { cursor: default; color: var(--ink-muted); }
.cm-option.is-mine { color: var(--ink); font-weight: 800; box-shadow: inset 0 0 0 2px var(--ink); }
.cm-option:has(input:checked:not(:disabled)) { box-shadow: inset 0 0 0 2px var(--ink); }

/* Actions under a post and under a comment */
.cm-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.cm-act { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 0; border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font: 500 13px/20px var(--font); text-decoration: none; white-space: nowrap; }
.cm-act:hover:not(.is-static):not(:disabled) { background: var(--surface-sunken); }
.cm-act.is-static { background: none; padding-left: 4px; color: var(--ink-muted); }
.cm-act.small { min-height: 32px; padding: 4px 10px; background: none; color: var(--ink-muted); font-size: 12px; }
.cm-act.small:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
.cm-like.is-on { color: var(--ink); }
.cm-like.is-on svg { fill: currentColor; }
.cm-like:disabled { opacity: 1; }

/* Comments */
.cm-thread { gap: 20px; }
.cm-thread-head { align-items: center; margin: 0 !important; }
.cm-comments, .cm-answers { display: flex; flex-direction: column; gap: 20px; }
.cm-comments:empty, .cm-answers:empty { display: none; }
.cm-comment { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start; }
.cm-cbody { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cm-chead { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.cm-chead .cm-name { font-size: 14px; line-height: 20px; }
.cm-chead > span:not(.cm-name):not(.tag) { font: 500 13px/20px var(--font); color: var(--ink-muted); }
.cm-pin { display: inline-flex; align-items: center; gap: 4px; }
.cm-comment.is-pinned > .cm-cbody > .cm-textbox { padding: 10px 14px; border-radius: 4px var(--r-lg) var(--r-lg) var(--r-lg); background: var(--surface); }
.cm-textbox { display: flex; flex-direction: column; gap: 12px; }
.cm-text { font: 400 15px/23px var(--font); white-space: pre-wrap; overflow-wrap: anywhere; }
.cm-text.is-folded { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.cm-cactions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-left: -10px; }
.cm-answers-toggle { align-self: flex-start; padding: 6px 0; }
.cm-answers { margin-top: 12px; gap: 16px; }
.cm-comment.is-answer { grid-template-columns: 36px minmax(0, 1fr); }

.cm-form { display: flex; flex-direction: column; gap: 8px; }
.cm-input { width: 100%; min-height: 72px; padding: 12px 16px; border: 0; border-radius: var(--r-lg); background: var(--surface); font: 500 15px/23px var(--font); resize: none; }
.cm-input::placeholder { color: var(--gray-400); }
.cm-form-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.cm-hint, .cm-counter { font-size: 13px; line-height: 20px; }
.cm-confirm { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--danger-surface); font: 500 14px/20px var(--font); }
.cm-confirm .btn { min-height: 36px; padding: 6px 16px; }
.cm-delete-yes { color: var(--danger); }

@media (max-width: 900px) {
  #view-topluluk .view-head .pill.outline { display: none; }
  .cm-post, .cm-thread { padding: 16px; border-radius: var(--r-lg); }
  .cm-rich { font-size: 15px; line-height: 24px; }
  .cm-video-thumb { width: 112px; }
  .cm-nav { display: none; } /* fingers swipe the strip */
  .cm-form-foot .cm-hint { flex-basis: 100%; }
  .cm-form-foot .cm-counter { margin-right: auto; }
  .cm-form-foot { gap: 8px; }
  .cm-form .btn { min-height: 40px; padding: 8px 12px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .cm-track { scroll-behavior: auto; } }
