/* Blog pages. Builds on /style.css (brand tokens, nav, footer, buttons); same look as the learn hub, no extra palette. */
html { scroll-behavior: smooth; scroll-padding-top: 1rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

#readbar { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 50; background: transparent; }
#readbar span { display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(0); background: var(--brand); }

.post-hero { background: var(--accent-soft); border-bottom: 1px solid var(--border); padding: 2.75rem 0 2.25rem; }
.post-hero .inner { max-width: 68rem; margin: 0 auto; padding: 0 1.5rem; }
.post-hero h1 { font-size: 2.35rem; line-height: 1.15; margin: 0 0 1rem; letter-spacing: -.02em; max-width: 44rem; text-wrap: balance; }
.post-hero .lead { color: var(--muted); font-size: 1.1rem; max-width: 40rem; margin: 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .85rem; color: var(--muted); margin: 0 0 1rem; }
.crumbs a { color: var(--brand); text-decoration: none; font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }
.meta { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.meta li { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .2rem .8rem; font-size: .82rem; color: var(--muted); }

.layout { display: grid; grid-template-columns: 14.5rem minmax(0, 44rem); gap: 3rem; max-width: 68rem; margin: 0 auto; padding: 0 1.5rem; }
.side { position: sticky; top: 1rem; align-self: start; max-height: calc(100vh - 2rem); overflow: auto; padding: 2rem 0; }
.side h2 { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 .6rem; }
.side a { display: block; padding: .32rem .7rem; border-inline-start: 2px solid var(--border); color: var(--muted); text-decoration: none; font-size: .88rem; line-height: 1.35; }
.side a:hover { color: var(--ink); }
.side a.active { border-inline-start-color: var(--brand); color: var(--brand); font-weight: 600; }
.toc-mobile { display: none; margin: 1.25rem 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft); }
.toc-mobile summary { cursor: pointer; padding: .8rem 1rem; font-weight: 600; }
.toc-mobile nav { padding: 0 1rem 1rem; display: grid; gap: .1rem; }
.toc-mobile a { color: var(--ink); text-decoration: none; padding: .35rem 0; font-size: .95rem; }

.post { padding: 2rem 0 4rem; font-size: 1.0625rem; line-height: 1.7; }
.post h2 { font-size: 1.5rem; line-height: 1.25; margin: 2.75rem 0 .8rem; padding-top: 1.5rem; border-top: 1px solid var(--border); scroll-margin-top: 1rem; }
.post h3 { font-size: 1.15rem; margin: 1.75rem 0 .5rem; scroll-margin-top: 1rem; }
.post p { margin: 0 0 1.1rem; }
.post ul, .post ol { margin: 0 0 1.25rem; padding-inline-start: 1.4rem; }
.post li { margin-bottom: .45rem; }
.post li > p { margin: 0; }
.post strong { font-weight: 700; }
.post a { text-underline-offset: 2px; }
.post code { font-size: .88em; background: var(--bg-soft); border: 1px solid var(--border); border-radius: .3rem; padding: .08rem .35rem; word-break: break-word; }
.post pre { background: var(--code-bg); color: var(--code-text); border-radius: .6rem; padding: 1rem 1.1rem; overflow: auto; font-size: .85rem; line-height: 1.55; margin: 0 0 1.25rem; }
.post pre code { background: none; border: 0; padding: 0; color: inherit; }
.post blockquote { margin: 0 0 1.25rem; padding: .2rem 1.1rem; border-inline-start: 3px solid var(--accent-line); color: var(--muted); }
.post hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.post a:focus-visible, .side a:focus-visible, .toc-mobile a:focus-visible, .toc-mobile summary:focus-visible, .card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* the short answer that opens every post */
.post p.answer { background: var(--accent-soft); border: 1px solid var(--accent-line); border-inline-start: 4px solid var(--brand); border-radius: var(--radius); padding: 1.1rem 1.3rem; font-size: 1.1rem; line-height: 1.6; margin: 0 0 1.75rem; }

.table-wrap { overflow-x: auto; margin: 0 0 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); }
/* /style.css stacks every table into cards on phones; these are comparison tables, so keep them as tables */
.table-wrap table { display: table; width: 100%; border-collapse: collapse; font-size: .92rem; line-height: 1.5; }
.table-wrap thead { display: table-header-group; }
.table-wrap tbody { display: table-row-group; }
.table-wrap tr { display: table-row; padding: 0; border-bottom: 0; }
.table-wrap th, .table-wrap td { display: table-cell; width: auto; padding: .65rem .85rem; text-align: start; vertical-align: top; border-bottom: 1px solid var(--border); }
.table-wrap td:empty { display: table-cell; }
.table-wrap th { background: var(--bg-soft); font-weight: 700; }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap td:first-child { font-weight: 600; }

.cta-band { border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: .9rem; padding: 1.5rem 1.6rem; margin: 3rem 0 1.5rem; }
.post .cta-band h2 { margin: 0 0 .4rem; border: 0; padding: 0; font-size: 1.35rem; }
.cta-band p { margin: 0 0 1rem; }
.cta-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.post .fine { color: var(--muted); font-size: .88rem; }

.more { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 2.5rem 0 3rem; }
.more.index { border-top: 0; background: transparent; padding-top: 2.5rem; }
.more .inner { max-width: 68rem; margin: 0 auto; padding: 0 1.5rem; }
.more h2 { font-size: 1.2rem; margin: 0 0 1rem; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.card { display: flex; flex-direction: column; gap: .4rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; color: var(--ink); text-decoration: none; transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.card:hover { border-color: var(--brand); box-shadow: var(--shadow-card); }
.card-kicker { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); font-weight: 700; }
.card-title { font-weight: 800; font-size: 1.05rem; line-height: 1.3; letter-spacing: -.01em; }
.card-desc { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.card-meta { margin-top: auto; padding-top: .4rem; color: var(--muted); font-size: .8rem; }

@media (max-width: 959px) {
  .layout { display: block; padding: 0 1.25rem; }
  .side { display: none; }
  .toc-mobile { display: block; }
  .post-hero h1 { font-size: 1.9rem; }
  .cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .post-hero { padding: 2rem 0 1.5rem; }
  .post-hero .inner, .more .inner { padding: 0 1rem; }
  .layout { padding: 0 1rem; }
  .post { font-size: 1rem; }
  .cards { grid-template-columns: 1fr; }
  .cta-actions .btn { flex: 1 1 100%; text-align: center; }
}
@media (pointer: coarse) { .toc-mobile a, .side a { display: flex; align-items: center; min-height: 44px; } }
@media print { nav.top, .side, .toc-mobile, #readbar, .cta-band, .more, footer.site { display: none !important; } .layout { display: block; } }
