/* ==========================================================================
   BioMed AI Watch: the newsletter home (newsletter.html) and issue pages
   (newsletter/<date>.html). Loaded after style.css and built from its tokens.
   ========================================================================== */

/* ---------- newsletter home: latest issue + grid + sidebar ---------- */
.nl-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2.5rem; align-items: start;
}
@media (max-width: 960px) { .nl-layout { grid-template-columns: 1fr; } }

.nl-latest {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); text-decoration: none; color: inherit; margin-bottom: 2.5rem;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.nl-latest:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: inherit;
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border)); }
.nl-latest__media { background: #fff; aspect-ratio: 16 / 9; overflow: hidden; }
.nl-latest__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nl-latest__text { padding: 1.6rem 1.6rem 1.4rem; display: flex; flex-direction: column; gap: .6rem; }
.nl-latest__text h2 { margin: 0; font-size: clamp(1.2rem, 2.6vw, 1.6rem); font-weight: 800;
  letter-spacing: -.02em; line-height: 1.2; }
.nl-latest__text p { margin: 0; color: var(--text-soft); font-size: .9rem; }
.nl-latest .post__more { margin-top: auto; }
@media (max-width: 760px) { .nl-latest { grid-template-columns: 1fr; } }

.nl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 0 1rem; }
.nl-head h2 { margin: 0; font-size: 1.15rem; font-weight: 800; letter-spacing: -.015em; }
.nl-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.25rem;
  list-style: none; margin: 0; padding: 0;
}
.nl-grid .post p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nl-grid .post__media, .nl-latest__media { background: #fff; }
.nl-empty { color: var(--text-soft); }

.nl-side { display: grid; gap: 1.25rem; position: sticky; top: calc(var(--nav-h) + 1rem); }
@media (max-width: 960px) { .nl-side { position: static; } }
.nl-side .card { padding: 1.25rem; }
.nl-side h3 { margin: 0 0 .5rem; font-size: .95rem; font-weight: 800; }
.nl-side p { margin: 0 0 .9rem; font-size: .84rem; color: var(--text-soft); }
.nl-topics { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.nl-topics a { display: grid; grid-template-columns: 1fr 64px; gap: .7rem; align-items: center;
  text-decoration: none; color: inherit; font-size: .84rem; font-weight: 600; line-height: 1.3; }
.nl-topics a:hover { color: var(--accent); }
.nl-topics small { display: block; margin-top: .15rem; font-weight: 500; font-size: .7rem; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .05em; }
.nl-topics img { width: 64px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border);
  background: #fff; }

/* ---------- issue page ---------- */
.issue__head { max-width: 760px; text-align: left; }
.issue__head h1 { margin-bottom: .5rem; }
.issue__deck { margin: 0 0 1rem !important; max-width: none !important; font-size: 1.12rem; color: var(--text-soft); }
.issue__byline { font-size: .78rem; color: var(--text-faint); font-weight: 600; letter-spacing: .03em; }
.issue__byline strong { color: var(--text); }

.share { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.1rem; }
.share a, .share button {
  display: inline-flex; align-items: center; gap: .35rem; padding: .38rem .75rem;
  font: inherit; font-size: .76rem; font-weight: 600; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  text-decoration: none; cursor: pointer;
}
.share a:hover, .share button:hover { border-color: var(--accent); color: var(--accent); }

.issue { max-width: 720px; margin-inline: auto; }
.issue-toc {
  margin: 0 0 2rem; padding: 1rem 1.2rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.issue-toc strong { display: block; margin-bottom: .4rem; font-size: .72rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-faint); }
.issue-toc ol { margin: 0; padding-left: 1.2rem; display: grid; gap: .2rem; font-size: .88rem; }
.issue-toc a { text-decoration: none; }

/* Chart slides break out of the text column so two charts sit side by side legibly. */
.issue .article__body img {
  display: block; width: min(1040px, calc(100vw - 32px)); max-width: none; height: auto;
  position: relative; left: 50%; transform: translateX(-50%);
  margin: 1.6rem 0 .8rem; background: #fff; border: 1px solid var(--border); border-radius: 10px;
}
.issue .article__body p:has(> img) { margin: 0; }
.issue .article__body h2 { scroll-margin-top: calc(var(--nav-h) + 1rem); }
.issue .article__body h4 { margin: 0 0 1rem; font-size: 1rem; font-weight: 600; color: var(--text-soft); }

.issue-cta {
  margin: 2.4rem 0; padding: 1.4rem; text-align: center; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.issue-cta p { margin: 0 0 .9rem !important; font-weight: 600; }
.issue-cta .btn { margin: 0 .25rem; }

.issue-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.issue-nav a { display: block; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: inherit; font-weight: 600; font-size: .88rem; background: var(--surface); }
.issue-nav a:hover { border-color: var(--accent); color: var(--accent); }
.issue-nav small { display: block; font-size: .7rem; color: var(--text-faint); text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: .25rem; }
.issue-nav .next { text-align: right; grid-column: 2; }
@media (max-width: 600px) { .issue-nav { grid-template-columns: 1fr; } .issue-nav .next { grid-column: 1; } }
