/* ============================================================
   ergodic reader — editorial theme (Foreign Affairs-inspired)
   Drop-in replacement for your previous publish.css.

   MARKDOWN CONVENTIONS
     > [!kicker] On Wealth          ← optional small-caps label
     # Headline                      ← the article title
     > [!deck]                       ← italic standfirst
     > attention-grabbing sentence
     ...body...
     > a sentence to pull out        ← plain > = FA pull quote
     ...body...
     > [!source] Inspired by *Book*. ← the attribution/caption
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Libre+Caslon+Display&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400;1,6..72,500&family=Libre+Franklin:wght@600;700;800&display=swap');

/* ---- Tokens -------------------------------------------------- */
.published-container {
  --file-line-width: 40rem;
  --font-text-size: 20px;
  --line-height-normal: 1.6;
  --p-spacing: 1.4em;
  --ink: #16314a;                 /* Foreign Affairs navy accent */
}

/* ---- Body --------------------------------------------------- */
.markdown-rendered,
.markdown-rendered p,
.markdown-rendered li {
  font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
  font-size: var(--font-text-size);
  line-height: var(--line-height-normal);
  letter-spacing: 0.1px;
}
.markdown-rendered p { text-align: left; text-wrap: pretty; hyphens: none; }

/* ---- Hide the automatic note title (use body # H1) ---------- */
.published-container .inline-title { display: none; }

/* ============================================================
   MASTHEAD
   ============================================================ */

/* Kicker */
.callout[data-callout="kicker"] { background: none; border: none; margin: 0 0 1rem; padding: 0; }
.callout[data-callout="kicker"] .callout-icon { display: none; }
.callout[data-callout="kicker"] .callout-title { justify-content: center; padding: 0; }
.callout[data-callout="kicker"] .callout-title-inner {
  font-family: 'Libre Franklin', system-ui, sans-serif;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.2em;
  font-size: 0.72rem; color: var(--ink);
}

/* Headline */
.markdown-rendered h1 {
  font-family: 'Libre Caslon Display', Georgia, serif;
  font-weight: 400; font-size: clamp(2.6rem, 6vw, 4rem);
  line-height: 1.04; letter-spacing: -0.005em; text-align: center;
  max-width: 20ch; margin: 0 auto 1.2rem;
}
.markdown-rendered h1::after { content: none; }

/* Deck */
.callout[data-callout="deck"] { background: none; border: none; margin: 0 auto 1.4rem; padding: 0; max-width: 34ch; }
.callout[data-callout="deck"] > .callout-title { display: none; }
.callout[data-callout="deck"] .callout-content p {
  font-family: 'Newsreader', Georgia, serif; font-style: italic; font-weight: 400;
  font-size: clamp(1.15rem, 2.4vw, 1.5rem); line-height: 1.32;
  color: var(--text-muted); text-align: center; margin: 0;
}

/* Byline */
.callout[data-callout="byline"] {
  background: none; border: none; padding: 0 0 1.6rem; margin: 0 auto 2.6rem;
  border-bottom: 1px solid var(--background-modifier-border); max-width: 22rem;
}
.callout[data-callout="byline"] .callout-icon { display: none; }
.callout[data-callout="byline"] .callout-title { justify-content: center; padding: 0; }
.callout[data-callout="byline"] .callout-title-inner {
  font-family: 'Libre Franklin', system-ui, sans-serif;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 0.7rem; color: var(--text-faint);
}

/* ---- Drop cap on the first body paragraph ------------------- */
.markdown-rendered > p:first-of-type::first-letter {
  font-family: 'Libre Caslon Display', serif; font-weight: 400; float: left;
  font-size: 3.4em; line-height: 0.74; padding: 0.04em 0.1em 0 0; color: var(--ink);
}

/* ============================================================
   PULL QUOTE  ( a plain  >  blockquote )
   ============================================================ */
.markdown-rendered blockquote {
  border: none;
  border-top: 1px solid var(--background-modifier-border);
  border-bottom: 1px solid var(--background-modifier-border);
  margin: 2.6rem auto; padding: 1.5rem 0; max-width: 32ch;
}
.markdown-rendered blockquote p {
  margin: 0;
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  line-height: 1.3;
  text-align: center;
  color: var(--ink);
}
/* Attribution: a quiet credit tucked under the quote.
   Only applies when the blockquote has a SECOND paragraph,
   so a plain one-paragraph pull quote is left alone.
   Change text-align to right for a flush-right caption feel. */
.markdown-rendered blockquote p:last-child:not(:only-child) {
  margin-top: 1rem;
  font-family: 'Libre Franklin', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-align: center;
  color: var(--text-faint);
}

/* ---- Source line / caption  ( > [!source] ... ) ------------- */
.callout[data-callout="source"] {
  background: none; border: none; padding: 1rem 0 0; margin: 3rem 0 0;
  border-top: 1px solid var(--background-modifier-border);
}
.callout[data-callout="source"] .callout-icon { display: none; }
.callout[data-callout="source"] .callout-title { padding: 0; }
.callout[data-callout="source"] .callout-title-inner {
  font-family: 'Newsreader', Georgia, serif; font-style: italic; font-weight: 400;
  font-size: 0.85rem; color: var(--text-faint); letter-spacing: 0.2px;
}

/* ---- Links & sidebar ---------------------------------------- */
.markdown-rendered a {
  color: inherit; text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 2px; text-decoration-color: var(--ink);
}
.markdown-rendered a:hover { color: var(--ink); }

.site-name { font-family: 'Newsreader', Georgia, serif; font-weight: 500; }
.nav-file-title, .nav-folder-title {
  font-family: 'Libre Franklin', system-ui, sans-serif; font-size: 0.9rem; letter-spacing: 0.01em;
}
.nav-file-title.is-active,
.nav-file-title.is-active .nav-file-title-content { color: var(--ink); }
