/* ─────────────────────────────────────────────────────────────────────────────
   Articles: /blog/, /guides/ and /ai-blog/, their category archives and the
   article page itself. Loaded after pages.css. Everything here is built from
   the tokens in styles.css, so tints are rgb(var(--ink) / a) rather than raw
   white: these pages are dark-only today but the tokens are the contract.
   ───────────────────────────────────────────────────────────────────────── */

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ───── Article head ───── */
.art-head { padding: 104px 0 0; text-align: center; }
.art-head .crumbs { margin-bottom: 24px; }
.art-head h1 {
  max-width: 940px; margin: 0 auto;
  font-size: clamp(32px, 4.4vw, 54px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 560;
}
.art-lead {
  max-width: 700px; margin: 24px auto 0;
  font-size: 19px; line-height: 1.65; color: var(--fg-2); text-wrap: pretty;
}
.art-by {
  display: flex; justify-content: center; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin-top: 32px; font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em; color: var(--fg-3);
}
/* the "·" glyph that used to sit between byline parts is gone (DE-AI V22a); the flex gap carries the
   spacing, and longer runs can use the shared .meta-gap utility */
.art-who { color: var(--fg); }

.art-cover { margin: 56px auto 0; max-width: 960px; }

/* ───── Article body and its rail ───── */
.art-wrap {
  display: grid; grid-template-columns: minmax(0, 236px) minmax(0, 752px);
  gap: 72px; justify-content: center; align-items: start; padding-top: 72px;
}
/* A post with no contents list gets the column to itself, centred. */
.art-wrap.is-solo, .art-foot.is-solo { grid-template-columns: minmax(0, 752px); gap: 0; }
.art-foot.is-solo > * { grid-column: 1; }
.art-side { position: sticky; top: 92px; }
.art-toc { border-left: 1px solid var(--line); padding-left: 20px; max-height: calc(100vh - 140px); overflow-y: auto; }
.art-toc .eyebrow { margin-bottom: 14px; }
.art-toc ol { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.art-toc a { display: block; font-size: 13.5px; line-height: 1.45; color: var(--fg-3); transition: color .2s; }
.art-toc a:hover, .art-toc a.is-on { color: var(--mint); }

.art-body { color: rgb(var(--ink) / .80); font-size: 17.5px; line-height: 1.78; overflow-wrap: break-word; }
/* Bare URLs used as their own link text, and long inline code, are both single unbreakable
   words wider than a phone. They break; only a <pre> is allowed to scroll. */
.art-body a, .art-body :not(pre) > code { overflow-wrap: anywhere; }
/* Fifteen years of pasted markup: images with hard width attributes, inline <img> outside any
   figure, wide embeds. Nothing in an article body may be wider than the column it sits in. */
.art-body img, .art-body video, .art-body iframe, .art-body svg, .art-body canvas { max-width: 100%; height: auto; }
.art-body > * { max-width: 100%; }
.art-body > :first-child { margin-top: 0; }
.art-body p { margin: 0 0 26px; text-wrap: pretty; }
.art-body h2 {
  margin: 68px 0 20px; font-size: clamp(25px, 2.6vw, 31px); line-height: 1.18;
  letter-spacing: -0.03em; font-weight: 560; color: var(--fg-0); scroll-margin-top: 92px;
}
.art-body h3 {
  margin: 44px 0 14px; font-size: 20.5px; line-height: 1.3;
  letter-spacing: -0.02em; font-weight: 600; color: var(--fg); scroll-margin-top: 92px;
}
.art-body h4 { margin: 32px 0 12px; font-size: 17.5px; font-weight: 600; color: var(--fg); }
.art-body a { color: var(--mint); text-decoration: underline; text-decoration-color: rgb(19 233 137 / .35); text-underline-offset: 3px; transition: color .2s, text-decoration-color .2s; }
.art-body a:hover { color: var(--mint-hi); text-decoration-color: currentColor; }
.art-body strong, .art-body b { color: var(--fg); font-weight: 600; }
.art-body ul, .art-body ol { margin: 0 0 26px; padding-left: 24px; }
.art-body li { margin-bottom: 10px; }
.art-body li::marker { color: var(--fg-3); }
.art-body li > ul, .art-body li > ol { margin: 10px 0 0; }

.art-body blockquote {
  margin: 36px 0; padding: 4px 0 4px 26px; border-left: 2px solid var(--accent);
  font-size: 19px; line-height: 1.6; color: var(--fg);
}
.art-body blockquote p:last-child { margin-bottom: 0; }
.art-body blockquote cite { display: block; margin-top: 14px; font-size: 14.5px; font-style: normal; color: var(--fg-3); }

.art-rule { margin: 56px 0; border: 0; border-top: 1px solid var(--line); }

/* ───── Figures ───── */
.art-fig { margin: 44px 0; }
.art-fig img, .art-fig video {
  display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line);
  background: var(--bg-1);
}
.art-fig figcaption, .art-caption {
  margin-top: 14px; font-size: 14px; line-height: 1.55; color: var(--fg-3); text-align: center;
}
.art-banner { display: block; }

/* ───── Code ───── */
.art-body code { font-family: var(--mono); font-size: .9em; }
.art-body :not(pre) > code {
  padding: 2px 6px; border-radius: 6px; background: rgb(var(--ink) / .07);
  border: 1px solid var(--line); color: var(--mint-hi);
}
.art-code {
  position: relative; margin: 32px 0; padding: 22px 24px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--term);
  font-size: 13.5px; line-height: 1.65; color: var(--fg-2);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.art-code code { display: block; white-space: pre; color: inherit; font-size: inherit; }
/* Syntax highlighting. Tokens are baked in at build time by tools/wp/lib/highlight.mjs, so
   there is no highlighter to download and no flash of unstyled code. Colours come from the
   site palette rather than a vendor theme. */
.hljs-comment, .hljs-quote { color: var(--fg-3); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-section, .hljs-doctag, .hljs-name { color: var(--mint); }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-meta-string { color: var(--mint-hi); }
.hljs-number, .hljs-symbol, .hljs-bullet, .hljs-link { color: var(--cyan); }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-selector-attr { color: var(--fg); }
.hljs-title, .hljs-class .hljs-title, .hljs-type, .hljs-built_in { color: var(--amber); }
.hljs-meta, .hljs-punctuation { color: var(--fg-3); }
.hljs-deletion { color: var(--red); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 600; }

.art-code[data-lang]::before {
  content: attr(data-lang); position: absolute; top: 10px; right: 16px;
  font-family: var(--mono); font-size: 12px; color: var(--fg-3);
}

/* ───── Tables ───── */
.art-table { margin: 36px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.art-table table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.55; }
.art-table th, .art-table td { padding: 13px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.art-table tr:last-child td { border-bottom: 0; }
.art-table th, .art-table tbody tr:first-child td strong:only-child { color: var(--fg); font-weight: 600; }
.art-table thead th, .art-table tbody tr:first-child:has(td strong:only-child) { background: rgb(var(--ink) / .04); }
.art-table p { margin: 0; }

/* ───── Embeds and formulas ───── */
.art-embed { position: relative; margin: 40px 0; padding-top: 56.25%; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-1); }
.art-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.art-math {
  margin: 28px 0; padding: 18px 22px; border-radius: 12px; border: 1px solid var(--line);
  background: rgb(var(--ink) / .03); font-family: var(--mono); font-size: 14.5px; text-align: center; color: var(--fg);
}

/* ───── In-article CTA and expert note ───── */
.art-cta, .art-expert {
  margin: 44px 0; padding: 32px; border-radius: 18px; border: 1px solid rgba(19,233,137,.26);
  background: radial-gradient(90% 130% at 0% 0%, rgba(19,233,137,.09), transparent 62%), linear-gradient(180deg, var(--card-a), var(--card-b));
}
.art-cta { text-align: center; }
.art-cta b { display: block; font-size: 21px; line-height: 1.25; letter-spacing: -0.02em; color: var(--fg-0); font-weight: 560; }
.art-cta p { margin: 12px 0 24px; font-size: 16px; color: var(--fg-2); }
.art-cta .btn { height: 44px; padding: 0 22px; }
.art-expert .eyebrow { margin-bottom: 18px; }
.art-expert-who { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.art-expert-who img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-2); }
.art-expert-name b { display: block; font-size: 16px; color: var(--fg-0); }
.art-expert-role { display: block; font-size: 13.5px; line-height: 1.4; color: var(--fg-3); }
.art-expert p { margin: 0; font-size: 16px; color: var(--fg-2); }

/* ───── FAQ ───── */
.art-faq { margin: 56px 0 0; }
.art-faq h2 { margin-bottom: 8px; }
.art-faq details { border-bottom: 1px solid var(--line); }
.art-faq summary {
  list-style: none; cursor: pointer; padding: 20px 36px 20px 0; position: relative;
  font-size: 17px; font-weight: 500; color: var(--fg); transition: color .2s;
}
.art-faq summary::-webkit-details-marker { display: none; }
.art-faq summary:hover { color: var(--mint); }
.art-faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-70%) rotate(45deg); transition: transform .25s var(--ease);
}
.art-faq details[open] summary::after { transform: translateY(-25%) rotate(-135deg); }
.art-faq-a { padding: 0 0 22px; color: var(--fg-2); font-size: 16px; line-height: 1.65; }
.art-faq-a p:last-child { margin-bottom: 0; }

/* ───── Foot: tags and related ───── */
.art-foot {
  display: grid; grid-template-columns: minmax(0, 236px) minmax(0, 752px);
  gap: 72px; justify-content: center; padding-top: 72px;
}
.art-foot > * { grid-column: 2; }
.art-tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding-top: 32px; border-top: 1px solid var(--line); }
.art-tags li {
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line);
  font-family: var(--mono); font-size: 12.5px; color: var(--fg-3);
}
.art-related { margin-top: 64px; }
.art-related h2 { font-size: 24px; letter-spacing: -0.025em; font-weight: 560; margin-bottom: 26px; }

/* ───── Article cards ───── */
.art-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.art-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.art-card-shot { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-1); border-bottom: 1px solid var(--line); }
.art-card-shot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.art-card:hover .art-card-shot img { transform: scale(1.03); }
.art-card-body { display: flex; flex-direction: column; gap: 10px; padding: 24px; flex: 1; }
.art-card-kicker { font-family: var(--mono); font-size: 12.5px; color: var(--accent); }
.art-card b { font-size: 17px; line-height: 1.35; letter-spacing: -0.015em; font-weight: 560; color: var(--fg); transition: color .2s; }
.art-card:hover b { color: var(--fg-0); }
/* Two lines of the standfirst: enough to tell one post from another, never enough to
   make the cards different heights. */
.art-card-lead {
  font-size: 14.5px; line-height: 1.55; color: var(--fg-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.art-card-meta {
  display: flex; align-items: center; gap: 9px; margin-top: auto; padding-top: 4px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; color: var(--fg-3);
}
.art-card-meta i { width: 3px; height: 3px; border-radius: 50%; background: rgb(var(--ink) / .25); }

/* ───── Lead story: the newest post, at the width it deserves ───── */
.art-feature {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  padding: 0; overflow: hidden; margin-bottom: 22px; align-items: stretch;
  border-color: rgba(19,233,137,.22);
  background: radial-gradient(70% 120% at 100% 0%, rgba(19,233,137,.07), transparent 60%), linear-gradient(180deg, var(--card-a), var(--card-b));
}
.art-feature:hover { border-color: rgba(19,233,137,.5); }
.art-feature.is-text { grid-template-columns: minmax(0, 1fr); }
.art-feature.is-text .art-feature-body { padding: 48px; max-width: 760px; }
/* These covers are mostly typography, so the image column is wide enough that filling the row
   costs a few percent of the edges rather than half the headline. aspect-ratio cannot do the job
   here: on a stretched grid item it sets the width from the row height and overflows the card. */
.art-feature .art-card-shot { aspect-ratio: auto; height: 100%; min-height: 340px; border-bottom: 0; border-right: 1px solid var(--line); }
.art-feature:hover .art-card-shot img { transform: scale(1.02); }
.art-feature-body { display: flex; flex-direction: column; gap: 15px; padding: 40px; justify-content: center; }
.art-feature-body b {
  font-size: clamp(22px, 2.1vw, 29px); line-height: 1.2; letter-spacing: -0.03em;
  font-weight: 560; color: var(--fg-0); text-wrap: balance;
}
.art-feature-text {
  font-size: 16px; line-height: 1.6; color: var(--fg-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
/* .art-card-meta pushes itself to the bottom of a grid card; here the block is centred instead. */
.art-feature-body .art-card-meta { margin-top: 0; }
.art-feature .link { margin-top: 4px; }
.art-feature:hover .link::after { transform: translateX(3px); }

/* ───── Archive ───── */
.art-archive-hero { position: relative; padding: 104px 0 0; text-align: center; overflow: hidden; }
/* The same wash the homepage's closing CTA uses, so the archive is not a title on black. */
.art-hero-glow {
  position: absolute; left: 50%; top: -420px; width: 1100px; height: 620px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(19,233,137,.26), rgba(34,211,238,.06) 55%, transparent 72%);
  filter: blur(26px); pointer-events: none;
}
.art-archive-hero .container { position: relative; }
.art-archive-hero h1 { font-size: clamp(38px, 5vw, 62px); line-height: 1.05; letter-spacing: -0.04em; font-weight: 560; }
.art-archive-hero .lead { max-width: 640px; margin-left: auto; margin-right: auto; }
.art-archive-hero .crumbs { margin-bottom: 24px; }
.art-count {
  margin-top: 18px; font-family: var(--mono); font-size: 12.5px; color: var(--fg-3);
}
.art-archive { padding-top: 72px; }
.art-filters { margin-bottom: 44px; }

/* The long tail of topics, folded away: 53 chips of equal weight buried the articles. */
.art-topics { margin-top: 14px; text-align: center; }
.art-topics summary {
  list-style: none; display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-family: var(--mono); font-size: 12.5px;
  color: var(--fg-3); transition: color .2s;
}
.art-topics summary::-webkit-details-marker { display: none; }
.art-topics summary:hover { color: var(--mint); }
.art-topics summary::after {
  content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .25s var(--ease);
}
.art-topics[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.art-topics .art-chips { margin-top: 18px; }
.art-search { display: block; max-width: 460px; margin: 0 auto 28px; }
.art-search input {
  width: 100%; height: 48px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--bg-1); color: var(--fg);
  font: inherit; font-size: 15px; transition: border-color .2s;
}
.art-search input::placeholder { color: var(--fg-3); }
.art-search input:focus { outline: none; border-color: rgba(19,233,137,.55); }
.art-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; }
.art-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 13.5px; color: var(--fg-2); transition: border-color .2s, color .2s, background .2s;
}
.art-chip i { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--fg-3); }
.art-chip:hover { color: var(--fg); border-color: var(--line-2); }
.art-chip.is-on { background: rgba(19,233,137,.12); border-color: rgba(19,233,137,.4); color: var(--mint); }
.art-chip.is-on i { color: var(--mint); }
.art-grid { gap: 22px; }
.art-grid .art-card[hidden] { display: none; }
.art-empty { text-align: center; color: var(--fg-3); padding: 56px 0; }

/* ───── Responsive ───── */
@media (max-width: 1120px) {
  .art-wrap, .art-foot { grid-template-columns: minmax(0, 752px); gap: 0; }
  .art-foot > * { grid-column: 1; }
  .art-side { display: none; }
}
@media (max-width: 960px) {
  .art-head, .art-archive-hero { padding-top: 84px; }
  .art-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .art-feature { grid-template-columns: minmax(0, 1fr); }
  .art-feature .art-card-shot { aspect-ratio: 16 / 9; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .art-feature-body { padding: 30px; }
  .art-cover { margin-top: 44px; }
  .art-wrap, .art-foot, .art-archive { padding-top: 56px; }
}
@media (max-width: 560px) {
  .art-head, .art-archive-hero { padding-top: 64px; }
  .art-feature-body { padding: 24px; gap: 12px; }
  .art-hero-glow { width: 760px; top: -460px; }
  /* Twelve wrapped chips is seven rows and 300px of a phone screen before the first article.
     One scrollable row, bled to the screen edges so it reads as a rail rather than a cut-off list. */
  .art-filters > .art-chips {
    flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none;
    margin-inline: -20px; padding-inline: 20px; scroll-padding-inline: 20px;
  }
  .art-filters > .art-chips::-webkit-scrollbar { display: none; }
  .art-filters > .art-chips > li { flex: 0 0 auto; }
  .art-body { font-size: 16.5px; line-height: 1.72; }
  .art-body h2 { margin-top: 48px; }
  .art-cards { grid-template-columns: minmax(0, 1fr); }
  .art-code { padding: 18px 16px; font-size: 12.5px; border-radius: 12px; }
  .art-cta, .art-expert { padding: 26px 22px; }
  .art-fig { margin: 32px 0; }
  .art-by { gap: 8px 12px; font-size: 12px; }
}

/* ───── Pagination ───── */
.art-pager { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 64px; }
.art-page {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--line-2); font-size: 14.5px; color: var(--fg); transition: border-color .2s, background .2s;
}
.art-page:hover { background: rgb(var(--ink) / .06); border-color: rgb(var(--ink) / .26); }
.art-page-prev::before { content: "‹"; font-size: 17px; line-height: 1; }
.art-page-next::after { content: "›"; font-size: 17px; line-height: 1; }
.art-page-of { font-family: var(--mono); font-size: 12.5px; letter-spacing: .08em; color: var(--fg-3); }

/* Light skin: small green text uses --mint (≥4.5:1 on the light surfaces); --accent stays for dots, fills,
   borders and large numbers. Light only, so the dark skin is unchanged. */
:root[data-theme="light"] .art-card-kicker { color: var(--mint); }
