/* ─────────────────────────────────────────────────────────────────────────
   Receipts — JoePro Press
   Editorial future-past: cream paper, deep ink, rust accents,
   one phosphor glow on the Arweave TX line.
   ───────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700;9..144,800&family=Newsreader:opsz,wght@6..72,400;6..72,500;6..72,600;6..72,700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ─── tokens ─────────────────────────────────────────────────────────── */
:root {
  --paper: #F4EFE6;
  --paper-soft: #ECE6D9;
  --ink: #0E0E12;
  --ink-soft: #3A3A40;
  --ink-muted: #6A6A70;
  --rule: #C9C2B2;
  --rust: #B23A26;
  --rust-deep: #8B2D1E;
  --phosphor: #6FFFB0;
  --phosphor-rim: #3FAA75;

  --serif-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --serif-body: 'Newsreader', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --col: 640px;
  --col-wide: 880px;
  --gutter: clamp(20px, 4vw, 40px);
}

/* ─── reset + base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif-body);
  font-size: 18px;
  line-height: 1.7;
  font-feature-settings: 'kern', 'liga', 'onum';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color 120ms ease; }
a:hover { color: var(--rust); }
hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 40px 0;
}

/* ─── layout ─────────────────────────────────────────────────────────── */
.layout { min-height: 100dvh; display: flex; flex-direction: column; }
.layout > main { flex: 1; }

.container {
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container--wide { max-width: var(--col-wide); }

/* ─── masthead ───────────────────────────────────────────────────────── */
.masthead {
  border-bottom: 1px solid var(--ink);
  padding: 28px 0 18px;
  margin-bottom: 40px;
}
.masthead-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.masthead-title {
  font-family: var(--serif-display);
  font-weight: 800;
  font-size: clamp(28px, 4.2vw, 40px);
  letter-spacing: -0.015em;
  line-height: 1;
  margin: 0;
}
.masthead-title a { text-decoration: none; color: var(--ink); }
.masthead-tagline {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.masthead-nav {
  display: flex;
  gap: 22px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.masthead-nav a { text-decoration: none; color: var(--ink); }
.masthead-nav a:hover { color: var(--rust); }
.masthead-nav .subscribe-cta {
  border: 1px solid var(--ink);
  padding: 6px 14px;
  background: var(--ink);
  color: var(--paper);
  transition: background 120ms ease, color 120ms ease;
}
.masthead-nav .subscribe-cta:hover { background: var(--rust); border-color: var(--rust); color: var(--paper); }

/* ─── home/list (front page) ─────────────────────────────────────────── */
.home-hero {
  padding: 0 0 48px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 48px;
}
.home-hero h2 {
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.home-hero p {
  font-size: 20px;
  color: var(--ink-soft);
  max-width: 36em;
  margin: 0;
}

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list-item { padding: 28px 0; border-bottom: 1px solid var(--rule); }
.post-list-item:last-child { border-bottom: 0; }
.post-list-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 8px;
}
.post-list-title {
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.15;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.post-list-title a { text-decoration: none; }
.post-list-title a:hover { color: var(--rust); }
.post-list-excerpt {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0;
}

/* ─── single post ────────────────────────────────────────────────────── */
.post-header {
  padding: 0 0 36px;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 36px;
}
.post-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 14px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.post-meta a { color: var(--ink-muted); text-decoration: none; }
.post-meta a:hover { color: var(--rust); }
.post-title {
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: clamp(34px, 5.5vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
}
.post-subtitle {
  font-family: var(--serif-body);
  font-style: italic;
  font-size: clamp(18px, 2.2vw, 22px);
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.45;
}

.post-feature-image {
  margin: 0 0 36px;
}
.post-feature-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* drop cap on first paragraph */
.post-content > p:first-of-type::first-letter,
.kg-card + p:first-of-type::first-letter {
  font-family: var(--serif-display);
  font-weight: 700;
  color: var(--rust);
  float: left;
  font-size: 4.6em;
  line-height: 0.85;
  padding: 0.08em 0.12em 0 0;
  margin-top: 0.05em;
}

/* body type */
.post-content { font-size: 18px; line-height: 1.78; }
.post-content p { margin: 0 0 1.1em; }
.post-content h2 {
  font-family: var(--serif-display);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  margin: 2.4em 0 0.6em;
  padding-top: 1.2em;
  border-top: 1px solid var(--ink);
  color: var(--ink);
}
.post-content h3 {
  font-family: var(--serif-display);
  font-size: 22px;
  font-weight: 700;
  margin: 2em 0 0.5em;
  letter-spacing: -0.01em;
}
.post-content blockquote {
  border-left: 2px solid var(--rust);
  padding: 0.2em 0 0.2em 1.1em;
  margin: 1.6em 0;
  color: var(--ink-soft);
  font-style: italic;
}
.post-content pre {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  background: rgba(14, 14, 18, 0.05);
  border: 1px solid rgba(14, 14, 18, 0.14);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 1.4em;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.post-content code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: rgba(14, 14, 18, 0.06);
  padding: 1px 5px;
  border-radius: 2px;
}
.post-content pre code { background: transparent; padding: 0; border: 0; }
.post-content ul, .post-content ol { padding-left: 1.2em; margin: 0 0 1.2em; }
.post-content li { margin: 0.3em 0; }
.post-content strong { font-weight: 600; }
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: 16px;
}
.post-content th, .post-content td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
}
.post-content th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Ghost card adjustments + width modifiers */
.kg-image-card, .kg-gallery-card { margin: 1.8em 0; }

/* Required by gscan: wide/full image cards extend beyond text column */
.kg-width-wide {
    position: relative;
    width: 85vw;
    max-width: 1040px;
    left: 50%;
    transform: translateX(-50%);
    margin: 2em 0;
}
.kg-width-full {
    position: relative;
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
    margin: 2em 0;
}
.kg-width-full img { width: 100%; }
@media (max-width: 700px) {
    .kg-width-wide, .kg-width-full {
        width: 100%;
        left: 0;
        transform: none;
        margin: 1.4em 0;
    }
}

.kg-bookmark-card {
  border: 1px solid var(--rule);
  display: flex;
  margin: 1.6em 0;
}
.kg-bookmark-card a { display: flex; width: 100%; text-decoration: none; color: inherit; }

/* ─── subscribe panel ────────────────────────────────────────────────── */
.subscribe-panel {
  margin: 56px 0 0;
  padding: 36px 0 0;
  border-top: 1px solid var(--ink);
  text-align: center;
}
.subscribe-panel h3 {
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: 26px;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.subscribe-panel p {
  color: var(--ink-soft);
  margin: 0 0 20px;
  font-size: 16px;
}
.subscribe-form {
  display: flex;
  gap: 8px;
  max-width: 420px;
  margin: 0 auto;
}
.subscribe-form input[type="email"] {
  flex: 1;
  font-family: var(--serif-body);
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  border-radius: 0;
}
.subscribe-form input[type="email"]:focus {
  outline: 1px solid var(--rust);
  outline-offset: -2px;
}
.subscribe-form button {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.subscribe-form button:hover { background: var(--rust); border-color: var(--rust); }

/* ─── footer + phosphor TX line ──────────────────────────────────────── */
.site-footer {
  margin-top: 80px;
  padding: 36px 0 60px;
  border-top: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}
.site-footer-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--rust); }
.tx-stamp {
  font-family: var(--mono);
  color: var(--phosphor);
  text-shadow: 0 0 8px rgba(111, 255, 176, 0.55), 0 0 1px rgba(111, 255, 176, 0.9);
  letter-spacing: 0.06em;
}
.tx-stamp a { color: var(--phosphor); text-decoration: none; }
.tx-stamp a:hover { color: #B6FFD3; }

/* ─── pagination ─────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 56px 0 0;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pagination a { text-decoration: none; }
.pagination .disabled { color: var(--ink-muted); }

/* ─── error / 404 ────────────────────────────────────────────────────── */
.error-page {
  padding: 80px 0;
  text-align: center;
}
.error-page h1 {
  font-family: var(--serif-display);
  font-size: clamp(60px, 12vw, 120px);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0 0 12px;
  color: var(--rust);
}
.error-page p {
  font-size: 18px;
  color: var(--ink-soft);
  margin: 0 0 28px;
}

/* ─── responsive ─────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  body { font-size: 17px; }
  .post-content { font-size: 17px; line-height: 1.72; }
  .masthead { margin-bottom: 28px; }
  .masthead-tagline { display: none; }
  .post-content > p:first-of-type::first-letter,
  .kg-card + p:first-of-type::first-letter {
    font-size: 3.6em;
  }
  .subscribe-form { flex-direction: column; }
}

/* ─── print: lean editorial ──────────────────────────────────────────── */
@media print {
  .masthead-nav, .subscribe-panel, .site-footer { display: none; }
  body { background: white; color: black; }
  .post-content { font-size: 12pt; line-height: 1.55; }
}
