.numbered-sections {
  counter-reset: story-section;
}

.numbered-section {
  align-items: start;
  display: grid;
  gap: clamp(1rem, 3vw, 2rem);
  grid-template-columns: 72px minmax(0, 1fr);
}

.section-number {
  align-items: center;
  background: var(--yellow);
  border: 3px solid var(--navy);
  border-radius: 50%;
  color: var(--navy);
  display: flex;
  font-size: 1.5rem;
  font-weight: 950;
  height: 64px;
  justify-content: center;
  position: sticky;
  top: 1rem;
  width: 64px;
}

.numbered-section h2 {
  margin-top: 0;
}

.related-documents {
  background: #edf5fb;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-top: 1.1rem;
  padding: 1rem;
}

.related-documents > strong {
  color: var(--navy);
  display: block;
  margin-bottom: 0.6rem;
}

.related-public-pages,
.related-source-descriptions {
  border-top: 1px solid var(--line);
  margin-top: 0.85rem;
  padding-top: 0.85rem;
}

.related-public-pages > strong {
  color: var(--navy);
  display: block;
  margin-bottom: 0.6rem;
  width: 100%;
}

.related-source-descriptions summary {
  color: var(--navy);
  cursor: pointer;
  font-weight: 900;
  min-height: 44px;
  padding: 0.55rem 0;
}

.related-source-descriptions[open] summary {
  margin-bottom: 0.6rem;
}

.related-documents div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.related-documents a {
  align-items: center;
  background: #fff;
  border: 2px solid var(--blue);
  border-radius: 999px;
  color: var(--blue);
  display: inline-flex;
  font-weight: 900;
  min-height: 42px;
  padding: 0.45rem 0.7rem;
  text-decoration: none;
}

body.pf-high-contrast .section-number,
body.pf-high-contrast .related-documents,
body.pf-high-contrast .related-public-pages,
body.pf-high-contrast .related-source-descriptions {
  background: #fff !important;
  border-color: #000 !important;
  color: #000 !important;
}

@media (max-width: 640px) {
  .numbered-section {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .section-number {
    font-size: 1.05rem;
    height: 44px;
    width: 44px;
  }
}
