/* ============================================================
   Magpie Journal — blog styles
   Loaded AFTER marketing.css; reuses its tokens + nav + footer.
   ============================================================ */

/* ---------- journal index hero ---------- */
.jhero { padding: clamp(48px, 7vw, 84px) 0 clamp(28px, 4vw, 44px); position: relative; }
.jhero h1 { font-size: clamp(38px, 5.6vw, 64px); letter-spacing: -0.035em; margin-top: 18px; }
.jhero .lede { margin-top: 20px; }

/* ---------- category chips ---------- */
.cat-bar { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 34px; }
.cat-chip {
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  padding: 8px 15px; border-radius: 100px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; transition: color 120ms, border-color 120ms, background 120ms;
}
.cat-chip:hover { color: var(--text); border-color: var(--text-dim); }
.cat-chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---------- cover motif (reusable, per-category --cat) ---------- */
.cover {
  position: relative; overflow: hidden; background: var(--bg);
  border-bottom: 1px solid var(--border-soft); --cat: var(--accent);
}
.cover::before { /* instrument grid */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(transparent 0 27px, rgba(37,43,58,0.16) 27px 28px) 0 0 / 28px 28px,
    linear-gradient(90deg, transparent 0 27px, rgba(37,43,58,0.16) 27px 28px) 0 0 / 28px 28px;
}
.cover::after { /* accent glow */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 100% at 85% 110%, color-mix(in oklab, var(--cat) 22%, transparent), transparent 60%);
}
.cover svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cover-line { fill: none; stroke: var(--cat, var(--accent)); stroke-width: 2; vector-effect: non-scaling-stroke; opacity: 0.9; stroke-linejoin: round; stroke-linecap: round; }
.cover-area { fill: var(--cat, var(--accent)); opacity: 0.12; }
.cover .cover-tag {
  position: absolute; left: 18px; top: 16px; z-index: 2;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cat); display: inline-flex; align-items: center; gap: 7px;
}
.cover .cover-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cat); }
.cover .cover-ix { /* big faint index numeral */
  position: absolute; right: 16px; bottom: 8px; z-index: 1;
  font-family: var(--mono); font-size: clamp(40px, 7vw, 76px); font-weight: 600;
  color: color-mix(in oklab, var(--cat) 26%, transparent); letter-spacing: -0.03em; line-height: 1;
}

/* ---------- featured post ---------- */
.featured { margin-top: 8px; }
.feat-post {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0;
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface); transition: border-color 160ms, transform 160ms;
}
.feat-post:hover { border-color: var(--text-dim); transform: translateY(-2px); }
.feat-post .cover { min-height: 320px; border-bottom: 0; border-right: 1px solid var(--border-soft); }
.feat-post .fp-body { padding: clamp(26px, 3vw, 40px); display: flex; flex-direction: column; justify-content: center; }
.fp-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.fp-title { font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -0.02em; margin-top: 14px; line-height: 1.12; }
.feat-post:hover .fp-title { color: var(--accent); }
.fp-excerpt { font-size: 16px; line-height: 1.62; color: var(--text-muted); margin-top: 16px; max-width: 52ch; }
@media (max-width: 820px) { .feat-post { grid-template-columns: 1fr; } .feat-post .cover { min-height: 200px; border-right: 0; border-bottom: 1px solid var(--border-soft); } }

/* ---------- post grid ---------- */
.grid-head { display: flex; align-items: baseline; justify-content: space-between; margin: clamp(48px,6vw,72px) 0 22px; gap: 16px; }
.grid-head h2 { font-size: 22px; letter-spacing: -0.01em; }
.grid-head .count { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .post-grid { grid-template-columns: 1fr; } }
.post-card {
  display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--surface); transition: border-color 160ms, transform 160ms;
}
.post-card:hover { border-color: var(--text-dim); transform: translateY(-3px); }
.post-card .cover { height: 168px; }
.pc-body { padding: 20px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.pc-title { font-size: 18.5px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.22; }
.post-card:hover .pc-title { color: var(--accent); }
.pc-excerpt { font-size: 14px; line-height: 1.55; color: var(--text-muted); margin-top: 10px; flex: 1; }
.pc-meta, .fp-meta { display: flex; align-items: center; gap: 9px; margin-top: 18px; font-size: 12.5px; color: var(--text-dim); }
.pc-meta .av, .fp-meta .av, .byline .av {
  width: 26px; height: 26px; border-radius: 50%; background: #10202a; display: grid; place-items: center;
  color: var(--accent); flex: none; font-family: var(--mono); font-size: 11px; font-weight: 600;
}
.pc-meta .sep, .fp-meta .sep, .byline .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--border); }
.fp-meta { margin-top: 22px; font-size: 13px; }

/* ---------- subscribe band ---------- */
.subscribe {
  margin-top: clamp(56px,7vw,88px); border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: radial-gradient(100% 130% at 0% 0%, rgba(69,200,224,0.08), transparent 60%), var(--surface);
  padding: clamp(30px,4vw,52px); display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center;
}
@media (max-width: 760px) { .subscribe { grid-template-columns: 1fr; } }
.subscribe h3 { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -0.02em; }
.subscribe p { font-size: 15px; color: var(--text-muted); margin-top: 12px; max-width: 46ch; }
.sub-form { display: flex; gap: 10px; flex-wrap: wrap; }
.sub-form input { flex: 1; min-width: 200px; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: 13px 15px; font: inherit; font-size: 15px; outline: none; transition: border-color 120ms, box-shadow 120ms; }
.sub-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.sub-note { font-size: 12px; color: var(--text-dim); margin-top: 12px; }

/* ============================================================
   ARTICLE (single post) — the reusable template
   ============================================================ */
.article { max-width: 1080px; margin: 0 auto; padding: 0 var(--s6); }
.art-wrap { max-width: 720px; margin: 0 auto; }
.back-link { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-muted); margin: clamp(28px,4vw,44px) 0 0; }
.back-link:hover { color: var(--text); }
.back-link svg { width: 15px; height: 15px; }

.art-head { padding: clamp(22px,3vw,34px) 0 clamp(24px,3vw,36px); }
.art-cat { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cat, var(--accent)); display: inline-flex; align-items: center; gap: 8px; }
.art-cat::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cat, var(--accent)); }
.art-title { font-size: clamp(32px, 4.6vw, 52px); letter-spacing: -0.035em; line-height: 1.06; margin-top: 18px; text-wrap: balance; }
.art-deck { font-size: clamp(18px, 1.9vw, 22px); line-height: 1.5; color: var(--text-muted); margin-top: 20px; text-wrap: pretty; }
.byline { display: flex; align-items: center; gap: 11px; margin-top: 28px; font-size: 13.5px; color: var(--text-dim); flex-wrap: wrap; }
.byline .nm { color: var(--text); font-weight: 600; }
.byline .av { width: 38px; height: 38px; font-size: 13px; }

.art-cover { height: clamp(220px, 34vw, 380px); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: clamp(30px,4vw,48px); }
.art-cover.cover { border-bottom: 1px solid var(--border); }

/* ---------- prose ---------- */
.prose { font-size: 17.5px; line-height: 1.75; color: var(--text-muted); }
.prose > * + * { margin-top: 24px; }
.prose p { text-wrap: pretty; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(69,200,224,0.35); }
.prose a:hover { border-bottom-color: var(--accent); }
.prose h2 { color: var(--text); font-size: clamp(24px, 2.6vw, 31px); letter-spacing: -0.025em; line-height: 1.15; margin-top: 52px; }
.prose h3 { color: var(--text); font-size: 20px; letter-spacing: -0.015em; margin-top: 36px; }
.prose h2 + p, .prose h3 + p { margin-top: 14px; }
.prose ul, .prose ol { margin-top: 18px; padding-left: 24px; }
.prose li { margin-top: 8px; }
.prose li::marker { color: var(--text-dim); }
.prose hr { border: 0; border-top: 1px solid var(--border-soft); margin: 44px 0; }
.prose em { color: var(--text-muted); }
.prose figcaption { font-size: 13px; color: var(--text-dim); margin-top: 10px; text-align: center; }

/* pullquote */
.pullquote { margin: 44px 0; padding-left: 26px; border-left: 3px solid var(--accent);
  font-size: clamp(21px, 2.4vw, 27px); line-height: 1.4; color: var(--text); letter-spacing: -0.015em; font-weight: 500; text-wrap: balance; }

/* callout */
.callout { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
  padding: 22px 24px; margin: 36px 0; }
.callout .co-h { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: 0.02em; }
.callout .co-h svg { width: 17px; height: 17px; color: var(--accent); }
.callout p { font-size: 15px; line-height: 1.62; color: var(--text-muted); margin-top: 10px; }

/* definition / metric blocks */
.metric { border: 1px solid var(--border); border-left: 3px solid var(--cat, var(--accent)); border-radius: var(--radius); background: var(--surface); padding: 20px 22px; margin: 26px 0; }
.metric .m-top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.metric .m-name { font-size: 17px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.metric .m-tag { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.metric .m-good { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--pos); font-family: var(--mono); }
.metric p { font-size: 15px; line-height: 1.62; color: var(--text-muted); margin-top: 10px; }

/* small stat row inside prose */
.statrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin: 32px 0; }
@media (max-width: 560px) { .statrow { grid-template-columns: 1fr; } }
.statrow .s { background: var(--surface); padding: 20px 22px; }
.statrow .s .v { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; color: var(--text); }
.statrow .s .v.pos { color: var(--pos); }
.statrow .s .k { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }

/* author card */
.author-card { display: flex; gap: 16px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); padding: 24px; margin-top: 52px; }
.author-card .av { width: 52px; height: 52px; border-radius: 50%; background: #10202a; display: grid; place-items: center; color: var(--accent); flex: none; }
.author-card .av svg { width: 26px; height: 26px; }
.author-card .nm { font-size: 16px; font-weight: 600; color: var(--text); }
.author-card .rl { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.author-card .bio { font-size: 14.5px; line-height: 1.6; color: var(--text-muted); margin-top: 10px; }

/* related */
.related { margin-top: clamp(56px,7vw,84px); }
.related h2 { font-size: 22px; letter-spacing: -0.01em; margin-bottom: 22px; }

/* subscribe section CTA (opens the shared waitlist modal) */
.sub-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.sub-cta .sub-note { margin-top: 0; }
