/* The blog (built by scripts/blog.py): the blog page and its topic pages (a story-kit hero, then the articles) and the
   articles (one reading column, the top picture wider). On the site's shared styles (site/assets/hub/hub.css) and the
   story kit (story.css); the header and footer come from site/partials/. An embed's own styles: site/assets/embeds/. */

.article { max-width: 720px; margin-inline: auto; padding-block: 56px 72px; }
.article-head .label, .article-head .crumbs { margin-bottom: 18px; }
.article figure { margin-inline: 0; }
.article h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.04; letter-spacing: -.02em; text-wrap: balance; }
.article .lede { margin-top: 18px; max-width: none; }
.byline { margin-top: 22px; font: 500 .82rem/1.5 var(--mono); letter-spacing: .04em; color: var(--ink3); }
.byline b { color: var(--ink); font-weight: 600; }
.byline b a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.byline b a:hover { text-decoration-color: currentColor; }

/* "Blog / Topic": where a post or topic page sits, in the look of the hub's .label */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font: 400 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.crumbs::before { content: ""; width: 8px; height: 8px; background: var(--stamp); }
.crumbs a { color: var(--stamp); text-decoration: none; padding-block: 4px; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* the top picture runs wider than the text, up to the page's column */
.article-hero { position: relative; left: 50%; width: min(1040px, calc(100vw - 2 * clamp(16px, 3vw, 32px))); margin: 40px 0 0; translate: -50% 0; }
.article img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--rule); background: #0F1B2D; }

.article-body { margin-top: 40px; font-size: 1.12rem; line-height: 1.7; }
.article-body > * + * { margin-top: 1.1em; }
.article-body h2 { margin-top: 2.2em; font-size: clamp(1.45rem, 3vw, 1.9rem); line-height: 1.15; }
.article-body h3 { margin-top: 1.8em; font-size: clamp(1.2rem, 2.4vw, 1.4rem); line-height: 1.2; }
.article-body :is(h2, h3) + * { margin-top: .7em; }
.article-body ol { list-style: decimal; padding-left: 1.4em; }
.article-body ul { list-style: disc; padding-left: 1.4em; }
.article-body li + li { margin-top: .6em; }
.article-body li::marker { color: var(--ink3); font-weight: 600; }
.article-body strong { font-weight: 700; }
.article-body a { color: var(--stamp); text-underline-offset: 3px; }
.article-body blockquote { margin-inline: 0; padding-left: 20px; border-left: 3px solid var(--stamp); font: 500 1.3rem/1.45 var(--display); color: var(--ink); }
.article-body figure { margin-block: 2em; }
.article-body figcaption { margin-top: 10px; font-size: .88rem; line-height: 1.5; color: var(--ink3); }
.article-body #sources + :is(ul, ol) { font-size: .98rem; }

/* the contents beside the text, on screens wide enough for a column of its own (story.js marks the section in view) */
.toc { display: none; }
@media (min-width: 1180px) {
  .article.has-toc { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 720px) minmax(0, 1fr); column-gap: 40px; }
  .article.has-toc > * { grid-column: 2; }
  .article.has-toc > .toc { display: block; grid-column: 1; grid-row: 3; position: sticky; top: calc(var(--bar-h) + 40px); align-self: start; justify-self: end; width: 100%; max-width: 220px; margin-top: 40px; }
  .toc .cap { color: var(--ink3); }
  .toc ol { list-style: none; margin: 12px 0 0; padding: 0; border-left: 1px solid var(--rule); }
  .toc a { display: block; margin-left: -1px; padding: 6px 0 6px 14px; border-left: 2px solid transparent; font-size: 14px; line-height: 1.35; color: var(--ink3); text-decoration: none; transition: color .2s, border-color .2s; }
  .toc a:hover { color: var(--ink); }
  .toc a.is-on { border-left-color: var(--stamp); color: var(--ink); font-weight: 500; }
}
.article-body h2 { scroll-margin-top: calc(var(--bar-h) + 24px); }

/* a post that is not published yet (built with scripts/blog.py --drafts) */
.draft-note { margin-bottom: 22px; padding: 10px 14px; border: 1px dashed var(--stamp); background: var(--stamp-tint); color: var(--stamp); font: 500 13px/1.5 var(--mono); }

/* embeds (content/embeds/): a dark card for a tool or a next step, in a post's text or at its end */
.embed-card { margin: 2.2em 8px 2.2em 0; padding: clamp(22px, 3vw, 32px); display: flex; flex-direction: column; gap: 12px;
  background: var(--stage); color: var(--stage-ink); box-shadow: 8px 8px 0 var(--stamp); }
.article-body .embed-card > * + * { margin-top: 0; }
.embed-card__kick { font: 500 12px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--stamp-on-dark); }
.embed-card__title { font: 600 clamp(1.4rem, 3vw, 1.75rem)/1.15 var(--display); color: #fff; letter-spacing: -.01em; }
.embed-card__text { font-size: 1rem; line-height: 1.55; color: var(--stage-soft); }
.embed-card > .btn { align-self: flex-start; margin-top: 6px; }

/* after the text: share links and, when the author has a bio, who wrote it */
.article-foot { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 28px; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.share > span { margin-right: 6px; font: 500 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.share a { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border: 1px solid var(--rule); background: #fff; color: var(--ink); text-decoration: none; font: 500 15px var(--font); }
.share a:hover { border-color: var(--ink); }
.share svg { width: 16px; height: 16px; fill: currentColor; }
.author { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; align-items: start; }
.author img { grid-row: 1 / 4; width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--rule); object-fit: cover; }
.author b { font: 600 1.1rem var(--display); color: var(--ink); }
.author span { font: 500 .82rem var(--mono); letter-spacing: .04em; color: var(--ink3); }
.author p { color: var(--ink2); }
.author a { color: var(--stamp); text-underline-offset: 3px; }

/* blog page, topic pages and "Keep reading" under a post */
.blog-hero { min-height: 0; gap: 0; padding-block: clamp(48px, 7vw, 88px) clamp(28px, 3vw, 40px); }
.blog-hero .hero__in { gap: 22px; }
.blog-hero .hero__title { font-size: clamp(42px, 6.2vw, 84px); }
.blog-lede { max-width: 44rem; font-size: clamp(17px, 1.5vw, 19px); line-height: 1.6; color: var(--ink2); }
.blog { padding-block: 28px 72px; border-top: 1px solid var(--ink); }
.blog-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.blog-topics a { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 1px solid var(--rule); border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; font: 500 .9rem var(--font); transition: border-color .2s; }
.blog-topics a span { font: 500 .74rem var(--mono); color: var(--ink3); }
.blog-topics a:hover { border-color: var(--ink); }
.blog-topics a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.blog-topics a[aria-current="page"] span { color: inherit; opacity: .7; }
.blog-topics .blog-rss { margin-left: auto; border-color: transparent; background: none; color: var(--ink3); font: 500 .74rem var(--mono); letter-spacing: .1em; }
.blog-topics .blog-rss::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.blog-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 28px; }
.blog-grid { list-style: none; padding: 0; margin: 56px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 40px 28px; }
.blog-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-template-rows: auto auto auto 1fr; column-gap: 28px; text-decoration: none; padding: 16px; margin: -16px; border-radius: 14px; }
.blog-card:hover { background: var(--panel); }
.blog-card img { grid-row: 1 / 5; display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--rule); }
.blog-kicker { font: 500 12px/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--stamp); }
.blog-meta { margin-top: 4px; font: 500 .78rem/1.5 var(--mono); letter-spacing: .04em; color: var(--ink3); }
.blog-title { margin-top: 8px; font: 600 clamp(1.5rem, 3vw, 2.3rem)/1.1 var(--display); letter-spacing: -.015em; color: var(--ink); }
.blog-card:hover .blog-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.blog-desc { margin-top: 10px; color: var(--ink2); }
.blog-grid .blog-card { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; align-content: start; }
.blog-grid .blog-card img { grid-row: auto; margin-bottom: 14px; }
.blog-grid .blog-title { font-size: 1.3rem; }
.blog-grid .blog-desc { font-size: 15px; }
.blog .embed-card { margin-top: 64px; }
.related { padding: 40px 0 72px; border-top: 1px solid var(--ink); }
.related h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); line-height: 1.15; }
.related .blog-grid { margin-top: 28px; }

@media (max-width: 700px) {
  .article { padding-block: 32px 56px; }
  .article-body { font-size: 1.05rem; }
  .blog { padding-block: 32px 56px; }
  .blog-card { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .blog-card img { grid-row: auto; margin-bottom: 14px; }
}
