/* Blog pages reuse styles.css (fonts, header, buttons, footer) and add only this. */
.blog-page {
  min-height: 80vh;
  padding: 140px var(--page-pad) 100px;
  background:
    linear-gradient(90deg, rgba(96, 215, 229, 0.12), transparent 36%),
    var(--paper);
}

.blog-inner,
.blog-intro {
  max-width: 720px;
  margin: 0 auto;
}

/* List pages: posts, and the archive tree beside them on wide screens. */
.blog-intro {
  max-width: 980px;
}

.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 720px) 200px;
  gap: 60px;
  justify-content: center;
  max-width: 980px;
  margin: 0 auto;
}

.blog-side {
  display: grid;
  gap: 34px;
  align-content: start;
  position: sticky;
  top: 110px;
}

.blog-side h2 {
  margin: 0 0 12px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.archive-tree ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.archive-tree > ul > li + li {
  margin-top: 14px;
}

.archive-year {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 800;
}

.archive-tree li li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0 5px 14px;
  border-left: 2px solid var(--line);
  font-weight: 700;
}

.archive-tree li li:has(a[aria-current]) {
  border-left-color: var(--ink);
}

.archive-tree a:hover,
.archive-tree a[aria-current] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.archive-count {
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}

.tag-list a {
  padding: 3px 9px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: var(--white);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
}

.tag-list a:hover,
.tag-list a[aria-current] {
  background: var(--acid);
}

.post-tags {
  margin: -22px 0 32px;
}

.section-kicker a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-page .section-kicker {
  margin: 0 0 14px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.blog-title {
  margin: 0 0 16px;
  font-size: clamp(38px, 7vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.blog-lede {
  margin: 0 0 40px;
  color: #4f535d;
  font-size: 19px;
  line-height: 1.5;
}

.post-meta {
  display: block;
  margin: 0 0 14px;
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.post-meta a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-list {
  display: grid;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-card-link {
  display: grid;
  gap: 4px;
  padding: 22px 24px 24px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--white);
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.post-card-link:hover,
.post-card-link:focus-visible {
  box-shadow: 6px 6px 0 var(--ink);
  transform: translate(-2px, -2px);
}

.post-card-link .post-meta {
  margin: 0;
}

.post-card-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}

.post-card-summary {
  color: #4f535d;
}

.blog-pages {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  font-weight: 800;
}

.blog-pages a {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.blog-empty {
  color: var(--muted);
}

.draft-banner {
  margin: 0 0 28px;
  padding: 12px 16px;
  border: 2px dashed var(--ink);
  background: var(--yellow);
  font-size: 14px;
  font-weight: 700;
}

.post-figure {
  margin: 32px 0;
}

.post-figure img,
.post-figure video {
  display: block;
  border: 2px solid var(--ink);
  border-radius: 2px;
}

/* Phone screenshots are tall: keep them readable without filling three screens. */
.post-figure img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(78vh, 720px);
  margin: 0 auto;
}

.post-cover img,
.post-figure video {
  width: 100%;
  max-height: none;
}

.post-figure video {
  height: auto;
  background: var(--ink);
}

.post-video video {
  max-height: 80vh;
  object-fit: contain;
}

.post-figure figcaption {
  margin-top: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.post-figure figcaption a,
.post-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-cover {
  margin-top: 0;
}

/* [[images 1 2 3]]: screenshots side by side, swipe or scroll sideways. */
.post-gallery {
  display: flex;
  gap: 16px;
  margin: 32px 0;
  padding-bottom: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.post-gallery:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.post-slide {
  flex: 0 0 auto;
  max-width: 85%;
  margin: 0;
  scroll-snap-align: start;
}

.post-slide img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(70vh, 560px);
  border: 2px solid var(--ink);
  border-radius: 2px;
}

.post-slide figcaption {
  max-width: 320px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.post-body {
  font-size: 18px;
  line-height: 1.7;
}

.post-body p,
.post-body li {
  color: #2f3340;
}

.post-body h2 {
  margin: 44px 0 10px;
  font-size: 27px;
  line-height: 1.2;
}

.post-body h3 {
  margin: 32px 0 8px;
  font-size: 21px;
}

.post-body ul,
.post-body ol {
  padding-left: 1.3em;
}

.post-body li + li {
  margin-top: 6px;
}

.post-body blockquote {
  margin: 28px 0;
  padding: 2px 0 2px 20px;
  border-left: 4px solid var(--acid);
  font-style: italic;
}

.post-body code {
  padding: 1px 5px;
  border-radius: 2px;
  background: rgba(22, 27, 45, 0.07);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.85em;
}

.post-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  align-items: center;
  justify-content: space-between;
  margin: 56px 0 26px;
  padding: 24px;
  border: 2px solid var(--ink);
  background: var(--acid);
  box-shadow: var(--shadow);
}

.post-cta strong {
  display: block;
  font-size: 20px;
}

.post-cta span {
  color: #3b3f4a;
  font-size: 15px;
}

.post-cta-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.post-cta .button {
  min-height: 46px;
}

.post-cta .button-primary {
  background: var(--white);
}

.post-share {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 30px 0 0;
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
}

.post-share a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.more-posts {
  margin-top: 70px;
  padding-top: 28px;
  border-top: 2px solid var(--ink);
}

.more-posts h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

.more-posts ul {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.more-posts li a {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.more-posts time {
  margin-left: 8px;
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
}

.more-all {
  font-weight: 800;
}

@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
    max-width: 720px;
  }

  .blog-side {
    position: static;
    padding-top: 28px;
    border-top: 2px solid var(--ink);
  }

  .archive-tree > ul {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 36px;
  }

  .archive-tree > ul > li + li {
    margin-top: 0;
  }
}

@media (max-width: 760px) {
  .blog-page {
    padding-top: 108px;
    padding-bottom: 70px;
  }

  .blog-lede {
    font-size: 17px;
  }

  .post-body {
    font-size: 17px;
  }

  .post-card-link {
    padding: 18px 18px 20px;
  }

  .post-cta {
    padding: 20px;
    box-shadow: 6px 7px 0 var(--ink);
  }
}
