/* ==========================================================
   smith lab — posts (generated by scripts/build_site.py)
   ========================================================== */
.post-wrap { max-width: 760px; padding-top: 36px; }
.post-wrap .crumb a { color: var(--muted); }

.post-head { margin: 22px 0 26px; }
.post-head h1 {
  font-family: 'Space Grotesk', 'Noto Sans KR', system-ui, sans-serif;
  font-size: clamp(26px, 4.6vw, 38px); line-height: 1.3; letter-spacing: -0.02em; margin: 10px 0 12px;
  word-break: keep-all;
}
.post-cat { display: inline-block; font-size: 12px; color: var(--cat); border: 1px solid var(--cat); border-radius: 999px; padding: 2px 10px; }
.post-cat:hover { text-decoration: none; background: var(--cat); color: #000; }
.post-meta { font-size: 12px; color: var(--muted); }
.post-head.v0 h1 { border-left: 4px solid var(--cat); padding-left: 14px; }
.post-head.v1 .post-lede { font-size: 15px; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; padding: 12px 16px; margin: 0; line-height: 1.7; }
.post-head.v2 .post-term { font-size: 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; overflow-x: auto; white-space: nowrap; }
.post-head.v2 .post-term .ps1 { color: var(--cat); }

.toc { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 26px; font-size: 13px; }
.toc b { color: var(--muted); font-weight: 500; font-size: 12px; }
.toc ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.9; }
.toc a { color: var(--text); }

.post-body {
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', system-ui, sans-serif;
  font-size: 16.5px; line-height: 1.9; letter-spacing: -0.003em; word-break: keep-all; overflow-wrap: anywhere;
  color: color-mix(in srgb, var(--text) 92%, var(--muted));
}
.post-body p { margin: 0 0 1.25em; }
.post-body h2 { font-size: 22px; line-height: 1.45; margin: 2.1em 0 .7em; color: var(--text); scroll-margin-top: 70px; }
.post-body h2::before { content: '#'; color: var(--cat); margin-right: 8px; font-family: var(--mono); font-weight: 400; }
.post-body h3 { font-size: 18px; margin: 1.7em 0 .6em; color: var(--text); }
.post-body ul, .post-body ol { padding-left: 1.3em; margin: 0 0 1.3em; }
.post-body li { margin: .35em 0; }
.post-body li::marker { color: var(--cat); }
.post-body strong { color: var(--text); background: linear-gradient(transparent 62%, color-mix(in srgb, var(--cat) 30%, transparent) 62%); }
.post-body blockquote { margin: 1.5em 0; padding: 4px 18px; border-left: 3px solid var(--cat); color: var(--muted); background: var(--panel); border-radius: 0 8px 8px 0; }
.post-body blockquote p { margin: .7em 0; }
.post-body hr { border: 0; border-top: 1px dashed var(--line); margin: 2.2em 0; }
.post-body code { font-family: var(--mono); font-size: .88em; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--cat); }
.post-body pre.code-block { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; margin: 0 0 1.4em; position: relative; }
.post-body pre.code-block[data-lang]::before { content: attr(data-lang); position: absolute; top: 6px; right: 10px; font-size: 10px; color: var(--muted); font-family: var(--mono); }
.post-body pre.code-block code { background: none; border: 0; padding: 0; color: var(--text); font-size: 13px; line-height: 1.6; }
.post-body .table-wrap { overflow-x: auto; margin: 0 0 1.4em; }
.post-body table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.6; }
.post-body th, .post-body td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; }
.post-body th { color: var(--muted); font-weight: 500; font-size: 13px; border-bottom: 2px solid var(--line); }
.post-body.dropcap > p:first-child::first-letter { float: left; font-size: 3.1em; line-height: 1; padding: 4px 8px 0 0; color: var(--cat); font-weight: 700; }

.post-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 26px 0 0; }
.post-tags span { font-size: 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }

.post-tools { margin: 0 0 26px; background: var(--panel); border: 1px solid var(--cat); border-radius: 12px; padding: 14px; }
.post-tags + .post-tools { margin-top: 22px; }
.post-tools > b { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin: 0 2px 10px; }
.post-tools > div { display: grid; gap: 8px; }
.post-tools a { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 8px; background: var(--bg-2); color: var(--text); }
.post-tools a:hover { text-decoration: none; outline: 1px solid var(--cat); }
.post-tools .ti { width: 38px; height: 38px; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; font-size: 17px; }
.post-tools strong { display: block; font-size: 14px; }
.post-tools small { display: block; font-size: 12px; color: var(--muted); line-height: 1.5; }
.post-tools i { font-style: normal; color: var(--cat); }

.post-notice { margin-top: 22px; font-size: 12px; line-height: 1.7; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 32px; }
.post-nav a { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--text); font-size: 13px; line-height: 1.5; }
.post-nav a:hover { border-color: var(--cat); text-decoration: none; }
.post-nav a.r { text-align: right; }
.post-nav small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
@media (max-width: 560px) { .post-nav { grid-template-columns: 1fr; } .post-nav a.r { text-align: left; } }
.related { margin-top: 28px; }
.related h4 { font-size: 12px; color: var(--muted); font-weight: 500; margin: 0 0 8px; }
.related a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); color: var(--text); font-size: 14px; }
.related a:hover { color: var(--cat); text-decoration: none; }
.related time { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---------- posts index ---------- */
.post-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.post-item { display: grid; grid-template-columns: 110px 1fr; gap: 18px; padding: 18px 4px; border-bottom: 1px solid var(--line); color: var(--text); }
.post-item:hover { text-decoration: none; background: color-mix(in srgb, var(--panel) 70%, transparent); }
.post-item:hover h3 { color: var(--accent); }
.post-item .side { font-size: 12px; color: var(--muted); display: grid; gap: 6px; align-content: start; }
.post-item h3 { font-family: 'Noto Sans KR', system-ui, sans-serif; font-size: 17px; line-height: 1.5; margin: 0 0 6px; word-break: keep-all; transition: color .1s; }
.post-item p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.7; font-family: 'Noto Sans KR', system-ui, sans-serif; }
.post-item.big h3 { font-size: 20px; }
@media (max-width: 560px) { .post-item { grid-template-columns: 1fr; gap: 6px; } .post-item .side { display: flex; gap: 10px; } }
.more { text-align: center; margin: 24px 0; }

/* ---------- charts (```chart → inline SVG, scripts/postviz.py) ----------
   색약 안전 팔레트 (dataviz validator 통과 값), 다크가 기본 · 라이트 토글 대응 */
.viz { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --ink: #e6e8eb; --ink-2: #9aa1aa;
  margin: 1.8em 0; padding: 16px 16px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
:root[data-theme="light"] .viz { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --ink: #15171a; --ink-2: #5d6168; }
.viz svg { display: block; width: 100%; height: auto; overflow: visible; font-family: 'Noto Sans KR', system-ui, sans-serif; }
.viz-title { font-size: 15px; font-weight: 700; color: var(--text); margin: 0 0 8px; line-height: 1.5; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); margin: 0 0 6px; }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.viz-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.viz .s1 { fill: var(--s1); stroke: var(--s1); } .viz .s2 { fill: var(--s2); stroke: var(--s2); } .viz .s3 { fill: var(--s3); stroke: var(--s3); }
.viz .s4 { fill: var(--s4); stroke: var(--s4); } .viz .s5 { fill: var(--s5); stroke: var(--s5); }
.viz-legend i.s1 { background: var(--s1); } .viz-legend i.s2 { background: var(--s2); } .viz-legend i.s3 { background: var(--s3); }
.viz-legend i.s4 { background: var(--s4); } .viz-legend i.s5 { background: var(--s5); }
.viz rect, .viz path { stroke: none; transition: opacity .12s; }
.viz svg:hover rect[class^="s"], .viz svg:hover path[class^="s"] { opacity: .55; }
.viz svg rect[class^="s"]:hover, .viz svg path[class^="s"]:hover { opacity: 1; }
.viz-grid { stroke: var(--line); stroke-width: 1; }
.viz-base { stroke: var(--ink-2); stroke-width: 1; }
.viz-ax { fill: var(--ink-2); font-size: 12px; }
.viz-ax.lg { font-size: 13.5px; fill: var(--ink); }
.viz-val { fill: var(--ink); font-size: 12.5px; font-weight: 700; }
.viz-center { fill: var(--ink); font-size: 20px; font-weight: 700; }
.viz-line { fill: none !important; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.viz-dot { stroke: var(--panel) !important; stroke-width: 2; }
.viz-ring { fill: none !important; }
.viz-note { font-size: 13px; color: var(--muted); margin: 6px 0 0 !important; line-height: 1.6; }
.viz-cap { font-size: 11.5px; color: var(--muted); margin-top: 6px; font-family: var(--mono); }
.viz-table { margin-top: 6px; font-size: 13px; }
.viz-table summary { cursor: pointer; color: var(--muted); font-size: 12px; font-family: var(--mono); }
.viz-table table { margin-top: 8px; }

/* ---------- figures (![alt](src "caption")) ---------- */
.post-fig { margin: 1.8em 0; }
.post-fig img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: #fbfaf6; }
.post-fig figcaption { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 8px; line-height: 1.6; }
.post-body a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--cat) 50%, transparent); }
