/* writing.css — long-form essay layout + writing index. */

/* Narrow column shared by post hero + body. */
.wrap-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 720px) { .wrap-narrow { padding: 0 20px; } }

/* ── Post hero ─────────────────────────────────────────── */
.post-hero {
  padding: 96px 0 56px;
  border-bottom: 1px solid var(--hairline);
}
.post-crumb {
  display: flex; gap: 10px; align-items: baseline;
  font-size: 11px; color: var(--fg-muted);
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 32px;
}
.post-crumb a { color: var(--fg-muted); text-decoration: none; }
.post-crumb a:hover { color: var(--accent); }
.post-h {
  font-size: clamp(36px, 5vw, 64px) !important;
  line-height: 1.05 !important;
  max-width: 22ch;
  margin: 0;
}
.post-dek {
  margin-top: 28px;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.5;
  color: var(--fg-muted);
  max-width: 56ch;
  text-wrap: pretty;
}
.post-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 40px;
}
.post-tag {
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  color: var(--fg-muted);
  text-transform: uppercase;
}

/* ── Post body ─────────────────────────────────────────── */
.post-body {
  padding: 64px 0 80px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--fg);
}
.post-body > * + * { margin-top: 1.4em; }
.post-body h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 2.4vw, 34px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 2.4em 0 0.4em;
  text-wrap: balance;
}
html.dir-editorial .post-body h2 { font-weight: 400; }
.post-body h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  margin: 2em 0 0.4em;
  letter-spacing: -0.005em;
}
.post-body p { margin: 0; }
.post-body p + p { margin-top: 1.2em; }
.post-body strong { font-weight: 600; color: var(--fg); }
.post-body em { font-style: italic; }
.post-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.post-body a:hover { text-decoration-thickness: 2px; }
.post-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 2px 6px;
  background: var(--bg-soft);
  border: 1px solid var(--hairline);
  border-radius: 4px;
}
.post-body pre {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  padding: 20px 24px;
  background: var(--bg-soft);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.6em 0;
}
.post-body pre code { padding: 0; background: transparent; border: 0; font-size: inherit; }
.post-body ul, .post-body ol {
  padding-left: 1.4em;
  margin: 1.2em 0;
}
.post-body ul li, .post-body ol li { margin: 0.5em 0; }
.post-body blockquote {
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 24px;
  margin: 2em 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 1.8vw, 24px);
  font-style: italic;
  line-height: 1.4;
  color: var(--fg);
}
html.dir-brutalist .post-body blockquote { font-style: normal; font-family: var(--font-mono); font-size: 16px; }

/* Section number prefix (optional ornament for h2). */
.post-body .post-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 8px;
  font-style: normal;
}

/* Pull-out aside. */
.post-aside {
  margin: 2em 0;
  padding: 20px 24px;
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--accent);
  background: var(--bg-soft);
  font-size: 15px;
  line-height: 1.6;
}
.post-aside-h {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px;
}
.post-aside p { margin: 0; }
.post-aside p + p { margin-top: 0.8em; }

/* Mini-table (used for cost models, comparisons). */
.post-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 1.6em 0;
  font-variant-numeric: tabular-nums;
}
.post-table th, .post-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
}
.post-table th {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--hairline-strong);
}
.post-table tr:last-child td { border-bottom: 0; }
.post-table td.num { text-align: right; }

/* ── CTA bar ───────────────────────────────────────────── */
.post-cta {
  border-top: 1px solid var(--hairline);
  padding: 64px 0;
}
.post-cta-lead {
  font-family: var(--font-display);
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.3;
  margin: 0 0 28px;
  max-width: 36ch;
  font-weight: 500;
}
html.dir-editorial .post-cta-lead { font-weight: 400; }

/* ── Writing index ─────────────────────────────────────── */
.writing-hero {
  padding: 96px 0 56px;
  border-bottom: 1px solid var(--hairline);
}
.writing-h {
  font-size: clamp(40px, 5.5vw, 72px) !important;
  max-width: 18ch;
  margin: 0;
}

.writing-list { padding: 0 0 96px; }
.writing-list ol {
  list-style: none; padding: 0; margin: 0;
}
.writing-item {
  border-bottom: 1px solid var(--hairline);
}
.writing-item:first-child { border-top: 1px solid var(--hairline); }
.writing-item a {
  display: block;
  padding: 40px 0;
  color: var(--fg);
  text-decoration: none;
  transition: color .12s ease;
}
.writing-item a:hover { color: var(--accent); }
.writing-item a:hover .writing-item-arrow { transform: translateX(6px); }

.writing-item-meta {
  display: flex; gap: 16px;
  font-size: 11px;
  color: var(--fg-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.writing-item-meta > span:first-child { color: var(--accent); }
.writing-item-h {
  font-size: clamp(24px, 2.4vw, 34px) !important;
  margin: 0 0 12px;
  text-wrap: balance;
}
.writing-item-dek {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: 56ch;
  text-wrap: pretty;
}
.writing-item-tags {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px;
  color: var(--fg-muted);
}
.writing-item-arrow {
  margin-left: auto;
  font-size: 18px;
  transition: transform .15s ease;
  color: var(--fg-muted);
}
.writing-item a:hover .writing-item-arrow { color: var(--accent); }
