/* ==========================================================================
   Writing: the article index and article pages. Loaded after styles.css,
   uses its tokens. A separate file so styles.css (and its ?v= suffix on
   every page) stays untouched.
   ========================================================================== */

.article-wrap { padding: clamp(1rem, 3vw, 2rem) 0 clamp(3.5rem, 8vw, 6rem); }

.article-hero { padding-bottom: clamp(1.2rem, 3vw, 2rem); }

.article-hero .standfirst { margin-bottom: 1.1rem; }

.article-hero h1 {
  font-size: clamp(2.3rem, 5.6vw, 4rem);
  line-height: 1.05;
  max-width: 16em;
  text-wrap: balance;
}

.article-meta {
  color: var(--ink-faint);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.article {
  max-width: 40em;
  font-size: 1.12rem;
  line-height: 1.75;
}

.article > * + * { margin-top: 1.25em; }

.article p { color: var(--ink); }

.article h2 {
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.6vw, 1.85rem);
  font-weight: 560;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-top: 2.4em;
}

.article h2 + * { margin-top: 0.8em; }

.article a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rubric);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.article a:hover { color: var(--rubric); }

.article ul { padding-left: 1.2em; }

.article li + li { margin-top: 0.45em; }

.article li::marker { color: var(--rubric); }

.article code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--paper-dim);
  padding: 0.08em 0.32em;
  border-radius: 2px;
  overflow-wrap: anywhere;
}

.article-figure { margin: 2em 0; }

.article-figure img {
  width: auto;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  background: var(--paper-high);
}

.article-figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--ink-faint);
}

.table-wrap {
  overflow-x: auto;
  margin: 1.8em 0;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.article table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34em;
  font-size: 0.95rem;
  line-height: 1.45;
}

.article th,
.article td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.7rem 0.55rem 0;
  border-bottom: 1px solid var(--rule-soft);
}

.article thead th {
  font-weight: 600;
  border-bottom: 1px solid var(--rule);
}

.article td:not(:first-child),
.article th:not(:first-child) { white-space: nowrap; }

.article-end {
  max-width: 40em;
  margin-top: 3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

/* ---------- Index of articles ---------- */

.posts { list-style: none; max-width: 46em; }

.post-row {
  border-top: 1px solid var(--rule);
  padding: 1.6rem 0;
}

.post-row:last-child { border-bottom: 1px solid var(--rule); }

.post-date {
  display: block;
  color: var(--ink-faint);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.post-title {
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  font-weight: 560;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.post-title a { text-decoration: none; transition: color 0.2s ease; }

.post-title a:hover { color: var(--rubric); }

.post-desc { color: var(--ink-soft); margin-top: 0.45rem; max-width: 40em; }

@media (max-width: 480px) {
  .article { font-size: 1.05rem; }
}
