/* ══════════════════════════════════════════════════════════════
   Karya · blog
   Loads on top of factory.css, which supplies the tokens, the nav,
   the footer, the buttons and the reveal states. Everything here is
   long-form: the index of memoranda and the memoranda themselves.

   The reading column is 720px. Wider is faster to skim and worse to
   read, and these are arguments, not documentation.
   ══════════════════════════════════════════════════════════════ */

:root { --read: 720px; }

.wrap-read { max-width: var(--read); margin: 0 auto; padding: 0 var(--gut); }

/* ─── masthead ─────────────────────────────── */
.blog-head {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(48px, 8vh, 88px) var(--gut) clamp(38px, 6vh, 60px);
}
.blog-head h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 144;
  font-weight: 400;
  font-size: clamp(38px, 6vw, 68px);
  letter-spacing: -0.02em;
  line-height: 1.06;
  margin: 0;
  max-width: 16ch;
  text-wrap: balance;
}
.blog-head h1 em { font-style: italic; color: var(--accent); }
.blog-head .sub {
  margin: 24px 0 0;
  max-width: 58ch;
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.62;
  color: var(--ink-dim);
}

/* ─── index of memoranda ───────────────────── */
/* The grid's own background is the hairline between cells, so it must carry
 * no padding — margin does the spacing instead, or the padding renders as a
 * band of rule colour. */
.index-wrap {
  width: min(calc(var(--maxw) - 2 * var(--gut)), calc(100% - 2 * var(--gut)));
  margin: 0 auto clamp(56px, 9vh, 96px);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
}
/* The lead memo takes the full width and splits into copy + epigraph. */
.post-card.featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(24px, 4vw, 56px); }

.post-card {
  background: var(--paper);
  padding: 28px 26px 30px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: background .16s;
}
a.post-card:hover { background: #fff; }
a.post-card:hover h2 { color: var(--accent); }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 16px;
}
.meta-row .tag { color: var(--accent); }

.post-card h2 {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(21px, 2.4vw, 30px);
  letter-spacing: -0.024em;
  line-height: 1.14;
  margin: 0 0 12px;
  transition: color .16s;
  text-wrap: balance;
}
.post-card h2 em {
  font-style: italic;
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 120;
  font-weight: 400;
  color: var(--accent);
}
.post-card .excerpt { margin: 0 0 18px; font-size: 14.5px; line-height: 1.62; color: var(--ink-dim); max-width: 58ch; }
.post-card .read {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
/* Nothing to click yet, so it must not look clickable. */
.post-card.placeholder { opacity: .62; }
.post-card.placeholder .read { color: var(--ink-muted); }

.post-card .right {
  border-left: 2px solid var(--accent-line);
  padding-left: clamp(16px, 2.5vw, 28px);
  align-self: center;
}
.post-card .quote {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 60;
  font-style: italic;
  font-size: clamp(15px, 1.5vw, 17.5px);
  line-height: 1.42;
  color: var(--accent);
}
.post-card .att {
  display: block;
  margin-top: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ─── a memorandum ─────────────────────────── */
.memo-section { padding: clamp(50px, 8vh, 88px) 0 clamp(56px, 9vh, 96px); scroll-margin-top: 80px; }
.memo-wrap { max-width: var(--read); margin: 0 auto; padding: 0 var(--gut); }

.memo-head { padding-bottom: 34px; border-bottom: 1px solid var(--rule); margin-bottom: 40px; }
.memo-head h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 144;
  font-weight: 400;
  font-size: clamp(30px, 4.6vw, 50px);
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 20px;
  text-wrap: balance;
}
.memo-head h2 em { font-style: italic; color: var(--accent); }
.memo-head .deck { margin: 0 0 22px; font-size: 17px; line-height: 1.6; color: var(--ink-dim); }
.memo-head .deck strong { color: var(--ink); font-weight: 600; }
.memo-head .byline {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ─── body copy ────────────────────────────── */
.memo-body { font-size: 17px; line-height: 1.72; color: var(--ink-dim); }
.memo-body p { margin: 0 0 22px; }
.memo-body strong { color: var(--ink); font-weight: 600; }
.memo-body em { font-style: italic; }
.memo-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-line);
  transition: border-color .15s;
}
.memo-body a:hover { border-bottom-color: var(--accent); }

.memo-body h3 {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(21px, 2.3vw, 27px);
  letter-spacing: -0.022em;
  line-height: 1.18;
  color: var(--ink);
  margin: 52px 0 20px;
}
.memo-body h3 em {
  font-style: italic;
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 120;
  font-weight: 400;
  color: var(--accent);
}
/* The roman numeral hangs in the left margin where there is room for it,
 * and folds back inline on narrow screens. */
.memo-body h3 .num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-right: 12px;
}
@media (min-width: 1000px) {
  .memo-body h3 { position: relative; }
  .memo-body h3 .num { position: absolute; left: -62px; top: .5em; margin: 0; }
}

.memo-body .dropcap::first-letter {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 144;
  font-weight: 400;
  font-size: 3.1em;
  line-height: .84;
  float: left;
  padding: 4px 10px 0 0;
  color: var(--ink);
}

.memo-body ol, .memo-body ul { margin: 0 0 22px; padding-left: 26px; }
.memo-body li { margin-bottom: 9px; }
.memo-body li::marker { color: var(--accent); font-variant-numeric: tabular-nums; }

.memo-body blockquote {
  margin: 34px 0;
  padding: 0 0 0 clamp(18px, 3vw, 28px);
  border-left: 2px solid var(--accent-line);
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 72;
  font-style: italic;
  font-size: clamp(17px, 1.9vw, 21px);
  line-height: 1.45;
  color: var(--ink);
}
.memo-body blockquote .att {
  display: block;
  margin-top: 14px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* The one claim per memo that gets to interrupt the column. */
.memo-body .pullquote {
  margin: 40px 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding-block: 28px;
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 120;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(22px, 2.7vw, 31px);
  line-height: 1.24;
  letter-spacing: -0.015em;
  color: var(--accent);
  max-width: none;
  text-wrap: balance;
}
.memo-body .pullquote em { font-style: italic; }

.memo-body figure, .memo-body .chart { margin: 36px 0 6px; }
.memo-body .caption {
  text-align: center;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0 0 36px;
}

/* ─── references ───────────────────────────── */
.refs { margin-top: 52px; padding-top: 26px; border-top: 1px solid var(--rule); }
.refs h4 {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 16px;
}
.refs ol { padding-left: 22px; }
.refs li { font-size: 13.5px; line-height: 1.6; margin-bottom: 7px; word-break: break-word; }
.refs a { color: var(--ink-dim); border-bottom-color: var(--rule); }

/* ─── end matter ───────────────────────────── */
.memo-end {
  margin-top: 46px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.memo-end a { color: var(--ink-muted); text-decoration: none; border: 0; transition: color .15s; }
.memo-end a:hover { color: var(--accent); }

.section-divider { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut); }
.section-divider .sd { display: block; height: 1px; background: var(--rule); }

/* ─── responsive ───────────────────────────── */
@media (max-width: 860px) {
  .index-wrap { grid-template-columns: 1fr; }
  .post-card.featured { grid-template-columns: 1fr; }
  .post-card .right { border-left: 0; padding-left: 0; border-top: 2px solid var(--accent-line); padding-top: 18px; }
}
@media (max-width: 700px) {
  .memo-body { font-size: 16.5px; }
  .memo-body .dropcap::first-letter { font-size: 2.7em; }
}
