/* ===== NEWSLETTER ARCHIVE =====
   Loaded alongside /assets/resources.css, which supplies tokens, base type,
   container, nav and the shared .res-* page furniture. This file adds the
   archive list plus a dark-theme skin for beehiiv's own post markup.
   Generated by scripts/build-newsletter.js. */

/* ===== ARCHIVE INDEX ===== */
.archive-wrap { padding: 56px 0 110px; }
.archive-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 820px;
}
.archive-card {
  display: block;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-left: 2px solid transparent;
  border-radius: 14px;
  padding: 26px 28px;
  transition: transform 0.18s ease, border-left-color 0.18s ease, background 0.18s ease;
}
.archive-card:hover {
  transform: translateX(4px);
  border-left-color: var(--accent);
  background: #161616;
}
.archive-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 21px;
  letter-spacing: -0.01em;
  margin: 8px 0 10px;
  overflow-wrap: anywhere;
}
.issue-date {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.issue-desc { color: var(--muted); font-size: 14.5px; line-height: 1.55; margin: 0 0 16px; }

/* ===== ISSUE PAGE =====
   Everything below is scoped to `.issue-page` (set on <body> by renderIssue in
   scripts/build-newsletter.js). The archive index and the /resources pages
   share resources.css, so unscoped rules here would change those too. */

/* One centred reading column. Without `margin-inline: auto` these blocks sit
   left-aligned inside the 1200px .container. */
.issue-page .res-head-inner,
.issue-page .bh,
.issue-page .issue-source,
.issue-page .issue-nav,
.issue-page .nl-optin,
.issue-page .nl-optin-lg {
  max-width: 680px;
  margin-inline: auto;
}

.issue-h {
  font-size: clamp(32px, 4.6vw, 56px);
  margin: 14px 0 0;
  text-transform: none;
}

/* ===== OPT-IN BLOCKS =====
   Both use the same beehiiv embed as the homepage. The loader injects a
   cross-origin iframe, so only the wrapper is styleable from here — the input
   and button come from beehiiv's form builder. */
.nl-embed { width: 100%; }
.nl-embed iframe {
  display: block;
  width: 100% !important;
  max-width: 100%;
  border: 0;
}

/* Top — compact, deliberately quieter than the body it precedes. */
.nl-optin {
  margin-top: 40px;
  padding: 20px 24px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 12px;
}
.nl-optin-copy {
  margin: 0 0 12px;
  font-size: 14.5px;
  color: var(--muted);
}

/* Bottom — the primary ask, so it carries more weight. */
.nl-optin-lg {
  margin-top: 40px;
  padding: 44px 40px 40px;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--accent);
  border-radius: 20px;
  text-align: center;
}
.nl-optin-h {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(26px, 3.4vw, 36px);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.nl-optin-sub {
  color: var(--muted);
  font-size: 16px;
  margin: 0 auto 26px;
  max-width: 420px;
}
.nl-optin-lg .nl-embed { max-width: 460px; margin: 0 auto; }
.nl-optin-note {
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* beehiiv post body. Everything inside .bh comes from the feed, so it's scoped
   here rather than styled globally — its class names are generic enough
   (.paragraph, .heading, .link) to collide with anything else on the site. */
.bh {
  max-width: 720px;
  padding: 48px 0 40px;
  font-size: 16.5px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.8);
}
.bh p { margin: 0 0 20px; }
.bh h1, .bh h2, .bh h3, .bh .heading {
  font-family: 'Archivo Black', sans-serif;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 40px 0 14px;
}
.bh h1 { font-size: 30px; }
.bh h2 { font-size: 25px; }
.bh h3, .bh .heading { font-size: 20px; }
.bh a, .bh .link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.bh strong, .bh b { color: var(--text); font-weight: 500; }
/* A bolded link would otherwise take the white from the rule above and stop
   looking like a link at all. Newsletters bold their links constantly. */
.bh a b, .bh a strong, .bh .link b, .bh .link strong { color: inherit; }
.bh ul, .bh ol { margin: 0 0 20px; padding-left: 24px; }
.bh li { margin-bottom: 10px; }
.bh blockquote {
  border-left: 2px solid var(--accent);
  margin: 0 0 20px;
  padding: 4px 0 4px 20px;
  color: var(--muted);
  font-style: italic;
}
.bh img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 8px 0 10px;
}
.bh figure { margin: 0 0 22px; }
.bh figcaption,
.bh .image__source,
.bh .image__source_text { font-size: 13px; color: var(--muted); margin-top: 8px; }
/* beehiiv marks section breaks with .content_break rather than <hr>. */
.bh hr, .bh .content_break {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 34px 0;
  height: 0;
}
.bh code {
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 14px;
}
.bh pre {
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 20px;
  overflow-x: auto;
  margin: 0 0 20px;
}
/* Tables arrive with light-email styling; re-skin for the dark page. */
.bh table { width: 100%; border-collapse: collapse; margin: 0 0 20px; }
.bh .bh__table_cell,
.bh .bh__table_header,
.bh td, .bh th {
  border: 1px solid var(--line-strong) !important;
  background: var(--bg-3) !important;
  padding: 10px !important;
}
.bh .bh__table_cell p,
.bh .bh__table_header p { color: rgba(255, 255, 255, 0.8) !important; font-family: inherit !important; margin: 0; }
/* beehiiv's own footer links inside the body (unsubscribe etc.) aren't
   meaningful on our copy of the post. */
.bh .beehiiv__footer_link { display: none; }

.issue-source {
  max-width: 720px;
  margin: 0 0 8px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
}
.issue-source a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.issue-source a:hover { color: var(--accent); }

.issue-nav {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  max-width: 720px;
  padding: 24px 0 90px;
  font-size: 14px;
}
.issue-nav-link { color: var(--muted); transition: color 0.15s ease; }
.issue-nav-link:hover { color: var(--accent); }
.issue-nav-link.is-next { text-align: right; }

@media (prefers-reduced-motion: reduce) {
  .archive-card, .archive-card:hover { transform: none; transition: none; }
}

@media (max-width: 640px) {
  .archive-wrap { padding: 36px 0 70px; }
  .archive-card { padding: 20px 20px; }
  .archive-title { font-size: 18px; }
  .bh { padding: 34px 0 30px; font-size: 16px; }
  .bh h1 { font-size: 25px; }
  .bh h2 { font-size: 22px; }
  .issue-nav { flex-direction: column; gap: 12px; padding-bottom: 60px; }
  .issue-nav-link.is-next { text-align: left; }

  /* The column already collapses — .container's 20px padding takes over once
     the viewport is narrower than the 680px cap. These just trim the boxes so
     the opt-ins don't eat the screen on a phone. */
  .nl-optin { padding: 16px 18px; margin-top: 30px; }
  .nl-optin-lg { padding: 32px 22px 28px; margin-top: 32px; }
  .nl-optin-sub { font-size: 15px; margin-bottom: 22px; }
}
