/* One blog post. Builds on home.css and blog.css (the "Keep reading" cards). */

/* ---- The post and its contents list ---- */

.story {
  display: grid;
  grid-template-columns: minmax(0, 720px) 240px;
  justify-content: center;
  column-gap: 64px;
  padding-top: 20px;
  padding-bottom: 32px;
}

.story > * {
  grid-column: 1;
}

.story.no-toc {
  grid-template-columns: minmax(0, 720px);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-size: 14px;
}

.crumbs a {
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
}

.crumbs a:hover {
  text-decoration: underline;
}

.crumbs .topic {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--gold-tint);
  font-size: 13px;
}

.story h1 {
  margin-top: 14px;
  font-size: clamp(28px, 3vw, 40px);
}

.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink-muted);
}

.byline > * + *::before {
  content: "·";
  margin: 0 8px;
}

.story-image {
  margin: 24px 0 8px;
}

.story-image img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--sunken);
}

.toc {
  grid-column: 2;
  grid-row: 1 / span 4;
  align-self: start;
  position: sticky;
  top: 24px;
  margin-top: 4px;
  padding: 18px 20px;
}

.toc h2 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.toc ol {
  display: grid;
  gap: 2px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: block;
  padding: 5px 0;
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink-muted);
  text-decoration: none;
  border-radius: 6px;
}

.toc a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ---- The writing itself (WordPress's own blocks) ---- */

.prose {
  margin-top: 24px;
  font-size: 17px;
  line-height: 1.7;
}

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

.prose p,
.prose ul,
.prose ol,
.prose figure,
.prose blockquote,
.prose table {
  margin: 0 0 1.1em;
}

.prose h2,
.prose h3,
.prose h4 {
  margin: 1.8em 0 0.5em;
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-wrap: balance;
  scroll-margin-top: 24px;
}

.prose h2 {
  font-size: 25px;
}

.prose h3 {
  font-size: 20px;
}

.prose h4 {
  font-size: 17px;
}

.prose hr + h2,
.prose hr + h3 {
  margin-top: 0;
}

.prose strong {
  font-weight: 600;
}

.prose a {
  font-weight: 500;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

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

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose li {
  margin-bottom: 0.4em;
  padding-left: 0.2em;
}

.prose ul li::marker {
  color: var(--gold-text);
}

.prose ol li::marker {
  font-weight: 600;
  color: var(--ink-muted);
}

.prose hr {
  height: 1px;
  margin: 2.2em 0;
  border: 0;
  background: var(--border);
}

.prose blockquote {
  padding: 16px 22px;
  border-left: 4px solid var(--gold);
  border-radius: 0 12px 12px 0;
  background: var(--gold-tint);
  font-weight: 500;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose blockquote cite {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  font-style: normal;
  color: var(--ink-muted);
}

.prose figure.wp-block-table {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.45;
}

.prose figure.wp-block-table table {
  margin: 0;
}

.prose th,
.prose td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--sunken);
  font-size: 13px;
  font-weight: 600;
}

.prose tr:last-child td {
  border-bottom: 0;
}

.prose img,
.prose video,
.prose iframe {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

/* Video embeds (YouTube etc.) fill the column at their own shape. */
.prose .wp-block-embed {
  margin-inline: 0;
}

.prose .wp-block-embed iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

.prose .wp-embed-aspect-4-3 iframe {
  aspect-ratio: 4 / 3;
}

.prose .wp-embed-aspect-9-16 iframe {
  aspect-ratio: 9 / 16;
  max-width: 360px;
  margin-inline: auto;
}

.prose figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: var(--ink-muted);
  text-align: center;
}

.prose .aligncenter {
  margin-inline: auto;
}

/* ---- Keep reading ---- */

.more-posts {
  padding-top: 8px;
}

/* ---- Narrower screens ---- */

@media (max-width: 1020px) {
  .story {
    grid-template-columns: minmax(0, 720px);
  }

  .toc {
    display: none;
  }
}

@media (max-width: 640px) {
  .story {
    padding-top: 12px;
  }

  .byline .updated {
    flex-basis: 100%;
  }

  .byline .updated::before {
    content: none;
  }

  .prose {
    font-size: 16px;
  }

  .prose h2 {
    font-size: 22px;
  }

  .prose h3 {
    font-size: 18px;
  }
}
