/* 커뮤니티 게시판 · 1:1 문의 (v2) - studio.css 의 공용 부품 위에 얹는다 */

/* 목록 */
.board-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.board-filter .chip { display: inline-flex; align-items: center; }
.chip[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.bbs-list { list-style: none; margin: 0; padding: 0; overflow: hidden; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-l); }
.bbs-row + .bbs-row { border-top: 1px solid var(--line); }
.bbs-row a { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 18px; }
.bbs-row a:hover { background: var(--bg-elev-2); }
.bbs-row.is-notice .board-title { color: var(--brand); }
.board-type { justify-self: start; }
.board-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.board-title { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-title .cmt { margin-left: 4px; color: var(--brand); font-weight: 800; }
.board-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--text-3); }
.board-meta .to { color: var(--text-2); }
.board-views { font-size: 12px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pager { display: flex; justify-content: center; align-items: center; gap: 4px; margin-top: 20px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 36px; height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.pager a:hover { background: var(--bg-hover); color: var(--text); }
.pager [aria-current="page"] { background: var(--brand); color: var(--brand-ink); }
.pager .is-disabled { opacity: .35; pointer-events: none; }

/* 상세 */
.post { padding: 24px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-l); }
.post-head { display: flex; flex-direction: column; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.post-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.post-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.35; overflow-wrap: anywhere; margin: 0; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--text-3); }
.post-meta strong { color: var(--text-2); font-weight: 700; }
.post-share { margin-left: auto; }
.post-body { padding: 22px 0; font-size: 15px; line-height: 1.8; overflow-wrap: anywhere; }
.post-body p { margin: 0 0 4px; }
.post-body img { max-width: 100%; height: auto; }
.post-body .ck-content { color: var(--text); }
.post-body .ck-content a { color: var(--brand); text-decoration: underline; }
.post-files { display: flex; flex-direction: column; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.post-files h3 { font-size: 14px; font-weight: 800; margin: 0; }
.post-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.post-images button { aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-s); background: var(--bg-elev-2); }
.post-images img { width: 100%; height: 100%; object-fit: cover; }
.file-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 8px 12px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); font-size: 13px; }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip a:hover { color: var(--brand); }
.file-chip .icon-btn { width: 24px; height: 24px; flex: none; }
.file-chip .icon-btn .icon { width: 14px; height: 14px; }
.post-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.post-actions > div { display: flex; gap: 8px; }

/* 댓글 */
.comments { margin-top: 24px; }
.comments h2 { font-size: 17px; font-weight: 800; margin: 0 0 12px; }
.comments h2 span { color: var(--brand); margin-left: 4px; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 8px; }
.comment-form textarea, .comment-edit textarea {
  flex: 1; min-height: 72px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--bg-elev); color: var(--text); font: inherit; font-size: 14px; line-height: 1.6; resize: vertical; outline: none;
}
.comment-form textarea:focus, .comment-edit textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment-who { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.comment-who strong { font-weight: 700; }
.comment-who span { font-size: 12px; color: var(--text-3); }
.comment-text { margin-top: 4px; font-size: 14px; line-height: 1.65; color: var(--text-2); overflow-wrap: anywhere; }
.comment-text p { margin: 0; }
.comment-tools { display: flex; gap: 2px; }
.comment-tools .icon-btn { width: 32px; height: 32px; }
.comment-edit { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.comment-edit textarea { width: 100%; }
.comment-edit > div { display: flex; gap: 6px; justify-content: flex-end; }

/* 글쓰기 · 문의 폼 */
.target-search { position: relative; }
.target-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; display: none; max-height: 240px; overflow-y: auto;
  list-style: none; margin: 0; padding: 6px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.search_result_box.on .target-results { display: block; }
.target-results li { padding: 10px 12px; border-radius: var(--radius-s); font-size: 14px; cursor: pointer; }
.target-results li:hover { background: var(--bg-hover); }
.editor-count { font-size: 12px; color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }
.editor-count.is-over { color: var(--danger); font-weight: 700; }
.file-pick { position: relative; display: inline-flex; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* CKEditor 5 를 v2 테마에 맞춘다 */
.appage .ck.ck-editor {
  --ck-color-base-background: var(--bg);
  --ck-color-base-foreground: var(--bg-elev-2);
  --ck-color-base-border: var(--line);
  --ck-color-text: var(--text);
  --ck-color-toolbar-background: var(--bg-elev-2);
  --ck-color-toolbar-border: var(--line);
  --ck-color-button-default-hover-background: var(--bg-hover);
  --ck-color-button-default-active-background: var(--bg-hover);
  --ck-color-button-on-background: var(--brand-weak);
  --ck-color-button-on-hover-background: var(--brand-weak);
  --ck-color-button-on-color: var(--brand);
  --ck-color-dropdown-panel-background: var(--bg-elev);
  --ck-color-dropdown-panel-border: var(--line);
  --ck-color-panel-background: var(--bg-elev);
  --ck-color-panel-border: var(--line);
  --ck-color-input-background: var(--bg);
  --ck-color-input-border: var(--line);
  --ck-color-input-text: var(--text);
  --ck-color-list-background: var(--bg-elev);
  --ck-color-list-button-hover-background: var(--bg-hover);
  --ck-color-list-button-on-background: var(--brand);
  --ck-color-list-button-on-text: #fff;
  --ck-color-labeled-field-label-background: var(--bg-elev);
  --ck-color-focus-border: var(--brand);
  --ck-focus-ring: 1px solid var(--brand);
  --ck-border-radius: 10px;
  --ck-font-face: var(--font-sans);
  width: 100%;
}
.appage .ck-editor__editable_inline { min-height: 260px; padding: 0 16px !important; }
.appage .ck.ck-toolbar { border-radius: 10px 10px 0 0 !important; }
.appage .ck.ck-editor__main > .ck-editor__editable { border-radius: 0 0 10px 10px !important; }

@media (max-width: 767px) {
  .bbs-row a { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 16px; }
  .board-type { grid-column: 1 / -1; }
  .board-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .post { padding: 18px 16px; border-radius: var(--radius); }
  .post-title { font-size: 20px; }
  .comment-form { flex-direction: column; align-items: stretch; }
  .comment-form textarea { width: 100%; }
  .comment { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; }
}
