/* Research article: one template for every digest. The opening sits on the
   warm field with its 3:2 illustration; the text runs in a 36em column, with
   "The research behind this article" beside it on wide screens and after it
   on narrower ones. */

/* Opening */
.article-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 48px 6vw;
  padding: clamp(32px, 3.6vw, 72px) var(--bl-side) clamp(64px, 5.5vw, 104px) max(20px, 8.5%);
}

/* The column grows with the heading past 1440px, so it breaks as it does there. */
.article-head__text {
  flex: 1 1 300px;
  min-width: 0;
  max-width: max(26em, min(28.89vw, 607px));
}

.article-head__crumb {
  font-size: 15px;
}

.article-head__crumb a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-weight: 500;
}

.article-head__crumb svg {
  flex: none;
  width: 17px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  transform: scaleX(-1);
}

.article-head__topic {
  margin-top: clamp(28px, 2.6vw, 44px);
}

.article-head h1 {
  max-width: 14em;
  margin-top: 20px;
  font-size: clamp(28px, 2.474vw, 52px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -.01em;
  text-wrap: pretty;
}

.article-head__description {
  max-width: 22em;
  margin-top: 1.1em;
  font-size: clamp(17px, 1.302vw, 27px);
  line-height: 1.4;
  text-wrap: pretty;
}

.article-meta {
  max-width: 24em;
  margin-top: clamp(28px, 2.6vw, 44px);
  padding-top: 16px;
  border-top: 1px solid var(--bl-rule);
}

.article-meta__line {
  font-size: 15px;
  line-height: 1.5;
}

.article-meta__credit {
  margin-top: 4px;
  color: var(--bl-muted);
  font-size: 14px;
  line-height: 1.5;
}

.article-meta a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--bl-underline);
  text-underline-offset: .25em;
  overflow-wrap: anywhere;
}

.article-meta__credit a {
  color: var(--bl-muted);
  text-decoration-color: var(--bl-outline);
}

/* The drawing stops growing once it would run past the first screen. */
.article-head__art {
  position: relative;
  flex: 1.7 1 480px;
  min-width: 0;
  max-width: calc((100svh - 140px) * 1.5);
  aspect-ratio: 3 / 2;
}

.article-head__art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Text column, the research block and the share links */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 648px);
  padding: clamp(40px, 4vw, 72px) var(--bl-side) 0 max(20px, 8.5%);
}

.article-text {
  min-width: 0;
  font-size: 18px;
  line-height: 1.6;
}

.article-research {
  margin-top: clamp(56px, 6vw, 88px);
  padding: clamp(24px, 4vw, 44px) clamp(20px, 4vw, 44px) clamp(28px, 4vw, 48px);
  background: var(--bl-panel);
}

.article-research__title {
  margin-top: 18px;
  font-size: clamp(19px, 1.6vw, 24px);
  font-weight: 300;
  line-height: 1.3;
  text-wrap: pretty;
}

.article-research__title a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--bl-underline);
  text-underline-offset: .25em;
}

.article-research__label {
  margin-top: 10px;
  color: var(--bl-muted);
  font-size: 14px;
  line-height: 1.5;
}

.article-research__note {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--bl-rule-light);
  color: var(--bl-muted);
  font-size: 15px;
  line-height: 1.55;
  text-wrap: pretty;
}

.article-share {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(48px, 5vw, 72px);
}

.article-share a {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--bl-outline);
  font-size: 15px;
  font-weight: 500;
}

.article-share a:hover {
  border-color: var(--bl-ink);
  text-decoration: none;
}

@media (min-width: 1100px) {
  .article-layout {
    grid-template-columns: minmax(15em, 24%) minmax(0, 648px);
    column-gap: 4vw;
  }

  .article-text {
    grid-column: 2;
    grid-row: 1;
  }

  .article-research {
    position: sticky;
    top: 96px;
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    margin-top: 0;
    padding: 24px 24px 28px;
  }

  .article-research__title {
    font-size: 17px;
    font-weight: 400;
    line-height: 1.4;
  }

  .article-research__note {
    margin-top: 18px;
    font-size: 14px;
  }

  .article-share {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (max-width: 759px) {
  .article-text {
    font-size: 17px;
  }
}

/* Article text. Spacing follows what comes before each block. */
.article-text > * + * {
  margin-top: 1em;
}

.article-text > :is(ul, ol),
.article-text > :is(ul, ol) + * {
  margin-top: 1.4em;
}

.article-text > figure,
.article-text > figure + * {
  margin-top: clamp(40px, 4vw, 56px);
}

.article-text > :is(h2, h3) + * {
  margin-top: 16px;
}

.article-text > :is(h2, h3) + figure {
  margin-top: 28px;
}

.article-text > * + h2 {
  margin-top: clamp(56px, 5vw, 80px);
}

.article-text > * + h3 {
  margin-top: 44px;
}

.article-text > h2 + h3 {
  margin-top: 28px;
}

.article-text > p:first-child {
  font-size: clamp(19px, 1.35vw, 22px);
  line-height: 1.5;
}

.article-text p,
.article-text li {
  text-wrap: pretty;
}

.article-text a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--bl-underline);
  text-underline-offset: .25em;
}

.article-text strong {
  font-weight: 500;
}

.article-text h2 {
  font-size: clamp(22px, 1.75vw, 28px);
  font-weight: 400;
  line-height: 1.2;
  text-wrap: pretty;
}

.article-text h3 {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.35;
  text-wrap: pretty;
}

.article-text ul,
.article-text ol {
  border-top: 1px solid var(--bl-rule);
}

.article-text li {
  padding: 14px 0 15px;
  border-bottom: 1px solid var(--bl-stone);
}

.article-text ol {
  counter-reset: step;
}

.article-text ol > li {
  display: flex;
  gap: 16px;
}

.article-text ol > li::before {
  content: counter(step, decimal-leading-zero);
  counter-increment: step;
  flex: none;
  width: 2em;
  padding-top: .2em;
  color: var(--bl-muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}

.article-quote {
  padding-top: 24px;
  border-top: 1px solid var(--bl-ink);
}

.article-quote blockquote {
  font-size: clamp(22px, 1.75vw, 28px);
  font-weight: 300;
  line-height: 1.35;
  text-wrap: pretty;
}

.article-quote figcaption {
  margin-top: 16px;
  color: var(--bl-muted);
  font-size: 14px;
  line-height: 1.5;
}

.article-table figcaption {
  color: var(--bl-muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.article-table__scroll {
  margin-top: 18px;
  overflow-x: auto;
}

.article-table table {
  width: 100%;
  min-width: calc(var(--columns, 4) * 130px);
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 15px;
  line-height: 1.45;
}

.article-table th,
.article-table td {
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--bl-stone);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.article-table th:last-child,
.article-table td:last-child {
  padding-right: 0;
}

/* The first column is a little wider: 1.3 shares to each other column's 1. */
.article-table thead th:first-child {
  width: calc(130% / (var(--columns, 4) + .3));
}

.article-table thead th {
  padding-top: 0;
  padding-bottom: 10px;
  border-bottom-color: var(--bl-ink);
  color: var(--bl-muted);
  font-size: 14px;
  font-weight: 400;
}

.article-table tbody th {
  font-weight: 500;
}

/* Keep reading */
.keep-reading {
  padding: clamp(112px, 10vw, 184px) var(--bl-side) 0;
}

.keep-reading__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 40px;
}

.keep-reading__head h2 {
  font-size: clamp(22px, 1.75vw, 28px);
  font-weight: 400;
  line-height: 1.2;
}

.keep-reading__head a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--bl-muted);
  font-size: 15px;
}

.keep-reading__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, max(360px, calc((100% - 5vw) / 2))), 1fr));
  gap: clamp(64px, 6vw, 104px) 5vw;
  margin-top: clamp(20px, 2.4vw, 40px);
}

/* Headings never end on a word of their own. */
#article-research-title,
.article-text h2 {
  text-wrap: balance;
}
