/* Blog: the post list (/blog) and posts (/blog/{slug}) */

.blog-hero__title { max-width: 20ch; margin: 20px 0 16px; }
.blog-hero__lead { margin-bottom: 0; }
.blog-hero .eyebrow a { color: inherit; text-decoration: none; }
.blog-hero .eyebrow a:hover { text-decoration: underline; }

/* Post cards: the title link covers the whole card. */
/* auto-fill (not the shared .grid's auto-fit) keeps cards at a third of the width even with one or two posts. */
.blog-list {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 24px;
}
.blog-list > li { display: flex; }
.blog-card { position: relative; width: 100%; }
.blog-card:hover, .blog-card:focus-within { border-color: var(--purple); }
.blog-card__image {
    display: block; width: calc(100% + 56px); max-width: none; height: auto; aspect-ratio: 1200 / 630; object-fit: cover;
    margin: -28px -28px 8px; border-radius: 22px 22px 0 0; background: var(--lilac);
}
/* No cover image: a purple panel with the pea dots, so cards line up. */
.blog-card__image--none { display: grid; place-items: center; background: var(--purple); }
.blog-card__image--none .dots { --size: 22px; }
.blog-card__image--none .dots > i:not(.g) { background: var(--lavender); }
.blog-card__meta { font-size: 14px; }
.blog-card__title a { color: var(--ink); text-decoration: none; }
.blog-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.blog-card__title a:focus-visible { outline: none; }
.blog-card:has(a:focus-visible) { outline: 3px solid var(--purple); outline-offset: 3px; }

/* A post */
.blog-post__meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; font-size: 15px; color: var(--muted); }
/* Never wider than the image itself: small covers from the old blog stay sharp. */
.blog-post__cover { display: block; width: auto; max-width: 100%; height: auto; border-radius: 24px; margin: 0 0 40px; background: var(--lilac); }
.blog-post__body { font-size: 17px; }
.blog-post__body > :first-child { margin-top: 0; }
.blog-post__body h3 {
    font-family: var(--font-display); font-weight: 700; font-size: 21px; line-height: 1.25; color: var(--ink); margin: 32px 0 10px;
}
.blog-post__body h4, .blog-post__body h5, .blog-post__body h6 { font-size: 17px; color: var(--ink); margin: 24px 0 8px; }
.blog-post__body a { color: var(--purple); text-underline-offset: 3px; }
.blog-post__body a:hover { color: var(--purple-deep); }
.blog-post__body ol { margin: 0 0 16px; padding-left: 1.4em; }
.blog-post__body ol li::marker { color: var(--purple); font-weight: 700; }
/* Shown at the {width=…} the post gives, else the image's own size, never wider than the column. */
.blog-post__body img { display: block; max-width: 100%; height: auto; border-radius: 16px; margin: 24px 0; }
/* Images written on one line (in one paragraph) sit in a row. */
.blog-post__body p:has(> img + img) { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; margin: 24px 0; }
.blog-post__body p:has(> img + img) > img { margin: 0; }
.blog-post__body blockquote {
    margin: 24px 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--green); color: var(--ink); font-size: 19px; line-height: 1.6;
}
.blog-post__body hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.blog-post__body code { font: 0.9em var(--font-mono); padding: 2px 6px; border-radius: 6px; background: var(--lilac); }
.blog-post__body pre { overflow-x: auto; padding: 16px 18px; border-radius: 12px; background: var(--lilac); }
.blog-post__body pre code { padding: 0; background: none; }
.blog-post__body table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 15px; display: block; overflow-x: auto; }
.blog-post__body th, .blog-post__body td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.blog-post__body th { color: var(--ink); }
