/* Page-level refinements for the journal index and articles. Loaded after aura-site.css. */

/* ============================================================
   Articles: one paper ground, one reading column, quiet end matter.
   (Older layers in blog/style.css, journal.css and page-quality.css set
   blue grounds, teal accents and dark-theme components; these rules
   bring them into the site's language.)
   ============================================================ */
body.editorial-site.journal-article main,
body.editorial-site.journal-article .shell { background: var(--ax-paper) !important; }

/* Header: breadcrumb kicker, title, standfirst, then date and reading time. */
body.editorial-site.journal-article .article .reform-article-breadcrumb { margin: 0 0 18px !important; }
body.editorial-site.journal-article .article .reform-article-breadcrumb a { color: var(--ax-signal) !important; }
body.editorial-site.journal-article .article h1 { margin: 0 0 22px !important; text-wrap: balance; }
body.editorial-site.journal-article .article > .lede { margin: 0 !important; text-wrap: pretty; }
body.editorial-site.journal-article .article .article-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  margin: 26px 0 0; padding: 0;
  font: 500 11px/1.6 'JetBrains Mono', ui-monospace, Menlo, monospace;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ax-faint) !important;
}
body.editorial-site.journal-article .article .article-meta :is(time, span) { color: var(--ax-faint) !important; white-space: nowrap; }
body.editorial-site.journal-article .article .article-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: #9a9ea6; }

/* "In this article": one tidy disclosure, no dead space after it. */
body.editorial-site.journal-article .article .quality-article-index { margin: 18px 0 0 !important; border-block: 1px solid var(--ax-rule) !important; }
body.editorial-site.journal-article .article .quality-article-index > summary {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding-block: 12px !important;
  font: 500 14px/1.4 Inter, Arial, sans-serif; color: var(--ax-ink); cursor: pointer; list-style: none;
}
body.editorial-site.journal-article .article .quality-article-index > summary::-webkit-details-marker { display: none; }
body.editorial-site.journal-article .article .quality-article-index > summary::before {
  content: ""; flex: none; width: 0; height: 0; border-block: 4px solid transparent; border-left: 6px solid var(--ax-signal);
  transition: transform .2s ease;
}
body.editorial-site.journal-article .article .quality-article-index[open] > summary::before { transform: rotate(90deg); }
body.editorial-site.journal-article .article .quality-article-index .journal-reading-map { padding: 0 0 12px !important; }
body.editorial-site.journal-article .article .journal-reading-map a { color: var(--ax-ink) !important; text-decoration: none !important; }
body.editorial-site.journal-article .article .journal-reading-map a > span { color: var(--ax-faint) !important; font: 500 11px/1.6 'JetBrains Mono', ui-monospace, monospace !important; letter-spacing: .06em; }
body.editorial-site.journal-article .article .article-body { margin-top: 40px !important; padding-top: 0 !important; border: 0 !important; }
body.editorial-site.journal-article .article .article-body > :first-child { margin-top: 0 !important; }

/* Body rhythm. */
body.editorial-site.journal-article .article .article-body > h2 { margin: 52px 0 14px !important; }
body.editorial-site.journal-article .article .article-body h3 { margin: 32px 0 10px; font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
body.editorial-site.journal-article .article .article-body :is(ul, ol) { padding-left: 1.3em; }
body.editorial-site.journal-article .article .article-body li + li { margin-top: 8px; }
body.editorial-site.journal-article .article .article-body li::marker { color: var(--ax-faint); }

/* Takeaways and closing notes: a ruled note with a mono label, not a tinted box. */
body.editorial-site.journal-article .article .takeaways {
  margin: 40px 0 !important; padding: 18px 0 20px !important;
  background: none !important; box-shadow: none !important; border: 0 !important; border-radius: 0 !important;
  border-top: 1px solid var(--ax-ink) !important; border-bottom: 1px solid var(--ax-rule) !important;
}
body.editorial-site.journal-article .article .takeaways > h2,
body.editorial-site.journal-article .article :is(.refs, .readmore, .related-reading) > h2 {
  margin: 0 0 14px !important; font: 500 11px/1.6 'JetBrains Mono', ui-monospace, Menlo, monospace !important;
  letter-spacing: .16em !important; text-transform: uppercase !important; color: var(--ax-faint) !important;
}
body.editorial-site.journal-article .article .takeaways > h2 { color: var(--ax-signal) !important; }
body.editorial-site.journal-article .article .takeaways ul { margin: 0; padding-left: 1.15em; }
body.editorial-site.journal-article .article .takeaways li { margin: 0; line-height: 1.65; }
body.editorial-site.journal-article .article .takeaways li + li { margin-top: 10px; }
body.editorial-site.journal-article .article .takeaways p { margin: 0; }
/* Opening takeaways sit under the contents rule; no second rule above them. */
body.editorial-site.journal-article .article .article-body > .takeaways:first-child { border-top: 0 !important; padding-top: 0 !important; }

/* Callouts: a signal rule at the margin. */
body.editorial-site.journal-article .article .article-body .callout {
  margin: 32px 0 !important; padding: 16px 20px !important;
  background: #ffffff !important; border: 1px solid var(--ax-rule) !important; border-left: 2px solid var(--ax-signal) !important;
  border-radius: 0 3px 3px 0 !important; color: #464c58 !important; line-height: 1.7;
}

/* Inline call to action: a printed panel with the site's ink button. */
body.editorial-site.journal-article .article .cta-inline {
  margin: 44px 0 !important; padding: 24px 26px !important;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px;
  background: #ffffff !important; border: 1px solid var(--ax-rule) !important; border-radius: 4px !important;
}
body.editorial-site.journal-article .article .cta-inline p { flex: 1 1 320px; margin: 0; max-width: 58ch; font-size: 15.5px; line-height: 1.7; }
body.editorial-site.journal-article .article .cta-inline b { color: var(--ax-ink); font-weight: 600; }
body.editorial-site.journal-article .article .cta-inline > a {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 11px 18px !important;
  background: var(--ax-ink) !important; color: #fff !important; border-radius: 3px !important;
  font: 500 14px/1.2 Inter, Arial, sans-serif; text-decoration: none !important; transition: background-color .2s ease;
}
body.editorial-site.journal-article .article .cta-inline > a:hover { background: var(--ax-signal) !important; }
body.editorial-site.journal-article .article .cta-inline > a svg { width: 16px; height: 16px; }

/* Figures: printed instruments, like the rest of the site. */
body.editorial-site.journal-article .article .article-body .figure {
  margin: 36px 0 !important; padding: 22px 24px 20px !important;
  background: #ffffff !important; border: 1px solid var(--ax-rule) !important; border-radius: 4px !important; box-shadow: none !important;
}
body.editorial-site.journal-article .article .figure-title {
  margin: 0 0 18px !important; font: 500 11px/1.6 'JetBrains Mono', ui-monospace, Menlo, monospace !important;
  letter-spacing: .12em !important; text-transform: uppercase; color: var(--ax-faint) !important;
}
body.editorial-site.journal-article .article .fignote { margin: 16px 0 0; font-size: 13.5px; line-height: 1.65; color: var(--ax-soft) !important; }
body.editorial-site.journal-article .article .fignote strong { color: var(--ax-ink); font-weight: 600; }
/* Charts are drawn on a 400-unit canvas: full width on a phone, capped on desktop so labels stay at reading size. */
body.editorial-site.journal-article .article svg.chart { display: block; width: 100%; max-width: 500px; height: auto; margin: 6px auto 0; overflow: visible; }

/* Bar charts. */
body.editorial-site.journal-article .article .bar-chart { gap: 12px; }
/* Fixed label and value columns, so every track has the same length and the fills compare. */
body.editorial-site.journal-article .article .bar-row { grid-template-columns: 190px minmax(0, 1fr) 112px !important; gap: 16px; font-size: 13.5px; line-height: 1.4; color: var(--ax-soft); }
body.editorial-site.journal-article .article .article-body .bar-track { height: 8px; border-radius: 2px; background: #eceef2 !important; }
body.editorial-site.journal-article .article .bar-fill { border-radius: 2px; background: var(--ax-signal) !important; }
body.editorial-site.journal-article .article .bar-fill.muted { background: #868b95 !important; }
body.editorial-site.journal-article .article .bar-value { font: 500 12px/1.4 'JetBrains Mono', ui-monospace, monospace; color: var(--ax-ink); text-align: right; }

/* Process flows and grouped stages: columns along a rule (every flow has four). */
body.editorial-site.journal-article .article .flow {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 0 18px !important;
  overflow: visible; background: none !important; border: 0 !important; border-radius: 0 !important;
}
body.editorial-site.journal-article .article .flow-step {
  min-height: 0 !important; padding: 14px 0 4px !important;
  background: none !important; border: 0 !important; border-top: 2px solid var(--ax-signal) !important; border-radius: 0 !important;
}
body.editorial-site.journal-article .article .flow-step b { display: block; margin-bottom: 6px; font-size: 14.5px; font-weight: 600; color: var(--ax-ink) !important; }
body.editorial-site.journal-article .article .flow-step span { display: block; font-size: 13.5px; line-height: 1.55; color: var(--ax-soft) !important; }

/* Comparison matrices: ruled cells. */
body.editorial-site.journal-article .article .matrix {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 1px !important;
  background: var(--ax-rule) !important; border: 1px solid var(--ax-rule) !important; border-radius: 3px !important; overflow: hidden;
}
body.editorial-site.journal-article .article .matrix > div { min-height: 0 !important; padding: 16px 18px !important; background: #ffffff !important; }
body.editorial-site.journal-article .article .matrix b { display: block; font-size: 14.5px; font-weight: 600; color: var(--ax-ink) !important; }
body.editorial-site.journal-article .article .matrix span { display: block; margin-top: 6px; font-size: 13.5px; line-height: 1.55; color: var(--ax-soft) !important; }

/* Lead figures: the site's measured-number style. */
body.editorial-site.journal-article .article .lead-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 40px 0 !important; }
body.editorial-site.journal-article .article .lead-stats .s { padding: 14px 0 0 !important; background: none !important; border: 0 !important; border-top: 1px solid var(--ax-ink) !important; border-radius: 0 !important; box-shadow: none !important; }
body.editorial-site.journal-article .article .lead-stats .n { font: 400 32px/1.1 Inter, Arial, sans-serif !important; letter-spacing: -.045em !important; color: var(--ax-signal) !important; }
body.editorial-site.journal-article .article .lead-stats .n small { font-size: .5em; color: var(--ax-faint) !important; font-weight: 400; }
body.editorial-site.journal-article .article .lead-stats .k { margin-top: 8px; font-size: 13.5px; line-height: 1.55; color: var(--ax-soft) !important; }

/* End matter: references, more links, related notes, sources. */
body.editorial-site.journal-article .article :is(.refs, .readmore, .related-reading) {
  margin: 48px 0 0 !important; padding: 0 !important; background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
}
body.editorial-site.journal-article .article .refs ol { margin: 0; padding-left: 1.4em; font-size: 14px; line-height: 1.65; color: var(--ax-soft); }
body.editorial-site.journal-article .article .refs li { margin: 0; color: var(--ax-soft) !important; }
body.editorial-site.journal-article .article .refs li + li { margin-top: 8px; }
body.editorial-site.journal-article .article .readmore .links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; border-top: 1px solid var(--ax-rule); }
body.editorial-site.journal-article .article .readmore .links a {
  display: flex !important; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; padding: 12px 0 !important;
  border: 0 !important; border-bottom: 1px solid var(--ax-rule) !important; border-radius: 0 !important; background: none !important;
  font: 400 15px/1.45 Inter, Arial, sans-serif !important; color: var(--ax-ink) !important; text-decoration: none !important; transform: none !important;
}
body.editorial-site.journal-article .article .readmore .links a svg { display: none; }
body.editorial-site.journal-article .article .readmore .links a::after { content: "\2192"; flex: none; color: var(--ax-faint); transition: transform .2s ease, color .2s ease; }
body.editorial-site.journal-article .article .related-reading ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ax-rule); }
body.editorial-site.journal-article .article .related-reading li { position: relative; margin: 0 !important; padding: 16px 36px 17px 0; border-bottom: 1px solid var(--ax-rule); }
body.editorial-site.journal-article .article .related-reading li::after {
  content: "\2192"; position: absolute; right: 4px; top: 16px; font: 16px/1.4 Inter, Arial, sans-serif; color: var(--ax-faint); transition: transform .2s ease, color .2s ease;
}
body.editorial-site.journal-article .article .related-reading li > a {
  display: block; font: 400 17.5px/1.45 Inter, Arial, sans-serif !important; letter-spacing: -.015em;
  color: var(--ax-ink) !important; text-decoration: none !important; text-wrap: pretty; border: 0 !important;
}
body.editorial-site.journal-article .article .related-reading li > a::before { content: ""; position: absolute; inset: 0; }
body.editorial-site.journal-article .article .related-reading li > span { display: block; margin-top: 6px; font-size: 14.5px; line-height: 1.6; color: var(--ax-soft); }
body.editorial-site.journal-article .article hr.post-rule { margin: 48px 0 20px !important; border: 0 !important; border-top: 1px solid var(--ax-rule) !important; }
body.editorial-site.journal-article .article :is(.related-reading, .readmore) + hr.post-rule { margin: 12px 0 20px !important; border-top-color: transparent !important; }
body.editorial-site.journal-article .article .post-sources { margin: 0; font-size: 13.5px !important; line-height: 1.7 !important; color: var(--ax-soft) !important; }
body.editorial-site.journal-article .article .post-sources strong { color: var(--ax-ink); font-weight: 600; }
body.editorial-site.journal-article .article .post-sources a { font-weight: 400 !important; }
@media (hover: hover) {
  body.editorial-site.journal-article .article .readmore .links a:hover,
  body.editorial-site.journal-article .article .readmore .links a:hover::after,
  body.editorial-site.journal-article .article .related-reading li:hover > a,
  body.editorial-site.journal-article .article .related-reading li:hover::after { color: var(--ax-signal) !important; }
  body.editorial-site.journal-article .article :is(.related-reading li:hover, .readmore .links a:hover)::after { transform: translateX(3px); }
}

@media (max-width: 760px) {
  body.editorial-site.journal-article .article .article-meta { margin-top: 20px; }
  body.editorial-site.journal-article .article .article-body { margin-top: 32px !important; }
  body.editorial-site.journal-article .article .article-body > h2 { margin-top: 44px !important; }
  body.editorial-site.journal-article .article .article-body .figure { margin: 30px 0 !important; padding: 18px 16px 16px !important; }
  body.editorial-site.journal-article .article svg.chart { width: calc(100% + 16px); max-width: none; margin-inline: -8px; }
  body.editorial-site.journal-article .article .flow { grid-template-columns: 1fr !important; }
  body.editorial-site.journal-article .article .matrix { grid-template-columns: 1fr !important; }
  body.editorial-site.journal-article .article .flow-step { padding: 12px 0 14px 16px !important; border-top: 0 !important; border-left: 2px solid var(--ax-signal) !important; }
  body.editorial-site.journal-article .article .flow-step + .flow-step { margin-top: 4px; }
  body.editorial-site.journal-article .article .bar-row { grid-template-columns: minmax(0, 1fr) auto !important; grid-template-areas: "label value" "track track"; gap: 6px 12px !important; }
  body.editorial-site.journal-article .article .bar-row > :first-child { grid-area: label; }
  body.editorial-site.journal-article .article .bar-row > .bar-track { grid-area: track; }
  body.editorial-site.journal-article .article .bar-row > .bar-value { grid-area: value; align-self: end; }
  body.editorial-site.journal-article .article .lead-stats { grid-template-columns: 1fr; gap: 18px; }
  body.editorial-site.journal-article .article .cta-inline { padding: 20px !important; }
  body.editorial-site.journal-article .article .cta-inline p { flex-basis: 100%; }
  body.editorial-site.journal-article .article .readmore .links { grid-template-columns: 1fr; }
  body.editorial-site.journal-article .article .related-reading li > a { font-size: 17px !important; }
}
@media (prefers-reduced-motion: reduce) {
  body.editorial-site.journal-article .article .quality-article-index > summary::before,
  body.editorial-site.journal-article .article :is(.related-reading li, .readmore .links a)::after { transition: none; }
}

/* ============================================================
   Journal home: a latest-note lead, ruled subject sections, and a
   date and reading time on every entry. Search and subject filters
   keep working from assets/journal-index.js.
   ============================================================ */
body.editorial-site.journal-index .journal-library .journal-lead { margin: 0 0 60px; padding: 18px 0 0; border-top: 1px solid var(--ax-ink); }
body.editorial-site.journal-index .journal-library .journal-lead > h2 {
  margin: 0 0 18px; font: 500 11px/1.6 'JetBrains Mono', ui-monospace, Menlo, monospace !important;
  letter-spacing: .16em !important; text-transform: uppercase; color: var(--ax-signal);
}
body.editorial-site.journal-index .journal-library .journal-lead > a { display: block; color: inherit; text-decoration: none; }
body.editorial-site.journal-index .journal-library .journal-lead h3 {
  max-width: 22ch; margin: 0; font: 400 clamp(30px, 3.1vw, 44px)/1.1 Inter, Arial, sans-serif;
  letter-spacing: -.045em; color: var(--ax-ink); text-wrap: balance; transition: color .2s ease;
}
body.editorial-site.journal-index .journal-library .journal-lead-summary { max-width: 50ch; margin: 16px 0 0; font: 18px/1.6 Inter, Arial, sans-serif; color: var(--ax-soft); }
body.editorial-site.journal-index .journal-library .journal-lead .journal-entry-date { margin-top: 18px; }
body.editorial-site.journal-index .journal-library .journal-lead > a:focus-visible { outline: 2px solid var(--ax-signal); outline-offset: 6px; }

body.editorial-site.journal-index .journal-library .journal-results-header { padding-bottom: 16px; border-bottom: 0; }
body.editorial-site.journal-index .journal-library .journal-topic-heading { padding: 16px 0 10px; border-top: 1px solid var(--ax-ink); }
body.editorial-site.journal-index .journal-library .journal-topic-heading h2 {
  font: 500 11px/1.6 'JetBrains Mono', ui-monospace, Menlo, monospace !important;
  letter-spacing: .16em !important; text-transform: uppercase; color: var(--ax-signal);
}
body.editorial-site.journal-index .journal-library .journal-topic-heading p { margin-top: 6px; font-size: 14px; line-height: 1.6; color: var(--ax-soft); }
body.editorial-site.journal-index .journal-library .journal-entry { border-bottom-color: var(--ax-rule); }
/* The next subject's ink rule closes a section; no second rule above it. */
body.editorial-site.journal-index .journal-library .journal-topic-group:not(:last-child) .journal-entry:last-child { border-bottom: 0; }
body.editorial-site.journal-index .journal-library .journal-entry > a { padding: 24px 0 25px; }
body.editorial-site.journal-index .journal-library .journal-entry-category {
  margin-bottom: 8px; font: 500 11px/1.6 'JetBrains Mono', ui-monospace, Menlo, monospace;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ax-faint);
}
body.editorial-site.journal-index .journal-library .journal-entry h3 { font-weight: 400; letter-spacing: -.03em; }
body.editorial-site.journal-index .journal-library .journal-entry-summary { margin-top: 10px; color: var(--ax-soft); }
body.editorial-site.journal-index .journal-library .journal-entry-date {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin: 12px 0 0;
  font: 500 11px/1.6 'JetBrains Mono', ui-monospace, Menlo, monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--ax-faint);
}
body.editorial-site.journal-index .journal-library .journal-entry-date > * { white-space: nowrap; }
@media (hover: hover) {
  body.editorial-site.journal-index .journal-library .journal-lead > a:hover h3 { color: var(--ax-signal); }
}
@media (max-width: 760px) {
  body.editorial-site.journal-index .journal-library .journal-lead { margin-bottom: 44px; }
  body.editorial-site.journal-index .journal-library .journal-lead h3 { font-size: 30px; line-height: 1.14; }
  body.editorial-site.journal-index .journal-library .journal-lead-summary { font-size: 16px; line-height: 1.7; }
}
@media (prefers-reduced-motion: reduce) {
  body.editorial-site.journal-index .journal-library .journal-lead h3 { transition: none; }
}
