/*
 * Article and page templates: the post hero, the reading layout with its table
 * of contents, the .prose type for post and page bodies, and the sections that
 * close a post (tags and sharing, author, products, more to read, comments).
 *
 * This file also loads on /blog/, so every rule starts from an article class
 * (.article-*, .prose, .toc, .author-card, .comments). No bare element is styled.
 */

/* ------------------------------------------------------------ post hero */
.article-hero { padding-top: var(--s-4); }

.article-hero__panel {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(300px, 36vw, 440px);
  border-radius: 26px;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  /* a hairline keeps a dark banner readable against a dark page */
  outline: 1px solid rgb(255 255 255 / 0.1);
  outline-offset: -1px;
}

.article-hero__media { position: absolute; inset: 0; z-index: 0; }
.article-hero__media .dp-banner-media { position: absolute; inset: 0; }
.article-hero__media .dp-banner-icon {
  top: clamp(1.25rem, 3vw, 2.5rem);
  right: clamp(1.25rem, 4vw, 3.5rem);
  transform: none;
}
.article-hero__media .dp-banner-icon svg { width: clamp(64px, 11vw, 168px); }

/* Keeps white text readable on every gradient and on any photo */
.article-hero__panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgb(8 14 20 / 0.82) 0%, rgb(8 14 20 / 0.6) 45%, rgb(8 14 20 / 0.26) 75%, rgb(8 14 20 / 0) 100%);
  pointer-events: none;
}
.article-hero__panel.has-image::after {
  background: linear-gradient(to top, rgb(8 14 20 / 0.9) 0%, rgb(8 14 20 / 0.72) 50%, rgb(8 14 20 / 0.46) 80%, rgb(8 14 20 / 0.24) 100%);
}

.article-hero__body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-4);
  width: 100%;
  padding: clamp(4rem, 8vw, 6rem) clamp(1.25rem, 0.5rem + 3vw, 3rem) clamp(1.25rem, 0.5rem + 3vw, 3rem);
}

/* The category chip turns into a frosted label on the banner */
.article-hero .article-hero__chip a.cat-chip,
.article-hero .article-hero__chip span.cat-chip {
  background: rgb(8 14 20 / 0.42);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.38);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.article-hero .article-hero__chip a.cat-chip:hover { background: rgb(8 14 20 / 0.62); color: #fff; }

/* Category chips stay small to look at but get a 44px touch target */
.article-hero .cat-chip,
.article-more .cat-chip { position: relative; }
.article-hero .cat-chip::after,
.article-more .cat-chip::after { content: ""; position: absolute; inset: -10px -6px; }

.article-hero__title {
  max-width: 30em;
  color: #fff;
  font-size: clamp(2rem, 1.2rem + 3vw, 3.25rem);
  font-weight: 760;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-shadow: 0 1px 2px rgb(8 14 20 / 0.35), 0 4px 28px rgb(8 14 20 / 0.35);
}

.article-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-6);
  font-size: var(--fs-sm);
}
.article-hero__stat { font-weight: 600; opacity: 0.92; }

.article-byline { display: flex; align-items: center; gap: var(--s-3); }
.article-byline__avatar img {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: rgb(255 255 255 / 0.2);
  box-shadow: 0 0 0 2px rgb(255 255 255 / 0.85);
}
.article-byline__text { display: flex; flex-direction: column; line-height: 1.25; }
.article-byline__name { font-weight: 700; }
.article-byline__role { font-size: var(--fs-xs); opacity: 0.88; }

/* ------------------------------------------------------------ reading layout */
.article-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding-block: clamp(2rem, 1.2rem + 3vw, 3.5rem) clamp(2.5rem, 1.5rem + 3vw, 4rem);
}
.article-main {
  width: 100%;
  min-width: 0;
  max-width: var(--measure);
  margin-inline: auto;
}
.article-aside { display: none; }

@media (min-width: 1080px) {
  .article-body { grid-template-columns: minmax(0, var(--measure)); justify-content: center; }
  .article-body.has-toc {
    grid-template-columns: minmax(0, var(--measure)) 14.5rem;
    column-gap: clamp(2rem, 4vw, 3.5rem);
  }
  .article-main { grid-column: 1; grid-row: 1; margin-inline: 0; }
  .article-aside {
    display: block;
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
    max-height: calc(100vh - var(--header-h) - 3rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding-block: 0.25rem;
  }
  .admin-bar .article-aside {
    top: calc(var(--header-h) + 32px + 1.5rem);
    max-height: calc(100vh - var(--header-h) - 32px - 3rem);
  }
  .toc-m { display: none; }
}

/* ------------------------------------------------------------ table of contents */
.toc__title {
  margin: 0 0 var(--s-3);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.toc__list {
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}
.toc__item a {
  display: block;
  margin-left: -1px;
  padding: 0.35rem 0.5rem 0.35rem 0.95rem;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.4;
  text-decoration: none;
}
.toc__item a:hover { color: var(--ink); }
.toc__item a.is-active { border-left-color: var(--teal); color: var(--ink); }
.toc__item--sub a { padding-left: 1.8rem; }

/* On narrow screens the contents collapse into one disclosure above the article */
.toc-m {
  margin: 0 0 var(--s-6);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}
.toc-m summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  min-height: 48px;
  padding: 0 var(--s-4);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.toc-m summary::-webkit-details-marker { display: none; }
.toc-m summary::after {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  margin-top: -0.2rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.toc-m[open] summary { border-bottom: 1px solid var(--line); }
.toc-m[open] summary::after { margin-top: 0.2rem; transform: rotate(-135deg); }
.toc-m__list {
  max-height: 60vh;
  margin: 0;
  padding: var(--s-2) 0;
  overflow-y: auto;
}
.toc-m__item a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s-4);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  line-height: 1.35;
  text-decoration: none;
}
.toc-m__item a:hover { color: var(--teal); }
.toc-m__item--sub a { padding-left: var(--s-6); color: var(--muted); }

.article-lede {
  margin: 0 0 var(--s-6);
  color: var(--ink-2);
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.4375rem);
  line-height: 1.5;
  text-wrap: pretty;
}

/* ------------------------------------------------------------ prose: type */
.prose {
  --syn-comment: #8497a8;
  --syn-punct: #a8b6c2;
  --syn-keyword: #c0a6ff;
  --syn-string: #8fdcae;
  --syn-number: #f0b43c;
  --syn-func: #9db3ff;
  --syn-type: #6fcfc8;
  --syn-tag: #ff95bd;
  --syn-attr: #ffad7a;
  --code-bar: 2.75rem;

  display: flow-root;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.1875rem;
  line-height: 1.7;
  font-optical-sizing: auto;
  overflow-wrap: break-word;
}
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }

.prose p { margin: 0 0 1.25em; }
.prose strong, .prose b { font-weight: 650; }

.prose a {
  color: var(--teal);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.prose a:hover { color: var(--teal-hi); text-decoration-thickness: 2px; }

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  font-family: var(--font-sans);
  scroll-margin-top: 0.25rem;
}
.admin-bar .prose :is(h1, h2, h3, h4) { scroll-margin-top: calc(32px + 0.25rem); }
.prose h1, .prose h2 {
  margin: 3rem 0 1rem;
  font-size: 1.75rem;
  font-weight: 740;
  line-height: 1.18;
  letter-spacing: -0.022em;
}
.prose h3 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.016em;
}
.prose h4 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
}
.prose h5, .prose h6 {
  margin: 1.5rem 0 0.4rem;
  color: var(--ink-2);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}
.prose :is(h1, h2, h3, h4) + :is(h3, h4, h5, h6) { margin-top: 0.75rem; }
.prose :is(h2, h3, h4) code { font-size: 0.8em; }

.prose ul, .prose ol,
.prose ul[class], .prose ol[class] {
  margin: 0 0 1.25em;
  padding-left: 1.5rem;
}
.prose ul, .prose ul[class] { list-style: disc; }
.prose ol, .prose ol[class] { list-style: decimal; }
.prose ul ul, .prose ul[class] ul { list-style: circle; }
.prose li { margin: 0.4em 0; padding-left: 0.2em; }
.prose li::marker { color: var(--muted); }
.prose li > ul, .prose li > ol { margin: 0.4em 0 0; }
.prose li > p { margin: 0 0 0.6em; }
.prose li > p:last-child { margin-bottom: 0; }

.prose dl { margin: 0 0 1.25em; }
.prose dt { font-family: var(--font-sans); font-weight: 700; }
.prose dd { margin: 0.2em 0 0.9em 1.25rem; }

.prose blockquote {
  margin: 1.75rem 0;
  padding: 0.15rem 0 0.15rem 1.25rem;
  border-left: 3px solid var(--line-strong);
  color: var(--ink-2);
  font-style: italic;
}
.prose blockquote > :last-child { margin-bottom: 0; }
.prose blockquote cite { display: block; font-family: var(--font-sans); font-size: var(--fs-sm); font-style: normal; color: var(--muted); }
.prose blockquote p + cite { margin-top: -0.9rem; }

/* Callouts: a left rule, a tint and a label, in the colour of what they say */
.prose blockquote:is(.note, .tip, .warning, .danger) {
  --callout: var(--teal);
  --callout-bg: var(--teal-tint);
  --callout-ink: var(--teal);
  padding: 1rem 1.25rem 1.1rem;
  border-left: 4px solid var(--callout);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--callout-bg);
  color: var(--ink);
  font-size: 1.0625rem;
  font-style: normal;
  line-height: 1.6;
}
.prose blockquote.tip { --callout: var(--st-pub-dot); --callout-bg: var(--st-pub-bg); --callout-ink: var(--st-pub-fg); }
.prose blockquote.warning { --callout: var(--st-rev-dot); --callout-bg: var(--st-rev-bg); --callout-ink: var(--st-rev-fg); }
.prose blockquote.danger { --callout: var(--c-oss); --callout-bg: var(--c-oss-tint); --callout-ink: var(--c-oss); }
.prose blockquote:is(.note, .tip, .warning, .danger)::before {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--callout-ink);
  font: 700 0.9375rem/1.3 var(--font-sans);
}
.prose blockquote.note::before { content: "Note"; }
.prose blockquote.tip::before { content: "Tip"; }
.prose blockquote.warning::before { content: "Warning"; }
.prose blockquote.danger::before { content: "Danger"; }

/* Short centred rule */
.prose hr,
.prose hr.wp-block-separator,
.prose hr.wp-block-separator:not(.is-style-wide):not(.is-style-dots) {
  width: 3.5rem;
  max-width: none;
  height: 0;
  margin: 3rem auto;
  border: 0;
  border-top: 2px solid var(--line-strong);
  background: none;
  opacity: 1;
}

.prose mark { padding: 0 0.15em; border-radius: 3px; background: var(--saffron-tint); color: var(--ink); }
.prose abbr[title] { text-decoration: underline dotted; text-underline-offset: 0.2em; cursor: help; }
.prose sub, .prose sup { font-size: 0.75em; line-height: 0; }
.prose small { font-size: 0.85em; }
.prose del { color: var(--muted); }
.prose ins { text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

.prose kbd {
  display: inline-block;
  padding: 0.05em 0.45em 0.02em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: var(--r-xs);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.8em;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}

/* ------------------------------------------------------------ prose: code */
.prose :not(pre) > code {
  padding: 0.12em 0.38em;
  border-radius: var(--r-xs);
  background: var(--inline-code-bg);
  color: var(--inline-code-ink);
  font-family: var(--font-mono);
  font-size: 0.86em;
  font-weight: 500;
  overflow-wrap: break-word;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.prose a code { color: inherit; }

.prose pre,
.prose pre[class*="language-"] {
  position: relative;
  margin: 1.75rem 0;
  padding: var(--code-bar) 0 0;
  overflow: hidden;
  border: 1px solid var(--code-line);
  border-radius: 12px;
  background-color: var(--code-bg);
  background-image: linear-gradient(to bottom, rgb(255 255 255 / 0.04) var(--code-bar), transparent var(--code-bar));
  color: var(--code-ink);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.65;
  text-align: left;
  text-shadow: none;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  hyphens: none;
  tab-size: 2;
}
/* Hairline under the bar that carries the language label and the copy button */
.prose pre::after {
  content: "";
  position: absolute;
  top: var(--code-bar);
  right: 0;
  left: 0;
  height: 1px;
  background: var(--code-line);
  pointer-events: none;
}
.prose pre[data-language]::before {
  content: attr(data-language);
  position: absolute;
  top: 0;
  left: 1.25rem;
  display: flex;
  align-items: center;
  height: var(--code-bar);
  color: var(--syn-comment);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
}

/* A pre without a code child scrolls as a whole */
.prose pre:not(:has(> code)) { padding: var(--code-bar) 1.25rem 1.1rem; overflow-x: auto; }

/* The code scrolls sideways on its own; the bar stays put */
.prose pre > code,
.prose pre code[class*="language-"] {
  display: block;
  margin: 0;
  padding: 1rem 1.25rem 1.1rem;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-shadow: none;
  white-space: pre;
  tab-size: 2;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--code-line) transparent;
}

.prose pre > code:focus-visible { outline: 2px solid var(--teal); outline-offset: -3px; border-radius: 0 0 11px 11px; }

.prose pre .code-copy {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: var(--code-bar);
  padding: 0 1.1rem;
  border: 0;
  border-radius: 0 11px 0 0;
  background: transparent;
  color: var(--syn-comment);
  font: 600 0.8125rem/1 var(--font-sans);
  cursor: pointer;
}
.prose pre .code-copy:hover { background: rgb(255 255 255 / 0.07); color: var(--code-ink); }
.prose pre .code-copy.is-done { color: var(--syn-string); }
.prose pre .code-copy:focus-visible { outline: 2px solid var(--teal); outline-offset: -3px; border-radius: 0 11px 0 0; }
.prose pre .code-copy svg { width: 14px; height: 14px; }

/* Syntax colours for Prism, readable on the always-dark code background */
.prose .token.comment,
.prose .token.block-comment,
.prose .token.prolog,
.prose .token.doctype,
.prose .token.cdata { color: var(--syn-comment); font-style: italic; }
.prose .token.punctuation,
.prose .token.operator { color: var(--syn-punct); }
.prose .token.keyword,
.prose .token.atrule,
.prose .token.selector,
.prose .token.important { color: var(--syn-keyword); }
.prose .token.string,
.prose .token.char,
.prose .token.attr-value,
.prose .token.inserted { color: var(--syn-string); }
.prose .token.number,
.prose .token.boolean,
.prose .token.constant,
.prose .token.symbol { color: var(--syn-number); }
.prose .token.function,
.prose .token.function-name { color: var(--syn-func); }
.prose .token.class-name,
.prose .token.builtin,
.prose .token.namespace { color: var(--syn-type); }
.prose .token.tag,
.prose .token.regex,
.prose .token.deleted { color: var(--syn-tag); }
.prose .token.property,
.prose .token.attr-name,
.prose .token.entity,
.prose .token.url { color: var(--syn-attr); }
.prose .token.variable { color: var(--code-ink); }
.prose .token.bold,
.prose .token.important { font-weight: 700; }
.prose .token.italic { font-style: italic; }

/* SyntaxHighlighter Evolved: same frame and colours as the blocks above */
.prose .syntaxhighlighter {
  margin: 1.75rem 0 !important;
  padding: 1rem 1.25rem !important;
  border: 1px solid var(--code-line) !important;
  border-radius: 12px !important;
  background: var(--code-bg) !important;
  scrollbar-width: thin;
}
.prose .syntaxhighlighter table { width: auto !important; min-width: 100% !important; }
.prose .syntaxhighlighter code,
.prose .syntaxhighlighter .line,
.prose .syntaxhighlighter .gutter .line {
  font-family: var(--font-mono) !important;
  font-size: 0.875rem !important;
  line-height: 1.65 !important;
}
.prose .syntaxhighlighter .line.alt1,
.prose .syntaxhighlighter .line.alt2 { background: transparent !important; }
.prose .syntaxhighlighter .line.highlighted.alt1,
.prose .syntaxhighlighter .line.highlighted.alt2 { background: rgb(255 255 255 / 0.07) !important; }
.prose .syntaxhighlighter .gutter,
.prose .syntaxhighlighter .gutter .line { color: var(--syn-comment) !important; }
.prose .syntaxhighlighter .gutter .line { border-right: 1px solid var(--code-line) !important; }
.prose .syntaxhighlighter .gutter .line.highlighted { background: transparent !important; color: var(--code-ink) !important; }
.prose .syntaxhighlighter .plain,
.prose .syntaxhighlighter .plain a { color: var(--code-ink) !important; }
.prose .syntaxhighlighter .comments,
.prose .syntaxhighlighter .comments a,
.prose .syntaxhighlighter .preprocessor,
.prose .syntaxhighlighter .color1,
.prose .syntaxhighlighter .color1 a { color: var(--syn-comment) !important; }
.prose .syntaxhighlighter .string,
.prose .syntaxhighlighter .string a { color: var(--syn-string) !important; }
.prose .syntaxhighlighter .keyword,
.prose .syntaxhighlighter .script { color: var(--syn-keyword) !important; font-weight: 500 !important; background: none !important; }
.prose .syntaxhighlighter .variable { color: var(--syn-attr) !important; }
.prose .syntaxhighlighter .value,
.prose .syntaxhighlighter .constants { color: var(--syn-number) !important; }
.prose .syntaxhighlighter .functions,
.prose .syntaxhighlighter .color2,
.prose .syntaxhighlighter .color2 a { color: var(--syn-func) !important; }
.prose .syntaxhighlighter .color3,
.prose .syntaxhighlighter .color3 a { color: var(--syn-tag) !important; }
.prose .syntaxhighlighter .toolbar { display: none !important; }

/* ------------------------------------------------------------ prose: media and tables */
.prose img { max-width: 100%; height: auto; border-radius: var(--r-md); }
.prose p > img:only-child:not([class*="align"]) { display: block; margin: 1.75rem auto; }
.prose figure { margin: 2rem 0; }
.prose figure img { display: block; margin-inline: auto; }
.prose figcaption,
.prose .wp-element-caption {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  line-height: 1.45;
  text-align: center;
}
.prose iframe, .prose video { max-width: 100%; border: 0; border-radius: var(--r-md); }
.prose input, .prose select, .prose textarea, .prose button { font-family: var(--font-sans); font-size: 1rem; max-width: 100%; }
.prose iframe[src*="youtube"], .prose iframe[src*="youtu.be"], .prose iframe[src*="vimeo"] { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.prose svg { max-width: 100%; height: auto; }

.prose .aligncenter { display: block; margin-inline: auto; }
.prose .alignleft, .prose .alignright { max-width: 100%; margin-block: 0.5rem 1.25rem; }
@media (min-width: 640px) {
  .prose .alignleft { float: left; max-width: 50%; margin-right: 1.5rem; }
  .prose .alignright { float: right; max-width: 50%; margin-left: 1.5rem; }
}
@media (min-width: 1080px) {
  .prose .alignwide,
  .prose .alignfull { width: auto; max-width: none; margin-inline: -2rem; }
}

.prose .table-scroll {
  margin: 1.75rem 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.prose figure.wp-block-table { margin: 1.75rem 0; }
.prose figure.wp-block-table .table-scroll { margin: 0; }
.prose table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.prose table th,
.prose table td {
  min-width: 6.5rem;
  padding: 0.7rem 0.95rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.prose table thead { border: 0; }
.prose table thead th {
  border-bottom-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 700;
}
.prose table tbody th { font-weight: 650; }
.prose table tbody tr:last-child > td,
.prose table tbody tr:last-child > th { border-bottom: 0; }
.prose table :not(pre) > code { font-size: 0.85em; }

.prose details {
  margin: 1.5rem 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}
.prose summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  min-height: 48px;
  padding: 0.5rem 1.1rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.prose summary::-webkit-details-marker { display: none; }
.prose summary::after {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: -0.2rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.prose details[open] > summary { border-bottom: 1px solid var(--line); }
.prose details[open] > summary::after { margin-top: 0.2rem; transform: rotate(-135deg); }
.prose details > :not(summary) { margin-inline: 1.1rem; }
.prose details > summary + * { margin-top: 1rem; }
.prose details > :last-child { margin-bottom: 1.1rem; }

/* Mermaid diagrams (merpress): centred, scroll inside their own frame */
.prose .wp-block-merpress-mermaidjs {
  margin: 2rem 0;
  padding: 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: center;
}
.prose .mermaid svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }
/* Until the script has drawn the diagram, its source shows as quiet code */
.prose .mermaid:not([data-processed]) {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  text-align: left;
  white-space: pre;
  overflow-x: auto;
}
/* Mermaid draws dark lines for a light page; flip them for the dark theme */
:root[data-theme="dark"] .prose .mermaid[data-processed] svg { filter: invert(0.9) hue-rotate(180deg); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .prose .mermaid[data-processed] svg { filter: invert(0.9) hue-rotate(180deg); }
}

/* Older posts carry inline-styled boxes made for a light page; keep their text readable in dark */
.prose div[style*="background"][style*="#"] { color-scheme: light; color: CanvasText; }
.prose div[style*="background"][style*="#"] a { color: LinkText; }

/* ------------------------------------------------------------ end of the article */
.article-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4) var(--s-5);
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}
.article-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.article-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--fs-xs);
  font-weight: 650;
  text-decoration: none;
}
/* Keeps the touch target at 44px without making the chip tall */
.article-tag::after { content: ""; position: absolute; inset: -4px; }
.article-tag:hover { border-color: var(--teal); color: var(--teal); }

.article-share { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.article-share .btn { min-height: 44px; padding: 0.5rem 0.95rem; }
.article-edit { margin-top: var(--s-2); }

.author-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s-5);
  align-items: start;
  margin-top: var(--s-6);
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.author-card__avatar img {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}
.author-card__name {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 720;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.author-card__bio { margin: var(--s-2) 0 0; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.55; }
.author-card__links { display: flex; flex-wrap: wrap; gap: 0 var(--s-5); margin: var(--s-2) 0 0; }
.author-card__links .text-link { font-size: var(--fs-sm); }
@media (max-width: 480px) {
  .author-card { grid-template-columns: auto minmax(0, 1fr); gap: var(--s-3) var(--s-4); align-items: center; }
  .author-card__body { display: contents; }
  .author-card__avatar img { width: 52px; height: 52px; }
  .author-card__bio,
  .author-card__links { grid-column: 1 / -1; margin-top: 0; }
}

/* ------------------------------------------------------------ products and more to read */
.site-main > .article-more:last-child { padding-bottom: 0; }
.article-more .section-head { margin-bottom: var(--s-5); }
.article-more .section-head h2,
.article-more__title {
  font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem);
  font-weight: 760;
  letter-spacing: -0.022em;
  line-height: 1.12;
}
.article-more .section-head p { font-size: var(--fs-base); }
.article-more__title { margin-bottom: var(--s-5); }

.article-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
@media (min-width: 860px) {
  .article-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.article-nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); margin-bottom: var(--s-6); }
.article-nav__link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.article-nav__link:hover { border-color: var(--line-strong); color: var(--ink); }
.article-nav__label { color: var(--muted); font-size: var(--fs-xs); font-weight: 650; }
.article-nav__title { font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; text-wrap: balance; }
.article-nav__link:hover .article-nav__title { color: var(--teal); }
@media (min-width: 640px) {
  .article-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-nav__link--newer { grid-column: 2; align-items: flex-end; text-align: right; }
}

/* ------------------------------------------------------------ page header */
.article-head { padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem) var(--s-6); }
.article-head__title {
  font-size: var(--fs-xl);
  font-weight: 780;
  line-height: 1.06;
  letter-spacing: -0.03em;
}
.article-page-body { padding-bottom: clamp(2rem, 1rem + 3vw, 4rem); }
.article--page .prose { max-width: var(--measure); }
.page-links { margin-top: var(--s-5); font-weight: 650; }

/* ------------------------------------------------------------ comments */
.comments { max-width: var(--measure); margin-inline: auto; }
.comments__title,
.comments .comment-reply-title {
  margin: 0 0 var(--s-5);
  font-size: 1.5rem;
  font-weight: 740;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.comments .comment-reply-title small { margin-left: var(--s-3); font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0; }
.comments .comment-list,
.comments .comment-list .children { margin: 0; padding: 0; list-style: none; }
.comments .comment-list .children { margin-left: var(--s-4); padding-left: var(--s-4); border-left: 1px solid var(--line); }
.comments .comment-body { padding: var(--s-4) 0; border-bottom: 1px solid var(--line); }
.comments .comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem var(--s-3); font-size: var(--fs-sm); }
.comments .comment-author { display: flex; align-items: center; gap: var(--s-3); font-weight: 700; }
.comments .comment-author .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); }
.comments .comment-author .says {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.comments .comment-metadata { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.comments .comment-metadata a { color: inherit; text-decoration: none; }
.comments .comment-metadata a:hover { color: var(--teal); text-decoration: underline; }
.comments .comment-awaiting-moderation { color: var(--muted); font-size: var(--fs-sm); font-style: italic; }
.comments .comment-content { margin-top: var(--s-3); line-height: 1.6; overflow-wrap: break-word; }
.comments .comment-content p { margin: 0 0 0.8em; }
.comments .reply a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--teal);
  font-size: var(--fs-sm);
  font-weight: 650;
  text-decoration: none;
}
.comments .reply a:hover { text-decoration: underline; }
.comments__closed { margin-top: var(--s-5); color: var(--muted); }
.comments .comment-navigation { margin-top: var(--s-4); font-weight: 650; }
.comments .comment-navigation .nav-links { display: flex; justify-content: space-between; gap: var(--s-4); }

.comments .comment-respond { margin-top: var(--s-7); }
.comments > .comment-respond:first-child { margin-top: 0; }
.comments .comment-form { display: grid; gap: var(--s-4); }
.comments .comment-form p { margin: 0; }
.comments .comment-notes,
.comments .logged-in-as { color: var(--muted); font-size: var(--fs-sm); }
.comments .comment-form label { display: block; margin-bottom: 0.35rem; font-size: var(--fs-sm); font-weight: 650; }
.comments .comment-form .required { color: var(--c-oss); }
.comments .comment-form input[type="text"],
.comments .comment-form input[type="email"],
.comments .comment-form input[type="url"],
.comments .comment-form textarea {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
}
.comments .comment-form textarea { min-height: 9rem; resize: vertical; }
.comments .comment-form input:focus-visible,
.comments .comment-form textarea:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.comments .comment-form-cookies-consent { display: flex; align-items: flex-start; gap: 0.6rem; color: var(--muted); font-size: var(--fs-sm); }
.comments .comment-form-cookies-consent label { margin: 0; font-weight: 500; }
.comments .comment-form-cookies-consent input { width: 1.1rem; height: 1.1rem; margin-top: 0.2rem; accent-color: var(--teal); }
.comments .form-submit .btn { min-width: 10rem; }
