/* Long-form blog article; scoped to avoid changing existing site pages. */
.longform-article {
  width: min(calc(100% - 2rem), 64rem);
  margin: 0 auto 3rem;
  color: var(--color-dark);
  background: var(--color-bg);
  font-size: 1.0625rem;
  line-height: 1.75;

  /* One shared text column. Every text-level block uses it, so headings,
     paragraphs, lists and the project box share the same left edge.
     Set in rem, not ch: ch depends on the element's own font size, which is
     why headings used to run wider than the body text. */
  --text-col: 43rem;
}

.longform-article .article-back { margin: 1.25rem auto 2rem; }

.longform-article > .article-back,
.longform-article > .article-header,
.longform-article > p,
.longform-article > h2,
.longform-article > ol,
.longform-article > ul,
.longform-article > section,
.longform-article > .article-project {
  width: min(100%, var(--text-col));
  margin-inline: auto;
}

.longform-article > .article-header {
  display: block;
  padding: 0;
  margin: 0 auto;
  text-align: left;
  background: transparent;
}

.longform-article .article-meta {
  margin: 0 0 0.75rem;
  color: var(--color-secondary);
  font-size: 0.95rem;
}

.longform-article h1,
.longform-article h2 { color: var(--color-dark); }

.longform-article h1 {
  max-width: 24ch;
  margin: 0;
  font-size: clamp(2rem, 1.5rem + 2.5vw, 3rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.longform-article .article-subtitle {
  margin: 1rem 0 1.5rem;
  font-size: clamp(1.15rem, 1rem + 0.5vw, 1.35rem);
  font-weight: 600;
  line-height: 1.45;
}

.longform-article h2 {
  max-width: 100%;
  margin: 2.5rem 0 0.75rem;
  font-size: clamp(1.45rem, 1.2rem + 0.8vw, 1.85rem);
  line-height: 1.35;
}

.longform-article > h2 { margin-inline: auto; }

.longform-article p,
.longform-article ol,
.longform-article ul { max-width: var(--text-col); }

.longform-article p { margin: 0 0 1.25rem; }
.longform-article > p { margin-inline: auto; }
.longform-article > .article-back { margin: 1.25rem auto 2rem; }
.longform-article ol,
.longform-article ul { padding-inline-start: 1.65rem; margin: 0 auto 1.5rem; }
.longform-article .article-reasons { list-style: decimal outside; padding-inline-start: 2.25rem; }
.longform-article .article-references { list-style: disc outside; }
.longform-article li { padding-inline-start: 0.25rem; margin: 0 0 1rem; }
.longform-article li::marker { color: var(--color-accent-red); font-weight: 700; }
.longform-article .article-reasons li { padding-inline-start: 0.5rem; }
.longform-article .article-references li { overflow-wrap: anywhere; margin-bottom: 0.65rem; }
.longform-article a { text-underline-offset: 0.15em; }

.longform-article .article-figure {
  width: min(100%, 48rem);
  margin: 2rem auto;
}

.longform-article .article-figure--small { width: min(100%, 28rem); }
.longform-article .article-figure--inline { width: min(100%, 18rem); }

.longform-article .article-figure--inline { margin-block: 1rem 1.5rem; }

.longform-article .article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.4rem;
}

.longform-article .article-figure figcaption {
  max-width: 100%;
  margin-top: 0.6rem;
  color: var(--color-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.longform-article .article-byline { margin-top: 2rem; font-weight: 600; }

.longform-article .article-project {
  margin-top: 2.5rem;
  padding: 1.25rem;
  border-left: 4px solid var(--color-accent-red);
  background: var(--color-light);
}

.longform-article .article-project h2 { margin-top: 0; }
.longform-article .article-project p { max-width: none; }
.longform-article .article-project .funding-logo {
  display: block;
  width: min(100%, 21rem);
  height: auto;
  margin-top: 1.5rem;
}

@media (max-width: 40rem) {
  .longform-article { width: min(calc(100% - 1.5rem), 72rem); }
  .longform-article .article-project { padding: 1rem; }
  .longform-article .article-reasons { padding-inline-start: 2rem; }
}

@media print {
  .longform-article { width: 100%; margin: 0; font-size: 11pt; color: #000; }
  .longform-article .article-back { display: none; }
  .longform-article .article-figure,
  .longform-article li { break-inside: avoid; }
  .longform-article .article-project { background: #fff; }
  .longform-article a { color: #000; }
}
