/* ============================================================
   JAMES COOK MEDIA — BLOG LAYER
   Article reading experience + blog index cards.
   Loads AFTER jcm.css. Uses the same Through-Line tokens.
   Never edit jcm.css for blog work — extend here.
   ============================================================ */

/* ─── ARTICLE TOKENS ─────────────────────────────────────── */
:root {
  /* rem, not ch: `ch` resolves against each element's own font-size, which
     would give an h2 a far wider measure than a paragraph.
     One single column: prose, figures, tables, CTAs and FAQ all share it, so
     the article reads as one continuous edge rather than a widening stack. */
  --measure: 46rem;  /* ~736px */
}

/* ============================================================
   ARTICLE HERO
   ============================================================ */
.art-hero {
  padding-top: clamp(8.5rem, 15vh, 12rem);
  padding-bottom: clamp(2rem, 4vh, 3.2rem);
  background:
    radial-gradient(ellipse at 76% 12%, rgba(201, 168, 76, 0.13) 0%, transparent 56%),
    radial-gradient(ellipse at 5% 92%, rgba(201, 76, 42, 0.05) 0%, transparent 52%),
    var(--paper);
}
.art-hero .rail { max-width: var(--rail); }

.art-crumb {
  font-family: var(--ff-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 1.6rem;
}
.art-crumb a { color: var(--gold-dim); }
.art-crumb a:hover { color: var(--gold); }
.art-crumb span { margin: 0 0.5rem; opacity: 0.5; }

.art-pillar {
  display: inline-block;
  font-family: var(--ff-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dim);
  border: 1px solid var(--rule);
  padding: 0.4rem 0.8rem;
  margin-bottom: 1.4rem;
}

.art-title {
  font-family: var(--ff-display);
  font-weight: 900;
  font-size: clamp(2.3rem, 5.2vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--ink);
  max-width: 20ch;
  margin-bottom: 1.5rem;
}
.art-title em { font-style: italic; color: var(--gold); }

.art-standfirst {
  font-family: var(--ff-display);
  font-size: clamp(1.15rem, 1.9vw, 1.5rem);
  line-height: 1.55;
  color: var(--ash);
  max-width: 54ch;
  margin-bottom: 2.4rem;
}

/* byline strip */
.art-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.1rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
}
.art-meta-face {
  width: 44px; height: 44px; border-radius: 2px;
  object-fit: cover; object-position: center;
  border: 1px solid var(--rule);
}
.art-meta-who { line-height: 1.35; }
.art-meta-name { font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.art-meta-role { font-size: 0.78rem; color: var(--mid); }
.art-meta-dot { color: var(--paper-3); }
.art-meta-item {
  font-family: var(--ff-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid);
}

/* ============================================================
   ARTICLE BODY — the reading column
   ============================================================ */
.art-body { padding-top: clamp(2.4rem, 5vh, 4rem); padding-bottom: clamp(3rem, 7vh, 6rem); }

.prose {
  max-width: var(--measure);
  font-size: 1.075rem;
  line-height: 1.78;
  color: var(--ash);
}
.prose > * + * { margin-top: 1.35rem; }


/* headings */
.prose h2 {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  line-height: 1.16;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-top: 3.4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-soft);
  scroll-margin-top: 6rem;
}
.prose h3 {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  line-height: 1.28;
  color: var(--ink);
  margin-top: 2.4rem;
  scroll-margin-top: 6rem;
}
.prose h4 {
  font-family: var(--ff-body);
  font-weight: 600;
  font-size: 1.04rem;
  color: var(--ink);
  margin-top: 1.9rem;
}

.prose strong { color: var(--ink); font-weight: 600; }
.prose em { font-style: italic; }

.prose a {
  color: var(--gold-dim);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.prose a:hover { color: var(--ember); text-decoration-color: var(--ember-2); }

/* lists */
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: 0.55rem; }
.prose ul li::marker { color: var(--gold); }
.prose ol li::marker { color: var(--gold-dim); font-family: var(--ff-mono); font-size: 0.85em; }

/* answer-first passage — the GEO/citation block.
   One crisp, quotable answer right under an H2. */
.prose .answer {
  border-left: 3px solid var(--gold);
  background: rgba(201, 168, 76, 0.07);
  padding: 1.15rem 1.4rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink);
}
.prose .answer p { margin: 0; }
.prose .answer p + p { margin-top: 0.8rem; }

/* pull quote */
.prose blockquote {
  border-left: 3px solid var(--ember);
  padding-left: 1.4rem;
  font-family: var(--ff-display);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.5;
  font-style: italic;
  color: var(--ink);
  margin-top: 2.4rem;
  margin-bottom: 2.4rem;
}
.prose blockquote cite {
  display: block;
  margin-top: 0.9rem;
  font-family: var(--ff-mono);
  font-style: normal;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

/* figures — break out wider than the measure */
.prose figure {
  max-width: var(--measure);
  margin-top: 2.6rem;
  margin-bottom: 2.6rem;
}
.prose figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  background: var(--paper-2);
}
.prose figcaption {
  margin-top: 0.85rem;
  font-family: var(--ff-mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  line-height: 1.6;
  color: var(--mid);
  text-transform: uppercase;
}

/* tables */
.prose .table-wrap {
  max-width: var(--measure);
  overflow-x: auto;
  margin-top: 2.2rem;
  margin-bottom: 2.2rem;
  border: 1px solid var(--rule);
}
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.prose thead th {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--ff-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: left;
  padding: 0.85rem 1rem;
  font-weight: 500;
}
.prose tbody td { padding: 0.85rem 1rem; border-top: 1px solid var(--paper-3); vertical-align: top; }
.prose tbody tr:nth-child(even) { background: var(--paper-2); }
.prose tbody td:first-child { font-weight: 600; color: var(--ink); }

/* code */
.prose code {
  font-family: var(--ff-mono);
  font-size: 0.88em;
  background: var(--paper-2);
  border: 1px solid var(--paper-3);
  padding: 0.12em 0.38em;
  border-radius: 2px;
  color: var(--ink);
}
.prose pre {
  max-width: var(--measure);
  background: var(--ink);
  color: var(--paper);
  padding: 1.3rem 1.5rem;
  overflow-x: auto;
  font-family: var(--ff-mono);
  font-size: 0.86rem;
  line-height: 1.7;
  margin-top: 2rem;
  margin-bottom: 2rem;
}
.prose pre code { background: none; border: none; padding: 0; color: inherit; }

.prose hr { border: none; border-top: 1px solid var(--rule); margin: 3rem 0; }

/* ============================================================
   IN-ARTICLE CTA — the one small, safe next step
   ============================================================ */
/* Dark by design: on a warm paper page the one CTA has to be the thing the eye
   cannot skip. Ink ground, gold button, generous air. */
.art-cta {
  max-width: var(--measure);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(201, 168, 76, 0.28);
  background:
    radial-gradient(ellipse at 86% 8%, rgba(201, 168, 76, 0.20) 0%, transparent 58%),
    radial-gradient(ellipse at 0% 100%, rgba(201, 76, 42, 0.14) 0%, transparent 55%),
    var(--ink);
  padding: clamp(1.9rem, 3.6vw, 3rem);
  margin-top: 3.4rem;
  margin-bottom: 3.4rem;
}
/* faint grid, so it belongs to the same family as the OG cards */
.art-cta::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(201, 168, 76, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 168, 76, 0.05) 1px, transparent 1px);
  background-size: 58px 58px;
}
.art-cta > * { position: relative; }

.art-cta-label {
  font-family: var(--ff-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-2);
  margin-bottom: 1rem;
}
.art-cta h3 {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  line-height: 1.18;
  color: var(--paper);
  margin-bottom: 0.9rem;
}
.art-cta p {
  font-size: 0.99rem;
  line-height: 1.72;
  color: #B8B0A4;
  max-width: 52ch;
  margin-bottom: 1.6rem;
}
.art-cta .btn-gold { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.art-cta .btn-gold:hover { background: var(--gold-2); border-color: var(--gold-2); }
.art-cta-note {
  display: block;
  margin-top: 1.1rem;
  font-family: var(--ff-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8B8378;
}

/* ============================================================
   TABLE OF CONTENTS — sticky rail to the right of the reading column
   ============================================================ */
/* Two-column shell: prose keeps the measure, the TOC sits beside it and
   sticks while you read. Below 1180px it collapses back above the article. */
.art-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--measure)) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.art-toc { position: sticky; top: 6.5rem; }
.art-toc-label {
  font-family: var(--ff-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dim);
  padding-bottom: 0.9rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
}
.art-toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; display: grid; }
.art-toc li { counter-increment: toc; margin: 0; }
.art-toc a {
  display: grid;
  grid-template-columns: 1.7rem 1fr;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.5rem 0 0.5rem 0.85rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--mid);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}
.art-toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--ff-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--paper-3);
  transition: color 0.2s;
}
.art-toc a:hover { color: var(--ink); }
.art-toc a:hover::before { color: var(--gold-dim); }

/* the section you are reading */
.art-toc a.is-current {
  color: var(--ink);
  border-left-color: var(--gold);
  font-weight: 500;
}
.art-toc a.is-current::before { color: var(--gold); }

@media (max-width: 1180px) {
  .art-layout { grid-template-columns: minmax(0, 1fr); }
  .art-toc {
    position: static;
    order: -1;
    max-width: var(--measure);
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 1.3rem 0 1.4rem;
    margin-bottom: 2.4rem;
  }
  .art-toc-label { border-bottom: none; padding-bottom: 0; margin-bottom: 0.7rem; }
  .art-toc ol { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 1.5rem; }
}

/* ============================================================
   FAQ — collapsed by default, native <details>
   ============================================================ */
.art-faq-item {
  border-bottom: 1px solid var(--paper-3);
  padding: 0;
}
.art-faq-item:first-of-type { border-top: 1px solid var(--paper-3); }

.art-faq-item > summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr 1.6rem;
  gap: 1rem;
  align-items: start;
  padding: 1.25rem 0;
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 1.12rem;
  line-height: 1.35;
  color: var(--ink);
  transition: color 0.2s;
}
.art-faq-item > summary::-webkit-details-marker { display: none; }
.art-faq-item > summary::marker { content: ''; }
.art-faq-item > summary:hover { color: var(--gold-dim); }

/* the +/− toggle */
.art-faq-item > summary::after {
  content: '';
  width: 15px; height: 15px;
  margin-top: 0.35rem;
  justify-self: end;
  background:
    linear-gradient(var(--gold-dim), var(--gold-dim)) center/100% 1.5px no-repeat,
    linear-gradient(var(--gold-dim), var(--gold-dim)) center/1.5px 100% no-repeat;
  transition: transform 0.3s var(--ease-out), background-size 0.3s;
}
/* open state: the vertical stroke collapses, leaving a minus */
.art-faq-item[open] > summary::after {
  background:
    linear-gradient(var(--ember), var(--ember)) center/100% 1.5px no-repeat,
    linear-gradient(var(--ember), var(--ember)) center/0 100% no-repeat;
}
.art-faq-item[open] > summary { color: var(--gold-dim); }

.art-faq-a {
  font-size: 0.98rem;
  line-height: 1.72;
  color: var(--ash);
  max-width: 64ch;
  padding-bottom: 1.35rem;
}
.art-faq-a a { color: var(--gold-dim); text-decoration: underline; text-underline-offset: 0.2em; }

/* ============================================================
   FAQ (GEO block)
   ============================================================ */
.art-faq { max-width: var(--measure); margin-top: 3.4rem; }
.art-faq > h2 {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  color: var(--ink);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  margin-bottom: 1.6rem;
}
.art-faq-item:first-of-type { border-top: 1px solid var(--paper-3); }
.art-faq-a { font-size: 0.98rem; line-height: 1.72; color: var(--ash); max-width: 66ch; }
.art-faq-a a { color: var(--gold-dim); text-decoration: underline; text-underline-offset: 0.2em; }

/* ============================================================
   AUTHOR CARD
   ============================================================ */
.art-author {
  max-width: var(--measure);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: start;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  padding: clamp(1.5rem, 3vw, 2.2rem);
  margin-top: 3.4rem;
}
.art-author img {
  width: 88px; height: 88px; border-radius: 2px;
  object-fit: cover; object-position: center;
  border: 1px solid var(--rule);
}
.art-author-name { font-family: var(--ff-display); font-weight: 700; font-size: 1.2rem; color: var(--ink); }
.art-author-role {
  font-family: var(--ff-mono);
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin: 0.35rem 0 0.8rem;
}
.art-author-bio { font-size: 0.94rem; line-height: 1.7; color: var(--ash); max-width: 58ch; }
.art-author-bio a { color: var(--gold-dim); text-decoration: underline; text-underline-offset: 0.2em; }

/* ============================================================
   KEEP READING
   ============================================================ */
.art-next { padding-top: clamp(2.5rem, 5vh, 4rem); padding-bottom: clamp(3rem, 6vh, 5rem); }
.art-next-title {
  font-family: var(--ff-mono);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 1.6rem;
}

/* ============================================================
   PILLAR ACCENTS
   Six muted, earthy hues so a card is identifiable by colour
   before it is read. Gold and ember are the brand's own; the
   rest are chosen to sit in the same warm, desaturated family
   so the grid never looks like a set of category tags.
   ============================================================ */
.card[data-cat="get-found-online"]       { --accent: #C9A84C; }
.card[data-cat="story-driven-marketing"] { --accent: #C94C2A; }
.card[data-cat="ai-for-experts"]         { --accent: #4A6F6B; }
.card[data-cat="reluctant-expert"]       { --accent: #7C4A5E; }
.card[data-cat="podcasting-repurposing"] { --accent: #5D6B3A; }
.card[data-cat="funnels-web"]            { --accent: #44527A; }
.card[data-cat]                          { --accent: var(--gold); }

/* the accent reads as a spine along the card's top edge */
.card[data-cat]::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  z-index: 2;
}
.card[data-cat] .card-meta span:first-child { color: var(--accent); }
.card[data-cat]::after { background: var(--accent); }
.card[data-cat] .post-meta-line .dot { background: var(--accent); }

/* ============================================================
   CARD THUMBNAIL — the article's own OG card, full-bleed
   ============================================================ */
.card-thumb {
  display: block;
  position: relative;
  margin:
    calc(-1 * clamp(1.8rem, 2.5vw, 2.5rem))
    calc(-1 * clamp(1.8rem, 2.5vw, 2.5rem))
    clamp(1.3rem, 2vw, 1.7rem);
  aspect-ratio: 1200 / 630;
  overflow: hidden;
  background: var(--ink);
}
.card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease-out);
}
.card:hover .card-thumb img { transform: scale(1.035); }

/* planned articles have no artwork yet — keep the card's rhythm
   without pretending an image exists */
.card-thumb.is-planned {
  background: var(--paper-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-thumb.is-planned::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--rule-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule-soft) 1px, transparent 1px);
  background-size: 34px 34px;
}
.card-thumb.is-planned span {
  position: relative;
  font-family: var(--ff-mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.75;
}

/* ============================================================
   FILTER CHIPS — carry the same accent as a leading dot
   ============================================================ */
.filter-chip[data-filter="get-found-online"]       { --accent: #C9A84C; }
.filter-chip[data-filter="story-driven-marketing"] { --accent: #C94C2A; }
.filter-chip[data-filter="ai-for-experts"]         { --accent: #4A6F6B; }
.filter-chip[data-filter="reluctant-expert"]       { --accent: #7C4A5E; }
.filter-chip[data-filter="podcasting-repurposing"] { --accent: #5D6B3A; }
.filter-chip[data-filter="funnels-web"]            { --accent: #44527A; }

.filter-chip[data-filter]:not([data-filter="all"]) {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.filter-chip[data-filter]:not([data-filter="all"])::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.filter-chip[data-filter]:not([data-filter="all"]).active {
  border-color: var(--accent);
  background: var(--paper-2);
  color: var(--ink);
}

/* ============================================================
   FEATURED BLOCK — the art panel matches the OG ratio exactly,
   so the card is never letterboxed or cropped mid-word.
   ============================================================ */
/* The art panel is a tinted mat that fills the card's full height, with the
   OG card floating inside at its true 1.91:1 ratio — so it is never cropped
   mid-word, and never sits in an accidental black letterbox. */
.featured-art {
  display: flex;
  align-items: center;
  padding: clamp(1.2rem, 2.4vw, 2.2rem);
  background:
    radial-gradient(ellipse at 70% 25%, rgba(201, 168, 76, 0.10) 0%, transparent 62%),
    var(--paper-2);
}
.featured-art img {
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  display: block;
  border: 1px solid var(--rule-soft);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
  .prose { font-size: 1.02rem; }
  .art-author { grid-template-columns: 1fr; }
  .art-author img { width: 72px; height: 72px; }
  .art-meta { gap: 0.8rem; }
  .art-meta-dot { display: none; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .nav, .nav-sheet, .spine, .spine-node, .footer, .art-cta, .art-next { display: none !important; }
  .prose { max-width: none; font-size: 11pt; }
  body::after { display: none; }
}
