/* triedit 기본 디자인 */
:root {
  --text: #1f2328;
  --muted: #656d76;
  --line: #e4e7eb;
  --bg: #ffffff;
  --soft: #f6f8fa;
  --accent: #2563eb;
  --tip-bg: #fff8e6;
  --tip-line: #f0b429;
  --wrap: 720px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.8;
  word-break: keep-all;
  overflow-wrap: break-word;
}
a { color: var(--accent); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* 머리말 / 꼬리말 */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.site-title { font-weight: 700; font-size: 20px; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
main.wrap { padding-top: 32px; padding-bottom: 64px; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-footer .wrap { padding-top: 20px; padding-bottom: 28px; }
.site-footer p { margin: 0 0 4px; }
.site-footer a { color: var(--muted); }

/* 글 머리 */
.post-category { margin: 0; color: var(--accent); font-weight: 600; font-size: 14px; }
.post-header h1 { font-size: 30px; line-height: 1.35; margin: 0.2em 0 0.4em; letter-spacing: -0.03em; }
.post-meta { color: var(--muted); font-size: 14px; margin: 0 0 28px; }
.badge-draft {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  background: #fde8e8; color: #b42318; font-size: 12px; font-weight: 600; vertical-align: middle;
}

/* 목차 */
.toc { background: var(--soft); border-radius: 10px; padding: 16px 20px; margin: 0 0 32px; }
.toc-title { margin: 0 0 6px; font-weight: 700; font-size: 15px; }
.toc ul { margin: 0; padding-left: 0; list-style: none; font-size: 15px; line-height: 1.9; }
.toc li::before { content: "·"; color: var(--muted); margin-right: 8px; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--accent); }

/* 본문 */
.post-body h2 {
  font-size: 23px; line-height: 1.4; margin: 2.2em 0 0.7em;
  padding-left: 12px; border-left: 4px solid var(--accent); letter-spacing: -0.02em;
  scroll-margin-top: 16px;
}
.post-body h3 { font-size: 19px; line-height: 1.45; margin: 1.8em 0 0.5em; scroll-margin-top: 16px; }
.post-body p { margin: 0 0 1.1em; }
.post-body figure { margin: 1.6em 0; text-align: center; }
.post-body img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; vertical-align: middle; }
.post-body figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.post-body blockquote {
  margin: 1.4em 0; padding: 14px 18px; background: var(--tip-bg);
  border-left: 4px solid var(--tip-line); border-radius: 0 8px 8px 0;
}
.post-body blockquote p:last-child { margin-bottom: 0; }
.post-body ul, .post-body ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.post-body li { margin: 0.2em 0; }
.post-body table { border-collapse: collapse; width: 100%; margin: 1.4em 0; font-size: 15px; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.post-body th { background: var(--soft); }
.post-body code { background: var(--soft); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
.post-body pre { background: var(--soft); padding: 14px 16px; border-radius: 8px; overflow-x: auto; line-height: 1.6; }
.post-body pre code { padding: 0; background: none; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

/* 태그 / 다른 글 */
.tags { list-style: none; padding: 0; margin: 2.4em 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { background: var(--soft); color: var(--muted); font-size: 14px; padding: 2px 10px; border-radius: 999px; }
.more { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.more h2 { font-size: 18px; margin: 0 0 8px; }

/* 글 목록 */
.intro h1 { font-size: 28px; margin: 0 0 4px; letter-spacing: -0.03em; }
.intro p { margin: 0 0 28px; color: var(--muted); }
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list > li { border-top: 1px solid var(--line); }
.post-list > li:last-child { border-bottom: 1px solid var(--line); }
.post-link { display: block; padding: 18px 0; color: var(--text); text-decoration: none; }
.post-link:hover .title { color: var(--accent); }
.post-link .meta { display: block; font-size: 13px; color: var(--muted); }
.post-link .cat { color: var(--accent); font-weight: 600; margin-right: 8px; }
.post-link .title { display: block; font-size: 19px; line-height: 1.45; margin: 2px 0 4px; }
.post-link .desc { display: block; font-size: 15px; color: var(--muted); line-height: 1.6; }
.post-list.compact > li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 15px; }
.post-list.compact a { color: var(--text); text-decoration: none; }
.post-list.compact a:hover { color: var(--accent); }
.post-list.compact .date { color: var(--muted); font-size: 13px; white-space: nowrap; }
.empty { color: var(--muted); }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .post-header h1 { font-size: 25px; }
  .post-body h2 { font-size: 20px; }
  .post-body table { display: block; overflow-x: auto; }
}
