/* ===================== Kitex Digital: journal on the redesigned look =====================
   Loaded after header.css and kx.css by journal.html and every page in /journal.
   Everything shared (tokens, frame, rules, type, buttons, footer) comes from kx.css.
   This file only holds what is particular to the journal.

   Two layouts:
   - journal.html is a main page: hero with the ribbon, then ruled sections.
   - an article is a subpage: no ribbon, a breadcrumb, a reading column and one
     quiet card beside it. The article HTML keeps its old class names (.re-*,
     .prose, .post-cta); they are restyled here so 36 files did not need rewriting.

   Class names starting jr- are read by js/journal-search.js and written by
   _build/journal-index.py. Do not rename them without changing those two. */

/* =====================================================================
   INDEX: search in the hero
   ===================================================================== */
.jr-find{display:flex;gap:10px;margin-top:36px;max-width:560px}
.jr-find input{flex:1;min-width:0;height:48px;padding:0 16px;border:1px solid rgba(255,255,255,.24);border-radius:6px;
  background:rgba(8,8,9,.6);color:#fff;font:inherit;font-size:16px;-webkit-appearance:none;appearance:none;transition:border-color .18s ease}
.jr-find input::placeholder{color:var(--mute);opacity:1}
.jr-find input:hover{border-color:rgba(255,255,255,.4)}
.jr-find input:focus{outline:none;border-color:var(--blue-2);box-shadow:0 0 0 1px var(--blue-2)}
.jr-find input::-webkit-search-cancel-button{filter:grayscale(1) brightness(3);opacity:.6;cursor:pointer}
.jr-find .k-btn{cursor:pointer;flex:none}
/* a short headline here, so it stays clear of the ribbon */
.kj-index .k-hero .k-h1{max-width:640px}

/* =====================================================================
   INDEX: heading with the filter and sort on the same row
   ===================================================================== */
.jr-top{display:flex;align-items:flex-end;justify-content:space-between;flex-wrap:wrap;gap:20px 32px;padding:72px var(--pad) 36px}
.jr-tools{display:flex;align-items:center;flex-wrap:wrap;gap:8px 22px}
.jr-tabs{display:flex;gap:4px;padding:4px;border:1px solid var(--line-2);border-radius:8px}
.jr-tabs button{height:34px;padding:0 14px;border:0;border-radius:5px;background:none;color:var(--mute);
  font-size:15px;font-weight:500;line-height:1;white-space:nowrap;cursor:pointer;transition:color .18s ease,background .18s ease}
.jr-tabs button:hover{color:#fff}
.jr-tabs button.on{background:rgba(255,255,255,.1);color:#fff}
.jr-sort{display:inline-flex;align-items:center;gap:6px;height:42px;padding:0 2px;border:0;background:none;color:var(--link);
  font-size:15px;font-weight:500;line-height:1;white-space:nowrap;cursor:pointer;transition:color .18s ease}
.jr-sort:hover{color:#fff}
.jr-sort em,.jr-sort i{font-style:normal}
.jr-sort i{display:inline-block;transition:transform .2s ease}
.jr-sort[data-dir="old"] i{transform:rotate(180deg)}
.jr-status{padding:0 var(--pad) 18px;font-size:14.5px;color:var(--mute)}
.jr-status:empty{display:none}

/* =====================================================================
   INDEX: the guides as a ruled grid, flush with the frame lines.
   The same .jr-card is written by journal-search.js for search results.
   Rows are divided by each card's top border; the grid clips the first row's
   so the grid's own top rule is the only line there.
   ===================================================================== */
.jr-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border-top:1px solid var(--line);overflow:hidden}
.jr-card{display:flex;flex-direction:column;margin-top:-1px;padding:28px 28px 30px;border-top:1px solid var(--line);border-right:1px solid var(--line);
  transition:background .2s ease}
.jr-card:nth-child(3n){border-right:0}
.jr-card:hover{background:rgba(255,255,255,.022)}
.jr-card img{width:100%;height:auto;aspect-ratio:3/2;object-fit:cover;border-radius:8px;border:1px solid var(--line-2);background:#111}
.jr-card-in{flex:1;display:flex;flex-direction:column;margin-top:20px}
.jr-card h3{font-size:21px;line-height:1.24;font-weight:400;letter-spacing:-.014em;color:#fff;text-wrap:balance;transition:color .18s ease}
.jr-card:hover h3{color:var(--link)}
.jr-card p{margin-top:10px;font-size:15.5px;line-height:1.5;color:var(--body);
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}
/* the category sits under the text as plain meta, not as a label above the title */
.jr-cat{order:3;margin-top:auto;padding-top:16px;font-size:14.5px;color:var(--mute)}
.jr-empty{grid-column:1 / -1;padding:36px var(--pad) 44px;font-size:17px;color:var(--body)}

/* =====================================================================
   INDEX: featured and newest, two ruled columns of rows
   ===================================================================== */
.jr-duo{display:grid;grid-template-columns:1fr 1fr}
.jr-duo-cell{padding:60px 44px 64px var(--pad)}
.jr-duo-cell+.jr-duo-cell{border-left:1px solid var(--line);padding:60px var(--pad) 64px 44px}
.jr-rows{margin-top:22px;border-top:1px solid var(--line)}
.jr-row{display:grid;grid-template-columns:64px minmax(0,1fr) auto;align-items:center;gap:18px;padding:16px 4px 16px 0;border-bottom:1px solid var(--line)}
.jr-row img{width:64px;height:64px;object-fit:cover;border-radius:6px;background:#111}
.jr-row-t{display:flex;flex-direction:column;gap:5px;min-width:0}
.jr-row b{font-size:18px;line-height:1.3;font-weight:400;letter-spacing:-.012em;color:#fff;transition:color .18s ease}
.jr-row svg{color:var(--mute);transition:transform .18s ease,color .18s ease}
.jr-row:hover b{color:var(--link)}
.jr-row:hover svg{transform:translateX(3px);color:var(--link)}

/* =====================================================================
   INDEX: every article, by topic (written by _build/journal-index.py)
   ===================================================================== */
.jr-all-head{padding:72px var(--pad) 36px}
.jr-all-cols{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border-top:1px solid var(--line)}
.jr-all-col{padding:30px 28px 64px;border-left:1px solid var(--line)}
.jr-all-col:first-child{border-left:0;padding-left:var(--pad)}
.jr-all-col h3{font-size:19px;line-height:1.3;font-weight:500;letter-spacing:-.012em;color:#fff}
.jr-all-col ul{margin-top:12px}
.jr-all-col li a{display:block;padding:7px 0;font-size:15.5px;line-height:1.4;color:var(--body);transition:color .15s ease}
.jr-all-col li a:hover{color:var(--link)}

/* =====================================================================
   ARTICLE: a document, not a poster. No ribbon.
   ===================================================================== */
/* the breadcrumb row, with a rule across the whole screen under it */
.kj-post .re-eyebrow{position:relative;display:block;padding:20px var(--pad);font-size:14.5px;color:var(--link);transition:color .18s ease}
.kj-post .re-eyebrow:hover{color:#fff}
.kj-post .re-eyebrow span{margin:0 9px;color:var(--mute);opacity:.6}
.kj-post .re-eyebrow::after{content:"";position:absolute;bottom:0;left:50%;width:100vw;height:1px;margin-left:-50vw;background:var(--line);pointer-events:none}

.kj-post h1{max-width:980px;padding:56px var(--pad) 0;font-size:clamp(33px,3.6vw,50px);line-height:1.08;font-weight:300;letter-spacing:-.03em;color:#fff;text-wrap:balance}
.kj-post .re-deck{max-width:780px;padding:0 var(--pad);margin-top:20px;font-size:clamp(18px,1.55vw,21px);line-height:1.45;letter-spacing:-.008em;color:var(--mute)}
.kj-post .re-byline{display:flex;align-items:center;gap:10px;padding:0 var(--pad);margin-top:24px;font-size:14.5px;color:var(--mute)}
.kj-post .re-dot{flex:none;width:3px;height:3px;border-radius:50%;background:currentColor}

/* Reading column on the left, one card held beside it on the right.
   The card (.post-cta) is the last thing inside .prose in the HTML. It is put
   in the second grid column and spans every row, so it can stay in view while
   the article scrolls and the HTML did not have to change. */
.kj-post .prose{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 320px;column-gap:80px;margin-top:52px;padding:48px var(--pad) 96px}
.kj-post .prose::before{content:"";position:absolute;top:0;left:50%;width:100vw;height:1px;margin-left:-50vw;background:var(--line);pointer-events:none}
.kj-post .prose::after{content:"";position:absolute;top:0;bottom:0;right:calc(var(--pad) + 320px + 40px);width:1px;background:var(--line);pointer-events:none}
.kj-post .prose>*{grid-column:1;max-width:720px;min-width:0}
.kj-post .prose>:first-child{margin-top:0}

.kj-post .prose>p{margin-top:22px;font-size:17.5px;line-height:1.7;color:var(--body)}
.kj-post .prose>h2{margin-top:56px;font-size:clamp(24px,2.1vw,29px);line-height:1.2;font-weight:400;letter-spacing:-.018em;color:#fff;text-wrap:balance}
.kj-post .prose>h3{margin-top:36px;font-size:20px;line-height:1.3;font-weight:500;letter-spacing:-.012em;color:#fff}
.kj-post .prose>h2+p,.kj-post .prose>h3+p{margin-top:14px}
.kj-post .prose>hr{display:none}
.kj-post .prose>ul,.kj-post .prose>ol{margin-top:20px}
.kj-post .prose li{position:relative;padding-left:24px;font-size:17.5px;line-height:1.65;color:var(--body)}
.kj-post .prose li+li{margin-top:12px}
.kj-post .prose ul>li::before{content:"";position:absolute;left:3px;top:.72em;width:5px;height:5px;background:var(--blue-2)}
.kj-post .prose ol{counter-reset:kj}
.kj-post .prose ol>li{counter-increment:kj;padding-left:32px}
.kj-post .prose ol>li::before{content:counter(kj);position:absolute;left:0;top:0;font-weight:500;color:var(--link);font-variant-numeric:tabular-nums}
.kj-post .prose strong{font-weight:500;color:#fff}
.kj-post .prose em{font-style:italic}
.kj-post .prose p a,.kj-post .prose li a{color:var(--link);text-decoration:underline;text-underline-offset:3px;text-decoration-color:rgba(142,162,255,.45);transition:color .15s ease}
.kj-post .prose p a:hover,.kj-post .prose li a:hover{color:#fff}
.kj-post .prose>blockquote{margin:44px 0 6px;padding:2px 0 2px 24px;border-left:2px solid var(--blue);
  font-size:clamp(21px,1.9vw,26px);line-height:1.32;font-weight:300;letter-spacing:-.015em;color:#fff}

.kj-post .prose>.post-cta{grid-column:2;grid-row:1 / span 300;align-self:start;position:sticky;top:calc(var(--hd-h) + 28px);
  max-width:none;margin-top:0;padding:24px 24px 26px;border:1px solid var(--line);border-radius:8px;background:var(--bg-2)}
.kj-post .post-cta p{font-size:16px;line-height:1.55;color:var(--body)}
.kj-post .post-cta .link-arrow{display:inline-flex;align-items:center;justify-content:center;gap:10px;height:46px;padding:0 18px;margin-top:20px;border-radius:6px;
  background:var(--blue-deep);color:#fff;font-size:16px;font-weight:500;line-height:1;letter-spacing:-.005em;white-space:nowrap;transition:background .18s ease}
.kj-post .post-cta .link-arrow:hover{background:var(--blue-deep-h)}
/* the old arrow character is swapped for the chevron the buttons use everywhere else */
.kj-post .post-cta .arr{flex:none;width:7px;height:7px;font-size:0;border-top:1.6px solid currentColor;border-right:1.6px solid currentColor;transform:rotate(45deg);transition:transform .18s ease}
.kj-post .post-cta .link-arrow:hover .arr{transform:translateX(3px) rotate(45deg)}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media(max-width:1180px){
  .kj-post .prose{grid-template-columns:minmax(0,1fr) 290px;column-gap:64px}
  .kj-post .prose::after{right:calc(var(--pad) + 290px + 32px)}
  .jr-duo-cell{padding-right:32px}
  .jr-duo-cell+.jr-duo-cell{padding-left:32px}
}
@media(max-width:960px){
  .jr-top{padding-top:60px}
  .jr-all-head{padding-top:60px}
  .jr-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .jr-card:nth-child(3n){border-right:1px solid var(--line)}
  .jr-card:nth-child(2n){border-right:0}
  .jr-duo{grid-template-columns:1fr}
  .jr-duo-cell,.jr-duo-cell+.jr-duo-cell{padding:48px var(--pad) 12px;border-left:0}
  .jr-duo-cell+.jr-duo-cell{padding-bottom:56px}
  .jr-all-cols{grid-template-columns:1fr 1fr}
  .jr-all-col:nth-child(odd){border-left:0;padding-left:var(--pad)}
  .jr-all-col:nth-child(n+3){border-top:1px solid var(--line)}
  /* article: one column, the card goes back to the end of the text */
  .kj-post .prose{display:block;padding-top:40px;padding-bottom:72px}
  .kj-post .prose::after{display:none}
  .kj-post .prose>.post-cta{position:static;max-width:720px;margin-top:48px}
}
@media(max-width:700px){
  .jr-find{flex-direction:column;margin-top:28px;max-width:none}
  .jr-find input,.jr-find .k-btn{width:100%;height:50px;flex:none}
  .jr-top{flex-direction:column;align-items:flex-start;padding:48px 0 26px}
  .jr-tools{width:100%;justify-content:space-between}
  .jr-tabs button{padding:0 11px}
  .jr-status{padding:0 0 16px}
  .jr-grid{grid-template-columns:1fr;margin:0 -20px}
  .jr-card,.jr-card:nth-child(3n){padding:26px 20px 28px;border-right:0}
  .jr-empty{padding:28px 20px 36px}
  .jr-duo-cell,.jr-duo-cell+.jr-duo-cell{padding:44px 0 8px}
  .jr-duo-cell+.jr-duo-cell{padding-bottom:48px}
  .jr-row{grid-template-columns:56px minmax(0,1fr) auto;gap:14px}
  .jr-row img{width:56px;height:56px}
  .jr-row b{font-size:17px}
  .jr-all-head{padding:48px 0 26px}
  .jr-all-cols{grid-template-columns:1fr}
  .jr-all-col,.jr-all-col:first-child,.jr-all-col:nth-child(odd){padding:26px 0 30px;border-left:0}
  .jr-all-col:nth-child(n+2){border-top:1px solid var(--line)}
  .jr-all-col:last-child{padding-bottom:52px}

  .kj-post .re-eyebrow{padding:16px 0}
  .kj-post h1{padding:36px 0 0;font-size:clamp(31px,8.4vw,38px)}
  .kj-post .re-deck{padding:0;margin-top:16px}
  .kj-post .re-byline{padding:0;margin-top:20px}
  .kj-post .prose{margin-top:36px;padding:32px 0 60px}
  .kj-post .prose>p,.kj-post .prose li{font-size:17px}
  .kj-post .prose>h2{margin-top:44px}
  .kj-post .prose>blockquote{margin-top:36px;padding-left:18px}
  .kj-post .post-cta .link-arrow{width:100%;height:50px}
}
