/*
  Broadsheet redesign — drop-in replacement for static/css/site.css.
  Newsprint palette: near-black ink on paper white, Source Serif 4,
  cyan as the one interactive accent. Class names match the existing
  templates/layout.mjs, templates/post.mjs, templates/postList.mjs,
  templates/page.mjs output 1:1 — no template markup changes required
  beyond the font <link> noted in the handoff README.
*/

:root {
  --bg: #f3f2f2;
  --bg-raised: #eae9e9;
  --text: #201e1d;
  --text-muted: #6b6767;
  --border: color-mix(in srgb, #201e1d 16%, transparent);
  --brand: #0088b0;
  --brand-hover: #006786;
  --brand-visited: #6b6767;
  --max-width: 44rem;
  --side-inset: clamp(1.5rem, 8vw, 6rem);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--brand);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:visited {
  color: var(--brand-visited);
}

a:hover {
  color: var(--brand-hover);
  text-decoration: underline;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto 0 var(--side-inset);
  padding: 2.5rem 1.25rem 1.5rem 0;
}

.site-title {
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--text);
}

.site-title:visited {
  color: var(--text);
}

.site-header nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-header nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.site-header nav a:visited {
  color: var(--text-muted);
}

.site-header nav a:hover,
.site-header nav a.active {
  color: var(--brand);
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto 0 var(--side-inset);
  padding: 0 1.25rem 3rem 0;
}

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

.heading-anchor {
  margin-right: 0.4rem;
  color: var(--text-muted);
  opacity: 0;
}

h1:hover .heading-anchor,
h2:hover .heading-anchor,
h3:hover .heading-anchor,
h4:hover .heading-anchor {
  opacity: 1;
}

img {
  max-width: 100%;
  border-radius: 2px;
}

video {
  max-width: 100%;
  border-radius: 2px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  display: block;
  overflow-x: auto;
}

th, td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

th {
  background: var(--bg-raised);
  font-weight: 600;
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85em;
}

:not(pre) > code {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.15em 0.4em;
}

pre {
  border-radius: 2px;
  padding: 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  background: var(--bg-raised);
}

blockquote {
  margin: 1.5rem 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--brand);
  color: var(--text-muted);
  font-style: italic;
}

.post-date {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0;
}

.post-header {
  margin-bottom: 2.5rem;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list-item {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list-item:first-child {
  padding-top: 0;
}

.post-link {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
}

.post-link:hover {
  color: var(--brand);
}

.post-excerpt {
  color: var(--text-muted);
  margin-bottom: 0;
}

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto 0 var(--side-inset);
  padding: 2.5rem 1.25rem 2.5rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0.25rem 0;
}

.social-links a {
  margin-right: 1.25rem;
}
