/* Blog: /blog index and /post/<slug> in a reading layout (build/pages.py). The words are the live posts' own. */

/* ---------- post header ---------- */
.post-hero { padding: clamp(118px, 12vw, 168px) 0 clamp(20px, 3vw, 36px); }
.post-wrap { max-width: 980px; }
.post-crumb { font-size: 14px; font-weight: 600; opacity: .6; display: flex; flex-wrap: wrap; gap: 6px; }
.post-crumb a { text-decoration: underline; text-underline-offset: 3px; }
.post-title { font-size: clamp(36px, 5vw, 68px); font-weight: 600; letter-spacing: -.045em; line-height: 1.02; margin-top: 16px; text-wrap: balance; }
.post-dek { font-size: clamp(18px, 1.55vw, 22px); line-height: 1.45; opacity: .72; margin-top: 18px; max-width: 38em; }
.post-cover { max-width: 1100px; margin-top: clamp(28px, 3.4vw, 48px); }
/* covers keep their own shape (text is often baked into them): never cropped, never upscaled, at most ~a screen tall */
.post-cover img { display: block; width: min(100%, calc(min(72vh, 720px) * var(--ar, 1.7778))); height: auto; max-height: min(72vh, 720px); margin: 0 auto; border-radius: clamp(20px, 2.4vw, 32px); background: #eceef3; }

/* ---------- body: one comfortable reading column, contents on the side ---------- */
.post-main { overflow: clip; background: #fff; padding: clamp(40px, 5vw, 72px) 0 clamp(64px, 7vw, 110px); }
.post-grid { display: grid; grid-template-columns: 230px minmax(0, 700px); justify-content: center; gap: clamp(36px, 5vw, 88px); }
.post-grid.no-toc { grid-template-columns: minmax(0, 700px); }
.post-toc { position: sticky; top: 104px; align-self: start; max-height: calc(100vh - 140px); overflow-y: auto; font-size: 14px; }
.post-toc b { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .5; }
.post-toc ol { list-style: none; margin-top: 12px; border-left: 2px solid #ececf2; }
.post-toc a { display: block; margin-left: -2px; padding: 7px 0 7px 14px; border-left: 2px solid transparent; line-height: 1.35; opacity: .62; transition: opacity .2s, border-color .2s; }
.post-toc a:hover { opacity: 1; }
.post-toc a.on { opacity: 1; font-weight: 600; border-color: var(--orange); }

.post-content { min-width: 0; font-size: clamp(17px, 1.2vw, 19px); line-height: 1.72; color: #2a2a33; }
.post-content > * { margin: 0; }
.post-content > * + * { margin-top: 1.1em; }
.post-content h2 { font-size: clamp(27px, 2.5vw, 36px); font-weight: 600; letter-spacing: -.035em; line-height: 1.14; color: var(--ink); margin-top: 2.2em; text-wrap: balance; }
.post-content h3 { font-size: clamp(20px, 1.7vw, 24px); font-weight: 600; letter-spacing: -.02em; line-height: 1.28; color: var(--ink); margin-top: 1.8em; }
.post-content h4 { font-size: 18px; font-weight: 600; margin-top: 1.6em; }
.post-content h2 + *, .post-content h3 + *, .post-content h4 + * { margin-top: .55em; }
.post-content > :first-child { margin-top: 0; }
.post-content strong, .post-content b { font-weight: 600; color: var(--ink); }
.post-content a { color: #c9520b; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.post-content a:hover { color: var(--orange); }
.post-content ul, .post-content ol { padding-left: 1.25em; }
.post-content li + li { margin-top: .5em; }
.post-content li::marker { color: var(--orange); font-weight: 600; }
.post-content blockquote { border-left: 3px solid var(--orange); padding: .2em 0 .2em 1.1em; font-size: 1.08em; color: var(--ink); }
.post-content hr { border: 0; height: 1px; background: #ececf2; margin: 2.4em 0; }
/* images: never taller than a screen, rounded like the rest of the site */
.post-content img { display: block; width: 100%; height: auto; border-radius: 22px; background: #eceef3; }
.post-content img.tall { width: min(100%, calc(min(80vh, 720px) * var(--ar, .6667))); height: auto; max-height: min(80vh, 720px); margin: 0 auto; }   /* portrait: whole, centred; sized before it loads */   /* portrait: whole, centred */
.post-content > img, .post-content figure, .post-content p:has(> img:only-child) { margin-top: 1.8em; margin-bottom: .4em; }
.post-content figure { margin-left: 0; margin-right: 0; }
.post-content figure img:not(.tall) { margin: 0; }
.post-content figcaption { font-size: 14px; opacity: .6; margin-top: 8px; text-align: center; }
.post-content iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 22px; background: #0e0f1a; }
.post-content .post-video { margin-top: 1.8em; }
/* a few posts carry their own boxes and notes (their old inline CSS is gone; these are the site's versions) */
.post-content .callout { background: var(--light); border-radius: 20px; padding: 18px 22px; }
.post-content .callout > * + * { margin-top: .6em; }
.post-content .callout ul { margin-top: .5em; }
.post-content .lead { font-size: 1.08em; color: var(--ink); }
.post-content .muted, .post-content .tip { opacity: .78; }
.post-content .sources { font-size: 15px; opacity: .72; }
.post-content pre { overflow-x: auto; background: var(--ink); color: #f4f4f7; padding: 18px 20px; border-radius: 16px; font-size: 14px; line-height: 1.55; }
.post-content pre code { white-space: pre-wrap; }
.post-content a.btn { text-decoration: none; }
.post-content a.btn.solid, .post-content a.btn.store-btn { color: #fff; }
.post-content a.btn.ghost { color: var(--ink); }
/* tables: framed, scroll sideways on phones instead of squashing */
.post-table { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1px #e6e6ee; margin-top: 1.6em; }
.post-table table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.post-table th { text-align: left; font-weight: 600; background: var(--ink); color: #fff; padding: 13px 16px; white-space: nowrap; }
.post-table td { padding: 13px 16px; border-top: 1px solid #efeff4; vertical-align: top; }
.post-table tr:nth-child(even) td { background: #fafafc; }
/* competitor comparison tables (guides + posts), generated from build/competitors.json by blog_fix.comp_table.
   Desktop: a table (the guides let it run wider than the reading column). Phones (≤ 600px): one card per company, every fact labelled. */
.g-cmp table { min-width: 640px; font-size: 14px; line-height: 1.45; }   /* fits a post's 700px column; the guides' wide ones: css/guide.css */
.g-cmp caption { caption-side: top; text-align: left; font-size: 13px; font-weight: 600; letter-spacing: .02em; line-height: 1.4; opacity: .6; padding: 12px 16px 6px; }
.g-cmp thead th { white-space: normal; padding: 12px 14px; vertical-align: bottom; }
.g-cmp thead th:first-child { width: 124px; }
.g-cmp tbody th { background: transparent; color: var(--ink); font-weight: 600; white-space: normal; padding: 12px 14px; border-top: 1px solid #efeff4; vertical-align: top; }
.g-cmp tbody th small { display: block; font-size: 12.5px; font-weight: 500; opacity: .6; }
.g-cmp td { padding: 12px 14px; }
.g-cmp tbody tr:nth-child(even) > * { background: #fafafc; }
.g-cmp tbody tr.is-self > * { background: #fff5ec; }
.g-na { opacity: .4; }
.post-content .g-sources { margin-top: 12px; font-size: 13.5px; line-height: 1.55; opacity: .72; }
.post-content .g-sources a { color: inherit; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .post-table.g-cmp { overflow: visible; }
  .g-cmp table { display: block; min-width: 0; font-size: 15px; }
  .g-cmp caption { display: block; padding: 14px 16px 8px; }
  .g-cmp thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .g-cmp tbody, .g-cmp tbody tr, .g-cmp tbody th, .g-cmp td { display: block; width: auto; }
  .g-cmp tbody tr { border-top: 1px solid #e6e6ee; padding: 4px 0 12px; }
  .g-cmp tbody tr > *, .g-cmp tbody tr:nth-child(even) > *, .g-cmp tbody tr.is-self > * { background: transparent; border-top: 0; }
  .g-cmp tbody tr.is-self { background: #fff5ec; }
  .g-cmp tbody tr:last-child { border-radius: 0 0 18px 18px; }
  .g-cmp tbody th { padding: 12px 16px 2px; font-size: 17px; }
  .g-cmp tbody th small { display: inline; margin-left: 4px; font-size: 13px; }
  .g-cmp td { padding: 7px 16px; }
  .g-cmp td::before { content: attr(data-label); display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .55; margin-bottom: 2px; }
}

/* ---------- after the post ---------- */
.post-cta-in { max-width: 900px; }
.post-cta-in .ctas { margin-top: 26px; }
.post-more-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.post-more .blog-cards { margin-top: clamp(24px, 3vw, 40px); }
.more-link { font-size: 16px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.post-index { padding-top: 0; }
.post-index .blog-cards { margin-top: 0; }

@media (max-width: 1060px) {
  .post-grid { grid-template-columns: minmax(0, 700px); }
  .post-toc { display: none; }
}
@media (max-width: 640px) {
  .post-cover img, .post-content img { border-radius: 16px; }
  .post-content iframe { border-radius: 16px; }
}

/* ---------- /blog: topic chips + "Show more", CSS only (radio/checkbox + :has). All 77 cards stay in the HTML. ---------- */
.blog-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: clamp(24px, 3vw, 36px); }
.blog-filter input, .blog-more input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.blog-filter label { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px; background: var(--light); font-size: 15px; font-weight: 600; cursor: pointer; user-select: none; transition: background-color .2s, color .2s; }
.blog-filter label span { font-size: 12.5px; opacity: .5; }
.blog-filter label:hover { background: #e8e8ee; }
.blog-filter input:checked + label { background: var(--ink); color: #fff; }
.blog-filter input:focus-visible + label, .blog-more input:focus-visible + label { outline: 2px solid var(--orange); outline-offset: 2px; }
.blog-more { display: flex; justify-content: center; margin-top: clamp(28px, 3vw, 44px); }
.blog-more label { display: none; cursor: pointer; user-select: none; }
.blog-more input:not(:checked) + label { display: inline-flex; }
.blog-more input:not(:checked) ~ input:not(:checked) + label { display: none; }   /* only the first unused one */
.blog-more label span { font-size: 13px; opacity: .55; }
.post-index:has(#bf-all:checked):not(:has(#bm2:checked)) .bcard[data-p="2"],
.post-index:has(#bf-all:checked):not(:has(#bm3:checked)) .bcard[data-p="3"],
.post-index:has(#bf-all:checked):not(:has(#bm4:checked)) .bcard[data-p="4"],
.post-index:has(#bf-all:checked):not(:has(#bm5:checked)) .bcard[data-p="5"],
.post-index:has(#bf-all:checked):not(:has(#bm6:checked)) .bcard[data-p="6"],
.post-index:has(#bf-all:checked):not(:has(#bm7:checked)) .bcard[data-p="7"],
.post-index:has(#bf-all:checked):not(:has(#bm8:checked)) .bcard[data-p="8"],
.post-index:has(#bf-all:checked):not(:has(#bm9:checked)) .bcard[data-p="9"],
.post-index:has(#bf-all:checked):not(:has(#bm10:checked)) .bcard[data-p="10"],
.post-index:has(#bf-artists:checked) .bcard:not([data-t="artists"]),
.post-index:has(#bf-creators:checked) .bcard:not([data-t="creators"]),
.post-index:has(#bf-tips:checked) .bcard:not([data-t="tips"]),
.post-index:has(#bf-trends:checked) .bcard:not([data-t="trends"]),
.post-index:has(#bf-news:checked) .bcard:not([data-t="news"]),
.post-index:not(:has(#bf-all:checked)) .blog-more { display: none; }
@supports not selector(:has(a)) { .blog-filter, .blog-more { display: none; } }
@media (max-width: 640px) { .blog-filter { gap: 6px; } .blog-filter label { height: 38px; padding: 0 14px; font-size: 14px; } }

/* dated note at the top of a post (build/blog_fix.py: "Update (September 2026): …") */
.post-content .post-update { border-left: 3px solid var(--orange); background: #fff7f0; border-radius: 0 14px 14px 0; padding: 12px 18px 13px; font-size: 16px; line-height: 1.55; color: #3d3d47; }
.post-content .post-update p { margin: 0; }

/* in-page links (On this page, #anchors): the target lands below the fixed header at every screen size (header = 40 × --hu) */
main [id] { scroll-margin-top: calc(var(--hu, var(--u, 1.7px)) * 40 + 40px); }
