/* Blog index and posts. Loaded after site.css, which supplies the fonts, the
   nav and the footer; this file only lays out the page around them. */

.blog-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #faf8f4;
}
.blog-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-link[aria-current="page"] {
  color: #f07000;
}
/* site.css hands the phone nav to the burger, which needs site.js. Here the
   bar keeps the mark and the one link that matters on a blog page. */
@media (max-width: 759.98px) {
  .blog-page .nav-links {
    display: flex;
    margin-right: 0;
  }
  .blog-page .nav-link-wide {
    display: none;
  }
}

.blog-main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) 24px clamp(64px, 10vw, 128px);
}

/* ── Headings shared by index and post ───────────────────────────────────── */
.blog-head h1,
.post-head h1 {
  margin: 0;
  font-family: "Lora", "Lora Fallback", Georgia, serif;
  font-weight: 500;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: #003050;
  text-wrap: balance;
}
.blog-head p {
  margin: 16px 0 0;
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.5;
  color: #5a6671;
}

/* ── Index ───────────────────────────────────────────────────────────────── */
.post-list {
  list-style: none;
  margin: 48px 0 0;
  padding: 0;
  border-top: 1px solid rgba(0, 48, 80, 0.14);
}
.post-list li {
  border-bottom: 1px solid rgba(0, 48, 80, 0.14);
}
.post-list a {
  display: block;
  padding: 28px 0;
  color: inherit;
}
.post-list time,
.post-crumbs,
.post-aside-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5a6671;
}
.post-list h2 {
  margin: 8px 0 0;
  font-family: "Lora", "Lora Fallback", Georgia, serif;
  font-weight: 500;
  font-size: clamp(24px, 2.4vw, 30px);
  line-height: 1.2;
  color: #003050;
  transition: color 0.25s ease;
}
.post-list a:hover h2 {
  color: #f07000;
}
.post-list p {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.55;
  color: #1f2a35;
}
.post-empty {
  margin: 48px 0 0;
  color: #5a6671;
}

/* ── Post ────────────────────────────────────────────────────────────────── */
/* ── Post layout ─────────────────────────────────────────────────────────
   One column, the sidebar under the post. From 1100px the sidebar sits to the
   left of the post and sticks below the nav. */
/* as wide as the landing page's .wrap (1408px inside 24px gutters), so the
   call to action at the end matches the landing page's; the post's own grid
   stays centred at its narrower width */
.blog-main-post {
  max-width: 1456px;
}
.post {
  display: grid;
  grid-template-columns: minmax(0, 720px);
  justify-content: center;
}
.post-aside {
  order: 1;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 48, 80, 0.14);
}
.post-toc {
  display: none;
}
@media (min-width: 1100px) {
  .post {
    grid-template-columns: 220px minmax(0, 720px);
    column-gap: 64px;
  }
  .post-head,
  .prose {
    grid-column: 2;
  }
  .post-aside {
    order: 0;
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    position: sticky;
    top: 112px;
    margin-top: 48px;
    padding-top: 0;
    border-top: 0;
    font-size: 14px;
  }
  .post-toc {
    display: block;
    margin-bottom: 32px;
  }
}
.post-aside-label {
  display: block;
  margin-bottom: 14px;
}
.post-toc nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 48, 80, 0.14);
}
.post-toc a {
  color: #5a6671;
  line-height: 1.4;
  transition: color 0.2s ease;
}
.post-toc a:hover {
  color: #003050;
}
.post-toc a[aria-current] {
  font-weight: 600;
  color: #003050;
}
@media (min-width: 1100px) {
  .post-share {
    padding-top: 16px;
    border-top: 1px solid rgba(0, 48, 80, 0.14);
  }
}
.post-share-buttons {
  display: flex;
  gap: 8px;
}
.post-share-buttons a,
.post-share-buttons button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #b3bcce;
  border-radius: 50%;
  background: #fff;
  color: #003050;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.post-share-buttons a:hover,
.post-share-buttons button:hover {
  border-color: #f07000;
  color: #f07000;
}
.post-share-status {
  display: block;
  min-height: 1.5em;
  margin-top: 8px;
  font-size: 13px;
  color: #5a6671;
  overflow-wrap: anywhere;
}

.post-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.post-crumbs a {
  color: inherit;
}
.post-crumbs a:hover {
  color: #f07000;
}
.post-standfirst {
  margin: 24px 0 0;
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.5;
  font-weight: 500;
  color: #1f2a35;
}
.post-meta {
  margin: 16px 0 0;
  font-size: 14px;
  color: #5a6671;
}

.prose {
  margin-top: 48px;
  font-size: 18px;
  line-height: 1.7;
  color: #1f2a35;
}
.prose > * {
  margin: 0;
}
.prose > * + * {
  margin-top: 1.1em;
}
.prose h2,
.prose h3 {
  color: #003050;
  line-height: 1.25;
}
.prose h2 {
  scroll-margin-top: 112px;
  margin-top: 1.9em;
  font-family: "Lora", "Lora Fallback", Georgia, serif;
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -0.01em;
}
.prose h3 {
  margin-top: 1.6em;
  font-size: 20px;
  font-weight: 700;
}
.prose h2 + *,
.prose h3 + * {
  margin-top: 0.6em;
}
.prose a {
  color: #003050;
  text-decoration: underline;
  text-decoration-color: #f07000;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.prose a:hover {
  color: #f07000;
}
.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 16px;
}
.prose p:has(> img:only-child),
.prose figure:has(> img) {
  margin-block: 2em;
}
/* a captioned photo: <figure><img …><figcaption>…</figcaption></figure> */
.prose figure > img + figcaption {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #5a6671;
}
.prose blockquote {
  margin-block: 2em;
  padding-left: 20px;
  border-left: 2px solid #f07000;
  font-family: "Lora", "Lora Fallback", Georgia, serif;
  font-style: italic;
  font-size: 21px;
  line-height: 1.5;
  color: #003050;
}
.prose blockquote p {
  margin: 0;
}
.prose ul,
.prose ol {
  padding-left: 1.3em;
}
.prose li + li {
  margin-top: 0.4em;
}
.prose li::marker {
  color: #f07000;
}
.prose code {
  font-family: var(--monospace-stack);
  font-size: 0.86em;
  background: rgba(0, 48, 80, 0.06);
  padding: 0.12em 0.35em;
  border-radius: 4px;
}
.prose pre {
  overflow-x: auto;
  padding: 16px 20px;
  border-radius: 12px;
  background: rgba(0, 48, 80, 0.06);
  font-size: 15px;
  line-height: 1.55;
}
.prose pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}
.prose hr {
  margin-block: 2.4em;
  border: 0;
  border-top: 1px solid rgba(0, 48, 80, 0.14);
}
/* block + overflow so a wide table scrolls inside itself, not the page */
.prose table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 16px;
}
.prose th,
.prose td {
  padding: 8px 16px 8px 0;
  text-align: left;
  border-bottom: 1px solid rgba(0, 48, 80, 0.14);
}

/* ── Post blocks: raw HTML a post can drop between paragraphs ────────────── */
.post-stats > div,
.post-bars,
.post-pillars li {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 2px 12px rgba(0, 48, 80, 0.06);
}

/* <div class="post-stats"><div><strong>35%</strong><span>label</span></div>…</div> */
.prose .post-stats {
  margin-block: 2.2em;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.post-stats > div {
  padding: 24px;
}
.post-stats strong {
  display: block;
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #003050;
}
.post-stats span {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.45;
  color: #5a6671;
}

/* <figure class="post-bars"><figcaption/><div [class="hl"]><span>label</span>
   <span class="bar" style="--w: 80%"></span><b>value</b></div>…<p>source</p></figure> */
.prose .post-bars {
  margin-block: 2.2em;
  padding: 28px;
  font-size: 15px;
}
.post-bars figcaption,
.post-sources h2 {
  margin-bottom: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5a6671;
}
.post-bars > div {
  display: grid;
  grid-template-columns: minmax(90px, 140px) 1fr 48px;
  gap: 12px;
  align-items: center;
}
.post-bars > div + div {
  margin-top: 14px;
}
.post-bars .bar {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(#b3bcce, #b3bcce) 0 0 / var(--w) 100% no-repeat, #ede7da;
}
.post-bars b {
  text-align: right;
}
.post-bars .hl {
  font-weight: 600;
  color: #003050;
}
.post-bars .hl .bar {
  background: linear-gradient(#003050, #003050) 0 0 / var(--w) 100% no-repeat, #ede7da;
}
.post-bars p {
  margin: 16px 0 0;
  font-size: 13px;
  color: #5a6671;
}

/* phones: label and value on one line, the bar full width beneath them */
@media (max-width: 519.98px) {
  .prose .post-bars {
    padding: 24px;
  }
  .post-bars > div {
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
  }
  .post-bars .bar {
    grid-row: 2;
    grid-column: 1 / -1;
  }
  .post-pillars li {
    padding: 24px;
  }
}

/* <ol class="post-pillars"><li><h3/><p/></li>…</ol> — numbered cards */
.prose .post-pillars {
  margin-block: 1.2em 2.2em;
  padding: 0;
  list-style: none;
  counter-reset: pillar;
}
.post-pillars li {
  padding: 32px;
  counter-increment: pillar;
}
.post-pillars li + li {
  margin-top: 16px;
}
.post-pillars li::before {
  content: counter(pillar, decimal-leading-zero);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #5a6671;
}
.prose .post-pillars h3 {
  margin: 8px 0 0;
  font-family: inherit;
  font-size: 22px;
  line-height: 1.3;
}
.post-pillars p {
  margin: 14px 0 0;
  font-size: 16px;
}

/* <section class="post-sources"><h2>Sources</h2><ol>…</ol></section> */
.prose .post-sources {
  margin-top: 3.5em;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 48, 80, 0.14);
  font-size: 14px;
  line-height: 1.55;
  color: #5a6671;
}
.prose .post-sources h2 {
  margin: 0 0 14px;
  font-family: inherit;
}
.prose .post-sources ol {
  margin: 0;
  padding-left: 28px;
}
.prose .post-sources li + li {
  margin-top: 6px;
}
/* the body's link treatment, in grey instead of orange */
.prose .post-sources li::marker {
  color: #b3bcce;
}
.prose .post-sources a {
  color: inherit;
  text-decoration-color: #b3bcce;
}
.prose .post-sources a:hover {
  color: #1f2a35;
  text-decoration-color: #5a6671;
}

/* ── Call to action under every post ─────────────────────────────────────── */
.post-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: center;
  justify-content: space-between;
  margin-top: clamp(64px, 8vw, 96px);
  padding: clamp(40px, 6vw, 64px) clamp(24px, 4vw, 48px);
  border-radius: 32px;
  background: #ede7da;
  color: #003050;
}
.post-cta div {
  max-width: 620px;
}
.post-cta h2 {
  margin: 0;
  font-family: "Lora", "Lora Fallback", Georgia, serif;
  font-weight: 500;
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.post-cta em {
  font-weight: 700;
}
.post-cta p {
  margin: 16px 0 0;
  font-size: 17px;
  font-weight: 500;
}
/* not .nav-cta: site.css hides that one on phones */
.post-cta-button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 28px;
  border-radius: 999px;
  background: #003050;
  color: #faf8f4;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  white-space: nowrap;
  transition: background 0.45s ease;
}
.post-cta-button:hover {
  background: #002540;
  color: #faf8f4;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.blog-footer {
  position: relative;
  padding: 40px 24px;
  border-top: 1px solid rgba(0, 48, 80, 0.14);
  background: #faf8f4;
}
