/* Essay pages (generated by scripts/build-essays.mjs). Prose styling for
   full-text Wayfinder essays, scoped to .essay-body so nothing else moves.
   Reuses the global design tokens from styles.css. */

.essay-body {
  max-width: var(--reading);
  margin-inline: auto;
}

.essay-body p {
  color: var(--ink);
}

.essay-body h2 {
  font-family: var(--font-sans);
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  margin-top: 1.9em;
  margin-bottom: 0.5em;
  max-width: 30ch;
}

.essay-body h3 {
  font-family: var(--font-sans);
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  font-weight: 600;
  color: var(--ink);
  margin-top: 1.6em;
  margin-bottom: 0.4em;
}

.essay-body blockquote {
  margin: 1.6em 0;
  padding: 0.2em 0 0.2em 1.1em;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}

.essay-body blockquote p {
  color: var(--muted);
  font-size: clamp(1.02rem, 1.35vw, 1.1rem);
}

.essay-body blockquote p + p {
  margin-top: 0.5em;
}

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

.essay-body a:hover {
  color: var(--accent-ink);
}

.essay-body ul,
.essay-body ol {
  margin: 1em 0;
  padding-left: 1.4em;
}

.essay-body li {
  font-size: clamp(1.05rem, 1.4vw, 1.15rem);
  line-height: 1.66;
  margin-top: 0.4em;
}

.essay-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0 1.7em;
  font-family: var(--font-sans);
  font-size: clamp(0.92rem, 1.15vw, 1rem);
  line-height: 1.45;
}

.essay-body th,
.essay-body td {
  border: 1px solid var(--line);
  padding: 0.8em 0.9em;
  text-align: left;
  vertical-align: top;
}

.essay-body thead th {
  background: var(--paper);
  color: var(--muted);
  font-weight: 700;
}

.essay-body tbody th {
  width: 24%;
  color: var(--ink);
  font-weight: 700;
}

.essay-body hr {
  border: 0;
  width: 42%;
  height: 1px;
  background: var(--line-strong);
  margin: 2.6em auto;
}

.essay-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.6em 0;
}

.essay-body strong { font-weight: 700; }
.essay-body em { font-style: italic; }

.essay-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.35em;
}

/* Hero byline + Substack backlink on essay pages */
.essay-byline {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--soft);
  margin-top: 6px;
}

.essay-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
}

.in-brief {
  max-width: var(--reading);
  margin: 0 auto 2.4em;
  padding: 1.2em 0 1.35em;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.in-brief h2 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1em;
}

.in-brief-row + .in-brief-row {
  margin-top: 1em;
}

.in-brief-row h3 {
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.25em;
}

.in-brief-row p {
  color: var(--muted);
  font-size: clamp(1rem, 1.25vw, 1.08rem);
  line-height: 1.55;
}

.topic-brief {
  max-width: 52ch;
  margin: 1.35em 0 0.2em;
}

/* Foot-of-essay call to read/subscribe on Substack */
.essay-foot {
  max-width: var(--reading);
  margin: 2.4em auto 0;
  padding-top: 1.6em;
  border-top: 1px solid var(--line);
  font-family: var(--font-sans);
  color: var(--muted);
}

.essay-foot a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.essay-foot a:hover { color: var(--accent-ink); }

@media (max-width: 680px) {
  .essay-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
