/* The article template — E6.
 *
 * One column of prose with a sidebar that is never a second reading column.
 * The measure is capped at 68ch, headings at 34ch so they break on meaning,
 * and the figures and pull-facts occupy full rows rather than floating — which
 * is what lets any order of blocks stay readable.
 *
 * The sections here are the article's own furniture: header (M25), contents
 * (M26), answer (M27), next step (M30), byline (M32), related (M33). The
 * questions reuse the M14 accordion and the safety statement reuses M16.
 *
 * No colour literals. Every value traces to tokens.css.
 */

/* ------------------------------------------------------- progress hairline */
/* A position readout, not an effect. Width is set by assets/js/article.js; if
 * the script never runs this stays at zero and nothing about the page changes.
 * No transition — a bar that eases behind the scroll is lying about where you
 * are. */
.pl-article__progress {
  position: sticky;
  top: var(--masthead-h);
  z-index: 29;
  width: 0;
  height: 2px;
  background: var(--c-text);
}

/* ------------------------------------------------------------ M25 header  */
.pl-article__meta {
  font-size: 0.78125rem;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-3);
}

.pl-article__title {
  max-width: 20ch;
}

.pl-article__standfirst {
  font-size: var(--step-1);
  line-height: 1.5;
  max-width: 60ch;
  margin-top: var(--sp-3);
  text-wrap: pretty;
}

/* The cover. Full width of the wrap, not of the reading column: it belongs to
 * the article as a whole, the way the title does, and the measure starts below
 * it. */
.pl-article__cover {
  margin-top: var(--sp-4);
}

.pl-article__cover img {
  width: 100%;
  border: var(--rule) solid var(--c-rule);
}

.pl-article__cover-caption {
  padding-top: var(--sp-1);
  font-size: 0.75rem;
}

/* ------------------------------------------------------------- the layout */
/* The sidebar's width and the gap beside it are declared once, here: a
 * full-width figure has to reach back across both of them to touch the edge of
 * the wrap, and two numbers that must agree should not be written twice. */
.pl-article__layout {
  --article-aside: 15rem;
  --article-gap: var(--sp-8);

  display: grid;
  gap: var(--sp-6);
}

@media (min-width: 64rem) {
  .pl-article__layout {
    grid-template-columns: minmax(0, 1fr) var(--article-aside);
    column-gap: var(--article-gap);
    align-items: start;
  }

  /* Placed explicitly rather than by source order: the contents list comes
   * first in the DOM, where a keyboard user reaches it before the article, and
   * second on screen, where it must not push the prose off centre. */
  .pl-article__body {
    grid-column: 1;
    grid-row: 1;
  }

  .pl-article__aside {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: calc(var(--masthead-h) + var(--sp-4));
  }
}

/* -------------------------------------------------- M26 table of contents */
.pl-article__toc {
  display: flex;
  flex-direction: column;
  border-top: var(--rule) solid var(--c-rule);
  margin-top: var(--sp-2);
}

.pl-article__toc-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-block: var(--sp-1);
  border-bottom: var(--rule) solid var(--c-rule);
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--c-text-muted);
  text-decoration: none;
}

.pl-article__toc-link:hover {
  color: var(--c-text);
}

.pl-article__aside-label {
  margin-top: var(--sp-4);
}

.pl-article__reviewer {
  margin-top: var(--sp-1);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* -------------------------------------------------------- M27 the answer  */
/* Boxed and first. This is the passage an engine will lift, so it is the one
 * part of the page that has to make sense with nothing around it. */
.pl-answer {
  border: var(--rule) solid var(--c-text);
  padding: var(--sp-3);
  margin-bottom: var(--sp-6);
  max-width: var(--measure);
}

.pl-answer__text {
  font-size: var(--step-1);
  line-height: 1.55;
  margin-block: var(--sp-2);
  text-wrap: pretty;
}

.pl-answer__facts {
  padding-left: var(--sp-3);
  list-style-position: outside;
  line-height: 1.7;
}

/* ---------------------------------------------------------- the body copy */
/* The reading size is set on the column, not on the prose, because --measure
 * is 68ch and a ch is relative to the element's own font size: set it lower
 * down and the answer box, the panel and the paragraphs each compute a
 * slightly different 68ch, and the left edge stays straight while the right
 * one wanders. */
.pl-article__body {
  font-size: var(--step-read);
}

.pl-article__prose {
  line-height: 1.7;
}

/* An H2 inside nine minutes of prose is a signpost, not a page title — the
 * display step would shout over the paragraph it introduces. */
.pl-article__prose h2 {
  font-size: var(--step-2);
  max-width: 34ch;
  margin-top: var(--sp-6);
}

.pl-article__prose h3 {
  max-width: 44ch;
  margin-top: var(--sp-4);
}

/* Figures never float: they take a full row, so no order of blocks can break
 * the measure. */
.pl-article__prose figure {
  margin-block: var(--sp-4);
  max-width: none;
}

.pl-article__prose img {
  width: 100%;
  border: var(--rule) solid var(--c-rule);
}

.pl-article__prose figcaption {
  padding-top: var(--sp-1);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--c-text-muted);
  max-width: var(--measure);
}

/* ------------------------------------------------- the body's own blocks  */
/* Three widths, as E6 specifies: the measure, the column, and the wrap. Wide
 * fills the reading column; full reaches back across the sidebar as well. It
 * stops at the edge of the wrap — nothing on this site bleeds past the grid. */
.pl-article__prose .alignwide,
.pl-article__prose .alignfull {
  max-width: none;
  width: 100%;
}

@media (min-width: 64rem) {
  .pl-article__prose .alignfull {
    margin-right: calc(-1 * (var(--article-aside) + var(--article-gap)));
  }
}

/* A data table in the middle of prose is still data: mono, tabular figures, a
 * navy header row and hairlines between rows. It scrolls inside its own box
 * rather than pushing the page sideways. */
.pl-article__prose .wp-block-table {
  overflow-x: auto;
  margin-block: var(--sp-4);
}

.pl-article__prose table {
  width: 100%;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.84375rem;
  line-height: 1.5;
}

.pl-article__prose th {
  background: var(--c-surface-inv);
  color: var(--pl-paper);
  text-align: left;
  padding: 11px 16px;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pl-article__prose td {
  padding: 11px 16px;
  border-bottom: var(--rule) solid var(--c-rule);
}

/* A quotation is marked by the same hairline as everything else. No large
 * quotation marks: the brandbook has no decorative glyphs. */
.pl-article__prose blockquote {
  border-left: var(--rule) solid var(--c-text);
  padding-left: var(--sp-3);
  margin-block: var(--sp-4);
}

.pl-article__prose blockquote cite {
  display: block;
  margin-top: var(--sp-1);
  font-size: 0.9375rem;
  font-style: normal;
  color: var(--c-text-muted);
}

/* A document in the body reads like a row of the product library. The core
 * block's own button is dropped — the link downloads the file, and a button
 * beside it is the same action twice. */
.pl-article__prose .wp-block-file {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-1) var(--sp-3);
  border-top: var(--rule) solid var(--c-rule);
  border-bottom: var(--rule) solid var(--c-rule);
  padding-block: var(--sp-2);
  margin-block: var(--sp-4);
  font-size: var(--step-0);
}

.pl-article__prose .wp-block-file__button {
  display: none;
}

.pl-article__prose .wp-block-file a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------- M30 the next step */
.pl-next {
  background: var(--c-water);
  color: var(--pl-navy);
  padding: var(--sp-3);
  margin-block: var(--sp-6);
  max-width: var(--measure);
}

.pl-next__text {
  font-size: var(--step-1);
  line-height: 1.5;
  margin-block: var(--sp-2) var(--sp-3);
  text-wrap: pretty;
}

/* The panel is sky whatever the section around it, so the label cannot inherit
 * a muted colour meant for white. */
.pl-next .label {
  color: var(--pl-navy);
}

/* --------------------------------------------------------- M31 questions  */
/* An accordion is interface, so it stays at the interface size rather than the
 * reading size (E6). That makes its own 68ch narrower than the column's, so
 * the measure is pinned to the same edge instead. */
.pl-article__faq {
  margin-block: var(--sp-6);
  font-size: var(--step-0);
  max-width: 51rem;
}

/* ------------------------------------------- M32 who stands behind it */
.pl-byline {
  border-top: var(--rule) solid var(--c-text);
  padding-top: var(--sp-3);
  max-width: var(--measure);
}

.pl-byline__grid {
  display: grid;
  gap: var(--sp-4);
}

@media (min-width: 48rem) {
  .pl-byline__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.pl-byline__author {
  margin-top: var(--sp-2);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.pl-byline__sources {
  margin-top: var(--sp-2);
  font-size: 0.9375rem;
}

.pl-byline__source {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------ M33 related */
.pl-related__grid {
  margin-top: var(--sp-4);
}

.pl-related__card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  text-decoration: none;
  transition: background-color var(--transition);
}

.pl-related__card:hover {
  background: var(--c-water);
}

/* Slate on sky is 3.3:1 and fails AA — see the same note in product.css. The
 * card's quiet text comes up to full ink while it is hovered. */
.pl-related__card:hover .pl-related__kind,
.pl-related__card:hover .pl-related__note {
  color: var(--c-text);
}

.pl-related__kind {
  font-size: 0.75rem;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pl-related__title {
  font-size: var(--step-1);
  line-height: 1.2;
}

.pl-related__note {
  font-size: 0.9375rem;
  line-height: 1.5;
}
