/*
 * Blog: the /blog index and article pages (/blog/<slug>). Uses the tokens and components from spokly.css.
 */

/* ---------- Index ---------- */
.blog-hero { padding-bottom: 40px; }
.blog-list { padding-bottom: 96px; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.post-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .post-grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 400px) { .post-grid { grid-template-columns: 1fr; } }
.post-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s;
}
.post-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.post-card-title { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.35; }
.post-card p { color: var(--text-2); font-size: 14px; line-height: 1.55; flex: 1; }
.post-card-meta { font-size: 13px; color: var(--text-2); }

/* ---------- Article ---------- */
.post { max-width: 760px; padding-block: 32px 96px; }
.post-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-2); text-decoration: none; }
.post-back:hover { color: var(--text); }
.icon-flip { transform: scaleX(-1); }
.post-head { display: flex; flex-direction: column; gap: 14px; margin: 20px 0 28px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.post-title { font-size: clamp(30px, 5.4vw, 44px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.12; }
.post-desc { font-size: 18px; line-height: 1.55; color: var(--text-2); }
.post-meta { font-size: 14px; color: var(--text-2); }
.post-meta a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

.toc { padding: 18px 20px; margin-bottom: 36px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r-card); }
.toc-h { font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { text-decoration: underline; text-underline-offset: 2px; }

.post-body { font-size: 17px; line-height: 1.7; color: var(--text); overflow-wrap: break-word; }
.post-body > * + * { margin-top: 18px; }
.post-body h2 { margin-top: 44px; font-size: 26px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.25; scroll-margin-top: calc(var(--nav-h) + 16px); }
.post-body h3 { margin-top: 30px; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; scroll-margin-top: calc(var(--nav-h) + 16px); }
.post-body h2 + *, .post-body h3 + * { margin-top: 10px; }
.post-body p, .post-body li { color: #292524; }
:root[data-theme="dark"] .post-body p, :root[data-theme="dark"] .post-body li { color: #E7E5E4; }
.post-body ul, .post-body ol { padding-left: 24px; display: flex; flex-direction: column; gap: 8px; }
.post-body li > ul, .post-body li > ol { margin-top: 8px; }
.post-body a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.post-body a:hover { text-decoration-thickness: 2px; }
.post-body strong { font-weight: 600; }
.post-body code { font-family: var(--mono); font-size: .88em; padding: 2px 5px; border-radius: 6px; background: var(--field); }
.post-body pre { padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-subtle); overflow-x: auto; line-height: 1.55; }
.post-body pre code { padding: 0; background: none; font-size: 14px; }
.post-body blockquote { padding: 4px 0 4px 18px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.post-body .table-wrap table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.post-body th, .post-body td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.post-body th { font-size: 14px; font-weight: 500; color: var(--text-2); background: var(--bg-subtle); }
.post-body tr:last-child td { border-bottom: 0; }
.post-body .ad-content { margin-block: 36px; }

.try-card {
  position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 48px; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
}
.try-card > .orb { --orb-size: 300px; top: -190px; right: -110px; z-index: -1; }
.try-card > div { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; }
.try-label { font-size: 13px; font-weight: 500; color: var(--success-ink); }
.try-name { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.try-card p:not(.try-label):not(.try-name) { color: var(--text-2); font-size: 15px; }

.author-box { display: flex; gap: 14px; align-items: flex-start; margin-top: 24px; padding: 20px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.author-avatar { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--grad-source); color: var(--tile-ink); font-weight: 600; }
.author-name { font-weight: 600; }
.author-box p:not(.author-name) { font-size: 15px; color: var(--text-2); margin-top: 2px; }
.author-box a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

.related { margin-top: 48px; display: flex; flex-direction: column; gap: 16px; }
