/* board.css */

/* ── 카테고리 배지 ── */
.bd-cat-badge {
  display: inline-block;
  flex-shrink: 0;
  font-size: .72em;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid;
  white-space: nowrap;
  vertical-align: middle;
}

/* ── 목록 ── */
.bd-list-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.bd-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.bd-list-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background .1s;
}
.bd-list-item:last-child { border-bottom: none; }
.bd-list-item:hover { background: var(--primary-light); }
.bd-list-item.bd-row-pinned { background: rgba(59,130,246,.04); }
.bd-list-item.bd-row-pinned:hover { background: var(--primary-light); }
.bd-list-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.bd-list-title {
  font-weight: 600;
  font-size: .92em;
}
.bd-list-bottom {
  font-size: .76em;
  color: var(--text-muted);
  padding-left: 2px;
}

/* ── 상세 ── */
.bd-detail {
  max-width: 780px;
}
.bd-detail-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 24px;
}
.bd-detail-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.bd-detail-title {
  font-size: 1.2em;
  font-weight: 700;
  margin: 0;
}
.bd-detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bd-date {
  font-size: .78em;
  color: var(--text-muted);
}
.bd-detail-body {
  line-height: 1.75;
  font-size: .92em;
}
.bd-detail-body .bd-p {
  margin: 0 0 12px;
}
.bd-detail-body .bd-p:last-child {
  margin-bottom: 0;
}
.bd-detail-body .bd-link {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 600;
}
.bd-detail-body .bd-link:hover {
  color: var(--primary-dark, var(--primary));
}
.bd-detail-body .bd-h2 {
  font-size: 1.1em;
  font-weight: 700;
  margin: 24px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.bd-detail-body .bd-h3 {
  font-size: .97em;
  font-weight: 700;
  margin: 18px 0 6px;
  color: var(--primary);
}
.bd-detail-body .bd-hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}
.bd-detail-body .bd-ul {
  padding-left: 1.4em;
  margin: 6px 0 10px;
  list-style: disc;
}
.bd-detail-body .bd-ul li {
  margin-bottom: 4px;
}
.bd-detail-footer {
  display: flex;
  gap: 8px;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.wiki-btn-danger {
  background: #7f1d1d;
  color: #fca5a5;
  border-color: #991b1b;
}
.wiki-btn-danger:hover {
  background: #991b1b;
}

/* ── 글쓰기 폼 ── */
.bd-form-wrap {
  max-width: 780px;
}
.bd-form-row {
  margin-bottom: 14px;
}
.bd-label {
  display: block;
  font-size: .82em;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.bd-hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: .9em;
}
.bd-input,
.bd-select,
.bd-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 7px 10px;
  font-size: .9em;
  font-family: inherit;
  box-sizing: border-box;
}
.bd-input:focus,
.bd-select:focus,
.bd-textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.bd-textarea {
  resize: vertical;
  line-height: 1.6;
}
.bd-select {
  width: auto;
  min-width: 100px;
}
.bd-form-inline {
  display: flex;
  align-items: center;
  gap: 16px;
}
.bd-pin-label {
  font-size: .88em;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: var(--text);
}
.bd-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

/* ── 네이버 피드 렌더링 (source=naver) ────────────────────── */
.bd-detail-body-naver { font-size: .92em; line-height: 1.7; }
.bd-detail-body-naver .bd-p { margin: 0 0 8px; white-space: pre-wrap; word-break: break-word; }
.bd-detail-body-naver .bd-img { margin: 12px 0; text-align: center; }
.bd-detail-body-naver .bd-img img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    background: #0a0a14;
}
.bd-detail-body-naver .bd-img-cap {
    font-size: .82em; color: var(--text-muted); text-align: center; margin-top: 4px;
}
.bd-detail-body-naver .bd-table-wrap {
    overflow-x: auto;
    margin: 14px 0;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.bd-detail-body-naver .bd-table,
.bd-detail-body-naver table {
    border-collapse: collapse;
    width: 100%;
    font-size: .88em;
}
.bd-detail-body-naver .bd-table td,
.bd-detail-body-naver .bd-table th,
.bd-detail-body-naver table td,
.bd-detail-body-naver table th {
    border: 1px solid var(--border);
    padding: 8px 10px;
    vertical-align: middle;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg-card);
}
.bd-detail-body-naver .bd-table th,
.bd-detail-body-naver table th {
    background: var(--bg-subtle);
    font-weight: 600;
    text-align: center;
}
.bd-detail-body-naver .bd-table tr:nth-child(even) td,
.bd-detail-body-naver table tr:nth-child(even) td {
    background: var(--bg-subtle);
}
.bd-detail-body-naver .bd-table td .bd-p { margin: 0; }
.bd-detail-body-naver .bd-embed {
    margin: 14px 0;
    text-align: center;
}
.bd-detail-body-naver .bd-embed iframe {
    max-width: 100%;
    border-radius: 6px;
}
.bd-detail-body-naver .bd-hr {
    border: none;
    border-top: 1px solid #3a3a4a;
    margin: 16px 0;
}
.bd-detail-body-naver .bd-quote {
    border-left: 3px solid #5a5a8a;
    padding: 4px 14px;
    margin: 12px 0;
    color: var(--text-muted);
    background: #1a1a22;
    border-radius: 0 4px 4px 0;
}
/* WIKI 배지 특별 스타일 */
.bd-cat-badge[data-cat="WIKI"] { letter-spacing: .05em; }

/* ── 필터 배지 ────────────────────────────────────────── */
.bd-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.bd-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: .82em;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all .12s;
  font-family: inherit;
}
.bd-filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.bd-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.bd-filter-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  font-size: .8em;
  font-weight: 700;
  background: rgba(255,255,255,.18);
  border-radius: 10px;
  text-align: center;
}
.bd-filter-btn:not(.active) .bd-filter-count {
  background: var(--bg);
  color: var(--text-muted);
}

/* ── 상단 고정 표시 ──────────────────────────────────── */
.bd-pin-mark {
  flex-shrink: 0;
  font-size: .78em;
  color: #f59e0b;
  margin-left: auto;
  padding-left: 6px;
}

/* ── 작성자 블록 (naver 포스트) ─────────────────────── */
.bd-detail-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.bd-author-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #0a0a14;
  flex-shrink: 0;
}
.bd-author-info { flex: 1; min-width: 0; }
.bd-author-name {
  font-size: .92em;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.bd-author-title {
  font-size: .75em;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,106,0,.15);
}
.bd-author-lv {
  font-size: .72em;
  font-weight: 600;
  color: var(--text-muted);
  padding: 1px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.bd-author-meta {
  display: flex;
  gap: 12px;
  margin-top: 2px;
  font-size: .78em;
  color: var(--text-muted);
  align-items: center;
}
.bd-source-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.bd-source-link:hover { text-decoration: underline; }

/* ── naver 이미지 좌측 정렬 (기존 center 오버라이드) ── */
.bd-detail-body-naver .bd-img { text-align: left; }
.bd-detail-body-naver .bd-img-cap { text-align: left; }

/* ── NEW 배지 (리스트) ────────────────────────────── */
.bd-new-badge {
  flex-shrink: 0;
  display: inline-block;
  font-size: .62em;
  font-weight: 800;
  padding: 1px 6px;
  background: linear-gradient(135deg,#f43f5e,#e11d48);
  color: #fff;
  border-radius: 10px;
  letter-spacing: .06em;
  vertical-align: middle;
  box-shadow: 0 0 6px rgba(244,63,94,.5);
  animation: bdNewPulse 1.8s ease-in-out infinite;
}
@keyframes bdNewPulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: .75; transform: scale(.95); }
}

/* ── 리스트 하단 (작성자 + 날짜) ─────────────────── */
.bd-list-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: .78em;
  color: var(--text-muted);
  margin-top: 4px;
}
.bd-list-author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 60%;
}
.bd-list-author .bd-author-title {
  font-size: .82em;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255,255,255,.06);
}
.bd-list-date {
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* ── Fallback 프로필 아이콘 ──────────────────────── */
.bd-author-img-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg,#6366f1,#a78bfa);
  color: #fff;
  font-size: 1.1em;
}

/* ── 호버 언더라인 제거 + 세로 정렬 보정 ────────── */
.bd-list-item:hover,
.bd-list-item:hover * { text-decoration: none; }

.bd-list-bottom {
  display: flex;
  align-items: center;
  line-height: 1;
}
.bd-list-author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}
.bd-list-author .bd-author-title {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  padding: 3px 6px;
}
.bd-list-date { line-height: 1; }

/* ── 네이버 iframe 샌드박스 ──────────────────────────── */
.bd-naver-iframe {
  width: 100%;
  border: none;
  min-height: 200px;
  overflow: hidden;
  display: block;
}

/* ── 페이지네이션 ────────────────────────────────────── */
.bd-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin: 20px 0 12px;
  flex-wrap: wrap;
}
.bd-pagination:empty { display: none; }
.bd-page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: .85em;
  font-weight: 600;
  font-family: inherit;
  border-radius: 6px;
  cursor: pointer;
  transition: all .12s;
}
.bd-page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}
.bd-page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  cursor: default;
}
.bd-page-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.bd-page-dots {
  padding: 0 4px;
  color: var(--text-muted);
  font-size: .9em;
  user-select: none;
}
