.post-article {
  counter-reset: post-figure;
}

.post-article h1 {
  font-size: clamp(var(--heading-size), 5vw, var(--article-title-max-size));
  text-align: center;
}

.post-article p {
  margin: 0 0 1.2em;
}

.post-toc-rail {
  display: none;
}

@media (width > 1280px) {
  .post-body {
    --post-toc-inset: var(--page-gutter);
    position: relative;
  }

  .post-body > :is(#introduction, h2[id]) {
    scroll-margin-block-start: var(--post-toc-inset);
  }

  .post-toc-rail {
    position: absolute;
    inset-block: 0;
    inset-inline-end: calc(100% + var(--page-gutter));
    display: block;
    inline-size: min(14rem, calc(50vw - 50% - 2 * var(--page-gutter)));
  }

  .post-toc {
    position: sticky;
    top: var(--post-toc-inset);
    max-block-size: calc(100dvh - 2 * var(--post-toc-inset));
    overflow: auto;
    font: var(--control-size)/1.4 Arial, sans-serif;
  }

  .post-toc ul {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .post-toc a {
    color: var(--control-highlight-color);
    text-decoration: none;
  }

  .post-toc a:is(:hover, :focus-visible) {
    color: var(--control-color);
  }

  .post-toc a[aria-current="location"] {
    color: var(--text-color);
  }

  .post-toc a:is(:focus-visible, [aria-current="location"]) {
    text-decoration: underline;
  }
}

.post-figure {
  counter-increment: post-figure;
  margin: 1.5rem 0;
}

.post-figure-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.post-figure > img,
.post-figure-panels img {
  display: block;
  height: auto;
}

.post-figure > img {
  width: 75%;
  margin-inline: auto;
}

.post-figure-panels img {
  width: 100%;
}

.post-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.4;
}

.post-figure > figcaption::before {
  content: "Figure " counter(post-figure) ": ";
  font-weight: bold;
}

.post-figure figcaption a {
  color: var(--control-color);
}

.post-figure figcaption a:is(:hover, :focus-visible) {
  color: var(--control-highlight-color);
}

@media (max-width: 36rem) {
  .post-figure-panels {
    grid-template-columns: 1fr;
  }
}
