/* Site styles. Plain CSS, no build step. */

:root {
  --text: #1c1f23;
  --muted: #5f6873;
  --faint: #8a929b;
  --rule: #e3e6ea;
  --accent: #14365c;
  --accent-hover: #2a6bb3;
  /* System font, as in the original theme: San Francisco on Apple devices. */
  --sans: -apple-system, Helvetica, arial, sans-serif;
  --mono: 'IBM Plex Mono', SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: #fff;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* Content column: 700px. The width guide in CLAUDE.md depends on this. */
.wrap {
  max-width: 700px;
  margin: 0 auto;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* Header: Home, Blog, RSS, left-aligned. Link style from the original theme. */

.site-header {
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 15px 0;
}
.site-header a {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.6);
  text-decoration: none;
}
.site-header a:hover { font-weight: bold; }

main { padding-bottom: 80px; }

/* Landing page */

.landing { padding-top: 110px; }
.landing h1 {
  font-size: 24px;
  margin: 0 0 12px;
}
.landing ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 15px;
  line-height: 1.6;
}
.landing a {
  color: var(--text);
}
.landing a:hover { color: var(--accent); }

/* Blog index and tag pages */

.home { padding-top: 56px; }

.tagline {
  font-size: 19px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 48px;
  max-width: 560px;
}

.page-title {
  font-size: 28px;
  margin: 0 0 36px;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.post-list li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0 20px;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
}
.post-list li:last-child { border-bottom: 1px solid var(--rule); }
.post-list time {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--faint);
  padding-top: 3px;
}
.post-list .post-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.post-list .post-title:hover { color: var(--accent); }
.post-list .post-subtitle {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.empty {
  color: var(--faint);
  font-style: italic;
  border-top: 1px solid var(--rule);
  padding-top: 18px;
}

/* Tag list (top of /blog/ and every tag page) */
.tag-list {
  list-style: none;
  margin: 0 0 48px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: 14px;
  font-weight: 600;
}
.tag-list a {
  color: var(--text);
  text-decoration: none;
}
.tag-list a:hover { color: var(--accent); }

.tag-title {
  font-size: 26px;
  margin: 0 0 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.tag-title + .post-list li:first-child { border-top: none; }

/* Article */

.post-header { padding-top: 56px; }
.post-header h1 {
  font-size: 34px;
  margin: 0 0 12px;
}
.post-header .subtitle {
  font-size: 19px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 16px;
}
.post-header .meta {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--faint);
  margin: 0;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}
.post-header .meta span { margin-left: 6px; }
.post-header .meta a {
  margin-left: 6px;
  color: var(--faint);
  text-decoration: none;
}
.post-header .meta a:hover { color: var(--accent); }

.article {
  font-size: 16.5px;
  line-height: 1.7;
  margin-top: 36px;
}

.article h2 {
  font-size: 24px;
  margin: 2.2em 0 0.6em;
}
.article h3 {
  font-size: 19px;
  margin: 1.8em 0 0.5em;
}
.article h4 {
  font-size: 16.5px;
  margin: 1.6em 0 0.4em;
}

.article ul, .article ol { padding-left: 1.4em; }
.article li + li { margin-top: 0.3em; }

.article blockquote {
  margin: 1.5em 0;
  padding: 0 0 0 1em;
  color: var(--muted);
  border-left: 3px solid var(--accent);
}

.article hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 40px 0;
}

.article img { max-width: 100%; }

/* Inline code: set apart by the monospace font only, no background. */
.article code {
  font-family: var(--mono);
  font-size: 0.85em;
}

/* Code blocks: no background or padding; 13px mono holds 89 characters
   in the 700px column (79-character limit in CLAUDE.md). */
.article pre {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  padding: 0;
  margin: 1.4em 0;
}
.article pre code {
  font-size: inherit;
  background: none;
  padding: 0;
}
.article div.highlight { background: none; }

/* On narrow screens wide code and equations scroll inside the column. */
.article pre, .article .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
}

.article .katex { font-size: 1.08em; }
.article .katex-display { margin: 1.4em 0; }

/* Tables */
.article table {
  border-collapse: collapse;
  margin: 1.6em auto;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.article th, .article td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--rule);
  text-align: right;
}
.article th:first-child, .article td:first-child { text-align: left; }
.article thead th {
  font-weight: 600;
  border-bottom: 1.5px solid var(--text);
}

/* Figures */
.article .figure {
  margin: 2.2em 0;
}
.article .figure iframe {
  border: none;
  display: block;
}
.article .figure .caption {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.article .figure .caption-label {
  font-weight: 600;
  color: var(--text);
}

.article .footnote { line-height: 0; }

/* References */
#bibliography .wrap {
  margin-top: 56px;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
}
#bibliography ol.bibliography:not(:empty)::before {
  content: 'References';
  display: block;
  margin: 0 0 12px -1.2em;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
#bibliography ol.bibliography {
  padding-left: 1.2em;
  font-size: 14px;
  color: var(--muted);
}
#bibliography ol.bibliography li + li { margin-top: 6px; }
#bibliography ol.bibliography:empty { display: none; }
#bibliography:has(ol.bibliography:empty) .wrap { border-top: none; margin-top: 0; }

.hidden { display: none; }
.clear { clear: both; }

@media (max-width: 740px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .post-header h1 { font-size: 28px; }
  .post-list li { grid-template-columns: 1fr; }
  .post-list time { padding: 0 0 2px; }
}
