/* The default Journal post. Every article under /blog/ and /zh/blog/ loads this
   file and nothing else of its own, unless docs/blog-authoring.md lists it as a
   fully custom post. Tokens mirror blog.css so the index and the posts read as
   one surface; theme.css swaps them for dark. */
:root {
  color-scheme: light;
  --paper: #fafafa;
  --panel: #ffffff;
  --paper-deep: #f0f0ec;
  --ink: #26251e;
  --muted: #6f6e67;
  --faint: #96958e;
  --line: #e2e2dc;
  --line-soft: #ebebe6;
  --accent: #e6532f;
  --accent-soft: #fff0ea;
  --blue: #278eff;
  --code: #24241f;
  --post-measure: 660px;
  --post-rail: 220px;
  --post-font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --post-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
html { scroll-behavior: smooth; }
body.post {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--post-font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.post #site-page { background: var(--paper); }
.post a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.post a:hover { color: var(--accent); }
.post :is(a, summary, button):focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 3px; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

/* Layout: the column and its rail, on the header's 960 grid. */
.post-layout {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 36px 16px 88px;
  display: grid;
  grid-template-columns: minmax(0, var(--post-measure)) var(--post-rail);
  justify-content: space-between;
  column-gap: 48px;
  align-items: start;
}
.post-article { min-width: 0; }

/* Hero */
.post-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 30px; color: var(--faint); font-size: 12px; }
.post-breadcrumb a { color: var(--muted); text-decoration: none; }
.post-breadcrumb a:hover { color: var(--ink); }
.post-hero { margin: 0 0 40px; padding-bottom: 32px; border-bottom: 1px solid var(--line-soft); }
.post-title {
  margin: 0;
  max-width: 600px;
  font-size: clamp(34px, 4.4vw, 46px);
  font-weight: 690;
  line-height: 1.08;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.post-title em { color: var(--accent); font-style: normal; }
.post-dek { max-width: 610px; margin: 18px 0 0; color: var(--muted); font-size: 17px; line-height: 1.6; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 22px 0 0; color: var(--faint); font-size: 12px; }
.post-meta > * { position: relative; }
.post-meta > * + *::before { content: ""; position: absolute; left: -9px; top: .55em; width: 2px; height: 2px; border-radius: 50%; background: var(--faint); }
.post-meta strong { color: var(--muted); font-weight: 600; }
.post-meta a { text-decoration: none; }
.post-meta a:hover { text-decoration: underline; }

/* Body typography */
.post-body { min-width: 0; }
.post-body > section { scroll-margin-top: 76px; }
.post-body p { margin: 0 0 20px; }
.post-body .post-lead { font-size: 18px; line-height: 1.65; }
.post-body h2 {
  margin: 56px 0 16px;
  padding-top: 8px;
  font-size: 25px;
  font-weight: 680;
  line-height: 1.25;
  letter-spacing: -.025em;
  scroll-margin-top: 76px;
}
.post-body h2::before { content: "#"; display: inline-block; width: 0; margin-left: -18px; color: transparent; font-weight: 500; transition: color .15s ease; }
.post-body h2:hover::before { color: var(--faint); }
.post-body h3 { margin: 36px 0 12px; font-size: 18px; font-weight: 680; line-height: 1.35; letter-spacing: -.015em; scroll-margin-top: 76px; }
.post-body h4 { margin: 28px 0 10px; font-size: 16px; font-weight: 680; }
.post-body ul, .post-body ol { margin: 0 0 24px; padding-left: 1.4em; }
.post-body li { margin: 7px 0; }
.post-body li > p { margin-bottom: 8px; }
.post-body strong { font-weight: 660; }
.post-body hr { height: 1px; margin: 48px 0; border: 0; background: var(--line); }
.post-body img, .post-body video { display: block; max-width: 100%; height: auto; }

/* Code */
.post pre {
  margin: 20px 0 26px;
  padding: 16px 18px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  background: var(--code);
  color: #f5f2e9;
  border: 1px solid #171713;
  border-radius: 8px;
  scrollbar-color: #5b5b56 transparent;
  scrollbar-width: thin;
  font: 13px/1.65 var(--post-mono);
}
.post pre::-webkit-scrollbar { height: 8px; }
.post pre::-webkit-scrollbar-thumb { min-width: 36px; background: #5b5b56; border: 2px solid var(--code); border-radius: 999px; }
.post code { padding: .12em .32em; background: var(--paper-deep); border-radius: 3px; font: .86em/1.5 var(--post-mono); }
.post pre code { padding: 0; background: transparent; font-size: inherit; }
.post-code { margin: 20px 0 26px; }
.post-code > figcaption { margin: 0 0 6px; color: var(--faint); font: 600 11px/1.4 var(--post-mono); }
.post-code > pre { margin: 0; }

/* Quotes, figures */
.post blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent);
}
.post blockquote p { margin-bottom: 8px; font-size: 19px; line-height: 1.5; letter-spacing: -.01em; }
.post blockquote cite { display: block; color: var(--muted); font-size: 13px; font-style: normal; }
.post-figure { margin: 28px 0 36px; }
.post-figure img { width: 100%; border: 1px solid var(--line); border-radius: 8px; }
.post-figure figcaption { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.post-figure.is-wide { margin-inline: -16px; }
.post-figure.is-wide img { border-radius: 0; }

/* Boxes: summary opens the post, callout interrupts it, note closes a section. */
.post-summary { margin: 0 0 32px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.post-summary p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.post-summary p + p { margin-top: 8px; }
.post-summary strong { color: var(--ink); }
.post-callout { margin: 26px 0; padding: 16px 20px; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; background: var(--accent-soft); }
.post-callout > :first-child { margin-top: 0; }
.post-callout p:last-child { margin-bottom: 0; }
.post-callout-title { display: block; margin: 0 0 6px; font-weight: 680; }
.post-note { margin: 24px 0; padding: 14px 18px; border-radius: 8px; background: var(--paper-deep); color: var(--muted); font-size: 14px; line-height: 1.65; }
.post-note p:last-child { margin-bottom: 0; }

/* Steps and checklists */
.post-steps { counter-reset: steps; margin: 0 0 28px; padding: 0 !important; list-style: none; }
.post-steps > li { position: relative; min-height: 30px; margin: 0; padding: 0 0 20px 44px; }
.post-steps > li::after { content: ""; position: absolute; left: 14px; top: 30px; bottom: 2px; width: 1px; background: var(--line); }
.post-steps > li:last-child::after { display: none; }
.post-steps > li::before { counter-increment: steps; content: counter(steps); position: absolute; left: 0; top: 0; width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); color: var(--muted); font: 700 11px/1 var(--post-mono); }
.post-steps > li > h3 { margin: 2px 0 6px; font-size: 16px; }
.post-steps > li > p { margin-bottom: 0; color: var(--muted); font-size: 15px; }
.post-checklist { margin: 0 0 28px; padding: 0 !important; list-style: none; }
.post-checklist > li { position: relative; margin: 0 0 10px; padding-left: 30px; }
.post-checklist > li::before { content: ""; position: absolute; left: 0; top: .42em; width: 16px; height: 16px; border-radius: 50%; background: var(--accent) center / 9px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m2.5 6.5 2.5 2.5 4.5-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

/* Cards, comparisons, tables */
.post-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 24px 0 30px; }
.post-cards > * { margin: 0; padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.post-cards h3 { margin: 0 0 8px; font-size: 15px; }
.post-cards p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.post-cards p + p { margin-top: 8px; }
.post-cards code { display: inline-block; margin-top: 10px; }
.post-cards .post-card-index { display: block; margin-bottom: 14px; color: var(--accent); font: 600 11px/1 var(--post-mono); }
.post-cards.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.post-compare { display: grid; grid-template-columns: 1fr 1fr; margin: 24px 0 30px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.post-compare > div { padding: 20px; }
.post-compare > div + div { border-left: 1px solid var(--line); }
.post-compare span, .post-compare h3 { display: block; margin: 0 0 10px; font-size: 14px; font-weight: 680; }
.post-compare ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.post-compare .is-highlight { background: var(--ink); color: var(--paper); }
.post-compare .is-highlight ul { color: inherit; opacity: .8; }
.post-table { margin: 22px 0 30px; overflow-x: auto; overscroll-behavior-inline: contain; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.post-table table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.5; }
.post-table th, .post-table td { padding: 11px 13px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.post-table tr:last-child td { border-bottom: 0; }
.post-table th:last-child, .post-table td:last-child { border-right: 0; }
.post-table th { background: var(--paper-deep); color: var(--muted); font-size: 12px; font-weight: 680; }
.post-table td[rowspan] { color: var(--muted); font-weight: 600; }

/* Pills, catalogs, FAQ */
.post-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.post-pills li { margin: 0; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font: 600 11px/1.2 var(--post-mono); }
.post-catalog { margin: 26px 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.post-catalog details { background: var(--panel); border-bottom: 1px solid var(--line); }
.post-catalog details:last-child { border-bottom: 0; }
.post-catalog summary { display: flex; justify-content: space-between; gap: 20px; padding: 14px 16px; cursor: pointer; font-size: 14px; font-weight: 680; list-style: none; }
.post-catalog summary::-webkit-details-marker { display: none; }
.post-catalog details[open] summary { background: var(--paper-deep); }
.post-catalog summary span { color: var(--faint); font-size: 12px; font-weight: 500; }
.post-catalog ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 0; padding: 14px 16px 16px; list-style: none; }
.post-catalog li { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.post-catalog li a { color: var(--ink); font-family: var(--post-mono); font-size: 11.5px; }
.post-faq { margin: 0 0 40px; border-top: 1px solid var(--line); }
.post-faq details { padding: 14px 0; border-bottom: 1px solid var(--line); }
.post-faq summary { position: relative; padding-left: 24px; cursor: pointer; font-size: 15px; font-weight: 650; list-style: none; }
.post-faq summary::-webkit-details-marker { display: none; }
.post-faq summary::before { content: "+"; position: absolute; top: -.08em; left: 1px; color: var(--faint); font-size: 19px; font-weight: 400; line-height: 1; transition: color .18s ease, transform .22s ease; }
.post-faq summary:hover::before { color: var(--ink); }
.post-faq details[open] summary::before { transform: rotate(45deg); }
.post-faq details p { margin: 12px 0 0; padding-left: 24px; color: var(--muted); font-size: 14px; }
.post-faq details p + p { margin-top: 8px; }
.post-faq details[open] p { animation: post-faq-in .24s ease both; }
@keyframes post-faq-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* Sources and the closing line */
.post-sources { margin: 40px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.6; }
.post-sources h2 { margin: 0 0 12px; padding: 0; font-size: 14px; letter-spacing: 0; }
.post-sources h2::before { display: none; }
.post-sources ol, .post-sources ul { margin: 0; padding-left: 1.3em; }
.post-sources li { margin: 6px 0; }
.post-sources p { margin: 0 0 10px; }
.post-footer { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; line-height: 1.6; }
.post-footer p { margin: 0 0 8px; }
.post-footer a { color: var(--muted); }

/* CTA: the one ask at the end of every post. */
.post-cta {
  margin: 56px 0 0;
  padding: 28px 28px 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.post-cta-kicker { margin: 0 0 8px; color: var(--accent); font: 600 12px/1.4 var(--post-mono); }
.post-cta h2 { margin: 0; font-size: 24px; font-weight: 680; line-height: 1.2; letter-spacing: -.03em; }
.post-cta p { max-width: 520px; margin: 10px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.post-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.post-cta-actions a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.post-cta-actions a:hover { border-color: var(--ink); color: var(--ink); }
.post-cta-actions a.is-primary { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.post-cta-actions a.is-primary:hover { opacity: .85; }
.post-cta-note { margin-top: 12px; color: var(--faint); font-size: 12px; }

/* Rail: contents and the alternate language. */
.post-toc { position: sticky; top: 76px; align-self: start; padding-top: 4px; font-size: 12px; }
.post-toc > p { margin: 0 0 10px; color: var(--faint); font-weight: 680; }
.post-toc ol { margin: 0; padding: 0 0 16px; border-bottom: 1px solid var(--line-soft); list-style: none; }
.post-toc li { margin: 0; }
.post-toc a { display: block; padding: 4px 0; color: var(--muted); line-height: 1.45; text-decoration: none; }
.post-toc a:hover, .post-toc a[aria-current="true"] { color: var(--ink); }
.post-toc-actions { padding-top: 14px; }
.post-toc-actions a { display: block; padding: 3px 0; color: var(--faint); text-decoration: none; }
.post-toc-actions a:hover { color: var(--ink); }

@media (max-width: 1080px) {
  .post-layout { grid-template-columns: minmax(0, var(--post-measure)); justify-content: center; }
  .post-toc { display: none; }
}
@media (max-width: 760px) {
  .post-layout { padding: 24px 16px 64px; }
  .post-breadcrumb { margin-bottom: 22px; }
  .post-hero { margin-bottom: 30px; padding-bottom: 24px; }
  .post-title { font-size: clamp(30px, 8.5vw, 36px); }
  .post-dek { font-size: 16px; }
  .post-body h2 { margin-top: 44px; font-size: 22px; }
  .post-body h2::before { display: none; }
  .post-cards, .post-cards.is-three, .post-compare, .post-catalog ul { grid-template-columns: 1fr; }
  .post-compare > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .post-cta { padding: 22px 20px; }
  .post-cta h2 { font-size: 21px; }
  .post-figure.is-wide { margin-inline: -16px; }
}
@media (max-width: 520px) {
  .post-meta { display: grid; gap: 4px; }
  .post-meta > * + *::before { display: none; }
  .post blockquote p { font-size: 17px; }
  .post-cta-actions a { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .post-faq details[open] p { animation: none; }
  .post-faq summary::before { transition: none; }
}

/* One panel on its own, for a repository or a product the post is about. */
.post-panel { margin: 24px 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.post-panel h3 { margin: 0 0 8px; font-size: 16px; }
.post-panel p { margin: 0 0 10px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.post-panel .post-card-index { display: block; margin: 0 0 8px; color: var(--accent); font: 600 11px/1 var(--post-mono); }
.post-panel .post-pills { margin-top: 4px; }
