/* Additive reader refinements, scoped to article pages. */
.page-post .post-main,
.page-post .post,
.page-post .post-header,
.page-post .post-footer {
  min-width: 0;
}

.page-post .post-header h1,
.page-post .prose :is(h2, h3, h4) {
  overflow-wrap: anywhere;
}

.page-post .prose {
  width: 100%;
  max-width: min(76ch, 100%);
  letter-spacing: 0;
  line-height: 1.86;
}

.page-post .prose h2 {
  padding-bottom: .28em;
  border-bottom: 1px solid var(--line);
}

.page-post .prose figure.code,
.page-post .table-wrap {
  max-width: 100%;
  border-color: var(--line);
  box-shadow: none;
}

.page-post .prose pre,
.page-post .table-wrap {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.page-post .prose :is(th, td) {
  overflow-wrap: anywhere;
}

.page-post .toc-item a.is-active {
  border-left-width: 3px;
  font-weight: 700;
}

.page-post .reader-toolbar {
  gap: 12px;
  scroll-margin-top: 7rem;
  font-size: 13px;
}

.page-post .reader-controls {
  gap: 12px;
  flex-wrap: wrap;
}

.page-post .reader-controls .font-controls {
  flex: 0 0 auto;
  gap: 4px;
}

.page-post .reader-controls .font-controls button {
  width: auto;
  height: auto;
  min-inline-size: 44px;
  min-block-size: 44px;
  padding: 8px;
  font-size: 14px;
}

.page-post .reader-controls .share-button {
  min-block-size: 44px;
  justify-content: center;
  padding: 8px;
  font-size: 13px;
  white-space: nowrap;
}

.page-post .reader-controls [data-focus-reading] {
  display: inline-flex;
  min-inline-size: 5.4em;
  min-block-size: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
}

.page-post .reader-controls [data-focus-reading]:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.page-post .reader-controls [data-focus-reading][aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue-wash);
  color: var(--blue);
}

.page-post :is(.reader-toolbar, .toc-mobile) :focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

/* The same native directory serves mobile and the focused desktop layout. */
.page-post .toc-mobile {
  margin-bottom: 28px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.page-post .toc-mobile summary {
  display: list-item;
  min-block-size: 48px;
  padding-block: 12px;
  list-style-position: inside;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.7;
  cursor: pointer;
}

.page-post .toc-mobile summary > span {
  float: right;
  margin-inline-start: 12px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.page-post .toc-mobile .toc-list {
  max-height: min(48vh, 28rem);
  margin-block: 0 12px;
  padding: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.page-post .toc-mobile .toc-item a {
  display: flex;
  min-block-size: 44px;
  align-items: center;
  padding-block: 8px;
  font-size: 14px;
}

.page-post .toc-mobile .toc-h3 a {
  font-size: 13px;
}

body.page-post.is-reading-focused .article-shell {
  display: block;
  width: min(100%, 50rem);
  max-width: 100%;
  margin-inline: auto;
}

body.page-post.is-reading-focused .post-main {
  width: 100%;
}

body.page-post.is-reading-focused .post-aside {
  display: none;
}

body.page-post.is-reading-focused .toc-mobile {
  display: block;
}

@media (max-width: 680px) {
  .page-post .reader-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
  }

  .page-post .reader-controls {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }
}

@media (forced-colors: active) {
  .page-post :is(.reader-toolbar, .toc-mobile) :focus-visible {
    outline-color: Highlight;
  }
}
