/*
 * pst3.css: a single post.
 *
 * Scoped to body.apex-pst3. Imports blg3.css for the article cards in "Read
 * next" and the footer re-skin, so the post and the blog stay one design.
 *
 * The text column is centred on the page with the contents in the left margin
 * from 1280px; below that the contents fold into a box above the text, because
 * the margin is too narrow for them. 720px at 19px is about 68 characters a line.
 *
 * Type: the post's title takes the head rank (46), the text the spoken rank
 * (19), its h3 the sub rank (22). The h2 inside an article is the one size
 * outside the five ranks, 28px: at 46 it would shout over the text, and at 22
 * it would be the same size as the h3 under it.
 *
 * 10 Nov rebuild. Before: _archive/blog-2026-11-10/.
 */

@import url("blg3.css");

body.apex-pst3 {
  --pst3-col: 720px;
  --pst3-aside: 220px;
  --pst3-gap: clamp(40px, 4.5vw, 72px);
  background: #fff;
}

body.apex-pst3 .site-main {
  position: relative;
  z-index: 1;
  overflow: clip;
  background: #fff;
}

body.apex-pst3 .pst3,
body.apex-pst3 .pst3 * {
  font-family: var(--a-sans);
  -webkit-font-smoothing: antialiased;
}

.pst3 { color: var(--a-body) }

/* the page ends on "Read next" on paper, or on the white article when there is
   nothing to read next, and the footer's ice fades into whichever it is */
body.apex-pst3 .nx-footer { --footer-fade: #fff }
body.apex-pst3:has(.pst3-next) .nx-footer { --footer-fade: var(--a-paper) }

/* ---------- reading progress ---------- */

.pst3-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 9999;
  height: 3px;
  pointer-events: none;
}

/* scaleX, not width: it runs every scroll frame and width would force layout */
.pst3-progress i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--a-brand);
  transform: scaleX(var(--pst3-read, 0));
  transform-origin: 0 50%;
  will-change: transform;
}

/* ---------- the head ---------- */

.pst3-head {
  padding-top: var(--a-hero-pt);
}

.pst3-head__inner {
  width: min(var(--pst3-col), 92vw);
  margin: 0 auto;
}

.pst3-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0 0 18px;
  font-size: var(--a-t-btn);
  line-height: 1.4;
  color: var(--a-soft);
}

.pst3-crumbs a {
  color: var(--a-soft);
  text-decoration: none;
  transition: color var(--a-dur-fast);
}

.pst3-crumbs a:last-child { font-weight: 600; color: var(--a-brand) }
.pst3-crumbs a:hover { color: var(--a-ink); text-decoration: underline; text-underline-offset: 3px }

.pst3 .pst3-head h1 {
  margin: 0 0 20px;
  font-size: var(--a-t-head);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.026em;
  color: var(--a-ink);
  text-wrap: balance;
}

.pst3-lede {
  margin: 0 0 30px;
  font-size: var(--a-t-lede);
  line-height: 1.6;
  color: var(--a-body);
  text-wrap: pretty;
}

.pst3-byline {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pst3-byline__face {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 18%;
  background: var(--a-paper);
}

.pst3-byline p {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  line-height: 1.35;
}

.pst3-byline__name {
  font-size: var(--a-t-body);
  font-weight: 600;
  color: var(--a-ink);
}

.pst3-byline__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  font-size: var(--a-t-mark);
  color: var(--a-soft);
  font-variant-numeric: tabular-nums;
}

.pst3-byline__facts > span::before {
  content: "·";
  margin-right: 8px;
}

.pst3-cover {
  width: var(--a-shell);
  margin: clamp(40px, 5vw, 64px) auto 0;
}

.pst3-cover img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  max-height: 640px;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border-radius: var(--a-r);
  box-shadow: var(--a-card-shadow);
  background: var(--a-paper);
}

.pst3-cover figcaption {
  width: min(var(--pst3-col), 92vw);
  margin: 12px auto 0;
  font-size: var(--a-t-mark);
  line-height: 1.5;
  color: var(--a-soft);
}

/* No cover: the blog's own night with its ridge, lower than a photograph. */
.pst3-cover.is-drawn { aspect-ratio: 16 / 5 }

.pst3-cover__night {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--a-r);
  background:
    url("../media/blog/blg3-aurora-ridge.png") var(--x, 50%) 100% / auto 96% no-repeat,
    linear-gradient(180deg, #040b1a 0%, #0a1c40 60%, #061532 100%);
  box-shadow: var(--a-card-shadow);
}

/* ---------- the shell: contents in the margin, text in the middle ---------- */

.pst3-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(var(--pst3-col), 100%) minmax(0, 1fr);
  column-gap: var(--pst3-gap);
  width: var(--a-shell-wide);
  margin: clamp(48px, 6vw, 80px) auto 0;
}

.pst3-aside {
  grid-column: 1;
  justify-self: end;
  width: min(var(--pst3-aside), 100%);
}

.pst3-aside__stick {
  position: sticky;
  top: calc(var(--a-anchor) + 20px);
  max-height: calc(100vh - var(--a-anchor) - 40px);
  overflow-y: auto;
  scrollbar-width: none;
}

.pst3-aside__stick::-webkit-scrollbar { display: none }

.pst3-main {
  grid-column: 2;
  min-width: 0;
}

/* contents */

.pst3-toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  font-size: var(--a-t-mark);
  font-weight: 600;
  color: var(--a-ink);
  list-style: none;
  cursor: default;
  pointer-events: none;
}

.pst3-toc summary::-webkit-details-marker { display: none }
.pst3-toc summary svg { display: none; width: 16px; height: 16px; transition: transform var(--a-dur-fast) var(--a-ease) }

.pst3-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--a-hair);
}

.pst3-toc a {
  display: block;
  padding: 7px 0 7px 16px;
  font-size: var(--a-t-btn);
  line-height: 1.4;
  color: var(--a-soft);
  text-decoration: none;
  transition: color var(--a-dur-fast), box-shadow var(--a-dur-fast);
}

.pst3-toc a:hover { color: var(--a-ink) }

.pst3-toc a[aria-current] {
  color: var(--a-ink);
  font-weight: 600;
  box-shadow: inset 1px 0 0 var(--a-brand);
}

/* share */

.pst3-share {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--a-hair);
}

.pst3-share button,
.pst3-share a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0;
  font: 400 var(--a-t-btn)/1.3 var(--a-sans);
  color: var(--a-soft);
  background: none;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--a-dur-fast);
}

.pst3-share button:hover,
.pst3-share a:hover,
.pst3-share button.is-done { color: var(--a-brand) }
.pst3-share svg { flex: none; width: 17px; height: 17px }

/* ---------- the article ---------- */

.pst3-prose {
  font-size: var(--a-t-spoken);
  line-height: 1.72;
  color: var(--a-body);
  overflow-wrap: break-word;
}

.pst3-prose > :first-child { margin-top: 0 }

.pst3-prose p {
  margin: 0 0 1.35em;
  text-wrap: pretty;
}

.pst3 .pst3-prose h2,
.pst3 .pst3-faq h2 {
  margin: 2.6em 0 .7em;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.018em;
  color: var(--a-ink);
  text-wrap: balance;
  scroll-margin-top: var(--a-anchor);
}

.pst3 .pst3-prose h3 {
  margin: 2.1em 0 .55em;
  font-size: var(--a-t-sub);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--a-ink);
  text-wrap: balance;
  scroll-margin-top: var(--a-anchor);
}

.pst3 .pst3-prose h4,
.pst3 .pst3-prose h5,
.pst3 .pst3-prose h6 {
  margin: 1.9em 0 .5em;
  font-size: var(--a-t-spoken);
  font-weight: 600;
  line-height: 1.4;
  color: var(--a-ink);
}

.pst3-prose h2 + h3 { margin-top: 1em }

.pst3-prose a {
  color: var(--a-brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(34, 69, 138, .4);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--a-dur-fast);
}

.pst3-prose a:hover { text-decoration-color: currentColor }

.pst3-prose strong,
.pst3-prose b { font-weight: 600; color: var(--a-ink) }

/* lists */

.pst3-prose ul,
.pst3-prose ol {
  margin: 0 0 1.5em;
  padding-left: 1.4em;
}

.pst3-prose li { margin: 0 0 .55em; padding-left: .35em }
.pst3-prose li > ul,
.pst3-prose li > ol { margin: .55em 0 0 }
.pst3-prose ul > li::marker { color: var(--a-brand); font-size: .9em }
.pst3-prose ol > li::marker { color: var(--a-brand); font-weight: 600; font-variant-numeric: tabular-nums }

/* quotes: the words set larger, a brand quote mark above them, no bar */

.pst3-prose blockquote,
.pst3-prose .wp-block-pullquote {
  position: relative;
  margin: 2.4em 0;
  padding: 2.1rem 0 0;
  border: 0;
  text-align: left;
}

.pst3-prose blockquote::before {
  content: "\201C";
  position: absolute;
  top: -.15rem;
  left: -.05em;
  font-size: 4.4rem;
  font-weight: 600;
  line-height: 1;
  color: var(--a-brand);
}

.pst3-prose .wp-block-pullquote blockquote { margin: 0; padding: 0 }
.pst3-prose .wp-block-pullquote blockquote::before { display: none }
.pst3-prose .wp-block-pullquote::before {
  content: "\201C";
  position: absolute;
  top: -.15rem;
  left: -.05em;
  font-size: 4.4rem;
  font-weight: 600;
  line-height: 1;
  color: var(--a-brand);
}

.pst3-prose blockquote p {
  margin: 0 0 .6em;
  font-size: var(--a-t-sub);
  line-height: 1.45;
  letter-spacing: -.01em;
  color: var(--a-ink);
}

.pst3-prose blockquote cite,
.pst3-prose blockquote footer {
  display: block;
  margin-top: .9rem;
  font-size: var(--a-t-mark);
  font-style: normal;
  font-weight: 600;
  color: var(--a-soft);
}

/* figures and images */

.pst3-prose figure,
.pst3-prose .wp-block-image {
  margin: 2.4em 0;
}

.pst3-prose img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--a-r);
}

.pst3-prose figure img { width: 100% }

.pst3-prose figcaption,
.pst3-prose .wp-element-caption {
  margin: 12px 0 0;
  font-size: var(--a-t-mark);
  line-height: 1.5;
  color: var(--a-soft);
  text-align: left;
}

/* tables: framed, and they scroll sideways inside the frame on a phone */

.pst3-table {
  margin: 2.2em 0;
  overflow-x: auto;
  border: 1px solid var(--a-card-line);
  border-radius: var(--a-r-sm);
  -webkit-overflow-scrolling: touch;
}

.pst3-table:focus-visible { outline: var(--a-focus); outline-offset: 2px }

.pst3-prose figure.wp-block-table { margin: 2.2em 0 }
.pst3-prose figure.wp-block-table .pst3-table { margin: 0 }

.pst3-prose table {
  width: 100%;
  min-width: 34rem;
  margin: 0;
  border-collapse: collapse;
  font-size: var(--a-t-body);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.pst3-prose th,
.pst3-prose td {
  padding: 13px 18px;
  text-align: left;
  vertical-align: top;
  border: 0;
}

.pst3-prose thead th {
  font-weight: 600;
  color: var(--a-ink);
  background: var(--a-paper);
}

.pst3-prose tbody tr + tr td,
.pst3-prose tbody tr + tr th { border-top: 1px solid var(--a-hair) }
.pst3-prose tbody th { font-weight: 600; color: var(--a-ink) }

/* code */

.pst3-prose code,
.pst3-prose kbd {
  padding: .12em .4em;
  font-family: var(--a-mono);
  font-size: .86em;
  color: var(--a-ink);
  background: var(--a-paper);
  border-radius: 6px;
}

.pst3-prose pre {
  margin: 2em 0;
  padding: 20px 24px;
  overflow-x: auto;
  font-family: var(--a-mono);
  font-size: .94rem;
  line-height: 1.65;
  color: var(--a-ink);
  background: var(--a-paper);
  border: 1px solid var(--a-hair);
  border-radius: var(--a-r-sm);
  white-space: pre;
}

.pst3-prose pre code { padding: 0; font-size: inherit; background: none; border-radius: 0 }

.pst3-prose hr {
  height: 1px;
  margin: 3em 0;
  background: var(--a-line);
  border: 0;
}

/* embeds */

.pst3-prose iframe,
.pst3-prose video { max-width: 100%; border-radius: var(--a-r-sm) }
.pst3-prose .wp-block-embed { margin: 2.4em 0 }
.pst3-prose .wp-block-embed.wp-has-aspect-ratio .wp-block-embed__wrapper { position: relative; aspect-ratio: 16 / 9 }
.pst3-prose .wp-block-embed.wp-has-aspect-ratio iframe { position: absolute; inset: 0; width: 100%; height: 100% }
.pst3-prose .wp-block-embed__wrapper::before { display: none }

/* the twenty imported articles carry their own meta row in the text; the
   byline above already says all of it */
body.apex-pst3 .apex-metadata-bar { display: none }

.pst3-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 2em 0;
  font-size: var(--a-t-btn);
  font-weight: 600;
}

/* ---------- after the article ---------- */

.pst3-faq { margin-top: 3.5rem }
.pst3 .pst3-faq h2 { margin-top: 0 }

.pst3-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 2.6rem 0 0;
  font-size: var(--a-t-btn);
}

.pst3-tags a {
  color: var(--a-soft);
  text-decoration: underline;
  text-decoration-color: var(--a-line);
  text-underline-offset: 4px;
}

.pst3-tags a:hover { color: var(--a-brand); text-decoration-color: currentColor }

.pst3-author {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
  margin-top: 3.5rem;
  padding: 28px;
  background: var(--a-paper);
  border-radius: var(--a-r);
}

.pst3-author__face {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 18%;
  background: #fff;
}

.pst3-author p { margin: 0 }

.pst3-author__name {
  margin-bottom: 6px !important;
  font-size: var(--a-t-spoken);
  font-weight: 600;
  color: var(--a-ink);
}

.pst3-author__bio {
  font-size: var(--a-t-body);
  line-height: 1.6;
  color: var(--a-body);
}

.pst3-author__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin-top: 14px !important;
  font-size: var(--a-t-btn);
  font-weight: 600;
}

.pst3-author__links a {
  color: var(--a-brand);
  text-decoration: underline;
  text-decoration-color: rgba(34, 69, 138, .35);
  text-underline-offset: 3px;
}

.pst3-author__links a:hover { text-decoration-color: currentColor }

.pst3-adjacent {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 1.6rem;
}

.pst3-adjacent a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 22px;
  text-decoration: none;
  border: 1px solid var(--a-card-line);
  border-radius: var(--a-r);
  transition: border-color var(--a-dur-fast), box-shadow var(--a-dur-fast);
}

.pst3-adjacent a:hover { border-color: var(--a-brand); box-shadow: var(--a-card-shadow) }

.pst3-adjacent span {
  font-size: var(--a-t-mark);
  color: var(--a-soft);
}

.pst3-adjacent b {
  font-size: var(--a-t-body);
  font-weight: 600;
  line-height: 1.4;
  color: var(--a-ink);
}

.pst3-adjacent__newer { grid-column: 2; text-align: right }

/* ---------- read next ---------- */

.pst3-next {
  margin-top: clamp(72px, 9vw, 120px);
  padding: clamp(64px, 8vw, 104px) 0;
  background: var(--a-paper);
}

.pst3-next__inner {
  width: var(--a-shell);
  margin: 0 auto;
}

.pst3 .pst3-next h2 {
  margin: 0 0 clamp(32px, 4vw, 48px);
  font-size: var(--a-t-head);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.026em;
  color: var(--a-ink);
}

.pst3-next .blg3-card__cover { box-shadow: var(--a-card-shadow) }

body.apex-pst3 .pst3:not(:has(.pst3-next)) { padding-bottom: clamp(72px, 9vw, 120px) }

/* ---------- wide figures, desktop only ---------- */

@media (min-width: 1280px) {
  .pst3-prose .alignwide,
  .pst3-prose .alignfull {
    width: auto;
    max-width: none;
    margin-inline: calc(-1 * min(140px, (100vw - var(--pst3-col)) / 2 - 40px));
  }
}

/* ---------- tablet and phone ---------- */

@media (max-width: 1279px) {
  .pst3-shell {
    grid-template-columns: minmax(0, 1fr);
    width: min(var(--pst3-col), 92vw);
  }

  /* the margin column dissolves: contents before the text, share after it */
  .pst3-aside,
  .pst3-aside__stick { display: contents }
  .pst3-main { grid-column: 1; order: 2 }
  .pst3-toc { order: 1; margin-bottom: 36px }
  .pst3-share { order: 3; flex-direction: row; flex-wrap: wrap; gap: 4px 24px; margin-top: 2.6rem }

  .pst3-toc {
    background: var(--a-paper);
    border-radius: var(--a-r-sm);
  }

  .pst3-toc summary {
    margin: 0;
    padding: 15px 18px;
    font-size: var(--a-t-body);
    cursor: pointer;
    pointer-events: auto;
  }

  .pst3-toc summary svg { display: block }
  .pst3-toc[open] summary svg { transform: rotate(180deg) }
  .pst3-toc ol { margin: 0 18px 16px; }
}

@media (max-width: 700px) {
  .pst3-cover { width: 100%; margin-top: 36px }
  .pst3-cover img { aspect-ratio: 3 / 2; border-radius: 0; box-shadow: none }
  .pst3-cover__night { border-radius: 0; box-shadow: none }
  .pst3-cover.is-drawn { aspect-ratio: 5 / 2 }
  .pst3-prose { font-size: 1.0625rem; line-height: 1.7 }
  .pst3 .pst3-prose h2,
  .pst3 .pst3-faq h2 { font-size: 1.5rem }
  .pst3 .pst3-prose h3 { font-size: 1.22rem }
  .pst3-prose blockquote p { font-size: 1.22rem }
  .pst3-author { grid-template-columns: minmax(0, 1fr); padding: 22px }
  .pst3-author__face { width: 64px; height: 64px }
  .pst3-adjacent { grid-template-columns: minmax(0, 1fr) }
  .pst3-adjacent__newer { grid-column: 1; text-align: left }
}

@media (prefers-reduced-motion: reduce) {
  .pst3-progress i { will-change: auto }
  .pst3-toc summary svg { transition: none }
  body.apex-pst3 [data-reveal] { opacity: 1; transform: none; filter: none; transition: none }
}
