/* =====================================================
   Content Detail — CATSBE Design System
   Mobile-First, cd-* prefix
===================================================== */

/* ── 페이지 래퍼 ── */
.cd-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* ── 브레드크럼 ── */
.cd-breadcrumb {
  font-size: 12px;
  color: var(--cb-text-muted, #7A7268);
  margin-bottom: 16px;
  padding: 8px 0;
}
.cd-breadcrumb a {
  color: var(--cb-text-muted, #7A7268);
  text-decoration: none;
}
.cd-breadcrumb a:hover { color: var(--cb-accent, #F37021); }
.cd-bc-sep {
  margin: 0 6px;
  opacity: 0.5;
}
.cd-bc-current {
  color: var(--cb-text-sub, #4A433B);
  font-weight: 600;
}

/* ── 헤더 ── */
.cd-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--cb-border-light, #F0EBE4);
}
.cd-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--cb-text, #1A1714);
  line-height: 1.4;
  margin: 0 0 8px;
}
.cd-subtitle {
  font-size: 14px;
  color: var(--cb-text-muted, #7A7268);
  margin: 0 0 12px;
  line-height: 1.5;
}
.cd-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--cb-text-muted, #7A7268);
}
.cd-meta-author {
  font-weight: 600;
  color: var(--cb-text-sub, #4A433B);
}
.cd-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--cb-text-faint, #B0A89C);
}
.cd-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.cd-action-btn {
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 6px;
  border: 1px solid var(--cb-border, #E8E2D8);
  background: var(--cb-surface, #fff);
  color: var(--cb-text-sub, #4A433B);
  text-decoration: none;
  transition: all 0.15s;
}
.cd-action-btn:hover {
  background: var(--cb-bg-hover, #F2EDE6);
}
.cd-action-del {
  border-color: var(--cb-danger, #A83838);
  color: var(--cb-danger, #A83838);
}

/* ── 본문 (TipTap) ── */
.cd-body {
  margin-bottom: 24px;
}
.tiptap-prose {
  font-size: 15px;
  line-height: 1.85;
  color: var(--cb-text-sub, #4A433B);
  word-break: break-word;
}
.tiptap-prose p { margin: 0 0 1rem; }
.tiptap-prose img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.2rem auto;
  border-radius: var(--cb-radius, 10px);
}
.tiptap-prose img[data-size="small"] { max-width: 40%; }
.tiptap-prose img[data-size="medium"] { max-width: 70%; }
.tiptap-prose img[data-size="large"] { max-width: 100%; }
.tiptap-prose img[data-align="left"] { float: left; margin: 0.3rem 1rem 0.8rem 0; }
.tiptap-prose img[data-align="right"] { float: right; margin: 0.3rem 0 0.8rem 1rem; }
.tiptap-prose img[data-align="center"] { margin-left: auto; margin-right: auto; float: none; }
.tiptap-prose::after { content: ""; display: block; clear: both; }
.tiptap-prose iframe {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--cb-radius, 10px);
  border: none;
  margin: 1.5rem 0;
}
.tiptap-prose pre {
  background: var(--cb-surface-alt, #F8F5F0);
  padding: 1rem;
  border-radius: var(--cb-radius, 10px);
  overflow-x: auto;
  font-size: 13px;
}
.tiptap-prose blockquote {
  border-left: 3px solid var(--cb-accent, #F37021);
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  color: var(--cb-text-sub, #4A433B);
  background: var(--cb-surface-alt, #F8F5F0);
  border-radius: var(--cb-radius-sm, 6px);
}
.tiptap-prose ul,
.tiptap-prose ol {
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}
.tiptap-prose h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 2rem 0 0.8rem;
  color: var(--cb-text, #1A1714);
}
.tiptap-prose h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 1.5rem 0 0.6rem;
  color: var(--cb-text, #1A1714);
}

/* ── 태그 ── */
.cd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}
.cd-tag {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--cb-surface-alt, #F8F5F0);
  border: 1px solid var(--cb-border-light, #F0EBE4);
  color: var(--cb-text-muted, #7A7268);
  text-decoration: none;
  transition: all 0.15s;
}
.cd-tag:hover {
  border-color: var(--cb-accent, #F37021);
  color: var(--cb-accent, #F37021);
}

/* ── 반응 + 평점 영역 ── */
.cd-engage {
  background: var(--cb-surface-alt, #F8F5F0);
  border: 1px solid var(--cb-border-light, #F0EBE4);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
}

/* 반응 버튼 */
.cd-reactions {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--cb-border-light, #F0EBE4);
}
.cd-react-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border: 1px solid var(--cb-border, #E8E2D8);
  border-radius: 8px;
  background: #fff;
  color: var(--cb-text, #1A1714);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s;
}
.cd-react-btn:hover { background: var(--cb-bg-hover, #F2EDE6); }
.cd-react-icon { font-weight: 700; font-size: 16px; }
.cd-react-btn.active-like {
  background: var(--cb-dungeon, #2E7A44);
  color: #fff;
  border-color: var(--cb-dungeon, #2E7A44);
}
.cd-react-btn.active-dislike {
  background: var(--cb-danger, #A83838);
  color: #fff;
  border-color: var(--cb-danger, #A83838);
}
.cd-react-info {
  font-size: 13px;
  color: var(--cb-text-muted, #7A7268);
}
.cd-react-info a { color: var(--cb-accent, #F37021); }

/* 평점 */
.cd-rating-avg {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.cd-rating-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--cb-text-sub, #4A433B);
}
.cd-rating-stars { display: inline-flex; gap: 2px; }
.cd-star { font-size: 18px; color: var(--cb-border, #E8E2D8); }
.cd-star.filled { color: var(--cb-gold, #D4A020); }
.cd-rating-value {
  font-weight: 700;
  font-size: 15px;
  color: var(--cb-text, #1A1714);
  margin-left: 4px;
}
.cd-rating-mine {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--cb-border-light, #F0EBE4);
}
.cd-rating-label-sm {
  font-size: 12px;
  color: var(--cb-text-muted, #7A7268);
}
.cd-rating-stars.interactive { cursor: pointer; }
.cd-rating-stars.interactive .cd-star {
  font-size: 22px;
  transition: transform 0.15s;
}
.cd-rating-stars.interactive .cd-star:hover {
  transform: scale(1.2);
  color: var(--cb-gold, #D4A020);
}
.cd-rating-note {
  font-size: 12px;
  color: var(--cb-text-muted, #7A7268);
}
.cd-rating-login {
  font-size: 12px;
  color: var(--cb-text-muted, #7A7268);
  padding-top: 8px;
}
.cd-rating-login a { color: var(--cb-accent, #F37021); }

/* ── 목록으로 ── */
.cd-back-wrap {
  text-align: center;
  margin: 24px 0;
}
.cd-back-btn {
  display: inline-block;
  padding: 10px 28px;
  border: 1px solid var(--cb-border, #E8E2D8);
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cb-text-sub, #4A433B);
  text-decoration: none;
  transition: all 0.15s;
}
.cd-back-btn:hover {
  background: var(--cb-bg-hover, #F2EDE6);
  border-color: var(--cb-accent, #F37021);
  color: var(--cb-accent, #F37021);
}

/* ── 댓글 ── */
.cd-comments {
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--cb-border-light, #F0EBE4);
}
.cd-comments-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--cb-text, #1A1714);
  margin: 0 0 16px;
}
.cd-comments-count {
  font-weight: 400;
  color: var(--cb-text-muted, #7A7268);
  font-size: 14px;
}
.cd-comment-form { margin-bottom: 20px; }
.cd-comment-form textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid var(--cb-border, #E8E2D8);
  border-radius: 10px;
  font-size: 14px;
  resize: vertical;
  font-family: inherit;
  background: #fff;
  color: var(--cb-text, #1A1714);
}
.cd-comment-form textarea:focus {
  outline: none;
  border-color: var(--cb-accent, #F37021);
}
.cd-comment-submit {
  margin-top: 8px;
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  background: var(--cb-accent, #F37021);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.cd-comment-submit:hover { background: #D86018; }
.cd-comment-login {
  padding: 14px;
  border-radius: 10px;
  background: var(--cb-surface-alt, #F8F5F0);
  font-size: 13px;
  color: var(--cb-text-muted, #7A7268);
  margin-bottom: 20px;
}
.cd-comment-login a { color: var(--cb-accent, #F37021); }
.cd-comment-list { /* wrapper */ }
.cd-comment-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--cb-border-light, #F0EBE4);
}
.cd-comment-item:last-child { border-bottom: none; }
.cd-comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.cd-comment-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--cb-text, #1A1714);
}
.cd-comment-time {
  font-size: 11px;
  color: var(--cb-text-faint, #B0A89C);
}
.cd-comment-body {
  font-size: 14px;
  color: var(--cb-text-sub, #4A433B);
  line-height: 1.65;
  margin-bottom: 6px;
}
.cd-comment-actions {
  display: flex;
  gap: 12px;
}
.cd-comment-actions button {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--cb-text-muted, #7A7268);
  cursor: pointer;
  padding: 0;
}
.cd-comment-actions button:hover { color: var(--cb-accent, #F37021); }
.cd-comment-actions .cd-del:hover { color: var(--cb-danger, #A83838); }
.cd-comment-reply {
  margin-left: 20px;
  padding-left: 14px;
  border-left: 2px solid var(--cb-accent, #F37021);
}
.cd-reply-form { margin-top: 10px; }
.cd-comment-empty {
  font-size: 13px;
  color: var(--cb-text-faint, #B0A89C);
  text-align: center;
  padding: 20px 0;
}

/* ── 이전/다음 글 ── */
.cd-nav-prev-next {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 20px;
  padding-top: 20px;
  border-top: 1px solid var(--cb-border-light, #F0EBE4);
}
.cd-nav-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  max-width: 48%;
}
.cd-nav-dir {
  font-size: 11px;
  color: var(--cb-text-muted, #7A7268);
  font-weight: 600;
}
.cd-nav-title {
  font-size: 13px;
  color: var(--cb-text-sub, #4A433B);
  line-height: 1.4;
}
.cd-nav-link:hover .cd-nav-title { color: var(--cb-accent, #F37021); }
.cd-nav-next { text-align: right; align-items: flex-end; }

/* ── QBarn 소스 링크 ── */
.cd-qbarn-link {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--cb-surface-alt, #F8F5F0);
  border: 1px solid var(--cb-border-light, #F0EBE4);
  font-size: 13px;
  color: var(--cb-text-sub, #4A433B);
  line-height: 1.6;
}
.cd-qbarn-link a {
  color: var(--cb-accent, #F37021);
  text-decoration: none;
}
.cd-qbarn-link a:hover { text-decoration: underline; }

/* =====================================================
   Desktop (768px+)
===================================================== */
@media (min-width: 768px) {
  .cd-title { font-size: 28px; }
  .cd-body { margin-bottom: 32px; }
  .tiptap-prose { font-size: 16px; }
  .cd-reactions { gap: 12px; }
  .cd-nav-prev-next { margin: 32px 0; }
}

/* =====================================================
   Mobile tweaks
===================================================== */
@media (max-width: 480px) {
  .cd-page { padding: 0 14px 32px; }
  .cd-title { font-size: 20px; }
  .tiptap-prose { font-size: 14px; line-height: 1.8; }
  .tiptap-prose img {
    max-width: 100% !important;
    float: none !important;
    margin: 0.8rem auto !important;
  }
  .cd-react-btn { padding: 7px 16px; font-size: 13px; }
  .cd-comment-reply { margin-left: 12px; padding-left: 10px; }
}
