/* Blog list, blog post, and the 404 page — every page of the site that is not
   the home page. Tokens come from global.css (--forest, --deep, --muted,
   --line, --light, --ink). Calm and plain: one column, generous space, forest
   type on white, no new accent colours. */

:root {
  /* global.css floats .topbar over the page (position: absolute, top: 24px)
     with a 64px bar, so any page without a hero of its own has to start below
     it. One value, used by the .blog wrapper every such page shares. */
  --blog-header-space: 88px;
}
@media (max-width: 767px) {
  :root {
    /* 16px offset + a 56px bar at this width. */
    --blog-header-space: 72px;
  }
}

/* The shared page wrapper. Matches the site container (.wrap: 1280px with
   56px gutters) and clears the floating header. */
.blog {
  width: min(100% - 40px, 1168px);
  margin-inline: auto;
  padding-block: calc(var(--blog-header-space) + 48px) 96px;
}
/* A post is a reading column: about 72 characters of the 18px body face. `ch`
   would resolve against this element's 16px size, not the body's, so the
   measure is written as the width it works out to. Every part of a post —
   header, body, FAQ, more posts — sits inside this one wrapper, so they all
   share the column and nothing looks off-centre. */
.blog-narrow {
  max-width: 46.25rem;
}

/* Page header, shared by the blog list and the 404 page. */
.page-head {
  max-width: 40rem;
  margin-inline: auto;
  text-align: center;
}
.page-eyebrow {
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.page-head h1 {
  margin-top: 14px;
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--forest);
}
.page-lead {
  margin-top: 16px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}
.page-lead a {
  color: var(--forest);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.page-lead a:hover {
  color: var(--deep);
}

/* The list of posts. */
.blog-list {
  margin-top: 56px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 20px;
}
@media (min-width: 900px) {
  .blog-list {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}
.blog-list li {
  display: flex;
}
.post-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  transition:
    border-color 0.18s,
    background 0.18s;
}
.post-card:hover {
  border-color: #c2d4c9;
  background: #fbfcfa;
}
.post-card h2 {
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--forest);
}
.post-card:hover h2 {
  color: var(--deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.post-card-summary {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}
.post-card-meta {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}
/* The separator trails the item it follows, so a wrapped line never starts
   with a stray bullet. */
.post-card-meta > *:not(:last-child)::after {
  content: "·";
  margin-left: 8px;
}
.blog-empty {
  max-width: 40rem;
  margin-top: 56px;
  margin-inline: auto;
  padding: 56px 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--light);
  text-align: center;
  color: var(--muted);
  line-height: 1.7;
}

/* Post header. The bare `nav` selector in global.css sets a 68px flex bar for
   the site header, so the breadcrumb has to say what it is. */
.blog-breadcrumb {
  height: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.blog-breadcrumb a:hover {
  color: var(--forest);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.post-header {
  margin-top: 20px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.post-header h1 {
  font-size: clamp(32px, 4.4vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--forest);
}
.post-summary {
  margin-top: 16px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}
.post-byline {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.byline-author {
  color: var(--forest);
}
.byline-role::before {
  content: "·";
  margin-inline: 6px;
}
.byline-when {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}
.byline-when > *:not(:last-child)::after {
  content: "·";
  margin-left: 8px;
}
.byline-markdown {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.byline-markdown:hover {
  color: var(--forest);
}
.post-cover {
  margin: 40px 0 0;
}
.post-cover img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
}

/* Post body. */
.post-body {
  margin-top: 40px;
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
}
.post-body > * + * {
  margin-top: 24px;
}
.post-body h2 {
  margin-top: 52px;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--forest);
}
.post-body h3 {
  margin-top: 36px;
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--forest);
}
.post-body a {
  color: var(--forest);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.post-body a:hover {
  color: var(--deep);
  text-decoration-thickness: 2px;
}
.post-body ul,
.post-body ol {
  padding-left: 24px;
}
.post-body li + li {
  margin-top: 10px;
}
.post-body li::marker {
  color: var(--muted);
}
.post-body strong {
  font-weight: 600;
  color: var(--forest);
}
.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 16px;
}
.post-body hr {
  margin-block: 40px;
  border: 0;
  border-top: 1px solid var(--line);
}
.post-body blockquote {
  margin-inline: 0;
  padding: 4px 0 4px 24px;
  border-left: 2px solid #cfe0cf;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}
.post-body blockquote > * + * {
  margin-top: 16px;
}
.post-body code {
  font-size: 0.88em;
  background: var(--light);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
  word-break: break-word;
}
.post-body pre {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
}
.post-body pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}
/* A wide table scrolls inside the column rather than pushing the page sideways. */
.post-body table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.post-body th,
.post-body td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.post-body th {
  color: var(--forest);
  font-weight: 500;
  white-space: nowrap;
  border-bottom-color: #c2d4c9;
}
.post-body tbody tr:last-child td {
  border-bottom: 0;
}

/* FAQ. The homepage accordion's shapes and colours, without the accordion:
   real headings keep the questions readable to search and answer engines. */
.post-faq {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.post-faq h2 {
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--forest);
}
.post-faq-list {
  margin-top: 24px;
}
.post-faq-item {
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
}
.post-faq-item:first-child {
  border-top: 1px solid var(--line);
}
.post-faq-item:last-child {
  border-bottom: 0;
}
.post-faq h3 {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--forest);
}
.post-faq p {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
}

/* Where to go next. */
.post-more {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.post-more h2 {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--forest);
}
.post-more ul {
  margin-top: 16px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.post-more a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  transition:
    border-color 0.18s,
    background 0.18s;
}
.post-more a:hover {
  border-color: #c2d4c9;
  background: #fbfcfa;
}
.post-more-title {
  color: var(--forest);
  font-size: 16px;
  line-height: 1.45;
}
.post-more a:hover .post-more-title {
  color: var(--deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.post-more time {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.post-footer {
  height: auto;
  justify-content: flex-start;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.post-footer a {
  color: var(--forest);
}
.post-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 767px) {
  .blog {
    padding-block: calc(var(--blog-header-space) + 32px) 64px;
  }
  .blog-list {
    margin-top: 40px;
  }
  .post-card {
    padding: 24px;
  }
  .post-body {
    font-size: 16px;
  }
  .post-body h2 {
    margin-top: 40px;
    font-size: 24px;
  }
  .post-body h3 {
    font-size: 19px;
  }
  .byline-markdown {
    margin-left: 0;
  }
  .post-faq {
    margin-top: 48px;
  }
  .post-faq h2 {
    font-size: 24px;
  }
  .post-more {
    margin-top: 48px;
  }
}
