/* ── The Risk Letters — Ghost Theme ── */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&family=Source+Sans+3:ital,wght@0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --ink: #1a1a1a;
  --dim: #555;
  --faint: #999;
  --rule: #ccc;
  --light: #e8e8e8;
  --wash: #F4F3EE;
  --paper: #fff;
  --accent: #C15F3C;
  --steel: #2E5990;
  --steel-light: #eff4fa;
  --alert: #b91c1c;
  --warn: #b45309;
  --ok: #047857;
  --font-serif: 'Newsreader', Georgia, serif;
  --font-sans: 'Source Sans 3', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max-w: 680px;
}

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

body {
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.95;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--steel); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ── Layout ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

/* ── Site Header ── */
.site-header { padding: 5rem 0 3rem; }
.site-header .brand {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--faint);
}
.site-header .rule-thick {
  height: 1px;
  background: var(--light);
  margin-top: 1.25rem;
}
.site-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 6vw, 4rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-top: 1.75rem;
}
.site-header h1 em {
  color: var(--accent);
  font-style: normal;
}
.site-header .tagline {
  font-size: 1.2rem;
  color: var(--dim);
  margin-top: 1.25rem;
  max-width: 560px;
  line-height: 1.7;
}

/* ── Signup Section ── */
.signup { padding: 2.5rem 0; }
.signup h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}
.signup p {
  color: var(--dim);
  font-size: 1rem;
  margin-bottom: 1.25rem;
  max-width: 500px;
  line-height: 1.7;
}
.signup .cta-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.signup .btn-primary {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--paper);
  background: var(--ink);
  border: none;
  padding: 0.65rem 1.5rem;
  cursor: pointer;
  transition: background 0.15s;
}
.signup .btn-primary:hover { background: var(--accent); text-decoration: none; }
.signup .btn-secondary {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--dim);
  background: none;
  border: 1px solid var(--rule);
  padding: 0.65rem 1.5rem;
  cursor: pointer;
}
.signup .btn-secondary:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }

/* ── Posts list ── */
.posts-section { padding: 2.5rem 0 1rem; }
.posts-section h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}
.post-card { padding: 1.25rem 0; border-bottom: 1px solid var(--light); }
.post-card:last-child { border-bottom: none; }
.post-card .post-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--faint);
  letter-spacing: 0.03em;
}
.post-card h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  margin-top: 0.15rem;
  line-height: 1.4;
}
.post-card h3 a { color: var(--ink); }
.post-card h3 a:hover { color: var(--accent); }
.post-card .post-excerpt {
  font-size: 1rem;
  color: var(--dim);
  margin-top: 0.3rem;
  line-height: 1.7;
}
.post-card .post-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.post-tag {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--wash);
  color: var(--dim);
  border: 1px solid var(--light);
}

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: space-between;
  padding: 1.5rem 0;
  font-size: 0.85rem;
  border-top: 1px solid var(--light);
}

/* ── Post (single) ── */
.post-full { padding: 4rem 0 2rem; }
.post-full .post-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--faint);
  letter-spacing: 0.03em;
}
.post-full h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-top: 0.5rem;
}
.post-full .post-excerpt-full {
  font-size: 1.1rem;
  color: var(--dim);
  margin-top: 0.75rem;
  line-height: 1.7;
}
.post-full .rule-thin {
  height: 1px;
  background: var(--rule);
  margin: 2rem 0;
}

/* ── Post content (Ghost) ── */
.gh-content { font-size: 16.5px; line-height: 1.95; }
.gh-content h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  margin: 2rem 0 0.5rem;
}
.gh-content h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  margin: 1.5rem 0 0.5rem;
}
.gh-content p { margin-bottom: 1rem; }
.gh-content a { color: var(--steel); }
.gh-content strong { color: var(--ink); font-weight: 600; }
.gh-content ul, .gh-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.gh-content li { margin-bottom: 0.35rem; }
.gh-content blockquote {
  border-left: 2px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1rem;
  margin: 1.5rem 0;
  color: var(--dim);
  background: var(--wash);
}
.gh-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--wash);
  padding: 0.15em 0.4em;
  border-radius: 2px;
}
.gh-content pre {
  background: var(--wash);
  border: 1px solid var(--light);
  padding: 1rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  line-height: 1.6;
}
.gh-content pre code { background: none; padding: 0; }
.gh-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.gh-content th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--ink);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--faint);
  font-weight: 600;
}
.gh-content td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--light);
  color: var(--dim);
}
.gh-content img { border-radius: 2px; margin: 1.5rem 0; }
.gh-content hr {
  border: none;
  height: 1px;
  background: var(--rule);
  margin: 2rem 0;
}

/* ── Site Footer ── */
.site-footer {
  background: var(--wash);
  padding: 2rem 0;
  margin-top: 0;
}
.site-footer .footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.site-footer .brand-footer {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--faint);
}
.site-footer .footer-text {
  font-size: 0.85rem;
  color: var(--dim);
  margin-top: 0.75rem;
  line-height: 1.6;
  max-width: 540px;
}
.site-footer .footer-nav { display: flex; gap: 1.5rem; font-size: 0.8rem; }
.site-footer .footer-nav a { color: var(--faint); }
.site-footer .footer-nav a:hover { color: var(--ink); }
.site-footer .hsb-quote {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 1rem;
}
.site-footer .hsb-quote a { color: var(--accent); text-decoration: none; }

/* ── Page template ── */
.page-full { padding: 4rem 0 2rem; }
.page-full h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 1rem;
}

/* ── Ghost editor width classes ── */
.gh-content .kg-width-wide {
  max-width: calc(var(--max-w) + 8rem);
  margin-left: calc(50% - 50vw + 1.5rem);
  margin-right: calc(50% - 50vw + 1.5rem);
}
.gh-content .kg-width-full {
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
.gh-content .kg-width-wide img,
.gh-content .kg-width-full img {
  width: 100%;
}

/* ── Utility ── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
