/*
 * The blog's rules on top of the landing page's stylesheet (/site.css):
 * the same tokens, faces and top bar, plus what a post needs that a landing
 * page does not. site.css resets paragraph margins and list markers for its
 * own layouts; a post body puts them back. Served at /blog/blog.css.
 */

/* ---- The column: one centred measure for every blog page ---- */
.blog-hero,
.featured,
.all-posts,
.post,
.related {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---- The index ---- */
.blog-hero {
  padding-top: 56px;
  padding-bottom: 28px;
  display: grid;
  gap: 14px;
}
.blog-hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.015em;
}
.blog-hero .lede {
  max-width: 52ch;
  color: var(--muted);
}
.featured {
  padding-top: 8px;
  padding-bottom: 36px;
}
/* The featured card: the surface with a wash of the accent's tint, a
   hairline that turns to the accent on hover, and the landing page's
   180ms ease. The whole card is not a link; the title and the button are. */
.featured-card {
  position: relative;
  padding: 30px 30px 28px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent-tint) 0%, var(--surface) 55%);
  display: grid;
  gap: 12px;
  justify-items: start;
  transition: border-color 180ms ease-out, transform 180ms ease-out;
}
.featured-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.featured-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.featured-card h2 {
  font-size: clamp(26px, 3vw, 32px);
  line-height: 1.12;
}
.featured-card h2 a {
  color: var(--ink);
}
.featured-card h2 a:hover {
  color: var(--accent);
  text-decoration: none;
}
.featured-text {
  font-size: 16px;
  color: var(--muted);
  max-width: 56ch;
  text-wrap: pretty;
}
.featured-card .btn {
  margin-top: 8px;
}
.all-posts {
  padding-top: 0;
  padding-bottom: 64px;
  display: grid;
  gap: 10px;
}
.all-posts h2,
.related h2 {
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-list {
  display: grid;
}
.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--hairline);
}
.post-list li:last-child {
  border-bottom: 1px solid var(--hairline);
}
.post-list a {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
  transition: color 180ms ease-out;
}
.post-list a:hover {
  color: var(--accent);
  text-decoration: none;
}
.post-list-arrow {
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 180ms ease-out, transform 180ms ease-out;
}
.post-list a:hover .post-list-arrow {
  opacity: 1;
  transform: none;
}
.post-list time {
  flex: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}

/* ---- A post: one column, the title block and the body set left ---- */
.post {
  padding-top: 56px;
  padding-bottom: 8px;
}
.post-head {
  display: grid;
  gap: 16px;
  margin-bottom: 40px;
}
.post-head h1 {
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.post-head .lede {
  max-width: 52ch;
  color: var(--muted);
}
.post-body {
  font-size: 17px;
  line-height: 1.6;
}
.post-body > * + * {
  margin-top: 16px;
}
.post-body h2 {
  font-size: 28px;
  line-height: 1.15;
  margin-top: 44px;
}
.post-body h3 {
  font-size: 20px;
  line-height: 1.25;
  margin-top: 32px;
}
.post-body h2 + *,
.post-body h3 + * {
  margin-top: 12px;
}
.post-body ul,
.post-body ol {
  padding-left: 1.4em;
  display: grid;
  gap: 8px;
}
.post-body ul {
  list-style: disc;
}
.post-body ol {
  list-style: decimal;
}
.post-body li::marker {
  color: var(--muted);
}
.post-body strong {
  font-weight: 600;
}
.post-body blockquote {
  margin: 20px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent-tint);
  color: var(--muted);
}
.post-body pre {
  margin: 20px 0;
  padding: 16px 18px;
  overflow-x: auto;
  background: var(--sunken);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.55;
}
.post-body pre code {
  padding: 0;
  background: none;
  font-size: inherit;
  font-weight: 400;
}
.post-body img,
.post-body video {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}
.post-body figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}
.post-body table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15px;
}
.post-body th,
.post-body td {
  text-align: left;
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}
.post-body th {
  font-weight: 600;
}
.post-body hr {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 32px 0;
}
.related {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  padding-bottom: 64px;
  display: grid;
  gap: 12px;
}
.related-empty {
  font-size: 15px;
  color: var(--muted);
}

@media (max-width: 560px) {
  .blog-hero,
  .post {
    padding-top: 36px;
  }
}

/* ---- The byline, the "in short" block and the index descriptions ---- */
.byline {
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
}
.byline a {
  color: var(--ink);
}
.summary p {
  margin: 0 0 28px;
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 16px;
  line-height: 1.55;
  text-wrap: pretty;
}
.post-list-desc {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
  max-width: 60ch;
  text-wrap: pretty;
}
