:root {
  --site-standalone-heading-size: clamp(1.875rem, 3.15vw, 3.25rem);
  --site-paired-heading-size: clamp(1.75rem, 2.9vw, 3rem);
  --site-card-heading-size: clamp(1.35rem, 2.45vw, 2.5rem);
  --site-heading-weight: 700;
  --site-intro-spacing: 0.9rem;
  --site-intro-measure: 59ch;
}

/* Text that introduces a section reads before its content, in one column. */
html main:not(.home-design, .brief-shell) :is(
  .overview-heading, .editorial-heading, .intro-grid, .section-heading-grid,
  .climate-navigation__heading, .public-directory-heading, .solution-intro__grid,
  .help-heading, .system-section__intro, .story-grid, .context-grid,
  .operations-heading, .workplace-heading, .team-heading, .case-heading-grid
) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: var(--site-intro-spacing);
  text-align: left;

  & :is(h2, p:not(.eyebrow)) {
    margin-block: 0;
  }

  & > p:not(.eyebrow),
  & > div > p:not(.eyebrow) {
    max-inline-size: var(--site-intro-measure);
    font-size: 1rem !important;
    line-height: 1.65 !important;
  }

  & :is(h2 + p, p + p):not(.eyebrow) {
    margin-block-start: var(--site-intro-spacing);
  }
}

html main:not(.home-design, .brief-shell) :is(
  .intro-copy, .solution-intro__copy, .editorial-heading__aside,
  .story-copy, .context-copy
) {
  padding-block-start: 0;
}

html main:not(.home-design, .brief-shell) h2 {
  max-inline-size: 100% !important;
  font-size: var(--section-heading-size, var(--site-standalone-heading-size)) !important;
  font-weight: var(--site-heading-weight) !important;
  line-height: 1.08 !important;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

/* Sections with a neighbouring image, list, chart, card or contact panel. */
html main :is(
  .proof-grid, .content-grid, .considerations-grid, .consider-grid, .feature-section,
  .index-grid, .archive-grid, .backbone-grid, .cta-grid, .page-cta__grid,
  .solution-cta__grid, .universe-cta__inner, .next-section__inner, .home-story,
  .people-section__copy, .service-agreement__grid, .team-navigation__grid,
  .contact-band__grid, .featured-card, .customers-grid, .sponsor-grid,
  .responsibility-grid, .governance-grid, .principle-grid, .apprentice-grid,
  .application-grid, .vacancy-grid, .career-cta__grid, .references-grid,
  .agreement-layout, .housing-details, .public-operations
) {
  --section-heading-size: var(--site-paired-heading-size);
}

html main :is(.step-heading, .quote-aside, .related-grid, .facts-grid, .housing-content > aside, .rich-article) {
  --section-heading-size: var(--site-card-heading-size);
}

html main:not(.home-design, .brief-shell) :is(
  section, section > .container, section .content-copy, .considerations-heading,
  .consider-heading, .enrichment-heading, .index-heading, .archive-heading,
  .backbone-copy, .proof-copy, .home-story__copy, .customers-copy,
  .responsibility-copy, .sponsor-copy, .apprentice-copy, .featured-card__copy,
  .people-section__copy, .governance-copy, .feature-section > .container > div,
  .service-agreement__grid > div, .housing-details > section
) > h2 + p:not(.eyebrow) {
  max-inline-size: var(--site-intro-measure);
  margin-block: var(--site-intro-spacing) 0;
  font-size: 1rem;
  line-height: 1.65;
  text-align: left;
}

html main:not(.home-design, .brief-shell) :is(h3, h4, h5, h6) {
  font-weight: var(--site-heading-weight) !important;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

html main:not(.home-design, .brief-shell, .not-found) h1 {
  font-size: min(var(--hero-heading-size), max(1.85rem, 8.6vw)) !important;
}

@media (max-width: 450px) {
  html main:not(.home-design, .brief-shell) h2 {
    font-size: min(var(--section-heading-size, var(--site-standalone-heading-size)), 6.95vw) !important;
  }
}
