/*
Single article page.

Loaded after theme.css so it can override the stock blog-single styles, whose
fixed-height banner clipped long headlines and whose avatar relied on a
translateY(-48px) hack.

Keeps Open Sans and the brand navy rather than introducing a display face:
one page is not the place to fork the site's typography.
*/

.article-page {
  /* The stock banner block supplied the clearance for the fixed site header;
     this page drops that banner, so it carries the offset itself. */
  padding-top: 140px;

  --a-navy: #2d2e82;
  --a-ink: #1a1a1f;
  --a-body: #3c3c46;
  --a-muted: #645f88;
  --a-hairline: #e6e5ef;
  --a-surface: #f6f5fc;
  --a-radius: 8px;
}

/* ---------- breadcrumb: the only one on the page ---------- */

.article-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  font-size: 14px;
  color: var(--a-muted);
}

.article-crumbs li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--a-hairline);
}

.article-crumbs a {
  color: var(--a-navy);
  text-decoration: none;
}

.article-crumbs a:hover,
.article-crumbs a:focus-visible {
  text-decoration: underline;
}

.article-crumbs__current {
  /* Long headlines would otherwise wrap the trail onto three lines. */
  max-width: 28ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- header ---------- */

.article-header {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--a-hairline);
}

.article-eyebrow {
  display: block;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--a-navy);
}

/* The single h1 on the page. */
.article-title {
  margin: 0 0 20px;
  font-size: 40px;
  line-height: 1.18;
  font-weight: 700;
  color: var(--a-ink);
  /* Headlines read better slightly narrower than the body measure. */
  max-width: 30ch;
}

.article-standfirst {
  margin: 0 0 24px;
  font-size: 19px;
  line-height: 1.6;
  color: var(--a-muted);
  max-width: 62ch;
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.article-byline__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--a-surface);
  flex: 0 0 auto;
}

.article-byline__who {
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

.article-byline__author {
  font-size: 15px;
  font-weight: 600;
  color: var(--a-ink);
}

.article-byline__date {
  font-size: 14px;
  color: var(--a-muted);
}

.article-share {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.article-share__label {
  font-size: 13px;
  color: var(--a-muted);
}

.article-share a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* 44px minimum target. */
  width: 44px;
  height: 44px;
  border: 1px solid var(--a-hairline);
  border-radius: 50%;
  color: var(--a-navy);
  font-size: 16px;
  text-decoration: none;
  transition: border-color .2s ease, background-color .2s ease;
}

.article-share a:hover,
.article-share a:focus-visible {
  border-color: var(--a-navy);
  background: var(--a-surface);
}

.article-share a:focus-visible {
  outline: 3px solid var(--a-navy);
  outline-offset: 2px;
}

/* ---------- hero image ---------- */

.article-hero {
  margin: 0 0 36px;
}

.article-hero img {
  display: block;
  width: 100%;
  /* Reserve the space so the image cannot shift the text below it. */
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--a-radius);
  background: var(--a-surface);
}

.article-hero figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--a-muted);
}

/* ---------- body ---------- */

.article-body {
  /* ~70 characters per line. */
  max-width: 68ch;
  font-size: 17px;
  line-height: 1.75;
  color: var(--a-body);
}

.article-body > *:first-child {
  margin-top: 0;
}

.article-body p {
  margin: 0 0 24px;
}

/* Staff author this in CKEditor, so style by element rather than class. */
.article-body h2,
.article-body h3,
.article-body h4 {
  margin: 40px 0 16px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--a-ink);
}

.article-body h2 { font-size: 27px; }
.article-body h3 { font-size: 22px; }
.article-body h4 { font-size: 18px; }

.article-body a {
  color: var(--a-navy);
  text-decoration: underline;
}

.article-body ul,
.article-body ol {
  margin: 0 0 24px;
  padding-left: 24px;
}

.article-body li {
  margin-bottom: 10px;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--a-radius);
  margin: 8px 0 24px;
}

.article-body blockquote {
  margin: 32px 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--a-navy);
  font-size: 19px;
  line-height: 1.6;
  color: var(--a-ink);
}

.article-body table {
  width: 100%;
  margin-bottom: 24px;
  border-collapse: collapse;
  font-size: 15px;
}

.article-body th,
.article-body td {
  padding: 10px 12px;
  border: 1px solid var(--a-hairline);
  text-align: left;
}

/* CKEditor tables can be wider than the measure. */
.article-body__scroll {
  overflow-x: auto;
}

/* ---------- attached document ---------- */

.article-document {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 68ch;
  margin: 0 0 32px;
  padding: 18px 20px;
  border: 1px solid var(--a-hairline);
  border-left: 3px solid var(--a-navy);
  border-radius: var(--a-radius);
  background: #fff;
  color: var(--a-navy);
  text-decoration: none;
  font-weight: 600;
  transition: box-shadow .2s ease;
}

.article-document:hover,
.article-document:focus-visible {
  box-shadow: 0 4px 18px rgba(45, 46, 130, .12);
}

.article-document small {
  display: block;
  font-weight: 400;
  color: var(--a-muted);
}

/* ---------- footer ---------- */

.article-footer {
  max-width: 68ch;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--a-hairline);
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--a-navy);
  font-weight: 600;
  text-decoration: none;
}

.article-back:hover,
.article-back:focus-visible {
  text-decoration: underline;
}

/* ---------- sidebar ---------- */

.article-aside .widget-title {
  /* theme.css sets this to the stock template's purple. */
  color: var(--a-ink);
  font-size: 17px;
  font-weight: 700;
}

.article-related {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-related li + li {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--a-hairline);
}

.article-related a {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
}

.article-related a:focus-visible {
  outline: 3px solid var(--a-navy);
  outline-offset: 2px;
  border-radius: 4px;
}

.article-related__thumb {
  width: 72px;
  height: 56px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 6px;
  background: var(--a-surface);
}

.article-related__title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--a-ink);
}

.article-related a:hover .article-related__title {
  color: var(--a-navy);
}

.article-related__date {
  font-size: 13px;
  color: var(--a-muted);
}

/* ---------- responsive ---------- */

@media (max-width: 991px) {
  .article-aside {
    margin-top: 48px;
  }
}

@media (max-width: 767px) {
  .article-title {
    font-size: 29px;
    max-width: none;
  }

  .article-standfirst {
    font-size: 17px;
  }

  .article-body {
    font-size: 16px;
  }

  .article-share {
    /* Keep the share buttons off the byline's line on a phone. */
    margin-left: 0;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-share a,
  .article-document {
    transition: none;
  }
}
