/* themes/blog/style.css ─ 블로그형 공개화면 (Image 1 재현, 경량) */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "맑은 고딕", "Malgun Gothic", system-ui, -apple-system, sans-serif;
  color: #3a3a3a; background: #efe6df;        /* 베이지 톤 */
  line-height: 1.7; font-size: 16px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ── 헤더 ── */
.site-header {
  background: #fff; border-bottom: 1px solid #e7ddd4;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; position: sticky; top: 0; z-index: 20;
}
.site-title { font-size: 20px; font-weight: 700; }
.hd-btn {
  width: 42px; height: 42px; border: none; cursor: pointer;
  background: #8a7a6d; color: #fff; border-radius: 8px; font-size: 18px;
}
.dots { background: #fff; color: #8a7a6d; border: 1px solid #e0d6cc; border-radius: 50%; }

/* ── 카테고리 메뉴 ── */
.cat-nav {
  background: #fff; border-bottom: 1px solid #e7ddd4;
  display: flex; gap: 4px; flex-wrap: wrap; padding: 10px 24px;
}
.cat-link { padding: 6px 14px; border-radius: 16px; font-size: 14px; color: #6b5d50; }
.cat-link:hover { background: #f2ebe4; }
.cat-cnt { color: #b0a294; font-size: 12px; }

/* ── 본문 영역 ── */
.site-main { max-width: 860px; margin: 0 auto; padding: 30px 20px 60px; }

.list-head { margin-bottom: 16px; padding: 0 4px; }
.list-head h2 { font-size: 17px; font-weight: 700; color: #4a4036; }
.list-head .count { color: #9b8c7d; font-weight: 400; }
.list-head { border-bottom: 1px solid #cdbfae; padding-bottom: 14px; }

/* ── 글 목록 ── */
.post-list { background: #fff; border-radius: 12px; padding: 8px 30px; margin-top: 20px; }
.post-card {
  display: flex; gap: 22px; align-items: flex-start;
  padding: 30px 0; border-bottom: 1px solid #eee;
}
.post-card:last-child { border-bottom: none; }
.pc-body { flex: 1; min-width: 0; }
.pc-title { font-size: 19px; font-weight: 700; margin-bottom: 12px; color: #2e2a25; }
.pc-title a:hover { color: #8a7a6d; }
.pc-excerpt { color: #6f6457; font-size: 15px; line-height: 1.7; }
.pc-cat {
  display: inline-block; margin-top: 14px; font-size: 13px;
  color: #9b8c7d; background: #f3ede6; padding: 3px 10px; border-radius: 10px;
}
.pc-thumb { flex-shrink: 0; width: 160px; }
.pc-thumb img { width: 160px; height: 130px; object-fit: cover; border-radius: 8px; }

.list-empty {
  background: #fff; border-radius: 12px; padding: 70px 20px;
  text-align: center; color: #9b8c7d; margin-top: 20px;
}

/* ── 페이지네이션 ── */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 30px; }
.pager .pg {
  min-width: 36px; height: 36px; display: inline-flex; align-items: center;
  justify-content: center; background: #fff; border-radius: 6px; color: #6b5d50; font-size: 14px;
}
.pager .pg.on { background: #8a7a6d; color: #fff; }

/* ── 글 상세 ── */
.post-view { background: #fff; border-radius: 12px; padding: 44px 48px; }
.pv-head { border-bottom: 1px solid #eee; padding-bottom: 22px; margin-bottom: 30px; }
.pv-cat { display: inline-block; font-size: 13px; color: #9b8c7d; margin-bottom: 12px; }
.pv-title { font-size: 27px; font-weight: 700; line-height: 1.4; color: #2e2a25; }
.pv-meta { margin-top: 14px; color: #a0937f; font-size: 14px; }
.pv-meta .dot { margin: 0 6px; }

/* 본문 출력 (3-모드 공통) */
.pv-body { font-size: 16px; line-height: 1.85; color: #3a3a3a; }
.pv-body p { margin: 0 0 18px; }
.pv-body h1, .pv-body h2, .pv-body h3 { margin: 32px 0 14px; line-height: 1.4; color: #2e2a25; }
.pv-body h1 { font-size: 24px; } .pv-body h2 { font-size: 21px; } .pv-body h3 { font-size: 18px; }
.pv-body img { margin: 18px auto; border-radius: 8px; }
.pv-body a { color: #b5715e; text-decoration: underline; }
.pv-body ul, .pv-body ol { margin: 0 0 18px 22px; }
.pv-body blockquote { border-left: 3px solid #cdbfae; padding: 4px 16px; color: #6f6457; margin: 0 0 18px; }
.pv-body pre { background: #f5f1ec; padding: 14px; border-radius: 6px; overflow-x: auto; font-size: 14px; }
.pv-body code { background: #f5f1ec; padding: 2px 6px; border-radius: 4px; font-size: 14px; }

.pv-foot { margin-top: 40px; padding-top: 22px; border-top: 1px solid #eee; }
.back-link { color: #8a7a6d; font-size: 15px; }
.back-link:hover { text-decoration: underline; }

/* ── 푸터 ── */
.site-footer { text-align: center; padding: 40px 20px; color: #9b8c7d; font-size: 13px; }
.site-footer strong { font-weight: 700; }

/* ── 반응형 ── */
@media (max-width: 600px) {
  .post-list { padding: 4px 18px; }
  .post-card { gap: 14px; padding: 22px 0; }
  .pc-thumb, .pc-thumb img { width: 96px; }
  .pc-thumb img { height: 80px; }
  .pc-title { font-size: 17px; }
  .post-view { padding: 28px 20px; }
  .pv-title { font-size: 22px; }
  .cat-nav { gap: 2px; padding: 8px 16px; }
}

/* ── 이미지 그리드 (본문 여러 장 → 썸네일 배치) ── */
.pv-body .img-single { margin: 18px 0; text-align: center; }
.pv-body .img-single img { display: inline-block; border-radius: 8px; max-width: 100%; }

.img-grid { display: grid; gap: 8px; margin: 18px 0; }
.img-grid .ig-item { overflow: hidden; border-radius: 8px; }
.img-grid .ig-item img {
  width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 1 / 1;
}
/* 2장: 2칸 / 3장: 3칸 / 4장 이상: 2x2 */
.img-grid.g2 { grid-template-columns: repeat(2, 1fr); }
.img-grid.g3 { grid-template-columns: repeat(3, 1fr); }
.img-grid.g4 { grid-template-columns: repeat(2, 1fr); }

/* 모바일: 3칸은 그대로 2칸으로 줄임 */
@media (max-width: 600px) {
  .img-grid.g3 { grid-template-columns: repeat(2, 1fr); }
}
