/* Articles share the homepage shell; prose gets its own reading measure. */
body.post {
  font-size: 1.4rem;
  line-height: 1.7;
}

body.post .post-main {
  width: calc(100% - 64px);
  max-width: 56ch;
  margin-inline: auto;
  padding: 64px 0 48px;
  overflow-wrap: break-word;
}

.post-heading {
  margin-bottom: 40px;
}

.post-heading h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.post-subtitle {
  max-width: 42ch;
  margin: 18px 0 0;
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  line-height: 1.4;
  text-wrap: pretty;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin: 24px 0 0;
  font-size: 1.125rem;
  color: color-mix(in oklch, var(--ink) 80%, var(--home-background));
  font-variant-numeric: tabular-nums;
}

.post-meta a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.post-content > :first-child {
  margin-top: 0;
}

.post-content p {
  margin-block: 0 1.2em;
  text-wrap: pretty;
}

.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  margin-block: 1.8em 0.65em;
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.post-content h2 {
  font-size: 1.8rem;
}

.post-content h3 {
  font-size: 1.5rem;
}

.post-content :is(ul, ol) {
  padding-inline-start: 1.3em;
  margin-block: 0 1.4em;
}

.post-content li {
  padding-inline-start: 0.3em;
  margin-block: 0.6em;
}

.post-content li::marker {
  color: var(--accent);
}

.post-content blockquote {
  margin: 1.5em 0;
  padding: 24px 28px;
  background: var(--home-surface);
}

.post-content blockquote > :last-child {
  margin-bottom: 0;
}

.post-content img,
.post-content video {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}

.post-figure {
  margin: 0 0 40px;
  padding: 24px;
  background: var(--home-surface);
}

.post-figure img {
  width: auto;
  max-height: min(70svh, 38rem);
  object-fit: contain;
}

.post-figure figcaption {
  margin-top: 20px;
  font-size: 1.125rem;
  line-height: 1.5;
  text-align: center;
}

.post-figure--screenshot img {
  width: 100%;
  max-height: none;
}

.post-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.post-comparison .post-figure {
  margin: 0;
  padding: 0;
  background: none;
}

.post-comparison figcaption {
  margin-top: 12px;
  text-align: left;
}

.post-content code {
  font-family: var(--mono);
  font-size: 0.9em;
}

.post-content :not(pre) > code {
  padding: 0.1em 0.25em;
  background: var(--home-surface);
  overflow-wrap: anywhere;
}

.post-content pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 24px;
  background: var(--home-surface);
  line-height: 1.5;
}

.post-pagination {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 24px 40px;
  margin-top: 64px;
}

body.post .post-pagination a {
  display: block;
  padding-block: 16px;
  text-decoration: none;
}

.post-pagination span {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1.125rem;
}

.post-pagination strong {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  text-wrap: balance;
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.post-all-writing {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  min-height: 44px;
  margin-top: 24px;
  font-size: 1.125rem;
}

@media (max-width: 850px) {
  body.post .post-main {
    width: calc(100% - 48px);
  }
}

@media (max-width: 600px) {
  body.post {
    font-size: 1.25rem;
  }
  body.post .post-main {
    width: calc(100% - 36px);
    padding-block: 36px 32px;
  }
  .post-heading {
    margin-bottom: 28px;
  }
  .post-content h2 {
    font-size: 1.65rem;
  }
  .post-figure {
    padding: 16px;
    margin-bottom: 28px;
  }
  .post-pagination {
    margin-top: 40px;
  }
}
