/* A post's look (#758), the one place it is declared: its page and the list of posts load it (`src/articles.ts`), and
   so does the dashboard's preview of a post, which is its page (`src/article-page.ts`): what is previewed is what is
   shown. Its heading on the page, then its body on the grey band, in the site's tokens (`tokens.css`). The body is what
   `src/markdown.ts` writes: its marks are given back the space and the shape every page of ours resets. Each type's
   colour is its pill's `--tone`, written from the code's one list (`/posts/assets/types.css`). */

.article-head { padding-block: calc(var(--nav-h) + clamp(32px, 5vw, 72px)) clamp(24px, 3vw, 40px); }
.article-head-in { display: grid; justify-items: start; gap: 14px; max-width: 760px; margin-inline: auto; }
.article-back { margin-bottom: -6px; font-size: 15px; }
.article-kind { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font: 600 15px/1.3 var(--font); letter-spacing: .02em; color: var(--ink-2); }

/* A type as a pill: its colour's dot, and the whole pill in it where the list is kept to that type. */
.pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 14px;
  border: 1px solid var(--edge); border-radius: 999px; background: var(--card);
  color: var(--ink); font: 600 14px/1 var(--font); letter-spacing: 0; white-space: nowrap;
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.pill::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--tone, var(--ink-2)); }
.pill:hover { border-color: var(--edge-strong); }
.pill[aria-current="page"] { border-color: var(--tone, var(--ink)); background: var(--tone, var(--ink)); color: #fff; }
.pill[aria-current="page"]::before { background: currentColor; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* A post's cover over its body, as wide as the body, as tall as its own shape makes it: never cut. */
.article-cover { display: block; width: 100%; max-width: 760px; height: auto; margin: 0 auto 12px; border-radius: 28px; background: var(--card); }

/* The list of posts: each a card on the grey band, newest first. Its cover sits at its right as a square (Berke,
   2026-10-16: "desktop cards could be square"); on a phone, on top of it, as tall as its own shape makes it ("mobile
   ones still respecting the height of the aspect ratio of the image"). */
.posts { display: grid; gap: 12px; max-width: 760px; margin: 0 auto; padding: 0; list-style: none; }
.post { display: grid; gap: clamp(16px, 2.4vw, 28px); align-items: center; padding: clamp(24px, 3vw, 36px); border-radius: 28px; background: var(--card); }
.post-covered { grid-template-columns: minmax(0, 1fr) clamp(140px, 26%, 200px); }
.post-in { display: grid; justify-items: start; gap: 10px; min-width: 0; }
.post-cover { width: 100%; height: auto; aspect-ratio: 1; border-radius: 18px; object-fit: cover; background: var(--panel); }
@media (max-width: 560px) {
  .post-covered { grid-template-columns: minmax(0, 1fr); }
  .post-cover { order: -1; aspect-ratio: auto; object-fit: fill; }
}
.post-kind { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font: 600 14px/1.3 var(--font); color: var(--ink-2); }
.post-title { font: 700 clamp(22px, 2.2vw, 28px)/1.2 var(--font); letter-spacing: -.02em; color: var(--ink); }
.post-title a:hover { color: var(--link); }
.post-summary { color: var(--ink-2); }
.post-summary a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.posts-none { max-width: 760px; margin: 0 auto; color: var(--ink-2); }
.posts-onward { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; max-width: 760px; margin: 16px auto 0; }
.article-title { font: 700 clamp(36px, 5.4vw, 64px)/1.04 var(--font); letter-spacing: -.026em; color: var(--ink); text-wrap: balance; }
.article-summary { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; color: var(--ink-2); }
.article-band { flex: 1; padding-block: clamp(24px, 3vw, 40px) clamp(72px, 9vw, 128px); background: var(--panel); }

.article-body {
  max-width: 760px; margin-inline: auto; padding: clamp(28px, 3.4vw, 44px); border-radius: 28px;
  background: var(--card); color: var(--ink-body); font-size: 17px; line-height: 1.65; overflow-wrap: anywhere;
}
.article-body > :first-child { margin-top: 0; }
.article-body > :last-child { margin-bottom: 0; }
.article-body :is(p, ul, ol, blockquote, pre, table, figure, .callout, .video, hr) { margin: 0 0 1.1em; }
.article-body :is(h2, h3, h4, h5, h6) { margin: 1.6em 0 .5em; color: var(--ink); font-family: var(--font); letter-spacing: -.016em; line-height: 1.2; }
.article-body h2 { font-size: clamp(26px, 2.4vw, 30px); font-weight: 700; }
.article-body h3 { font-size: 22px; font-weight: 700; }
.article-body :is(h4, h5, h6) { font-size: 18px; font-weight: 600; }
.article-body a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.article-body :is(ul, ol) { padding-inline-start: 1.4em; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li + li { margin-top: .3em; }
.article-body li > :is(ul, ol) { margin: .3em 0 0; }
.article-body strong { color: var(--ink); font-weight: 650; }
.article-body hr { border: 0; border-top: 1px solid var(--line); }
.article-body blockquote { padding-inline-start: 18px; border-inline-start: 3px solid var(--edge); color: var(--ink-2); }
.article-body code {
  padding: .12em .38em; border-radius: 6px; background: var(--wash);
  font: .9em/1.4 ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
}
.article-body pre { overflow-x: auto; padding: 16px 18px; border-radius: 14px; background: var(--panel); }
.article-body pre code { padding: 0; background: none; font-size: 14px; }
.article-body table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 15px; }
.article-body :is(th, td) { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: start; }
.article-body th { color: var(--ink); font-weight: 600; }
.article-body .align-center { text-align: center; }
.article-body .align-right { text-align: end; }
.article-body img { display: block; max-width: 100%; height: auto; border-radius: 16px; }
.article-body video { display: block; width: 100%; height: auto; border-radius: 16px; background: #000; }
.article-body figure img { margin-inline: auto; }
.article-body figcaption { margin-top: 8px; font-size: 15px; color: var(--ink-2); text-align: center; }
.article-body .video { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 16px; background: #000; }
.article-body .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* A callout, as GitHub draws one: its kind's colour along its edge and in its title. */
.article-body .callout { --tone: var(--link); padding: 12px 18px; border-inline-start: 3px solid var(--tone); border-radius: 0 12px 12px 0; background: var(--wash); }
.article-body .callout > :last-child { margin-bottom: 0; }
.article-body .callout-title { margin-bottom: .35em; color: var(--tone); font-weight: 650; }
.article-body .callout-tip { --tone: var(--ok); }
.article-body .callout-important { --tone: #8B5CF6; }
.article-body .callout-warning { --tone: var(--warn); }
.article-body .callout-caution { --tone: var(--bad); }
