/* ============================================================
   writing.css — /writing index + individual post pages
   Includes Rouge syntax-highlighting palette for code blocks.
   ============================================================ */

/* ── Index list ───────────────────────────────────────── */

.writing-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 2.5rem;
}
.writing-row {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-block: 1.75rem;
  border-top: 1px solid var(--rule-soft);
  align-items: baseline;
  text-decoration: none;
  color: inherit;
  transition: padding-left 0.2s, color 0.2s;
}
.writing-row:first-child { border-top: 1px solid var(--rule); }
.writing-row:hover {
  padding-left: 0.5rem;
  color: var(--ink-strong);
}
.writing-row:hover .writing-row__title { color: var(--accent); }

.writing-row__date {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
  padding-top: 0.25rem;
  white-space: nowrap;
}
.writing-row__title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink-strong);
  margin: 0 0 0.5rem 0;
  font-variation-settings: 'opsz' 24;
  transition: color 0.2s;
}
.writing-row__summary {
  font-size: 0.9375rem;
  color: var(--ink-muted);
  margin: 0;
  max-width: var(--measure);
}

@media (max-width: 720px) {
  .writing-row { grid-template-columns: 1fr; gap: 0.5rem; }
  .writing-row__date { padding-top: 0; }
}

/* ── Post header ──────────────────────────────────────── */

.post-header {
  padding-block: clamp(4rem, 10vw, 7rem) clamp(2.5rem, 6vw, 4rem);
  border-bottom: 1px solid var(--rule);
}
.post-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
  margin: 0 0 1.25rem 0;
  font-variation-settings: 'opsz' 96;
  max-width: 22ch;
}
.post-summary {
  font-size: clamp(1.125rem, 1.7vw, 1.3125rem);
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0;
  max-width: 42rem;
}

/* ── Post body — Markdown-derived prose ───────────────── */

.post-body {
  padding-block: clamp(3rem, 6vw, 5rem);
}
.post-body .container > * {
  max-width: var(--measure);
}
.post-body .container > pre,
.post-body .container > figure,
.post-body .container > hr {
  max-width: 100%;
}

.post-body p,
.post-body ul,
.post-body ol,
.post-body blockquote {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 1.25rem 0;
}

.post-body h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.875rem;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink-strong);
  margin: 3rem 0 1rem 0;
  font-variation-settings: 'opsz' 48;
}
.post-body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink-strong);
  margin: 2.25rem 0 0.75rem 0;
  font-variation-settings: 'opsz' 24;
}
.post-body h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--ink-strong);
  margin: 1.75rem 0 0.5rem 0;
}

.post-body ul,
.post-body ol {
  padding-left: 1.5rem;
}
.post-body li { margin-bottom: 0.5rem; }
.post-body li::marker { color: var(--ink-faint); }

.post-body a {
  color: var(--ink-strong);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule);
}
.post-body a:hover {
  text-decoration-color: var(--accent);
  color: var(--accent);
}

.post-body strong { color: var(--ink-strong); font-weight: 600; }
.post-body em { font-style: italic; }

.post-body blockquote {
  border-left: 2px solid var(--accent);
  padding: 0.25rem 0 0.25rem 1.5rem;
  margin-left: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--ink-strong);
  font-variation-settings: 'opsz' 36;
}
.post-body blockquote p { font-size: inherit; line-height: inherit; margin-bottom: 0.5rem; }
.post-body blockquote p:last-child { margin-bottom: 0; }

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--paper-deep);
  padding: 0.1em 0.4em;
  border-radius: 1px;
  color: var(--ink-strong);
}

.post-body pre {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  background: var(--ink-strong);
  color: var(--paper);
  padding: 1.25rem 1.5rem;
  border-radius: 1px;
  overflow-x: auto;
  margin: 1.5rem 0 1.75rem 0;
}
.post-body pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.post-body hr {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: 3rem auto;
  width: 4rem;
}

.post-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem 0;
  border-radius: 1px;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}
.post-body th, .post-body td {
  text-align: left;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--rule-soft);
}
.post-body th {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom-color: var(--rule);
}

/* Back-to-index link below the article */
.post .back-link { margin-top: 4rem; }

/* ── Rouge syntax highlighting — monochrome editorial ─── */
/* Designed to read on the .post-body pre dark surface.    */

.highlight .c, .highlight .cm, .highlight .cp, .highlight .c1, .highlight .cs { color: oklch(60% 0.01 60); font-style: italic; }  /* comments */
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt { color: oklch(78% 0.05 30); font-weight: 500; }  /* keywords */
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .sr, .highlight .ss { color: oklch(82% 0.07 80); }  /* strings */
.highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo, .highlight .il { color: oklch(85% 0.05 80); }  /* numbers */
.highlight .nb, .highlight .bp { color: oklch(80% 0.04 200); }  /* builtins */
.highlight .nc, .highlight .nn { color: oklch(78% 0.06 150); }  /* class / namespace */
.highlight .nf, .highlight .fm { color: oklch(82% 0.04 100); }  /* function names */
.highlight .nt { color: oklch(78% 0.05 30); }  /* html tags */
.highlight .na { color: oklch(80% 0.04 200); }  /* html attrs */
.highlight .o, .highlight .ow { color: oklch(80% 0.02 60); }  /* operators */
.highlight .err { color: oklch(70% 0.18 30); }  /* errors */
.highlight .ge { font-style: italic; }
.highlight .gs { font-weight: 600; }
