/* board-view: 글 보기, 댓글 */

/* 머리 */
.pv-head-row { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.pv-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pv-tags .tag { display: inline-flex; align-items: center; gap: 4px; }
.pv-tags .tag .ico { width: 11px; height: 11px; stroke-width: 2.2; }
.pv .post-title { overflow-wrap: anywhere; word-break: keep-all; }
.pv-owner { display: flex; gap: 6px; flex: 0 0 auto; }
.pv-edited { color: var(--muted); font-size: var(--fs-xs); margin-left: 6px; }
.pv-meta { gap: 6px 16px; }
.pv-author { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.pv-author strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar > .ico { width: 14px; height: 14px; stroke-width: 2; }
.pv-meta-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.pv-meta-item > .ico { width: 14px; height: 14px; color: #7f8db0; }
.pv-meta-link { color: inherit; text-decoration: none; }
/* 작은 칩·링크는 모양은 그대로 두고 누르는 범위만 넓힌다 */
.pv-tags a.tag, .pv-meta-link { position: relative; }
.pv-tags a.tag::after, .pv-meta-link::after { content: ""; position: absolute; inset: -10px -3px; }
.pv-meta-link:hover { color: var(--accent-hi); }
.pv-num, .post-meta [data-likes], .pv-meta time { font-variant-numeric: tabular-nums; }

/* 본문 안 긴 주소, 코드 */
.pv .post-text { overflow-wrap: anywhere; }
.pv .post-text pre { max-width: 100%; overflow-x: auto; }
/* 표 칸이 한 글자씩 세로로 찌그러지지 않게: 낱말 단위로 줄바꿈, 넘치면 표만 가로 스크롤 */
.pv .post-text th, .pv .post-text td { min-width: 6em; overflow-wrap: break-word; word-break: keep-all; }
.pv .post-text iframe, .pv .post-text video { max-width: 100%; }

/* 추천, 도구 */
.pv-actions { padding: 22px 22px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.pv-vote { display: flex; gap: 10px; margin: 0; }
.pv-vote-btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 92px; min-height: 76px; padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font-size: var(--fs-sm); font-weight: 700; line-height: 1.3; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s, opacity .15s; }
.pv-vote-btn > .ico { width: 20px; height: 20px; color: var(--muted); transition: color .15s, transform .15s; }
.pv-vote-btn strong { font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.pv-vote-btn:hover:not(:disabled) { background: var(--surface-3); border-color: var(--accent-line); }
.pv-vote-btn:hover:not(:disabled) > .ico { color: var(--text); }
.pv-vote-btn:active:not(:disabled) > .ico { transform: scale(.9); }
.pv-vote-btn.is-up[aria-pressed="true"] { background: var(--accent-wash); border-color: var(--accent); color: var(--accent-hi); }
.pv-vote-btn.is-up[aria-pressed="true"] > .ico { color: var(--accent); }
.pv-vote-btn.is-down[aria-pressed="true"] { background: rgba(255, 90, 106, .1); border-color: var(--danger); color: var(--danger-hi); }
.pv-vote-btn.is-down[aria-pressed="true"] > .ico { color: var(--danger); }
.pv-vote-btn[aria-pressed="true"] > .ico { fill: currentColor; }
.pv-vote-btn:disabled { cursor: default; opacity: .65; }
.pv-vote[aria-busy="true"] .pv-vote-btn { opacity: .6; cursor: progress; }
.pv-tool[aria-busy="true"] { opacity: .6; cursor: progress; }
.pv-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pv-tools > form { display: contents; }
.pv-tools .btn { font-weight: 600; }
.pv-tool[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-hi); }
.pv-tool.is-done { border-color: var(--accent-line); color: var(--accent-hi); }
.pv-status { margin: 0; min-height: 1.4em; font-size: var(--fs-sm); color: var(--muted); text-align: center; }
.pv-status:empty { display: none; }
.is-bump { display: inline-block; animation: pv-bump .32s ease-out; }
@keyframes pv-bump { 0% { transform: translateY(0); } 35% { transform: translateY(-3px); } 100% { transform: translateY(0); } }

/* 목록, 글쓰기 */
.post-nav .btn > .ico { color: inherit; }

/* 이전글, 다음글 */
.pv-prevnext { border-top: 1px solid var(--line); }
.pv-pn-row { position: relative; display: flex; align-items: center; gap: 14px; min-height: 46px; padding: 8px 22px; font-size: var(--fs-sm); transition: background-color .15s; }
a.pv-pn-title::after { content: ""; position: absolute; inset: 0; } /* 줄 전체를 누를 수 있게 */
.pv-pn-row:has(a.pv-pn-title):hover { background: rgba(91, 155, 255, .05); }
.pv-pn-row:hover a.pv-pn-title { color: var(--accent-hi); }
.pv-pn-row + .pv-pn-row { border-top: 1px solid var(--line-soft); }
.pv-pn-label { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-weight: 600; }
.pv-pn-label > .ico { width: 15px; height: 15px; }
.pv-pn-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
a.pv-pn-title { padding: 4px 0; }
a.pv-pn-title:hover { color: var(--accent-hi); }
.pv-pn-title.is-locked { color: var(--muted); }
.pv-pn-date { flex: 0 0 auto; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 댓글 */
/* #comments, #c123 으로 이동할 때 고정 머리에 가리지 않게 */
.pv-comments, .pv-comment, .pv-reply-form { scroll-margin-top: 84px; }
.pv-comments .panel-head h2.title { font-size: var(--fs-md); gap: 6px; }
.pv-count { color: var(--accent-hi); font-variant-numeric: tabular-nums; }
.pv-thread { border-bottom: 1px solid var(--line-soft); }
.pv-thread .comment-item { border-bottom: 0; }
.pv-thread:first-child > .pv-comment:first-child { padding-top: 0; }
.pv-comment { position: relative; }
.pv-comment.is-reply { margin-left: 0; padding: 12px 0 12px 30px; border-top: 1px dashed var(--line-soft); }
.pv-reply-mark { position: absolute; left: 8px; top: 17px; width: 15px; height: 15px; color: #6a7899; }
.pv-comment-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.pv-comment-who { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; min-width: 0; }
.pv-comment-who .avatar { width: 24px; height: 24px; }
.pv-comment-who .avatar > .ico { width: 12px; height: 12px; }
.pv-comment-time { color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.pv-comment-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.pv-link { position: relative; display: inline-flex; align-items: center; height: 32px; padding: 0 10px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 14px; font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s; }
.pv-link::after { content: ""; position: absolute; inset: -6px -2px; }
.pv-link:hover, .pv-link[aria-expanded="true"] { color: var(--text); background: var(--surface-3); }
.pv-link.comment-del:hover { color: var(--danger-hi); background: rgba(255, 90, 106, .1); }
.pv-writer { font-size: 12px; font-weight: 700; line-height: 18px; padding: 0 7px; border-radius: 999px; color: var(--accent-hi); box-shadow: inset 0 0 0 1px var(--accent-line); }
.pv-secret-tag { color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
.pv-comment.by-author > .pv-comment-head strong { color: var(--accent-hi) !important; }
.pv-comment .comment-content { margin-top: 2px; color: #dde4f2; overflow-wrap: anywhere; }
.pv-comment .comment-content p:first-child { margin-top: 8px; }
.pv-comment .comment-content p:last-child { margin-bottom: 0; }
.pv-masked { display: flex; align-items: center; padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--r-md); color: var(--muted); font-size: var(--fs-sm); }
.pv-comment.is-deleted { padding-bottom: 10px; }
.pv-edit-form { margin-top: 8px; }
.pv-reply-form { margin: 0 0 14px 30px; padding: 12px; border: 1px solid var(--accent-line); border-radius: var(--r-md); background: var(--surface-2); }
.pv-comment-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.pv-comments .panel-body > .pv-comment-form:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.pv-comments textarea.form-control { min-height: 96px; max-height: 420px; resize: vertical; font-size: 15px; line-height: 1.6; }
.pv-comment-form textarea.form-control { min-height: 120px; }
.pv-form-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.pv-form-opts { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; min-width: 0; }
.pv-form-btns { display: flex; gap: 8px; margin-left: auto; }
/* 등록·저장·취소: 본문 기본 버튼보다 한 단계 크게 */
.pv-form-foot .btn, .pv-dialog-foot .btn { min-height: 44px; padding: 0 20px; }
.pv-form-foot .pv-submit, .pv-dialog-foot .pv-submit { min-width: 96px; padding: 0 22px; }
.pv-form-foot .form-check { display: flex; align-items: center; gap: 8px; min-height: 36px; padding-left: 0; }
.pv-form-foot .form-check-input { float: none; margin: 0; }
.pv-form-foot .form-check-label { font-size: 14px; color: var(--muted); cursor: pointer; }
/* 비밀댓글: 체크 상자까지 덮는 글자 영역을 눌러도 켜지고 꺼지게 */
.pv-form-foot .form-check-label { display: inline-flex; align-items: center; align-self: stretch; margin-left: -26px; padding: 0 6px 0 26px; }
.pv-form-foot .form-check-input:checked + .form-check-label { color: var(--text); }
.pv-form-foot .form-check-input { background-color: var(--field); border-color: var(--line-strong); }
.pv-form-foot .form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.pv-chars { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.pv-chars.is-near { color: var(--danger-hi); }
.pv-chars.is-full { color: var(--danger); font-weight: 700; }
.pv-form-btns .btn[aria-busy="true"], .pv-dialog .btn[aria-busy="true"] { opacity: .7; cursor: progress; }
.pv-comment:target { background: var(--accent-wash); border-radius: var(--r-sm); }
.pv-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 0 22px; color: var(--muted); font-size: var(--fs-sm); text-align: center; }
.pv-empty > .ico { width: 26px; height: 26px; stroke-width: 1.6; color: #56627e; }

/* 신고 창 */
.pv-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--text); }
.pv-dialog::backdrop { background: rgba(3, 6, 16, .72); }
.pv-dialog form { padding: 20px; }
.pv-dialog .form-label { font-size: var(--fs-sm); font-weight: 600; margin-bottom: 6px; }
.pv-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -4px -6px 6px 0; }
.pv-dialog-title { font-size: var(--fs-lg); font-weight: 800; margin: 0; }
.pv-dialog-x { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--r-md); color: var(--muted); transition: background-color .15s, color .15s; }
.pv-dialog-x:hover { background: var(--surface-3); color: var(--text); }
.pv-dialog-x > .ico { width: 18px; height: 18px; }
.pv-dialog-desc { font-size: var(--fs-sm); color: var(--muted); margin: 0 0 16px; }
.pv-dialog-error { margin: 10px 0 0; font-size: var(--fs-sm); color: var(--danger-hi); }
.pv-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
/* JS 없이 ?report 로 연 경우 */
.pv-dialog[open]:not(:modal) { position: fixed; inset: 0; margin: auto; height: fit-content; z-index: 200; box-shadow: var(--shadow); }
.lightbox-close { display: inline-flex; align-items: center; justify-content: center; }
.lightbox-close > .ico { width: 18px; height: 18px; }

@media (max-width: 767.98px) {
  .pv-actions { padding-left: 14px; padding-right: 14px; }
  .pv-pn-row { padding-left: 14px; padding-right: 14px; gap: 10px; }
  .pv-reply-form { margin-left: 0; }
  /* 터치 영역 44px */
  .pv .btn-sm, .pv-dialog .btn-sm { min-height: 44px; padding-left: 12px; padding-right: 12px; }
  .pv-dialog-x { width: 44px; height: 44px; }
  .pv-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); width: 100%; max-width: 420px; }
  .pv-tools .btn { white-space: nowrap; }
  .pv-form-foot .form-check { min-height: 44px; }
  .pv-form-btns { flex: 1 1 auto; justify-content: flex-end; }
}
@media (max-width: 420px) {
  .pv-head-row { flex-direction: column; }
  .pv-owner { align-self: flex-end; }
  .pv-pn-date { display: none; }
  .pv-vote { width: 100%; }
  .pv-vote-btn { flex: 1; min-width: 0; padding: 8px 10px; }
  .pv-comment-head { flex-wrap: wrap; }
  .pv-comment-actions { margin-left: auto; }
  .pv-comment.is-reply { padding-left: 24px; }
  .pv-reply-mark { left: 4px; }
  .pv-form-btns { width: 100%; }
  .pv-form-btns .btn { flex: 1; }
  .pv-comment-form .pv-form-foot > .pv-submit { width: 100%; } /* 줄바꿈되면 왼쪽에 홀로 남지 않게 */
}
@media (prefers-reduced-motion: reduce) {
  .pv-vote-btn, .pv-vote-btn > .ico, .pv-link { transition: none; }
}

/* 인쇄 */
@media print {
  .notice-bar, .pv-empty, .pv-comments:not(:has(.pv-comment)),
  .site-header, .site-footer, .drawer, .drawer-overlay, .fab-stack, .toast-notice, .alert,
  .pv-actions, .post-nav, .pv-prevnext, .pv-comment-form, .pv-reply-form, .pv-edit-form,
  .pv-comment-actions, .pv-dialog, .lightbox, .post-header form, .post-header .btn, .pv-owner { display: none !important; }
  .pv .ico { display: none !important; }
  html, body { background: #fff !important; color: #000 !important; }
  .page { max-width: none; padding: 0; }
  .panel { background: #fff !important; border: 0 !important; box-shadow: none !important; }
  .panel-head { background: #fff !important; border-bottom: 1px solid #999 !important; }
  .post-header, .post-content, .post-images { border-color: #999 !important; padding-left: 0; padding-right: 0; }
  .post-title, .panel-head .title, .pv-count, .post-text, .post-text *, .comment-content, .post-meta, .post-meta strong,
  .pv-comment strong, .text-white, .pv-meta-link { color: #000 !important; }
  .post-text a { color: #000 !important; }
  .tag, .level-badge, .pv-writer { color: #000 !important; background: none !important; box-shadow: inset 0 0 0 1px #999 !important; }
  .avatar { display: none !important; }
  .pv-comment.is-reply { padding-left: 18px; border-left: 2px solid #999; border-top: 0; }
  .pv-masked { border-color: #999; color: #444; }
  .pv-comment:target { background: none; }
  .post-img-thumb { break-inside: avoid; }
}
