/* The background pages: /context/ and /context/<slug>/.
   Layers on styles.css, reusing its tokens, masthead, pagehead and footer. */

.ctx {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
}

/* ---------- Head ---------- */

.ctx-head__kicker {
  margin: 0 0 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ctx-head__kicker a {
  color: var(--accent);
  text-decoration: none;
}

.ctx-head__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4.2vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.ctx-head__dek {
  margin: 0.8rem 0 0;
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.ctx-head__meta {
  margin: 0.8rem 0 0;
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* ---------- Figures and videos ---------- */

.ctx-figure,
.ctx-video {
  margin: 1.75rem 0;
}

.ctx-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 44rem;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
}

.ctx-figure--wide img {
  max-height: 30rem;
  object-fit: cover;
}

.ctx-figure figcaption,
.ctx-video figcaption {
  margin-top: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.ctx-credit {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--text-faint);
}

.ctx-credit a {
  color: inherit;
}

.ctx-video__link,
.ctx-video__frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
}

.ctx-video__link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
  transition: opacity 0.15s;
}

.ctx-video__link:hover img,
.ctx-video__link:focus-visible img {
  opacity: 1;
}

.ctx-video__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 4.25rem;
  height: 3rem;
  border-radius: 0.8rem;
  background: rgb(0 0 0 / 72%);
}

.ctx-video__play::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.65rem 0 0.65rem 1.1rem;
  border-color: transparent transparent transparent #fff;
  transform: translateX(0.12rem);
}

.ctx-video__link:hover .ctx-video__play {
  background: #c4302b;
}

/* ---------- Impartiality note, contents ---------- */

.ctx-note {
  margin: 1.5rem 0;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.ctx-toc {
  margin: 1.5rem 0 2rem;
  padding: 0.9rem 1.1rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ctx-toc__title {
  margin: 0 0 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.ctx-toc ol {
  margin: 0;
  padding-left: 1.2rem;
  columns: 2;
  column-gap: 2rem;
  font-size: 0.88rem;
}

.ctx-toc li {
  margin-bottom: 0.25rem;
  break-inside: avoid;
}

.ctx-toc a {
  color: var(--accent);
  text-decoration: none;
}

.ctx-toc a:hover {
  text-decoration: underline;
}

/* ---------- Body text ---------- */

.ctx-body {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--text);
}

.ctx-body h2 {
  margin: 2.75rem 0 0.75rem;
  font-family: var(--font-sans);
  font-size: 1.45rem;
  line-height: 1.25;
  scroll-margin-top: 5rem;
}

.ctx-body h3 {
  margin: 1.75rem 0 0.5rem;
  font-family: var(--font-sans);
  font-size: 1.1rem;
}

.ctx-body p {
  margin: 0 0 1rem;
}

.ctx-body ul,
.ctx-body ol {
  margin: 0 0 1rem;
  padding-left: 1.3rem;
}

.ctx-body li {
  margin-bottom: 0.4rem;
}

.ctx-body a {
  color: var(--accent);
  text-underline-offset: 2px;
}

.ctx-body blockquote {
  margin: 1.25rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 3px solid var(--border-strong);
  color: var(--text-muted);
  font-style: italic;
}

.ctx-body blockquote cite {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.85rem;
  font-style: normal;
  font-family: var(--font-sans);
}

/* ---------- Key figures ---------- */

.ctx-body .ctx-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-sans);
}

.ctx-body .ctx-facts li {
  margin: 0;
  padding: 0.85rem 1rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.ctx-facts strong {
  display: block;
  font-size: 1.45rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.ctx-facts span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.ctx-facts small {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-faint);
}

/* ---------- Timeline ---------- */

.ctx-body .ctx-timeline {
  margin: 1.25rem 0 1.75rem;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--border-strong);
  font-family: var(--font-sans);
}

.ctx-body .ctx-timeline li {
  position: relative;
  margin: 0;
  padding: 0 0 1rem 1.25rem;
  font-size: 0.95rem;
  line-height: 1.55;
}

.ctx-timeline li::before {
  content: "";
  position: absolute;
  left: -0.4rem;
  top: 0.4rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 2px solid var(--accent);
}

.ctx-timeline time {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent);
}

/* ---------- Who says what ---------- */

.ctx-sides {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.9rem;
  margin: 1.25rem 0 1.75rem;
  font-family: var(--font-sans);
}

.ctx-side {
  padding: 1rem 1.1rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-top: 3px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.ctx-side h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.ctx-body .ctx-side p,
.ctx-body .ctx-side li {
  font-size: 0.9rem;
  line-height: 1.55;
}

.ctx-body .ctx-side ul {
  margin: 0;
}

/* ---------- Tables ---------- */

.ctx-table-wrap {
  margin: 1.25rem 0 1.75rem;
  overflow-x: auto;
}

.ctx-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 0.88rem;
}

.ctx-table caption {
  text-align: left;
  font-weight: 650;
  margin-bottom: 0.5rem;
}

.ctx-table th,
.ctx-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.ctx-table td.num,
.ctx-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ctx-table thead th {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  border-bottom-color: var(--border-strong);
}

.ctx-table-wrap .ctx-source {
  margin-top: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* ---------- Sources ---------- */

.ctx-body .ctx-sources {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.ctx-body .ctx-sources li {
  margin-bottom: 0.35rem;
  overflow-wrap: anywhere;
}

/* ---------- Follow live, corrections, more ---------- */

.ctx-follow {
  margin: 2.5rem 0 1.25rem;
  padding: 1.1rem 1.25rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.ctx-follow__title {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
}

.ctx-follow p {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.ctx-follow ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ctx-follow li {
  padding: 0.4rem 0;
  border-top: 1px solid var(--border);
}

.ctx-follow a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.ctx-follow a:hover {
  text-decoration: underline;
}

.ctx-fix {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ctx-fix a {
  color: var(--accent);
}

.ctx-more {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.ctx-more__title {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.ctx-more ul {
  margin: 0;
  padding-left: 1.2rem;
}

.ctx-more li {
  margin-bottom: 0.35rem;
}

.ctx-more a {
  color: var(--accent);
}

/* ---------- Index cards ---------- */

.ctx-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1.1rem;
  margin: 1.5rem 0 2.5rem;
  padding: 0;
  list-style: none;
}

.ctx-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ctx-card__link {
  color: var(--text);
  text-decoration: none;
}

.ctx-card__link img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg-sunken);
}

.ctx-card__title {
  display: block;
  padding: 0.9rem 1.1rem 0;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
}

.ctx-card__link:hover .ctx-card__title {
  color: var(--accent);
}

.ctx-card__dek {
  margin: 0.45rem 0 0;
  padding: 0 1.1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.ctx-card__meta {
  margin: auto 0 0;
  padding: 0.75rem 1.1rem 0.9rem;
  font-size: 0.75rem;
  color: var(--text-faint);
}

@media (max-width: 34rem) {
  .ctx-toc ol {
    columns: 1;
  }

  .ctx-body {
    font-size: 1.02rem;
  }
}
