/* Article pages: reading-first layout. One centred column of about 70 characters,
   18 px body text at 1.75 line height, real headings and paragraphs, figures with
   their own captions, key takeaways, pull quote, disclaimer, related research.
   Cards, waves and reveals come from cards.css. Colours from tokens.css. */
main#article-page {
  --header-height: 7.875rem;
  --measure: 57.5rem;

  .wrapper {
    padding-inline: 1.5rem;
  }

  /* reading progress */
  .ar-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    height: 3px;
    pointer-events: none;

    span {
      display: block;
      height: 100%;
      width: 0;
      background-color: var(--dr-goldenrod);
    }
  }

  /* ---- header ------------------------------------------------------------------------- */
  .ar-hero {
    position: relative;
    overflow: hidden;
    background-image: url("../assets/images/gradient-bg.png");
    background-position: center;
    background-size: cover;
  }

  .ar-hero-inner {
    position: relative;
    z-index: 1;
    max-width: calc(var(--measure) + 3rem);
    padding-top: calc(var(--header-height) + 3.5rem);
    padding-bottom: 8rem;
  }

  .ar-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dr-lavender);

    a:hover { color: var(--dr-white); text-decoration: underline; }
  }

  .ar-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
    margin-top: 2rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dr-lavender);
  }

  .ar-tag {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background-color: var(--primary-600);
    color: var(--accent-300);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .ar-title {
    margin-top: 1rem;
    font-size: 3.25rem;
    font-weight: 800;
    line-height: 1.12;
    color: var(--dr-white);
    text-wrap: balance;
  }

  .ar-dek {
    margin-top: 1.25rem;
    max-width: var(--measure);
    font-size: 1.3125rem;
    font-weight: 500;
    line-height: 1.55;
    color: var(--dr-lavender);
  }

  .ar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;

    > a.secondary-button { width: fit-content; }
  }

  .ar-icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.32);
    transition: background-color 0.2s ease;

    &:hover { background-color: var(--primary-600); }

    &:focus-visible {
      outline: 2px solid var(--dr-white);
      outline-offset: 2px;
    }

    img { width: 1.25rem; height: 1.25rem; }
  }

  /* ---- body --------------------------------------------------------------------------- */
  .ar-body {
    padding: 1rem 1.5rem 6rem;
  }

  .ar-column {
    max-width: var(--measure);
    margin-inline: auto;
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--gray-900);

    > * + * { margin-top: 1.5rem; }

    h2 {
      margin-top: 3.5rem;
      font-size: 1.75rem;
      font-weight: 800;
      line-height: 1.3;
      color: var(--dr-blue);
      text-wrap: balance;
      scroll-margin-top: calc(var(--header-height) + 1rem);
    }

    h2 + * { margin-top: 1rem; }

    h3 {
      margin-top: 2.5rem;
      font-size: 1.3125rem;
      font-weight: 700;
      line-height: 1.4;
      color: var(--gray-900);
    }

    h3 + * { margin-top: 0.75rem; }

    p {
      text-align: justify;
      hyphens: auto;
      -webkit-hyphens: auto;
    }

    strong { font-weight: 700; }

    a:not([class]) {
      color: var(--dr-blue);
      text-decoration: underline;
      text-underline-offset: 3px;
    }

    ul:not([class]),
    ol:not([class]) {
      padding-left: 1.5rem;

      li + li { margin-top: 0.5rem; }
      li::marker { color: var(--dr-blue); font-weight: 700; }
    }
  }

  .ar-column p.ar-lead {
    text-align: left;
    hyphens: manual;
    -webkit-hyphens: manual;
  }

  .ar-lead {
    font-size: 1.3125rem;
    line-height: 1.65;
    font-weight: 500;
  }

  .ar-banner img {
    display: block;
    width: 100%;
    border-radius: 1rem;
  }

  .ar-takeaways {
    margin-top: 2.5rem;
    padding: 1.75rem 2rem;
    border-radius: 1rem;
    background-color: var(--surface-tint);

    h2 {
      margin-top: 0;
      font-size: 0.875rem;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--dr-blue);
    }

    ul {
      margin-top: 1rem;
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
    }

    li {
      position: relative;
      padding-left: 1.75rem;
      font-size: 1.0625rem;
      font-weight: 600;
      line-height: 1.55;

      &::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0.5rem;
        width: 0.625rem;
        height: 0.625rem;
        border-radius: 50%;
        background-color: var(--dr-goldenrod);
      }
    }
  }

  .ar-kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2.5rem;

    > div {
      padding: 1.5rem;
      border-radius: 1rem;
      background-color: var(--surface-tint);
      font-size: 0.9375rem;
      font-weight: 600;
      line-height: 1.5;
      color: var(--gray-900);
    }

    span {
      display: block;
      margin-bottom: 0.5rem;
      font-size: 2rem;
      font-weight: 800;
      line-height: 1.1;
      color: var(--text-accent-large);
    }
  }

  .ar-figure {
    margin-top: 2.5rem;
    margin-bottom: 2.5rem;

    .dr-chart { margin: 0; max-width: none; }

    img { display: block; width: 100%; border-radius: 12px; }

    .ar-figure-head {
      margin: 0 0 1rem;
      font-size: 1.25rem;
      font-weight: 700;
      line-height: 1.4;
      color: var(--dr-blue);

      span {
        display: block;
        margin-bottom: 0.25rem;
        font-size: 0.875rem;
        font-weight: 600;
        color: var(--dr-charcoal);
      }
    }

    figcaption {
      margin-top: 0.75rem;
      font-size: 0.875rem;
      line-height: 1.5;
      color: var(--dr-charcoal);
    }
  }

  .ar-bands {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;

    li {
      display: flex;
      align-items: baseline;
      gap: 1rem;
    }
  }

  .ar-band {
    flex-shrink: 0;
    min-width: 4.25rem;
    padding: 0.125rem 0.625rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;

    &.ar-band-fav { background-color: var(--success-50); color: var(--success-700); }
    &.ar-band-neu { background-color: var(--warning-50); color: var(--warning-700); }
    &.ar-band-unfav { background-color: var(--error-50); color: var(--error-700); }
  }

  .ar-quote {
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding: 2rem 0;
    border-top: 2px solid var(--dr-goldenrod);
    border-bottom: 1px solid var(--border-default);

    p {
      font-size: 1.5rem;
      font-weight: 700;
      line-height: 1.45;
      color: var(--dr-blue);
      text-wrap: balance;
    }

    cite {
      display: block;
      margin-top: 1rem;
      font-size: 0.9375rem;
      font-style: normal;
      font-weight: 600;
      color: var(--dr-charcoal);
    }
  }

  .ar-end {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;

    > a { width: fit-content; }
  }

  .ar-signoff {
    font-weight: 700;
    color: var(--text-accent);
  }

  .ar-disclaimer {
    margin-top: 3rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-default);
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--dr-charcoal);
  }

}

/* ---- tablet ------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  main#article-page {
    .ar-hero-inner {
      padding-top: calc(var(--header-height) + 2rem);
      padding-bottom: 7rem;
    }

    .ar-title { font-size: 2.75rem; }

  }
}

/* ---- phone -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  main#article-page {
    .wrapper { padding-inline: 1rem; }

    .ar-title { font-size: 2.125rem; }
    .ar-dek { font-size: 1.125rem; }

    .ar-body { padding-inline: 1rem; }

    .ar-column {
      font-size: 1.0625rem;
      line-height: 1.7;

      h2 { font-size: 1.5rem; margin-top: 2.75rem; }
    }

    .ar-lead { font-size: 1.1875rem; }

    .ar-takeaways { padding: 1.5rem 1.25rem; }

    .ar-kpis { grid-template-columns: 1fr; }

    .ar-quote p { font-size: 1.25rem; }

    .ar-bands li { flex-direction: column; gap: 0.25rem; }

  }
}
