/* Blog — the index and the long-form article layout.
   Loaded only by /blog and /blog/*, on top of styles.css and site-chrome.css.
   Tokens and chrome come from the design system; nothing is redefined here. */

/* ---------- article shell ---------- */
.article-page .closing-cta .sub {
  margin: 20px auto 32px;
}

.article {
  --measure: 72ch;
  padding: clamp(40px, 6vw, 88px) 0 0;
}
.article-head { max-width: var(--measure); }
.article-head h1 {
  font-size: clamp(34px, 4.6vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin: 10px 0 20px;
}
.article-head .lede {
  max-width: 62ch;
  color: var(--ink-2);
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.5;
}

/* ---------- byline ---------- */
.article-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  align-items: baseline;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.article-author { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; font-weight: 600; }
.article-author a { border-bottom: 1px solid var(--line-2); }
.article-author a:hover, .article-author a:focus-visible { color: var(--accent); border-bottom-color: currentColor; }
.article-author span { font-weight: 400; color: var(--muted); font-size: 14px; }
.article-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

/* ---------- takeaways ---------- */
.article-takeaways {
  max-width: var(--measure);
  margin: clamp(32px, 4vw, 52px) 0 0;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  background: var(--paper-2);
}
.article-takeaways ul { margin: 14px 0 0; padding-left: 20px; display: grid; gap: 10px; }
.article-takeaways li { color: var(--ink-2); }

/* ---------- contents rail ---------- */
.article-contents {
  max-width: var(--measure);
  margin: clamp(32px, 4vw, 48px) 0 0;
  padding-bottom: 6px;
}
.article-contents h2 {
  font-size: 12px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 12px;
}
.article-contents ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  display: grid;
  gap: 8px;
}
.article-contents li { counter-increment: toc; display: flex; gap: 12px; }
.article-contents li::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-2);
  padding-top: 3px;
}
.article-contents a { color: var(--ink-2); border-bottom: 1px solid transparent; }
.article-contents a:hover, .article-contents a:focus-visible { color: var(--accent); border-bottom-color: currentColor; }

/* ---------- prose ---------- */
.article-body {
  max-width: var(--measure);
  margin-top: clamp(36px, 5vw, 60px);
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.7;
}
.article-body > * + * { margin-top: 1.1em; }
.article-body h2 {
  margin-top: 1.8em;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 600;
  color: var(--ink);
  scroll-margin-top: 110px;
}
.article-body h3 {
  margin-top: 1.7em;
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--ink);
  scroll-margin-top: 110px;
}
.article-body h2 + p, .article-body h3 + p { margin-top: 0.7em; }
.article-body strong { color: var(--ink); font-weight: 600; }
.article-body a {
  color: var(--ink);
  border-bottom: 1px solid var(--accent-soft);
}
.article-body a:hover, .article-body a:focus-visible { color: var(--accent); border-bottom-color: currentColor; }
.article-body ul, .article-body ol { padding-left: 24px; display: grid; gap: 10px; }
.article-body li > ul, .article-body li > ol { margin-top: 10px; }
.article-body li::marker { color: var(--muted-2); }
.article-body blockquote {
  margin-inline: 0;
  padding: 4px 0 4px 22px;
  border-left: 2px solid var(--accent);
  color: var(--ink);
}
.article-body code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-2);
  color: var(--ink);
}
.article-body pre {
  overflow-x: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
}
.article-body pre code { border: 0; padding: 0; background: none; font-size: 14px; line-height: 1.6; }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin-block: 2em; }

/* ---------- comparison tables ----------
   Comparison tables are the point of half these articles, so they get more
   width than the reading measure and scroll rather than squeeze on a phone. */
.table-wrap {
  width: min(100vw - 48px, 1000px);
  margin-top: 1.6em;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  -webkit-overflow-scrolling: touch;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}
.article-body thead th {
  position: sticky;
  top: 0;
  text-align: left;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mint);
  background: var(--forest);
  padding: 14px 18px;
  white-space: nowrap;
}
.article-body tbody td {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  vertical-align: top;
  min-width: 180px;
}
.article-body tbody tr:nth-child(odd) { background: rgba(238, 242, 238, 0.02); }
.article-body tbody td:first-child { color: var(--ink); font-weight: 600; }

/* ---------- sources ---------- */
.article-sources {
  max-width: var(--measure);
  margin-top: clamp(44px, 5vw, 66px);
  padding-top: clamp(28px, 3vw, 40px);
  border-top: 1px solid var(--line);
}
.article-sources ol { margin: 0; padding-left: 22px; display: grid; gap: 10px; color: var(--muted); font-size: 15px; }
.article-sources a { border-bottom: 1px solid transparent; }
.article-sources a:hover, .article-sources a:focus-visible { color: var(--accent); border-bottom-color: currentColor; }

/* ---------- index ---------- */
.article-feed-link { margin-top: 26px; }
.article-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  padding-bottom: clamp(40px, 6vw, 80px);
}
.article-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-2);
  transition: border-color 0.3s var(--ease);
}
.article-card:hover { border-color: var(--accent); }
.article-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
}
.article-card-meta span:first-child { color: var(--accent); }
.article-card .h3 { margin: 0; }
.article-card p { color: var(--ink-2); }
.article-card-author { color: var(--muted); font-size: 14px; margin-top: auto; }
.article-card .card-link { margin-top: 4px; }

@media (max-width: 720px) {
  .article-body { font-size: 17px; }
  .table-wrap { width: 100%; }
  .article-body thead th { position: static; }
  .article-list { grid-template-columns: 1fr; }
}

/* ---------- figures ---------- */
/* Diagrams are inline SVG, like every other visual on the site, so they inherit
   the type tokens, follow currentColor and stay crisp without an image request.
   Each carries <title>/<desc> via aria-labelledby: that pair is the alt text. */
.article-figure {
  margin: 40px 0;
  max-width: var(--measure);
}
.article-figure svg {
  width: 100%;
  height: auto;
  display: block;
  color: var(--ink);
  overflow: visible;
}
.article-figure figcaption {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
/* The architecture figure has two layouts rather than one shrinking layout:
   side by side on wide screens, stacked on narrow ones, so the 12.5px labels
   never scale below legibility. display:none also drops the hidden variant
   from the accessibility tree, so only one <desc> is ever announced. */
.figure-arch .figure-narrow { display: none; }

.walkthrough-video video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--forest-deep);
}
.walkthrough-transcript {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
  overflow-wrap: anywhere;
}
.walkthrough-transcript summary {
  padding: 16px 20px;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}
.walkthrough-transcript summary::marker { color: var(--mint); }
.walkthrough-transcript summary:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 4px;
  border-radius: 8px;
}
.walkthrough-transcript-body {
  padding: 0 20px 20px;
  font-size: 16px;
  line-height: 1.7;
}
.walkthrough-transcript-body > p + p { margin-top: 1em; }
.walkthrough-transcript-body > :last-child { margin-bottom: 0; }

/* The walkthrough separates illustrative material from recorded evidence. */
.walkthrough-note, .walkthrough-recording, .walkthrough-document {
  padding: clamp(20px, 3vw, 30px);
  margin: 28px 0;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--paper-2);
}
.walkthrough-note { border-left: 3px solid var(--accent); }
.walkthrough-recording { border-style: dashed; background: var(--forest-deep); }
.article-body .walkthrough-recording h3, .article-body .walkthrough-document h3 { margin-top: 0; }
.article-body .walkthrough-note > :first-child, .article-body .walkthrough-recording > :first-child { margin-top: 0; }
.article-body .walkthrough-note > :last-child, .article-body .walkthrough-recording > :last-child, .article-body .walkthrough-document > :last-child { margin-bottom: 0; }
.walkthrough-exchange { margin: 28px 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.walkthrough-message { padding: 22px clamp(20px, 3vw, 28px); background: var(--paper-2); }
.walkthrough-message + .walkthrough-message { border-top: 1px solid var(--line); }
.article-body .walkthrough-role { margin: 0 0 10px; font: 500 12px/1.5 var(--mono); color: var(--mint); text-transform: uppercase; letter-spacing: .06em; }
.article-body .walkthrough-message > :last-child { margin-bottom: 0; }
.walkthrough-before-after { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 28px 0; }
.walkthrough-before-after > section { padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); }
.walkthrough-before-after > section:last-child { border-color: var(--mint); }
.article-body .walkthrough-before-after h3 { margin: 0 0 14px; font-size: 18px; }
.article-body .walkthrough-before-after p:last-child { margin-bottom: 0; }
.walkthrough-document { border-top: 3px solid var(--mint); }
.walkthrough-document ul { padding-left: 20px; }
.article-body .walkthrough-document h4 { margin: 22px 0 10px; }
.walkthrough-note, .walkthrough-recording, .walkthrough-message, .walkthrough-document { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .walkthrough-before-after { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .article-figure { margin: 32px 0; }
  .figure-arch .figure-wide { display: none; }
  .figure-arch .figure-narrow { display: block; }
}
