/* Piksio blog — index, post typography, live Piksio images, subscribe box.
   Builds on site.css tokens; pages are generated by scripts/blog/build.js. */

.b-narrow { max-width: 760px; }
.b-index, .b-post { padding: clamp(40px, 6vw, 80px) 0 clamp(64px, 9vw, 112px); }
.b-index h1 { font-size: clamp(40px, 5.5vw, 64px); }
.b-meta { font-size: 14px; color: var(--text-muted); margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.b-meta .chip { padding: 4px 8px; font-size: 11px; }

/* ---------- Index ---------- */
.b-index > .container > .b-sub-form { margin-top: 28px; }
.b-list { list-style: none; padding: 0; margin: clamp(40px, 6vw, 64px) 0 0; display: grid; gap: 20px; }
.b-card a {
  display: block; text-decoration: none; color: inherit;
  background: #fff; border: var(--border-w) solid var(--ink); border-radius: var(--radius-card);
  box-shadow: var(--pop-sm); padding: clamp(20px, 3vw, 28px);
  transition: transform .15s var(--ease-bounce), box-shadow .15s var(--ease-out);
}
.b-card a:hover { transform: translate(-2px, -2px); box-shadow: var(--pop-md); }
.b-card h2 { font-size: clamp(24px, 2.6vw, 30px); margin: 10px 0 8px; line-height: 1.15; }
.b-card p { margin: 0; color: var(--ink-800); }
.b-read { display: inline-block; margin-top: 14px; font: 600 16px/1 var(--font-display); color: var(--brand-strong); }
.b-empty { margin-top: 48px; color: var(--text-muted); }

/* ---------- Post ---------- */
.b-back { display: inline-block; font-weight: 600; font-size: 15px; text-decoration: none; margin-bottom: 28px; }
.b-back:hover { text-decoration: underline; }
.b-head h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.08; }
.b-head .chip { margin-bottom: 16px; }
.b-head .lede { margin-top: 16px; }
.b-head .b-meta { margin-top: 18px; }
.b-cover { width: 100%; margin-top: 32px; border: var(--border-w) solid var(--ink); border-radius: var(--radius-card); box-shadow: var(--pop-md); }

.prose { margin-top: clamp(28px, 4vw, 44px); font-size: 18px; line-height: 1.7; color: var(--text-body); }
.prose > * + * { margin-top: 1.1em; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table { margin-bottom: 0; }
.prose h2 { font-size: clamp(26px, 3vw, 34px); line-height: 1.15; margin-top: 1.8em; }
.prose h3 { font-size: clamp(21px, 2.2vw, 24px); margin-top: 1.6em; }
.prose h2 + *, .prose h3 + * { margin-top: .6em; }
.prose a { color: var(--brand-strong); text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose strong { color: var(--ink); }
.prose img { border-radius: 16px; border: 2px solid var(--ink); height: auto; }
.prose blockquote { margin-left: 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--brand); color: var(--ink-800); }
.prose code { font: 400 .88em var(--font-mono); background: var(--paper-100); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: var(--ink); color: var(--paper-100); padding: 18px 20px; border-radius: 16px; overflow-x: auto; font-size: 14px; line-height: 1.55; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose hr { border: 0; border-top: 2px dashed var(--sand-300); margin: 2.2em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1.5px solid var(--sand-300); }
.prose th { font-weight: 700; color: var(--ink); }

/* ---------- Live Piksio image ---------- */
.pk-live { margin: 2em 0; }
.pk-frame { position: relative; background: var(--paper-100); border: var(--border-w) solid var(--ink); border-radius: var(--radius-card); box-shadow: var(--pop-md); overflow: hidden; }
.pk-frame img { width: 100%; height: auto; border: 0; border-radius: 0; transition: opacity .25s; }
.pk-live.loading .pk-frame img { opacity: .55; }
.pk-spin { position: absolute; top: 14px; right: 14px; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--ink); border-top-color: var(--brand); background: #fff; opacity: 0; transition: opacity .2s; }
.pk-live.loading .pk-spin { opacity: 1; animation: pk-spin .8s linear infinite; }
@keyframes pk-spin { to { transform: rotate(360deg); } }
.pk-try { margin-top: 18px; padding: 18px 20px; background: var(--yellow-50); border: 2px dashed var(--yellow-600); border-radius: 18px; display: grid; gap: 12px; }
.pk-try-title { margin: 0; font: 600 17px/1.3 var(--font-display); color: var(--ink); }
.pk-field { display: grid; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ink); }
.pk-field code { font: 400 12px var(--font-mono); background: #fff; border: 1.5px dashed var(--yellow-600); padding: 1px 6px; border-radius: 6px; margin-left: 4px; font-weight: 400; }
.pk-field input { font: 500 17px/1.3 var(--font-body); color: var(--ink); padding: 11px 14px; border-radius: var(--radius-field); border: 2px solid var(--ink); background: #fff; box-shadow: var(--pop-sm); width: 100%; }
.pk-field input:focus { outline: none; box-shadow: 0 0 0 4px var(--blue-400), var(--pop-sm); }
.pk-url { margin: 0; font: 400 13px/1.5 var(--font-mono); color: var(--ink-800); word-break: break-all; }
.pk-url b { color: var(--brand-strong); }
.pk-url.err { font-family: var(--font-body); color: #8c1a26; }
.pk-live figcaption { margin-top: 12px; font-size: 15px; color: var(--text-muted); text-align: center; }

/* ---------- Comments ---------- */
.b-comments { margin-top: clamp(48px, 7vw, 72px); padding-top: clamp(32px, 5vw, 48px); border-top: 2px dashed var(--sand-300); }
.b-comments h2 { font-size: clamp(26px, 3vw, 34px); }
.b-c-count { color: var(--text-muted); font-weight: 500; }
.b-c-notice { margin: 16px 0 0; padding: 12px 16px; border: 2px solid var(--ink); border-radius: 14px; background: var(--green-50); font-weight: 600; }
.b-c-list, .b-c-replies { list-style: none; padding: 0; margin: 0; }
.b-c-list { margin-top: 24px; display: grid; gap: 16px; }
.b-c-item { background: #fff; border: 2px solid var(--ink); border-radius: 18px; padding: 16px 18px; box-shadow: var(--pop-sm); scroll-margin-top: 96px; }
.b-c-item:target { box-shadow: 0 0 0 4px var(--yellow-400), var(--pop-sm); }
.b-c-replies { margin-top: 14px; display: grid; gap: 12px; padding-left: clamp(12px, 3vw, 24px); border-left: 3px solid var(--sand-200); }
.b-c-item.reply { box-shadow: none; border-width: 1.5px; background: var(--paper-0); }
.b-c-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 15px; }
.b-c-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow-400); border: 2px solid var(--ink); font: 700 14px/1 var(--font-display); color: var(--ink); }
.b-c-badge { padding: 3px 8px; font-size: 11px; }
.b-c-time { color: var(--text-muted); font-size: 13px; }
.b-c-text { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; }
.b-c-reply { background: none; border: 0; padding: 4px 0; font: 600 14px var(--font-body); color: var(--brand-strong); cursor: pointer; }
.b-c-reply:hover { text-decoration: underline; }
.b-c-empty { color: var(--text-muted); }

.b-c-form { margin-top: 28px; display: grid; gap: 14px; background: #fff; border: var(--border-w) solid var(--ink); border-radius: var(--radius-card); box-shadow: var(--pop-md); padding: clamp(18px, 3vw, 28px); }
.b-c-form h3 { font-size: 22px; }
.b-c-replying { margin: 0; padding: 8px 12px; background: var(--yellow-50); border: 1.5px dashed var(--yellow-600); border-radius: 12px; font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.b-c-cancel { background: none; border: 0; font: 600 14px var(--font-body); color: var(--brand-strong); cursor: pointer; text-decoration: underline; }
.b-c-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.b-c-field { display: grid; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ink); }
.b-c-field input, .b-c-field textarea { font: 500 16px/1.4 var(--font-body); color: var(--ink); padding: 11px 14px; border-radius: var(--radius-field); border: 2px solid var(--ink); background: #fff; width: 100%; min-width: 0; }
.b-c-field textarea { resize: vertical; min-height: 110px; }
.b-c-field input:focus, .b-c-field textarea:focus { outline: none; box-shadow: 0 0 0 4px var(--blue-400); }
.b-c-check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.b-c-check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); flex: none; }
.b-c-msg { margin: 0; font-size: 15px; font-weight: 600; }
.b-c-msg:empty { display: none; }
.b-c-msg.err, .b-c-notice.err { color: #8c1a26; }
.b-c-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.b-c-legal { margin: 0; font-size: 13px; color: var(--text-muted); max-width: 360px; }
.b-c-legal a { color: inherit; }
.b-c-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 560px) { .b-c-row { grid-template-columns: 1fr; } .b-c-foot .btn { width: 100%; } }

/* ---------- Subscribe ---------- */
.b-sub { margin-top: clamp(48px, 7vw, 72px); background: var(--brand-soft); border: var(--border-w) solid var(--ink); border-radius: var(--radius-panel); box-shadow: var(--pop-md); padding: clamp(24px, 4vw, 40px); }
.b-sub h2 { font-size: clamp(26px, 3vw, 34px); }
.b-sub > p { margin: 10px 0 20px; color: var(--ink-800); }
.b-sub-form { display: grid; grid-template-columns: 1fr 1.3fr auto; gap: 10px; align-items: start; }
.b-sub-form input:not([type=hidden]) { font: 500 16px/1.3 var(--font-body); color: var(--ink); padding: 13px 16px; border-radius: var(--radius-control); border: 2px solid var(--ink); background: #fff; box-shadow: var(--pop-sm); width: 100%; min-width: 0; }
.b-sub-form input:focus { outline: none; box-shadow: 0 0 0 4px var(--blue-400), var(--pop-sm); }
.b-sub-form .btn { padding: 13px 22px; }
.b-sub-legal, .b-sub-msg { grid-column: 1 / -1; margin: 2px 0 0; font-size: 13px; color: var(--text-muted); }
.b-sub-legal a { color: inherit; }
.b-sub-msg:empty { display: none; }
.b-sub-msg { font-size: 15px; font-weight: 600; color: var(--ink); }
.b-sub-msg.err { color: #8c1a26; }
.b-sub-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 640px) { .b-sub-form { grid-template-columns: 1fr; } .b-sub-form .btn { width: 100%; } }
