/* Journal: the /blog index (.jn-idx) and the article template (.jn-art) used by all 97 posts.
   Markup: blog.html and tools/partials/article-template.html, filled by tools/journal.py. Spec: DECK-journal.md.
   Built on the kit (assets/page.css): tokens, .wrap, .pg-hero.lt, .pg-sec, .pg-card, .pg-cta, data-snap. */

/* ---------- Shared: meta lines, rows ---------- */
.pg :is(.jn-meta,.ar-eb,.jn-row .m){font-size:14px;line-height:20px;color:var(--ink-2);font-variant-numeric:tabular-nums;}
.pg :is(.jn-meta,.ar-eb,.jn-row .m) .c{color:var(--green-2);font-weight:500;}
.pg .ar-ic{width:16px;height:16px;flex:0 0 auto;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;transition:transform .2s var(--ease-out);}

/* ---------- Index: S1 hero ---------- */
.pg .jn-hero{padding:88px 0 56px;}
.pg .jn-hero h1{max-width:12em;}
.pg .jn-hero .sub{max-width:36em;}
.pg .jn-hero .acts{margin-top:20px;}

/* ---------- Index: S2 featured note ---------- */
.pg .jn-fcard{display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);gap:72px;align-items:center;padding:48px 56px;border-radius:var(--r-l);background:#fff;box-shadow:0 0 0 1px rgba(20,32,27,.06),var(--sh-1);transition:box-shadow .2s ease,transform .2s var(--ease-out);}
@media (hover:hover) and (pointer:fine){
  .pg .jn-fcard:hover{box-shadow:0 0 0 1px rgba(20,32,27,.10),var(--sh-2);}
  .pg .jn-fcard:hover .lnk{color:var(--green);text-decoration-color:currentColor;}
}
.pg .jn-fcard:active{transform:scale(.995);}
.pg .jn-pill{display:inline-flex;align-items:center;height:28px;padding:0 12px;border-radius:999px;background:#E4ECE7;color:var(--green);font-size:13px;font-weight:500;}
.pg .jn-fcopy .jn-meta{margin-top:20px;}
.pg .jn-fcopy h2{margin-top:10px;max-width:17em;font-size:clamp(28px,2.7vw,40px);line-height:1.1;letter-spacing:-0.035em;}
.pg .jn-fline{margin-top:16px;max-width:34em;font-size:17px;line-height:1.55;color:var(--ink-2);}
.pg .jn-fcopy .lnk{margin-top:16px;}
.pg .jn-fq{padding:4px 0 4px 28px;border-left:2px solid var(--green-2);}
.pg .jn-fq figcaption{font-size:14px;color:var(--ink-2);}
.pg .jn-fq blockquote{margin:14px 0 0;}
.pg .jn-fq blockquote p{font-size:clamp(22px,1.9vw,27px);line-height:1.3;letter-spacing:-0.022em;font-weight:500;color:var(--ink);text-wrap:balance;}

/* ---------- Index: S3 notes and S4 archive rows ---------- */
.pg .jn-notes{padding-top:112px;}
.pg .jn-row{display:grid;grid-template-columns:260px minmax(0,1fr) auto;column-gap:40px;align-items:baseline;min-height:48px;padding:28px 0;border-top:1px solid var(--line);}
/* no automatic hyphenation, and hyphenated words stay whole (journal.py wraps them in .nw) */
.pg .jn-row h3{hyphens:manual;-webkit-hyphens:manual;font-size:24px;line-height:1.2;letter-spacing:-0.025em;font-weight:500;color:var(--ink);transition:color .16s ease;}
.pg .jn-row .nw{white-space:nowrap;}
.pg .jn-row .rd{display:inline-flex;align-items:center;gap:8px;font-size:15px;font-weight:500;color:var(--ink);}
@media (hover:hover) and (pointer:fine){
  .pg .jn-row:hover h3{color:var(--green);}
  .pg .jn-row:hover .ar-ic{transform:translateX(3px);}
}
/* touch has no hover: the title and arrow answer the press instead (no scale on a full-width row) */
.pg .jn-row:active h3{color:var(--green);transition-duration:0s;}
.pg .jn-row:active .ar-ic{transform:translateX(3px);}
.pg .jn-notes .jn-rows{border-bottom:1px solid var(--line);}
.pg .jn-arch .jn-row{padding:22px 0;}
.pg .jn-arch .jn-row h3{font-size:21px;line-height:1.25;letter-spacing:-0.02em;}

/* site.css still carries !important grid rules for .arow from the old index; the class stays because site.js's filter reads it */
.pg .jn-row.arow{grid-template-columns:260px minmax(0,1fr) auto !important;column-gap:40px !important;row-gap:0 !important;}
.pg .jn-row.arow > :is(h3,.rd){grid-column:auto !important;text-align:left !important;}
@media (max-width:1099px){.pg .jn-row.arow{grid-template-columns:minmax(0,1fr) auto !important;row-gap:6px !important;}.pg .jn-row.arow > h3{grid-column:1 !important;}.pg .jn-row.arow > .rd{grid-column:2 !important;}}
@media (max-width:759px){.pg .jn-row.arow{grid-template-columns:minmax(0,1fr) !important;}}

/* archive filter: pills (site.js toggles .on and aria-pressed), rows hidden by topic or past the first twelve */
.pg .jn-pills{margin-bottom:28px;}
.pg .jn-pills-in{display:flex;flex-wrap:wrap;gap:8px;}
.pg :is(.apill,.jn-more,.ar-share button){-webkit-user-select:none;user-select:none;}
.pg .apill{display:inline-flex;align-items:center;height:36px;padding:0 14px;border:1px solid var(--line);border-radius:999px;background:var(--canvas);color:var(--ink);font-size:14px;font-weight:500;white-space:nowrap;cursor:pointer;transition:background-color .16s ease,border-color .16s ease,color .16s ease,transform 140ms var(--ease-out);}
@media (hover:hover) and (pointer:fine){.pg .apill:not(.on):hover{border-color:#BFBEB6;background:#fff;}}
.pg .apill:active{transform:scale(.97);}
.pg .apill.on{background:var(--ink);border-color:var(--ink);color:#fff;}
.pg .arow[hidden],#archive.clip .arow.more{display:none;}
.pg .jn-afoot{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-top:24px;border-top:1px solid var(--line);font-size:14px;color:var(--ink-2);font-variant-numeric:tabular-nums;}
.pg .jn-more{display:inline-flex;align-items:center;justify-content:center;height:44px;padding:0 20px;border:0;border-radius:var(--r-s);background:#fff;color:var(--ink);font-size:15px;font-weight:500;box-shadow:0 0 0 1px var(--line);cursor:pointer;transition:box-shadow .16s ease,transform 140ms var(--ease-out);}
@media (hover:hover) and (pointer:fine){.pg .jn-more:hover{box-shadow:0 0 0 1px #BFBEB6,var(--sh-1);}}
.pg .jn-more:active{transform:scale(.97);}
.pg .jn-more[hidden]{display:none;}

/* ---------- Article: grid ---------- */
.pg .ar{padding:56px 0 112px;}
/* reading column 640px (about 74 characters a line at 18px); the slack sits between the contents rail and the text, so the
   text's right edge stays flush with the Keep reading cards below (.wrap.nar) */
.pg .ar-g{display:grid;grid-template-columns:240px minmax(0,640px);column-gap:72px;justify-content:space-between;}
.pg .ar-hd{grid-column:2;grid-row:1;min-width:0;}
.pg .ar-toc{grid-column:1;grid-row:2;}
.pg .ar-main{grid-column:2;grid-row:2;min-width:0;margin-top:48px;}

/* header: back link, eyebrow, H1, standfirst, byline, hero */
.pg .ar-back{display:inline-flex;align-items:center;gap:6px;min-height:40px;font-size:14px;font-weight:500;color:var(--green-2);transition:color .16s ease,transform 140ms var(--ease-out);}
.pg .ar-back:active{transform:scale(.97);}
@media (hover:hover) and (pointer:fine){.pg .ar-back:hover{color:var(--green);}}
.pg .ar-eb{margin-top:16px;}
.pg .ar-hd h1{margin-top:12px;max-width:20em;font-size:clamp(34px,3.6vw,52px);line-height:1.08;letter-spacing:-0.035em;font-weight:500;color:var(--ink);}
.pg .ar-sf{margin-top:20px;max-width:36em;font-size:clamp(18px,1.4vw,21px);line-height:1.5;color:var(--ink-2);}
.pg .ar-by{display:flex;align-items:center;gap:12px;margin-top:32px;padding-bottom:24px;border-bottom:1px solid var(--line);font-size:15px;line-height:20px;}
.pg .ar-mk{display:grid;place-items:center;width:40px;height:40px;flex:0 0 auto;border-radius:50%;background:var(--green-deep);color:#fff;font-size:16px;font-weight:500;}
.pg .ar-au{font-weight:500;color:var(--ink);}
.pg .ar-rt{color:var(--ink-2);font-variant-numeric:tabular-nums;}
.pg .ar-hero{width:auto;max-width:100%;height:auto;max-height:min(78vh,760px);max-height:min(78svh,760px);margin-top:32px;border-radius:var(--r-l);background:var(--tile);outline:1px solid rgba(0,0,0,.1);outline-offset:-1px;}

/* contents: sticky list beside the body on wide screens, a closed <details> under the byline on narrow ones */
.pg .ar-toc{display:block;position:sticky;top:calc(var(--bar) + env(safe-area-inset-top, 0px) + 32px);align-self:start;margin-top:48px;max-height:calc(100vh - var(--bar) - 64px);max-height:calc(100svh - var(--bar) - 64px);overflow-y:auto;scrollbar-width:none;}
.pg .ar-toc::-webkit-scrollbar{display:none;}
.pg .ar-toc .lab{margin-bottom:12px;font-size:14px;font-weight:500;color:var(--ink);}
.pg .ar-toc ol{border-left:1px solid var(--line);}
.pg .ar-toc a{display:block;margin-left:-1px;padding:6px 0 6px 14px;border-left:1px solid transparent;font-size:14px;line-height:1.45;color:var(--ink-2);text-wrap:pretty;transition:color .16s ease,border-color .16s ease;}
@media (hover:hover) and (pointer:fine){.pg .ar-toc a:hover{color:var(--ink);}}
.pg .ar-toc a[aria-current]{color:var(--ink);font-weight:500;border-left-color:var(--green-2);}
.pg .ar-tocm{display:none;}

/* archive note, outside the prose */
.pg .ar-note{margin-bottom:40px;padding:16px 20px;border-radius:var(--r-m);background:var(--canvas-2);font-size:15px;line-height:1.55;color:var(--ink-2);}
.pg .ar-note strong{font-weight:500;color:var(--ink);}
.pg .ar-note a{color:var(--green-2);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px;}

/* ---------- Article: body typography (DECK-journal B3) ---------- */
.pg .prose{font-size:18px;line-height:1.65;color:var(--ink-2);}
.pg .prose > :first-child{margin-top:0;}
.pg .prose p{margin:0 0 24px;}
.pg .prose h2{margin:56px 0 16px;font-size:28px;line-height:1.2;letter-spacing:-0.025em;font-weight:500;color:var(--ink);scroll-margin-top:calc(var(--bar) + env(safe-area-inset-top, 0px) + 24px);}
.pg .prose h3{margin:40px 0 12px;font-size:21px;line-height:1.3;letter-spacing:-0.02em;font-weight:500;color:var(--ink);scroll-margin-top:calc(var(--bar) + env(safe-area-inset-top, 0px) + 24px);}
.pg .prose h4{margin:32px 0 8px;font-size:18px;line-height:1.4;font-weight:600;color:var(--ink);}
.pg .prose :is(h2,h3,h4) + :is(h3,h4){margin-top:16px;}
.pg .prose ul{list-style:disc;}
.pg .prose ol{list-style:decimal;}
.pg .prose :is(ul,ol){margin:0 0 24px;padding-left:1.25em;}
.pg .prose li{margin:0 0 10px;padding-left:4px;}
.pg .prose li::marker{color:var(--green-2);}
.pg .prose li p{margin:0;}
.pg .prose li > :is(ul,ol){margin:10px 0 0;}
.pg .prose em{font-style:italic;}
/* archive posts wrap whole headings in <em>/<i>; Geist ships no italic, so the browser would fake a slant */
.pg :is(h2,h3,h4) :is(em,i){font-style:normal;}
.pg .prose strong{font-weight:600;color:var(--ink);}
.pg .prose a{color:var(--green-2);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px;text-decoration-color:rgba(39,96,75,.5);transition:color .16s ease,text-decoration-color .16s ease;}
@media (hover:hover) and (pointer:fine){.pg .prose a:hover{color:var(--green);text-decoration-color:currentColor;}}
.pg .prose :is(img,figure){display:block;max-width:100%;height:auto;margin:32px 0;border-radius:var(--r-m);}
.pg .prose img{outline:1px solid rgba(0,0,0,.1);outline-offset:-1px;}
.pg .prose figure img{margin:0;}
.pg .prose blockquote{margin:32px 0;padding-left:24px;border-left:2px solid var(--green-2);font-size:21px;line-height:1.45;font-style:normal;color:var(--ink);}

/* share row: the one CTA is the band below */
.pg .ar-share{display:flex;flex-wrap:wrap;align-items:center;gap:4px 24px;margin-top:48px;padding-top:16px;border-top:1px solid var(--line);font-size:15px;}
.pg .ar-share .lab{color:var(--ink-2);}
.pg .ar-share :is(a,button){display:inline-flex;align-items:center;min-height:40px;padding:0;border:0;background:none;font:inherit;font-weight:500;color:var(--ink);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:5px;text-decoration-color:rgba(74,85,80,.45);cursor:pointer;transition:color .16s ease,text-decoration-color .16s ease,transform 140ms var(--ease-out);}
.pg .ar-share :is(a,button):active{transform:scale(.97);}
@media (hover:hover) and (pointer:fine){.pg .ar-share :is(a,button):hover{color:var(--green);text-decoration-color:currentColor;}}

/* ---------- Article: keep reading ---------- */
.pg .ar-more{padding:96px 0;}
.pg .ar-more-hd{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-bottom:40px;}
.pg .ar-cards > li{display:flex;min-width:0;}
.pg .ar-card{flex:1 1 auto;gap:0;}
.pg .ar-card .lab{font-size:14px;line-height:20px;font-weight:500;color:var(--green-2);}
.pg .ar-card h3{margin-top:16px;font-size:20px;line-height:1.3;letter-spacing:-0.02em;color:var(--ink);transition:color .16s ease;}
@media (hover:hover) and (pointer:fine){.pg .ar-card:hover h3{color:var(--green);}}
.pg .ar-core{position:relative;overflow:hidden;}
/* the rule runs the full card width; the card's rounded corners (overflow:hidden) trim its ends evenly */
.pg .ar-core::before{content:"";position:absolute;top:0;left:0;right:0;height:3px;background:var(--green-2);}
.pg .ar-core .ln{margin-top:16px;font-size:20px;line-height:1.3;letter-spacing:-0.02em;font-weight:500;color:var(--ink);text-wrap:balance;}
.pg .ar-core .lnk{margin-top:auto;padding-top:16px;align-self:flex-start;}
@media (hover:hover) and (pointer:fine){.pg .ar-core:hover .lnk{color:var(--green);text-decoration-color:currentColor;}}

/* ---------- Responsive ---------- */
@media (max-width:1099px){
  .pg .jn-fcard{gap:48px;padding:40px;}
  .pg .jn-row{grid-template-columns:minmax(0,1fr) auto;row-gap:6px;}
  .pg .jn-row .m{grid-column:1;}
  .pg .jn-row h3{grid-column:1;grid-row:2;}
  .pg .jn-row .rd{grid-column:2;grid-row:1 / span 2;align-self:center;}
  .pg .wrap.nar.ar-g{grid-template-columns:minmax(0,1fr);max-width:calc(640px + var(--gut) * 2);}   /* .wrap.nar's 1040px would win at 0,3,0 */
  .pg .ar-hd,.pg .ar-main{grid-column:1;}
  .pg .ar-main{margin-top:40px;}
  .pg .ar-toc{display:none;}
  .pg .ar-tocm{display:block;margin-top:24px;border-radius:var(--r-m);box-shadow:inset 0 0 0 1px var(--line);}
  .pg .ar-tocm summary{display:flex;align-items:center;justify-content:space-between;min-height:48px;padding:0 16px;font-size:15px;font-weight:500;color:var(--ink);cursor:pointer;list-style:none;}
  .pg .ar-tocm summary::-webkit-details-marker{display:none;}
  .pg .ar-tocm summary::after{content:"";width:8px;height:8px;margin-right:4px;border-right:1.5px solid var(--ink-2);border-bottom:1.5px solid var(--ink-2);transform:translateY(-2px) rotate(45deg);transition:transform .2s var(--ease-out);}
  .pg .ar-tocm[open] summary::after{transform:translateY(2px) rotate(-135deg);}
  .pg .ar-tocm ol{padding:0 16px 12px;}
  .pg .ar-tocm[open] ol{animation:ar-tocm-in .18s var(--ease-out);}
  .pg .ar-tocm a{display:block;padding:11px 0;border-top:1px solid var(--line);font-size:15px;line-height:1.4;color:var(--ink-2);}
}
@media (max-width:759px){
  .pg .jn-hero{padding:40px 0 28px;}
  .pg .jn-hero h1{font-size:38px;}
  .pg .jn-hero .acts{margin-top:12px;}
  .pg .jn-fcard{grid-template-columns:minmax(0,1fr);gap:20px;padding:24px 20px;border-radius:var(--r-m);}
  .pg .jn-fcopy .jn-meta{margin-top:16px;}
  .pg .jn-fcopy h2{font-size:26px;line-height:1.12;}
  .pg .jn-fline{font-size:16px;}
  .pg .jn-fcopy .lnk{margin-top:8px;}
  .pg .jn-fq{padding-left:20px;}
  .pg .jn-fq blockquote{margin-top:10px;}
  .pg .jn-fq blockquote p{font-size:20px;}
  .pg .jn-notes{padding-top:56px;}
  .pg .jn-row,.pg .jn-arch .jn-row{grid-template-columns:minmax(0,1fr);padding:18px 0;}
  .pg .jn-row .rd{display:none;}
  .pg .jn-row h3{font-size:20px;line-height:1.25;}
  .pg .jn-arch .jn-row h3{font-size:18px;}
  .pg .jn-pills{margin:0 calc(var(--gut) * -1) 20px;}
  /* the pills run off the right edge: fade them out there so a cut pill reads as "scroll for more", not as a clipped word */
  .pg .jn-pills-in{-webkit-mask-image:linear-gradient(to right,#000 calc(100% - 48px),transparent);mask-image:linear-gradient(to right,#000 calc(100% - 48px),transparent);}
  .pg .jn-pills-in{flex-wrap:nowrap;overflow-x:auto;padding:0 var(--gut);scrollbar-width:none;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;}
  .pg .jn-pills-in::-webkit-scrollbar{display:none;}
  .pg .apill{flex:0 0 auto;height:44px;}
  .pg .jn-afoot{flex-direction:column;align-items:stretch;gap:14px;}
  .pg .jn-more{width:100%;height:48px;}
  .pg .ar{padding:16px 0 72px;}
  .pg .ar-eb{margin-top:4px;}   /* the back link's 44px box already spaces it */
  .pg .ar-hd h1{font-size:34px;line-height:1.1;}
  .pg .ar-sf{margin-top:16px;font-size:18px;}
  .pg .ar-by{margin-top:24px;padding-bottom:20px;}
  .pg .ar-hero{margin-top:24px;border-radius:var(--r-m);}
  .pg .prose{font-size:17px;line-height:1.6;}
  .pg .prose p,.pg .prose :is(ul,ol){margin-bottom:20px;}
  .pg .prose h2{margin:40px 0 12px;font-size:24px;}
  .pg .prose h3{margin:28px 0 10px;font-size:19px;}
  .pg .prose :is(img,figure){margin:28px 0;}
  .pg .ar-note{margin-bottom:32px;}
  .pg .ar-share{margin-top:40px;gap:0 20px;}
  .pg .ar-more{padding:64px 0;}
  .pg .ar-more-hd{margin-bottom:24px;}
  .pg .ar-core .ln{font-size:19px;}
  .pg .pg-cta .acts .btn{width:100%;}
}
@keyframes ar-tocm-in{from{opacity:0;transform:translateY(-4px);}to{opacity:1;transform:none;}}
@media (prefers-reduced-motion:reduce){
  .pg .jn-row:is(:hover,:active) .ar-ic{transform:none;}
}
@media (pointer:coarse){.pg .ar-toc a{min-height:44px;display:flex;align-items:center;}.pg .prose li>a:only-child{display:inline-flex;align-items:center;min-height:44px;}.pg .apill{height:44px;}.pg .ar-back{min-height:44px;}.pg .ar-share :is(a,button){min-height:44px;}}
