/* ============================================================
   V4 → GHOST — additions only.
   style.css is the untouched site-v4 stylesheet. Everything the
   CMS introduces lives here: essay pages, the archive, editor
   output, Ghost cards, pagination, the admin-managed nav.
   Same tokens, same rules: serif for reading, mono only for
   instrumentation, nothing below 11px (0.6875rem) in the flow.
   ============================================================ */

/* ---------- Ghost font picker (Design → Typography) ----------
   Ghost sets --gh-font-body / --gh-font-heading only when the admin
   picks custom fonts; otherwise these fall straight back to Fraunces,
   so the v4 type system is the default. Mono instrumentation is
   deliberately not overridable. */
:root {
  --serif: var(--gh-font-body, "Fraunces", Georgia, "Times New Roman", serif);
}
.masthead, .station-head h2, .essay-title,
.jar-body h3, .obs-body h3, .adj-title, .prose h2 {
  font-family: var(--gh-font-heading, var(--serif));
}

/* ---------- Nav (admin-managed) ---------- */
.site-nav a[aria-current="page"] { color: var(--core); }

/* Dynamic labels arrive in whatever case the admin typed them */
.jar-meta, .jar-lid, .jar-read, .obs-tag, .zone-tag,
.essay-foot, .adj-label, .pagination, .archive-all { text-transform: uppercase; }

/* ---------- Home: stations fed from Ghost pages ---------- */
/* hero page: first paragraph = lead (mirrors .hero-copy .lead) */
.hero-copy > p:first-child {
  font-size: clamp(1.12rem, 1.8vw, 1.3rem);
  line-height: 1.6;
  color: var(--ink);
}
/* about page: first paragraph = lead (mirrors .prose .lead) */
.prose > p:first-child {
  font-size: clamp(1.1rem, 1.6vw, 1.25rem);
  line-height: 1.6;
  color: var(--ink);
  margin-top: 0;
}

/* Work: depth from a counter — 1180 M, 1920 M, 2660 M… */
.obs-list { counter-reset: obs 440; }
.obs-list .observation { counter-increment: obs 740; }
.obs-depth-auto::before { content: "OBS · " counter(obs) " M"; }
.obs-body h3 a { transition: color 0.25s ease; }
.obs-body h3 a:hover, .obs-body h3 a:focus-visible { color: var(--ink); }

/* Writing on home */
.jar-body h3 a { transition: color 0.25s ease; }
.jar-body h3 a:hover, .jar-body h3 a:focus-visible { color: var(--ink); }
.jar-read {
  margin-top: 1rem;
  font-size: 0.6875rem; letter-spacing: 0.18em;
  color: var(--dim);
}
.jar-read a { color: var(--gold-hi); transition: color 0.25s ease; }
.jar-read a:hover, .jar-read a:focus-visible { color: var(--core); }
.jar-empty { color: var(--ink-dim); font-style: italic; }
.archive-all {
  margin-top: var(--sp-5);
  font-size: 0.6875rem; letter-spacing: 0.26em;
}
.archive-all a { color: var(--gold-hi); transition: color 0.3s ease; }
.archive-all a:hover, .archive-all a:focus-visible { color: var(--core); }

/* Now page: H3 + list, H3 + list → the two-column grid */
.now-content {
  column-count: 2;
  column-gap: clamp(2.5rem, 6vw, 4.5rem);
}
@media (max-width: 47rem) { .now-content { column-count: 1; } }
.now-content h3 {
  font-family: var(--mono);
  font-size: 0.6875rem; letter-spacing: 0.28em;
  color: var(--gold);
  font-weight: 500;
  text-transform: uppercase;
  break-after: avoid;
}
.now-content h3:not(:first-child) { margin-top: clamp(2rem, 5vh, 3rem); }
.now-content ul { margin-top: var(--sp-2); break-inside: avoid; }
.now-content li {
  position: relative;
  padding: 0.65rem 0 0.65rem 1.5rem;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-faint);
  font-size: 1.0625rem;
  line-height: 1.6;
}
.now-content li:last-child { border-bottom: 0; }
.now-content li::before {
  content: "·";
  position: absolute; left: 0.2rem; top: 0.5rem;
  color: var(--gold);
  font-weight: 700;
}

/* ============================================================
   ARCHIVE / VIEWPORT — /writing/, /work/, /tag/…
   ============================================================ */
.station-archive { align-items: flex-start; }

.pagination {
  margin-top: var(--sp-5);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  font-size: 0.6875rem; letter-spacing: 0.2em;
  color: var(--dim);
}
.pagination .pg-slot { flex: 1; }
.pagination .pg-right { text-align: right; }
.pagination a { color: var(--gold-hi); transition: color 0.25s ease; }
.pagination a:hover, .pagination a:focus-visible { color: var(--core); }

/* ============================================================
   ONE SPECIMEN — essay / page layout
   ============================================================ */
.station-essay {
  align-items: flex-start;
  padding-top: clamp(7rem, 15vh, 10rem);
}
.flow-essay {
  max-width: 40rem;
  margin-inline: auto;
}
.essay-head { margin-bottom: clamp(2.25rem, 6vh, 3.5rem); }
.essay-title {
  font-weight: 500;
  font-size: clamp(2.2rem, 4.8vw, 3.9rem);
  line-height: 1.06;
  color: var(--ink);
  text-wrap: balance;
}
.essay-note { font-size: clamp(1.1rem, 1.6vw, 1.25rem); }

.essay-figure { margin: 0 0 var(--sp-4); }
.essay-figure img { width: 100%; border: 1px solid var(--line-faint); }
.essay-figure figcaption,
.prose figcaption {
  margin-top: 0.75rem;
  font-family: var(--mono);
  font-size: 0.6875rem; letter-spacing: 0.12em;
  color: var(--dim);
  text-align: left;
}
.prose figcaption a { color: var(--gold-hi); }

.essay-body { max-width: none; }

.essay-foot {
  margin-top: var(--sp-5);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line-faint);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem;
  font-size: 0.6875rem; letter-spacing: 0.16em;
  color: var(--dim);
}
.essay-foot a { color: var(--gold-hi); transition: color 0.25s ease; }
.essay-foot a:hover, .essay-foot a:focus-visible { color: var(--core); }

/* previous / next specimen */
.station-adjacent { min-height: 0; padding: 0 0 clamp(4rem, 10vh, 6rem); }
.adjacent {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
  max-width: 40rem; margin-inline: auto;
}
.adj { display: block; padding-top: 1rem; border-top: 1px solid var(--line-faint); }
.adj-next { text-align: right; grid-column: 2; }
.adj-label { display: block; font-size: 0.6875rem; letter-spacing: 0.22em; color: var(--gold); }
.adj-title {
  display: block; margin-top: 0.5rem;
  font-size: 1.15rem; line-height: 1.3;
  color: var(--core);
  transition: color 0.25s ease;
}
.adj:hover .adj-title, .adj:focus-visible .adj-title { color: var(--ink); }
@media (max-width: 560px) {
  .adjacent { grid-template-columns: 1fr; }
  .adj-next { grid-column: auto; text-align: left; }
}

/* ============================================================
   EDITOR OUTPUT — what {{content}} produces, in the v4 voice
   ============================================================ */
.prose h2 {
  margin-top: clamp(3rem, 7vh, 4.5rem);
  font-weight: 500;
  font-size: clamp(1.7rem, 2.6vw, 2.2rem);
  line-height: 1.15;
  color: var(--core);
  text-wrap: balance;
}
.prose h2 + p { margin-top: var(--sp-2); }

/* H3 = the mono sub-head (mirrors .prose .sub) */
.prose h3 {
  margin-top: clamp(3rem, 7vh, 4.5rem);
  font-family: var(--mono);
  font-size: 0.6875rem; letter-spacing: 0.28em;
  color: var(--gold);
  font-weight: 500;
  text-transform: uppercase;
}
.prose h3 + p, .prose h3 + ul, .prose h3 + ol { margin-top: var(--sp-2); }

.prose h4 {
  margin-top: var(--sp-4);
  font-weight: 500; font-style: italic;
  font-size: 1.15rem;
  color: var(--gold-hi);
}

.prose a {
  color: var(--core);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: text-decoration-color 0.25s ease, color 0.25s ease;
}
.prose a:hover, .prose a:focus-visible { color: var(--ink); text-decoration-color: var(--core); }

/* The site's signature — italic gold inside serif prose — carries
   into essays: the editor's italics become the accent. */
.prose em, .prose i { font-style: italic; color: var(--gold-hi); }
.prose strong, .prose b { font-weight: 600; color: var(--ink); }

.prose ul, .prose ol { margin-top: var(--sp-3); }
.prose li {
  position: relative;
  padding: 0.65rem 0 0.65rem 1.5rem;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-faint);
  line-height: 1.6;
}
.prose li:last-child { border-bottom: 0; }
.prose ul > li::before {
  content: "·";
  position: absolute; left: 0.2rem; top: 0.5rem;
  color: var(--gold);
  font-weight: 700;
}
.prose ol { counter-reset: li; }
.prose ol > li { padding-left: 2.1rem; counter-increment: li; }
.prose ol > li::before {
  content: counter(li, decimal-leading-zero);
  position: absolute; left: 0; top: 0.85rem;
  font-family: var(--mono);
  font-size: 0.6875rem; letter-spacing: 0.1em;
  color: var(--gold);
}
.prose li p { margin-top: 0.4rem; }

.prose blockquote {
  margin-top: var(--sp-4);
  padding-left: 1.25rem;
  border-left: 1px solid var(--gold);
  font-style: italic;
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  line-height: 1.5;
  color: var(--ink);
}
.prose blockquote p { margin-top: var(--sp-2); color: inherit; }
.prose blockquote p:first-child { margin-top: 0; }
.prose blockquote.kg-blockquote-alt {
  border-left: 0; padding-left: 0;
  text-align: center;
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  color: var(--core);
}

.prose hr {
  border: 0; height: 1px;
  margin: var(--sp-5) 0;
  background: linear-gradient(to right, rgba(164, 152, 130, 0.55), rgba(164, 152, 130, 0.05));
}

.prose pre {
  margin-top: var(--sp-3);
  padding: 1rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.8125rem; line-height: 1.6;
  color: var(--ink-soft);
  background: rgba(2, 6, 15, 0.6);
  border: 1px solid var(--line-faint);
  border-radius: 2px;
  overflow-x: auto;
}
.prose code {
  font-family: var(--mono);
  font-size: 0.875em;
  color: var(--core);
  background: rgba(164, 152, 130, 0.1);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}
.prose pre code { font-size: inherit; color: inherit; background: none; padding: 0; }

.prose img { border: 1px solid var(--line-faint); }
.prose figure { margin-top: var(--sp-4); }
.prose iframe { max-width: 100%; }

.prose table {
  width: 100%;
  margin-top: var(--sp-3);
  border-collapse: collapse;
  font-size: 0.95rem;
}
.prose th {
  padding: 0.6rem 0.75rem 0.6rem 0;
  font-family: var(--mono); font-weight: 500;
  font-size: 0.6875rem; letter-spacing: 0.16em;
  color: var(--gold);
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.prose td {
  padding: 0.6rem 0.75rem 0.6rem 0;
  color: var(--ink-soft);
  vertical-align: top;
  border-bottom: 1px solid var(--line-faint);
}

/* ============================================================
   GHOST CARDS — Ghost ships light-mode card styles via
   {{ghost_head}} (card_assets: true). These win by specificity
   and recolour every card into the desert palette.
   ============================================================ */
.prose .kg-card { margin-top: var(--sp-4); }

/* Wide / full: break out of the 40rem column, stay inside the
   station frame (.world-reveal clips horizontally by design). */
.prose .kg-width-wide,
.prose .kg-width-full {
  width: min(64rem, calc(100vw - 2.5rem));
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}
.prose .kg-width-wide img, .prose .kg-width-full img { width: 100%; }

/* Callout */
.prose .kg-callout-card,
.prose .kg-callout-card[class*="kg-callout-card-"] {
  background: rgba(164, 152, 130, 0.06);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink-soft);
}
.prose .kg-callout-card .kg-callout-text { color: inherit; font-family: var(--serif); font-size: 1rem; }
.prose .kg-callout-card .kg-callout-text a { color: var(--core); }

/* Bookmark */
.prose .kg-bookmark-container,
.prose .kg-bookmark-container:hover {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(2, 6, 15, 0.5);
  color: var(--ink);
  text-decoration: none;
  box-shadow: none;
}
.prose .kg-bookmark-title { color: var(--core); font-family: var(--serif); font-weight: 500; font-size: 1.05rem; }
.prose .kg-bookmark-description { color: var(--ink-dim); font-family: var(--serif); }
.prose .kg-bookmark-metadata {
  font-family: var(--mono);
  font-size: 0.6875rem; letter-spacing: 0.1em;
  color: var(--dim);
}
.prose .kg-bookmark-author, .prose .kg-bookmark-publisher { color: var(--dim); }
.prose .kg-bookmark-thumbnail img { filter: saturate(0.7) brightness(0.9); }

/* Button — mirrors .contact-link */
.prose .kg-button-card .kg-btn,
.prose .kg-button-card .kg-btn-accent {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.9rem; letter-spacing: 0.04em;
  color: var(--core);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
.prose .kg-button-card .kg-btn:hover,
.prose .kg-button-card .kg-btn-accent:hover {
  border-color: var(--gold-hi);
  background: rgba(164, 152, 130, 0.08);
  box-shadow: 0 0 26px rgba(201, 185, 152, 0.16);
}

/* Toggle */
.prose .kg-toggle-card {
  background: rgba(2, 6, 15, 0.45);
  border: 1px solid var(--line-faint);
  border-radius: 2px;
}
.prose .kg-toggle-heading-text { color: var(--core); font-family: var(--serif); font-weight: 500; font-size: 1.15rem; }
.prose .kg-toggle-content { color: var(--ink-soft); }
.prose .kg-toggle-card-icon svg { color: var(--gold); }

/* Header card */
.prose .kg-header-card {
  background: rgba(2, 6, 15, 0.5) !important;
  border: 1px solid var(--line-faint);
  border-radius: 2px;
  color: var(--ink) !important;
}
.prose .kg-header-card h2, .prose .kg-header-card h3 { color: var(--core) !important; font-family: var(--serif); }
.prose .kg-header-card p { color: var(--ink-soft) !important; }

/* File / audio / video / product */
.prose .kg-file-card-container,
.prose .kg-product-card-container,
.prose .kg-audio-card {
  background: rgba(2, 6, 15, 0.5);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink);
}
.prose .kg-file-card-title, .prose .kg-product-card-title, .prose .kg-audio-title { color: var(--core); font-family: var(--serif); }
.prose .kg-file-card-caption, .prose .kg-product-card-description, .prose .kg-audio-duration { color: var(--ink-dim); }
.prose .kg-file-card-metadata, .prose .kg-file-card-filename, .prose .kg-file-card-filesize {
  font-family: var(--mono);
  font-size: 0.6875rem; letter-spacing: 0.08em;
  color: var(--dim);
}
.prose .kg-file-card-icon svg { color: var(--gold); }

/* Gallery / image */
.prose .kg-gallery-image img { border: 1px solid var(--line-faint); }
.prose .kg-image-card img { margin-inline: auto; }

/* Embed */
.prose .kg-embed-card { margin-top: var(--sp-4); }

/* ---------- Reduced motion (additions only) ---------- */
@media (prefers-reduced-motion: reduce) {
  .prose a, .jar-read a, .pagination a, .essay-foot a { transition: none; }
}
