/* 커뮤니티 — 휴대폰 전용 모양. community.html 에서 media="(max-width: 899px)" 로만 불러온다.
   목적: 글을 읽고 쓴다. 글 목록이 바로 보이게 위쪽을 낮추고, 글쓰기는 화면 아래에 늘 떠 있게 한다. */

[data-page="community"] .cm-wrap { padding-top: 12px; }
.cm-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cm-top .cm-title { margin: 0; font-size: 1.45rem; }
.cm-top { flex-wrap: nowrap !important; flex-direction: row !important; }
.cm-top .cm-title small { display: none; }
.cm-top .btn-row { margin: 0; width: auto; flex: 0 0 auto; }
.cm-side .hb-more { display: inline-flex; align-items: center; justify-content: flex-end; min-width: 48px; min-height: 44px; }
.cm-top #gamesBtn { min-height: 44px; padding: 0 14px; font-size: 0.95rem; }

/* 글쓰기: 화면 왼쪽 아래에 떠 있는 단추(오른쪽 아래는 닥터 랩 자리) */
.cm-top #writeBtn {
  position: fixed; left: 16px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  min-height: 52px; padding: 0 22px; border-radius: 26px; font-size: 1.05rem;
  box-shadow: 0 3px 0 #B6881B, 0 14px 22px -10px rgba(20, 40, 75, 0.55);
}
.cm-top #writeBtn::before { content: '✎ '; }

/* 게시판 고르기: 한 줄로 두고 옆으로 민다 */
#catFilter { display: flex; flex-wrap: nowrap; gap: 8px; margin: 0 -16px 10px; padding: 2px 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
#catFilter::-webkit-scrollbar { display: none; }
#catFilter .opt { flex: 0 0 auto; min-height: 44px; padding: 0 16px; white-space: nowrap; }

.cm-search { margin-bottom: 6px; }
.cm-search .input, .cm-search .btn { min-height: 48px; }
.cm-caption { margin: 4px 0 6px; }

/* 인기 글 묶음: 세로로 길게 늘어놓지 않고 옆으로 넘겨 본다 */
.cm-layout { display: block; }
.cm-side { margin-top: 18px; }
.cm-side .hb-grid { display: flex; gap: 10px; margin: 0 -16px; padding: 4px 16px 10px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.cm-side .hb-grid::-webkit-scrollbar { display: none; }
.cm-side .hb-grid > * { flex: 0 0 84%; margin: 0; scroll-snap-align: center; }

[data-page="community"] .notice-box { margin-top: 14px; font-size: 0.9rem; }
[data-page="community"] main { padding-bottom: 64px; }   /* 떠 있는 글쓰기 단추가 마지막 글을 가리지 않게 */
