/* ==========================================================================
   BLOG · /blog/ 목록·분야·글 (uiux-audit §3-4). HTML 은 tools/blog/build_blog.py 가 만든다
   - 표지는 CSS 로만 그린다(.post-cover). 자동 연출 없음. 목차 강조·진행 막대는 사용자 스크롤에 답한다
   ========================================================================== */

.blog-page { --blog-col: 42rem; }
.blog-main { padding-bottom: clamp(56px, 8vw, 112px); }
.blog-page :is(h1, h2, h3, p, li, td, th, summary, a) { word-break: keep-all; overflow-wrap: break-word; }
.blog-wrap { padding-top: clamp(28px, 6vw, 80px); width: min(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right), var(--wrap)); }

/* ---------- 빵부스러기 ---------- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .9rem; color: var(--text-3); }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--text-3); }
.crumbs a { color: var(--text-2); display: inline-flex; align-items: center; min-height: 32px; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }

/* ---------- 목록 머리 ---------- */
.blog-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-bottom: clamp(28px, 4vw, 48px); }
.blog-title { font-family: var(--f-display); font-weight: var(--w-display); font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.12; letter-spacing: -0.02em; }
.blog-motto { font-family: var(--f-display-latin); font-style: italic; font-size: clamp(1.3rem, 2vw, 1.7rem); line-height: 1.15; color: var(--text-2); }
.blog-lead { color: var(--text-2); font-size: 1.05rem; line-height: 1.75; max-width: 36em; }
.blog-cats { margin-top: 10px; }
.blog-cats ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.blog-cats .chip { min-height: 44px; padding-inline: 16px; }
.blog-cats .chip .n { font-family: var(--f-mono); font-size: .78em; opacity: .72; margin-left: 2px; }
@media (max-width: 719px) {
  .blog-cats { margin-inline: -16px; }
  .blog-cats ul { flex-wrap: nowrap; overflow-x: auto; padding: 2px 16px 6px; scroll-padding-inline: 16px; scrollbar-width: none; }
  .blog-cats ul::-webkit-scrollbar { display: none; }
  .blog-cats li { flex: none; }
}
.blog-sub { font-family: var(--f-display); font-weight: var(--w-display); font-size: 1.5rem; margin: clamp(48px, 6vw, 72px) 0 20px; }
.blog-empty { display: grid; gap: 18px; justify-items: center; }

/* ---------- 생성 표지 ---------- */
.post-cover {
  --c1: rgb(var(--ether-rgb) / .34); --c2: #0E1A33;
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-md); isolation: isolate;
  background:
    radial-gradient(120% 90% at 0% 0%, var(--c1), transparent 62%),
    radial-gradient(110% 100% at 100% 100%, var(--c2), transparent 70%),
    linear-gradient(135deg, #0B111B, #080C13);
}
.post-cover[data-cat="classics"] { --c1: rgb(var(--ether-rgb) / .30); --c2: rgba(46, 72, 128, .62); }
.post-cover[data-cat="ai"]       { --c1: rgb(var(--ether-rgb) / .30); --c2: rgb(var(--xync-rgb) / .30); }
.post-cover[data-cat="reading"]  { --c1: rgba(46, 72, 128, .70); --c2: rgb(var(--ether-rgb) / .26); }
.post-cover[data-cat="life"]     { --c1: rgb(var(--xync-rgb) / .30); --c2: rgba(46, 72, 128, .62); }
.post-cover[data-cat="studio"]   { --c1: rgb(var(--xync-rgb) / .30); --c2: rgb(var(--ether-rgb) / .24); }
.post-cover::after { /* 낟알 질감(정적) */
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.post-cover svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.post-cover path { fill: none; stroke-width: 2.2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.post-cover .pc-e { stroke: rgb(var(--ether-rgb) / .78); }
.post-cover .pc-x { stroke: rgb(var(--xync-rgb) / .74); }
.post-cover .pc-spark { position: absolute; z-index: 2; left: var(--cx); top: var(--cy); width: clamp(26px, 18%, 72px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle closest-side, #fff 0 11%, rgba(255, 255, 255, .5) 14%, rgba(255, 255, 255, .12) 50%, transparent 100%); }
.post-cover .pc-books { position: absolute; z-index: 2; right: 6%; bottom: -7%; width: 26%; display: flex; justify-content: flex-end; align-items: flex-end; }
.post-cover .pc-books img { flex: 0 0 56%; width: 56%; max-width: 104px; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px;
  box-shadow: 10px 12px 0 -2px rgb(var(--shade-rgb) / calc(.38 * var(--shade-a))), 0 0 0 1px rgb(var(--tint-rgb) / .06); transform: rotate(-7deg); }
.post-cover .pc-books img + img { margin-left: -14%; transform: rotate(5deg) translateY(-8%); }
.post-cover.is-hero { border-radius: var(--r-lg); margin: clamp(24px, 3vw, 36px) 0 clamp(28px, 4vw, 44px); }

/* ---------- 대표 글 ---------- */
.post-feature { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(20px, 3vw, 40px); align-items: center; padding: 14px; border-radius: var(--r-lg); }
.post-feature .post-cover { border-radius: calc(var(--r-lg) - 6px); }
.pf-body { display: grid; gap: 14px; align-content: center; padding: 8px clamp(4px, 1.4vw, 20px) 8px 0; }
.pf-title { font-family: var(--f-display); font-weight: var(--w-display); font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.25; letter-spacing: -0.02em; }
.pf-desc { color: var(--text-2); line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pf-go { justify-self: start; margin-top: 6px; }
@media (max-width: 859px) {
  .post-feature { grid-template-columns: 1fr; padding: 10px; }
  .pf-body { padding: 4px 8px 12px; }
}

/* ---------- 글 격자 ---------- */
.post-grid { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 32px) clamp(16px, 2vw, 28px); }
.post-grid + .ad-slot, .ad-slot + .post-grid { margin-top: 48px; }
.blog-sub + .post-grid { margin-top: 0; }
.post-feature + .post-grid { margin-top: clamp(40px, 5vw, 64px); }
@media (max-width: 1023px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.post-card { display: grid; gap: 14px; height: 100%; align-content: start; border-radius: var(--r-md); }
.post-card .post-cover { transition: transform var(--d-3) var(--ease-out); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .post-card:hover .post-cover { transform: translateY(-3px); } }
.post-card:hover .pk-title { text-decoration: underline; text-decoration-color: var(--line-input); }
.pk-body { display: grid; gap: 8px; }
.pk-cat, .bh-cat { font-size: .85rem; font-weight: 650; color: var(--ether); }
.post-cover[data-cat] + .pk-body .pk-cat { color: var(--ether); }
.pk-title { font-size: 1.14rem; line-height: 1.45; font-weight: 700; letter-spacing: -0.02em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pk-desc { color: var(--text-2); font-size: .95rem; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pk-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--text-3); font-size: .86rem; }
.pk-meta > span:not(.pc-mini)::before { content: "·"; margin-right: 12px; }
.pc-mini { display: inline-flex; gap: 4px; margin-left: auto; }
.pc-mini img { width: 15px; height: 22px; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgb(var(--tint-rgb) / .08); }
.post-grid.is-small .pk-desc { display: none; }

/* ---------- 쪽 넘김 ---------- */
.blog-pager { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 48px; }
.blog-pager ol { list-style: none; display: flex; gap: 4px; }
.blog-pager ol a { display: inline-grid; place-items: center; min-width: 44px; height: 44px; border-radius: var(--r-pill); color: var(--text-2); font-family: var(--f-mono); font-size: .9rem; }
.blog-pager ol a:hover { color: var(--text); background: rgb(var(--tint-rgb) / .05); }
.blog-pager ol a[aria-current="page"] { color: var(--ether-ink); background: var(--ether); }
.blog-pager .btn { min-height: 44px; }
.blog-pager .is-off { opacity: .4; pointer-events: none; }

/* ---------- 글 ---------- */
.blog-progress { position: fixed; top: var(--header-h); left: 0; right: 0; height: 2px; z-index: 90; pointer-events: none; }
.blog-progress span { display: block; height: 100%; background: var(--ether); transform: scaleX(0); transform-origin: 0 50%; will-change: transform; }
.post-layout { display: grid; grid-template-columns: minmax(0, var(--blog-col)); justify-content: center; gap: 56px; padding: clamp(28px, 5vw, 64px) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
@media (min-width: 1200px) { .post-layout { grid-template-columns: minmax(0, var(--blog-col)) 248px; padding-left: calc(248px + 56px + 16px); } }
@media (min-width: 1200px) and (max-width: 1359px) { .post-layout { padding-left: 16px; } }
.post { min-width: 0; }
.post-head { display: grid; gap: 16px; margin-top: 12px; }
.post-title { font-family: var(--f-display); font-weight: var(--w-display); font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.22; letter-spacing: -0.02em; text-wrap: balance; }
.post-meta { color: var(--text-3); font-size: .95rem; }
.post-meta a { color: var(--text-2); }
.post-meta a:hover { color: var(--text); text-decoration: underline; }
.post-lede { color: var(--text-2); font-size: 1.15rem; line-height: 1.75; }

.toc-inline { margin-top: 24px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-2); }
.toc-inline summary { min-height: 48px; display: flex; align-items: center; padding: 0 18px; cursor: pointer; font-weight: 650; color: var(--text-2); list-style: none; }
.toc-inline summary::-webkit-details-marker { display: none; }
.toc-inline summary::after { content: ""; width: 8px; height: 8px; margin-left: auto; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform var(--d-2); }
.toc-inline[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.toc-inline nav { padding: 0 18px 14px; }
@media (min-width: 1200px) { .toc-inline { display: none; } }
.post-layout ol:where(.toc-inline ol, .toc-side ol) { list-style: none; display: grid; gap: 2px; }
:is(.toc-inline, .toc-side) a { display: flex; align-items: center; min-height: 44px; padding: 7px 10px; border-radius: var(--r-xs); color: var(--text-2); font-size: .92rem; line-height: 1.45; }
:is(.toc-inline, .toc-side) a:hover { color: var(--text); background: rgb(var(--tint-rgb) / .04); }
.toc-side { display: none; }
@media (min-width: 1200px) {
  .toc-side { display: block; position: sticky; top: calc(var(--header-h) + 24px); align-self: start; padding: 18px 12px 14px; max-height: calc(100vh - var(--header-h) - 48px); overflow: auto; margin-top: 64px; }
  .toc-side .toc-h { font-size: .85rem; font-weight: 650; color: var(--text-3); padding: 0 10px 8px; }
  .toc-side a { border-left: 1px solid transparent; border-radius: 0 var(--r-xs) var(--r-xs) 0; }
  .toc-side a.is-on { color: var(--text); border-left-color: var(--ether); background: var(--ether-dim); }
}

/* 본문: 블로그는 "글". 라이브러리(Noto Serif)와 일부러 다르게 Pretendard */
.post-body { font-size: 18px; line-height: 1.85; color: var(--text); }
.post-body > * + * { margin-top: 1.1em; }
.post-body h2 { font-family: var(--f-display); font-weight: var(--w-display); font-size: 1.6rem; line-height: 1.35; margin-top: 2.4em; scroll-margin-top: calc(var(--header-h) + 16px); }
.post-body h3 { font-size: 1.18rem; line-height: 1.5; margin-top: 2em; scroll-margin-top: calc(var(--header-h) + 16px); }
.post-body h2 + *, .post-body h3 + * { margin-top: .8em; }
.post-body a { color: var(--ether); text-decoration: underline; text-decoration-color: rgb(var(--ether-rgb) / .4); }
.post-body a:hover { text-decoration-color: currentColor; }
.post-body .ext-ico { display: inline-block; vertical-align: -1px; margin-left: 3px; }
.post-body strong { font-weight: 700; color: var(--text); }
.post-body em { font-style: italic; }
.post-body code { font-family: var(--f-mono); font-size: .86em; padding: .1em .35em; border-radius: 4px; background: var(--card-2); }
.post-body :is(ul, ol) { padding-left: 1.4em; }
.post-body li + li { margin-top: .45em; }
.post-body li > p + p { margin-top: .6em; }
.post-body ol > li > p:first-child { margin-top: 0; }
.post-body li::marker { color: var(--text-3); }
.post-body blockquote { margin: 1.8em 0; padding: 2px 0 2px 22px; border-left: 1px solid var(--line-input); font-family: var(--f-display); font-size: 1.08rem; line-height: 1.85; color: var(--text); }
.post-body blockquote p + p { margin-top: .7em; }
.post-body hr { border: 0; height: 1px; background: var(--line-2); margin: 2.4em 0; }
.post-body .table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.post-body table { width: 100%; border-collapse: collapse; font-size: .92rem; line-height: 1.6; min-width: 32rem; }
.post-body th, .post-body td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.post-body th { color: var(--text-2); font-weight: 650; background: var(--bg-2); white-space: nowrap; }
.post-body tr:last-child td { border-bottom: 0; }
.post-body .ad-slot { margin-block: 48px; }
@media (max-width: 719px) {
  .post-body { font-size: 17px; line-height: 1.8; }
  .post-body h2 { font-size: 1.4rem; margin-top: 2em; }
  .post-body h3 { font-size: 1.1rem; }
  .post-body blockquote { padding-left: 16px; font-size: 1.02rem; margin: 1.5em 0; }
  .post-body :is(ul, ol) { padding-left: 1.2em; }
  .post-body table { font-size: .88rem; min-width: 30rem; }
  .post-body th, .post-body td { padding: 9px 12px; }
  .post-lede { font-size: 1.06rem; }
  .post-head { gap: 12px; }
  .post-cover.is-hero { border-radius: var(--r-md); margin: 20px 0 28px; }
  .post-books { margin-top: 44px; }
  .post-share .btn { flex: 1 1 0; }
  .blog-pager { gap: 4px; }
}
@media (max-width: 380px) {
  .post-title { font-size: 1.8rem; }
  .blog-pager .btn { padding-inline: 12px; }
}

/* 이 글에 나온 책 */
.post-books { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.post-books h2, .post-related h2 { font-family: var(--f-display); font-weight: var(--w-display); font-size: 1.35rem; margin-bottom: 18px; }
.post-books ul { list-style: none; display: grid; gap: 12px; }
.book-card { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); }
.book-card img, .pb-noimg { width: 64px; height: 96px; object-fit: cover; border-radius: 4px; box-shadow: 0 0 0 1px rgb(var(--tint-rgb) / .06); background: var(--card-2); }
.pb-txt { display: grid; gap: 0; min-width: 0; justify-items: start; }
.pb-title { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; font-size: 1.05rem; line-height: 1.4; }
.pb-title:hover { text-decoration: underline; }
.pb-author { color: var(--text-3); font-size: .9rem; }
.pb-go { min-height: 44px; }
.pb-more { margin-top: 14px; }
.pb-more a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--line-input); }
@media (max-width: 479px) {
  .book-card { grid-template-columns: 56px minmax(0, 1fr); }
  .book-card img, .pb-noimg { width: 56px; height: 84px; grid-row: span 2; }
  .pb-go { justify-self: start; }
}

.post-made { margin-top: 36px; padding: 14px 16px; border-left: 3px solid var(--ether, #63F2D2); border-radius: 6px;
  background: color-mix(in srgb, currentColor 4%, transparent); font-size: .86rem; line-height: 1.65; opacity: .85; }
.post-made a { white-space: nowrap; margin-left: 4px; }
.post-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 32px; }
.post-tags .chip { min-height: 30px; font-size: .84rem; }
.post-share { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.post-share .btn { min-height: 44px; }
.post-talk { margin-top: 12px; }
.post-talk .btn { min-height: 44px; padding-inline: 14px 18px; margin-left: -14px; color: var(--xync); }
.post-talk .btn:hover { color: var(--xync-2); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 40px; }
.post-nav a { display: grid; gap: 6px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-md); min-height: 44px; }
.post-nav a:hover { border-color: var(--line-input); background: rgb(var(--tint-rgb) / .02); }
.post-nav .pn-next { grid-column: 2; text-align: right; }
.pn-k { font-size: .84rem; color: var(--text-3); }
.pn-t { font-weight: 650; line-height: 1.45; }
@media (max-width: 559px) { .post-nav { grid-template-columns: 1fr; } .post-nav .pn-next { grid-column: auto; } }

.post-after { width: min(var(--wrap), 100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)); margin-inline: auto; }
.post-after > .ad-slot { max-width: var(--blog-col); margin-inline: auto; }
.post-related { margin-top: 24px; }

@media (max-width: 639px) {
  /* 휴대폰: 글 목록은 작은 표지 + 글자의 가로 줄로 (훑어보기 쉽게, 페이지 길이 절반) */
  .post-grid { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line); }
  .post-grid > li { border-bottom: 1px solid var(--line); }
  .post-card { grid-template-columns: clamp(96px, 30vw, 136px) minmax(0, 1fr); gap: 14px; align-items: start; padding: 16px 0; }
  .post-card .post-cover { aspect-ratio: 4 / 3; border-radius: var(--r-sm); }
  .post-card .pk-body { gap: 6px; }
  .pk-title { font-size: 1.02rem; line-height: 1.45; -webkit-line-clamp: 3; }
  .pk-desc { display: none; }
  .pk-meta { font-size: .8rem; gap: 2px 10px; }
  .pk-meta > span:not(.pc-mini)::before { margin-right: 10px; }
  .pc-mini { display: none; }
  .post-grid + .ad-slot, .ad-slot + .post-grid { margin-top: 32px; }
}
@media print {
  .blog-progress, .toc-side, .toc-inline, .post-share, .post-talk, .post-after, .ad-slot { display: none !important; }
}

/* 글마다 그린 썸네일(2026-10-25): 그림이 있으면 CSS 선 표지 대신 그림 */
.post-cover.has-img { background: #0d131c; }
.post-cover.has-img::after { display: none; }
.post-cover.has-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.post-cover[data-cat="self"]     { --c1: rgb(var(--xync-rgb) / .28); --c2: rgba(46, 72, 128, .55); }
.post-cover[data-cat="behavior"] { --c1: rgb(var(--ether-rgb) / .28); --c2: rgb(var(--xync-rgb) / .26); }
.post-cover[data-cat="brain"]    { --c1: rgba(46, 72, 128, .70); --c2: rgb(var(--xync-rgb) / .24); }
.post-cover[data-cat="growth"]   { --c1: rgb(var(--ether-rgb) / .30); --c2: rgba(46, 72, 128, .5); }
