/* ==========================================================================
   Essay page
   Loaded after styles.css, which supplies the colours, the font, the header,
   the footer and the page width (60% on desktop, full width on mobile).
   ========================================================================== */

.article {
  padding-top: clamp(2.5rem, 9vh, 5rem);
  padding-bottom: clamp(3rem, 10vh, 6rem);
}

/* --------------------------------------------------------------------------
   Title block
   -------------------------------------------------------------------------- */

.article-header {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--ink);
}

.article-title {
  font-size: var(--step-2.5);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.article-subtitle {
  margin-top: 1rem;
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-soft);
}

.article-meta {
  margin-top: 1.5rem;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.article-meta .author {
  color: var(---ink);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Essay text
   -------------------------------------------------------------------------- */

.article-body {
  padding-top: 2.5rem;
  font-size: 1.125rem;
  line-height: 1.75;
  overflow-wrap: break-word;
}

/* Space between consecutive blocks of text */
.article-body > * + * {
  margin-top: 1.4em;
}

.article-body h2 {
  margin-top: 2.5em;
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.article-body h3 {
  margin-top: 2em;
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.3;
}

.article-body h2 + *,
.article-body h3 + * {
  margin-top: 0.75em;
}

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

.article-body a:hover {
  text-decoration-thickness: 2px;
}

.article-body ul,
.article-body ol {
  margin-bottom: 0;
  padding-left: 1.4em;
}

.article-body li + li {
  margin-top: 0.4em;
}

.article-body blockquote {
  margin-inline: 0;
  margin-bottom: 0;
  padding-left: 1.25em;
  border-left: 2px solid var(--ink);
  color: var(--ink-soft);
}

.article-body figure {
  margin-inline: 0;
  margin-bottom: 0;
}

.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
}

.article-body figcaption {
  margin-top: 0.6rem;
  font-size: var(--step--1);
  line-height: 1.5;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   Link back to the homepage
   -------------------------------------------------------------------------- */

.article-footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: var(--step--1);
  font-weight: 600;
}

.article-footer a {
  text-decoration: none;
}

.article-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

/* --------------------------------------------------------------------------
   Phones: slightly smaller essay text
   -------------------------------------------------------------------------- */

@media (max-width: 40rem) {
  .article-body {
    font-size: 1.0625rem;
    line-height: 1.7;
  }
}
