/* ═══════════════════════════════════════════════════════
   skins/board/new  |  클래스 접두사: nw-
═══════════════════════════════════════════════════════ */

/* hidden 속성이 display 규칙에 묻히지 않도록 */
.nw-modal[hidden],
.nw-form-wrap[hidden],
.nw-sub-form[hidden],
.nw-method-panel[hidden],
.nw-fp-img[hidden],
.nw-fp-remove[hidden] {
  display: none !important;
}

/* ── 플래시 ── */
.nw-flash {
  padding: .6rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: .875rem;
}
.nw-flash.success { background: #d1fae5; color: #065f46; }
.nw-flash.error   { background: #fee2e2; color: #991b1b; }

/* ═══════════════════════════════════════════════════════
   상단 버튼바 — 가운데 정렬
═══════════════════════════════════════════════════════ */
.nw-topbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .65rem;
  margin-bottom: 1.2rem;
}

.nw-cat-nav {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  justify-content: center;
}
.nw-cat-tab {
  padding: .3rem .75rem;
  border-radius: 20px;
  font-size: .82rem;
  text-decoration: none;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--hair);
  transition: background .12s, color .12s;
}
.nw-cat-tab.active,
.nw-cat-tab:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.nw-topbar-btns {
  display: flex;
  gap: .5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.nw-write-toggle,
.nw-refresh-btn {
  padding: .4rem 1.1rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: .82rem;
  border: 1px solid var(--hair);
  transition: opacity .15s, background .12s;
}
.nw-write-toggle {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.nw-write-toggle:hover { opacity: .85; }
.nw-refresh-btn {
  background: var(--paper);
  color: var(--ink-soft);
}
.nw-refresh-btn:hover { background: var(--paper-2); }

/* ═══════════════════════════════════════════════════════
   작성 폼
═══════════════════════════════════════════════════════ */
.nw-form-wrap {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 1.4rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.nw-fp-box {
  position: relative;
  width: 100%;
  min-height: 160px;
  background: var(--paper-2);
  border-radius: 8px;
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.nw-fp-placeholder { color: var(--ink-mute); font-size: .85rem; }
.nw-fp-img { max-width: 100%; max-height: 260px; object-fit: contain; display: block; }
.nw-fp-remove {
  position: absolute; top: .45rem; right: .45rem;
  background: rgba(0,0,0,.5); color: #fff; border: none;
  border-radius: 50%; width: 24px; height: 24px;
  font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.nw-fp-remove:hover { background: rgba(0,0,0,.75); }

.nw-img-methods { display: flex; align-items: center; gap: .5rem; margin-bottom: .55rem; flex-wrap: wrap; }
.nw-method-btn {
  padding: .28rem .7rem; border: 1px solid var(--hair); border-radius: 4px;
  background: var(--paper); color: var(--ink-soft); font-size: .8rem; cursor: pointer;
}
.nw-method-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.nw-paste-hint { font-size: .76rem; color: var(--ink-mute); margin-left: auto; }

.nw-method-panel { margin-bottom: .55rem; }

.nw-drop-zone {
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--hair); border-radius: 6px;
  padding: 1rem; text-align: center; color: var(--ink-mute);
  font-size: .82rem; cursor: pointer; position: relative;
  transition: border-color .15s, background .15s; min-height: 56px;
}
.nw-drop-zone:hover,
.nw-drop-zone.drag-over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.nw-drop-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

.nw-url-row { display: flex; gap: .4rem; }
.nw-url-input {
  flex: 1; padding: .45rem .7rem; border: 1px solid var(--hair);
  border-radius: 4px; background: var(--paper-2); color: var(--ink); font-size: .85rem;
}
.nw-url-btn {
  padding: .4rem .8rem; border: 1px solid var(--hair); border-radius: 4px;
  background: var(--paper); cursor: pointer; font-size: .8rem; white-space: nowrap;
}

.nw-field-content {
  display: block; width: 100%; padding: .6rem .7rem;
  border: 1px solid var(--hair); border-radius: 6px;
  background: var(--paper-2); color: var(--ink); font-size: .88rem;
  resize: vertical; min-height: 100px; margin-bottom: .75rem;
  box-sizing: border-box; line-height: 1.65;
}

.nw-form-actions { display: flex; justify-content: flex-end; gap: .45rem; }
.nw-btn-cancel {
  padding: .42rem .95rem; border: 1px solid var(--hair); border-radius: 6px;
  background: var(--paper); cursor: pointer; font-size: .85rem; color: var(--ink-soft);
}
.nw-btn-submit {
  padding: .42rem 1.1rem; background: var(--accent); color: #fff;
  border: none; border-radius: 6px; cursor: pointer; font-size: .85rem;
}
.nw-btn-submit:hover { opacity: .85; }

/* ═══════════════════════════════════════════════════════
   레이아웃 — 좌: 이미지 · 우: 본문+댓글
═══════════════════════════════════════════════════════ */
.nw-timeline { display: flex; flex-direction: column; gap: 2.5rem; }

.nw-tl-post {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: flex-start;
}
.nw-tl-post .nw-post-num {
  width: 100%;
}

/* ── 번호 — 이미지 위, 게시물 맨 위 ── */
.nw-post-num {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-mute);
  margin-bottom: 4px;
  letter-spacing: .02em;
}

/* ── 좌측: 이미지 (박스 없음) ── */
.nw-left {
  flex-shrink: 0;
  max-width: 48%;
}
.nw-tl-img {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  cursor: zoom-in;
  transition: opacity .12s;
}
.nw-tl-img:hover { opacity: .9; }

/* ── 우측: 본문 + 댓글 각각 박스 ── */
.nw-right {
  flex: 1;
  min-width: 0;
  padding-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nw-tl-post:not(.nw-has-img) .nw-right { padding-left: 0; }

/* 본문 박스 */
.nw-post-box {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 10px;
  padding: .9rem 1rem;
}

/* 각 댓글 박스 (최상위) */
.nw-cm-box {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 10px;
  padding: .7rem 1rem;
}

/* view.php 호환 */
.nw-view-wrap .nw-left { position: sticky; top: 1.5rem; align-self: flex-start; }
.nw-post-img {
  display: block; max-width: 100%; max-height: 78vh;
  object-fit: contain; border-radius: 6px;
  transition: opacity .12s;
}
.nw-post-img:hover { opacity: .9; }

/* ═══════════════════════════════════════════════════════
   ENTRY — 본문/댓글 공통 디자인
═══════════════════════════════════════════════════════ */
.nw-entry-meta {
  display: flex; align-items: center; gap: .25rem;
  font-size: .8rem; margin-bottom: .35rem; flex-wrap: wrap; min-height: 1.3rem;
}
.nw-who  { font-weight: 700; color: var(--accent); font-size: 1rem; }
.nw-sep  { color: var(--ink-mute); }
.nw-when { color: var(--ink-mute); font-size: .78rem; }

.nw-entry-body {
  font-size: .875rem; color: var(--ink); line-height: 1.7; word-break: break-word;
}
.nw-entry-body.nw-locked { color: var(--ink-mute); font-style: italic; font-size: .82rem; }

/* 댓글/삭제 액션 */
.nw-acts { margin-left: auto; display: flex; align-items: center; gap: .2rem; flex-shrink: 0; }
.nw-act-btn {
  background: none; border: none; color: var(--ink-mute); font-size: .72rem;
  font-weight: 700; letter-spacing: .04em; cursor: pointer;
  padding: 0 .22rem; line-height: 1; text-decoration: none; transition: color .12s;
}
.nw-act-btn:hover { color: var(--accent); }

.nw-del-post-form { display: inline; }
.nw-act-del:hover { color: #c0392b !important; }

/* 관리자 태그 */
.nw-admin-tag {
  display: inline-block; font-size: .68rem; background: var(--accent-soft);
  color: var(--accent); padding: 0 .3rem; border-radius: 3px;
  vertical-align: middle; font-weight: 600;
}
.nw-who.nw-admin { color: var(--accent); }

/* ── 글 수정 폼 ── */
.nw-edit-post-form {
  margin: .5rem 0; padding: .8rem;
  background: var(--paper-2); border: 1px solid var(--hair);
  border-radius: 8px; display: flex; flex-direction: column; gap: .5rem;
}
.nw-ep-current { display: flex; align-items: center; gap: .75rem; }
.nw-ep-thumb { height: 56px; width: auto; border-radius: 4px; object-fit: cover; }
.nw-ep-remove-lbl { font-size: .8rem; color: var(--ink-mute); display: flex; align-items: center; gap: .3rem; cursor: pointer; }
.nw-ep-img-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.nw-ep-file-lbl {
  padding: .32rem .75rem; border: 1px solid var(--hair); border-radius: 4px;
  background: var(--paper); font-size: .8rem; color: var(--ink-soft); cursor: pointer; white-space: nowrap;
}
.nw-ep-file-lbl input { display: none; }
.nw-ep-url {
  flex: 1; min-width: 120px; padding: .38rem .6rem; border: 1px solid var(--hair);
  border-radius: 4px; background: var(--paper); color: var(--ink); font-size: .82rem;
}

/* ── 인라인 서브 폼 (댓글 삭제 등) ── */
.nw-sub-form { margin-top: .45rem; display: flex; flex-direction: column; gap: .35rem; }
.nw-sub-form textarea {
  width: 100%; padding: .45rem .65rem; border: 1px solid var(--hair); border-radius: 4px;
  background: var(--paper); color: var(--ink); font-size: .82rem;
  resize: vertical; min-height: 68px; box-sizing: border-box; line-height: 1.55;
}
.nw-sub-row { display: flex; gap: .35rem; flex-wrap: wrap; }
.nw-sub-row input[type=password], .nw-sub-row input[type=text] {
  padding: .38rem .6rem; border: 1px solid var(--hair); border-radius: 4px;
  background: var(--paper); color: var(--ink); font-size: .8rem; flex: 1; min-width: 80px;
}
.nw-sub-row--end { justify-content: flex-end; }
.nw-sub-form button {
  padding: .35rem .85rem; border-radius: 4px; cursor: pointer; font-size: .8rem;
  border: 1px solid var(--hair); background: var(--paper); color: var(--ink-soft); white-space: nowrap;
}

/* 대댓글 */
.nw-replies { margin-left: .75rem; padding-left: .7rem; margin-top: .15rem; }
.nw-reply-arrow { color: var(--ink-mute); margin-right: .1rem; }
.nw-kid-entry { padding: .45rem 0; }

/* ═══════════════════════════════════════════════════════
   댓글 작성 폼
═══════════════════════════════════════════════════════ */
.nw-cm-form-wrap {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 10px;
  padding: .7rem 1rem;
}
.nw-cm-form { display: flex; flex-direction: column; gap: .4rem; }
.nw-cm-inputs { display: flex; gap: .4rem; flex-wrap: wrap; }
.nw-cm-name, .nw-cm-pw {
  padding: .42rem .65rem; border: 1px solid var(--hair); border-radius: 6px;
  background: var(--paper-2); color: var(--ink); font-size: .82rem; flex: 1; min-width: 80px;
}
.nw-cm-admin { font-size: .82rem; color: var(--accent); font-weight: 700; padding: .15rem 0; }
.nw-cm-textarea {
  display: block; width: 100%; padding: .55rem .65rem;
  border: 1px solid var(--hair); border-radius: 6px;
  background: var(--paper-2); color: var(--ink); font-size: .85rem;
  resize: vertical; min-height: 70px; box-sizing: border-box; line-height: 1.6;
}
.nw-cm-submit {
  display: block; width: 100%; padding: .48rem;
  background: var(--accent); color: #fff; border: none;
  border-radius: 6px; cursor: pointer; font-size: .85rem; transition: opacity .15s;
}
.nw-cm-submit:hover { opacity: .85; }

/* ═══════════════════════════════════════════════════════
   페이지네이션
═══════════════════════════════════════════════════════ */
.nw-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin: 10px 0;
}
.nw-pg-btn,
.nw-pg-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--hair);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink-soft);
  background: var(--paper);
  transition: all .15s;
  padding: 0;
}
.nw-pg-btn:hover,
.nw-pg-num:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.nw-pg-current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.nw-pg-current:hover {
  color: #fff;
  background: var(--accent);
}

/* ═══════════════════════════════════════════════════════
   이미지 모달
═══════════════════════════════════════════════════════ */
.nw-modal {
  position: fixed; inset: 0; z-index: 9900;
  display: flex; align-items: center; justify-content: center;
}
.nw-modal-bg { position: absolute; inset: 0; background: rgba(0,0,0,.88); cursor: pointer; }
.nw-modal-inner {
  position: relative; z-index: 1; max-width: 92vw; max-height: 92vh;
  display: flex; align-items: center; justify-content: center;
}
.nw-modal-img {
  display: block; max-width: 90vw; max-height: 88vh; object-fit: contain;
  border-radius: 4px; box-shadow: 0 4px 32px rgba(0,0,0,.4);
}
.nw-modal-close {
  position: absolute; top: -1rem; right: -1rem;
  width: 30px; height: 30px; background: rgba(255,255,255,.18); color: #fff;
  border: none; border-radius: 50%; font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); transition: background .12s;
}
.nw-modal-close:hover { background: rgba(255,255,255,.32); }

/* ═══════════════════════════════════════════════════════
   반응형
═══════════════════════════════════════════════════════ */
@media (max-width: 620px) {
  .nw-tl-post.nw-has-img { flex-direction: column; }
  .nw-tl-post.nw-has-img .nw-left { max-width: 100%; margin-bottom: 10px; }
  .nw-tl-img { border-radius: 6px; }
  .nw-right { padding-left: 0 !important; width: 100%; }
  .nw-paste-hint { display: none; }
}
