/* Article page family — long-form body typography and the document download
   card. layout.html and layout_protected.html load this file only on pages
   tagged `style:article`, so every rule below may assume the article context. */

/* Page headline — sits outside .article-body, so this file (loaded on
   style:article pages only) is the right home for its article-page spacing. */
.headline {
  margin-block: 3rem 2rem;
}

/* ======================================
   ARTICLE BODY
====================================== */
.article-body {
  & h4 {
    /* Section heading entered in the page editor (converted web copy). */
    margin-block: 2.5rem 1rem;
    color: var(--brand-purple);
    font-family: var(--bs-font-family-headline);
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
    text-wrap: balance;
  }

  /* Body copy follows the policy page family: 20px, 1.5 line-height, brand
     purple. Set on paragraphs and list items directly so both escape NB
     core's 18px on .intro and stay in step with each other. */
  & p,
  & li {
    font-size: 20px;
    line-height: 1.5;
    color: var(--brand-purple);
    text-wrap: pretty;
  }

  /* Docs paste leaves trailing <br><br> runs inside list items; the list
     owns item rhythm, so hard breaks inside list items collapse. */
  & li br {
    display: none;
  }

  & ul {
    margin-top: 45px;
    margin-bottom: 45px;
    margin-block: 1.5rem;
    padding-inline-start: 1.5rem;

    /* Editors paste paragraphs inside list items; normalise so item rhythm
       comes from the list, not from nested paragraph margins. */
    & li,
    & li > p {
      margin-block: 0;
    }

    & li + li {
      margin-block-start: 0.75rem;
    }

    & ::marker {
      color: var(--brand-teal);
    }
  }

  /* Pull quote — entered in the editor as a blockquote. */
  & blockquote {
    margin-block: 3rem;
    color: var(--brand-teal);
    font-family: var(--bs-font-family-headline);
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 500;
    line-height: 1.15;
    text-align: center;
    text-wrap: balance;

    & > p {
      margin-block: 0;
    }
  }

  /* Editorial note — the web-copy convention is a paragraph written entirely
     in italics, so anchor the callout on the wrapping paragraph's em. */
  & p:has(> em:only-child) {
    margin-block: 1.5rem;
    padding: 1rem 1.25rem;
    background-color: var(--brand-pale);
    border-inline-start: 4px solid var(--brand-teal);
  }

  /* Pull quote, bordered variant — the editor emits this as a
     .quote-section div; the body p rules above supply its text styles. */
  & .quote-section {
    margin-block: 60px;
    padding-block: 20px;
    color: var(--brand-purple);
    text-align: center;
    border-block: 3px solid var(--primary);

    @media (width >= 768px) {
      padding-block: 48px;
    }
  }
}

.article-bottom-spacer {
  padding: 30px;
}

/* ======================================
   DOCUMENT DOWNLOAD CARD
====================================== */
.article-download {
  margin-block-start: 3rem;

  & .article-download__heading {
    padding-block-end: 20px;
    color: var(--brand-purple);
    font-family: var(--bs-font-family-headline);
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
    text-wrap: balance;
  }

  & .article-download__link {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 20px;
    padding: 20px;
    border: 3px solid var(--brand-teal);
    background-color: var(--brand-pale);
    color: var(--brand-purple);
    font-size: 18px;
    text-decoration: none;

    &:focus-visible {
      outline: 3px solid var(--brand-purple);
      outline-offset: 3px;
    }

    &:hover .article-download__pill,
    &:focus-visible .article-download__pill {
      background-color: var(--primary);
    }

    @media (width > 768px) {
      flex-direction: row;
      align-items: center;
      font-size: 22px;
    }
  }

  & .article-download__icon {
    @media (width <= 768px) {
      display: none;
    }
  }

  & .article-download__pill {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    margin-inline: auto;
    padding: 10px 10px 10px 20px;
    background-color: #fff;
    border-radius: var(--radius-pill);
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.3s ease;

    @media (width > 768px) {
      margin-inline: auto 0;
      font-size: 22px;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-download .article-download__pill {
    transition: none;
  }
}
