/* Blog: /blog and /blog/<slug>. Loaded after styles.css and uses its tokens, so light and dark follow the landing. */
.blog main { padding-top: calc(env(safe-area-inset-top, 0px) + 112px); padding-bottom: 72px; }
.blog main:focus { outline: none; }
.blog .nav .links a[aria-current="page"] { opacity: 1; background: var(--line); }

/* ---------- Index ---------- */
.blog-head { display: grid; gap: 14px; }
.blog-head h1 { font-family: var(--f-display); font-size: var(--fs-h2); line-height: 1; letter-spacing: -0.018em; }
.filters ul { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.chip { min-height: 40px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink-2); font: inherit; font-size: var(--fs-sm); font-weight: 500; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.chip:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 22%, transparent); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.count { margin: 18px 0 14px; color: var(--ink-3); font-size: var(--fs-xs); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 22px; }
.card a { display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: 24px; background: var(--card); box-shadow: var(--shadow-sm); text-decoration: none; transition: transform .3s var(--ease), box-shadow .3s ease; }
.card a:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card img, .card-ph { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--paper-2); }
.card-ph { display: grid; place-items: center; background: linear-gradient(135deg, var(--cobalt), var(--azure)); }
.card-ph svg { width: 56px; height: auto; fill: #fff; opacity: .9; }
.card-body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 18px 22px 22px; }
.card-body > span { display: block; }
.card .cats { color: var(--cobalt); font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.card-title { font-family: var(--f-display); font-size: 1.5rem; line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; }
.excerpt { display: -webkit-box; overflow: hidden; color: var(--ink-2); font-size: var(--fs-sm); -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.card-body .meta { margin-top: auto; padding-top: 4px; color: var(--ink-3); font-size: var(--fs-xs); }

/* ---------- Post ---------- */
.post { max-width: calc(760px + 2 * var(--gutter)); }
.post-head { display: grid; justify-items: start; gap: 16px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: var(--fs-sm); text-decoration: none; }
.back::before { content: "\2190"; }
.back:hover { color: var(--ink); }
.post-head .cats { display: flex; flex-wrap: wrap; gap: 6px; }
.post-head .cats li { padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--cobalt) 12%, transparent); color: var(--cobalt); font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.post-head h1 { font-family: var(--f-display); font-size: clamp(2.25rem, 5.2vw, 3.75rem); line-height: 1.04; letter-spacing: -0.016em; }
.post-head .meta { color: var(--ink-3); font-size: var(--fs-sm); }
.post-hero { margin: 32px 0 8px; }
.post-hero img { width: 100%; border-radius: 24px; background: var(--paper-2); }

.prose { margin-top: 36px; font-size: 1.125rem; line-height: 1.7; overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 1.9em; font-family: var(--f-display); font-size: clamp(1.7rem, 3vw, 2.15rem); line-height: 1.12; letter-spacing: -0.01em; }
.prose h3 { margin-top: 1.6em; font-size: 1.25rem; font-weight: 650; line-height: 1.3; }
.prose h4 { margin-top: 1.4em; font-size: 1.0625rem; font-weight: 650; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: .6em; }
.prose ul { padding-left: 1.3em; list-style: disc; }
.prose ol { padding-left: 1.5em; list-style: decimal; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--cobalt); }
.prose a { color: var(--cobalt); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose strong { font-weight: 650; }
.prose blockquote { margin-inline: 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--cobalt); color: var(--ink-2); }
.prose figure img { width: 100%; border-radius: 18px; }
.video { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 18px; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.table-wrap table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: var(--fs-sm); line-height: 1.5; }
.table-wrap th, .table-wrap td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-wrap tr:last-child > * { border-bottom: 0; }
.table-wrap tr:first-child > th { background: var(--paper-2); }
.post-end { margin-top: 56px; }
.post-end .btn { background: var(--cobalt); color: #fff; }

.blog .foot { padding-top: 24px; border-top: 1px solid var(--line); }

@media (max-width: 560px) {
  .blog main { padding-top: calc(env(safe-area-inset-top, 0px) + 96px); }
  .prose { font-size: 1.0625rem; }
  .post-hero img { border-radius: 16px; }
  .card a { border-radius: 20px; }
  .card-title { font-size: 1.375rem; }
}
@media (prefers-reduced-motion: reduce) {
  .card a { transition: none; }
  .card a:hover { transform: none; }
}
