/* Opt-in typography for public reading pages. Layout and theme colours remain
   in their existing components; Site Audit and Text Analysis never opt in. */
html:has(> body[data-editorial]) { font-size: 100%; }
body[data-editorial] {
  font-family: var(--ui-font);
  font-size: var(--type-body);
  font-weight: var(--type-weight-body);
  line-height: var(--type-leading-body);
}
:where(body[data-editorial] #main) :where(h1, h2, h3, h4, h5, h6) {
  font-family: var(--ui-font);
  font-weight: var(--type-weight-heading);
  line-height: var(--type-leading-heading);
  letter-spacing: var(--type-tracking-heading);
  overflow-wrap: anywhere;
}
:where(body[data-editorial] #main) :where(h1) {
  font-size: var(--type-page);
  line-height: var(--type-leading-page);
}
:where(body[data-editorial] #main) :where(h2) { font-size: var(--type-section); }
:where(body[data-editorial] #main) :where(h3) { font-size: var(--type-subheading); }
:where(body[data-editorial] #main) :where(h4, h5, h6) { font-size: var(--type-card); }
:where(body[data-editorial]) :where(button, input, select, textarea, table, label) {
  font-family: var(--ui-font);
  font-size: var(--type-control);
  line-height: var(--type-leading-control);
}
:where(body[data-editorial] #main) :where(small, figcaption) {
  font-size: var(--type-caption);
  line-height: var(--type-leading-caption);
}
:where(body[data-editorial] #main) :where(pre, code, kbd, samp) {
  font-family: var(--font-code);
  font-size: var(--type-control);
  line-height: var(--type-leading-body);
}
/* Header/footer layout variants contain no competing legacy font rules. */
body:is([data-editorial],[data-client-report]) :where(.site-header, .site-footer) {
  font-family: var(--ui-font);
  font-size: var(--type-control);
  line-height: var(--type-leading-control);
}
body:is([data-editorial],[data-client-report]) :where(.sh-brand, .footer-brand .logo-text) {
  font-size: var(--type-card);
  font-weight: var(--type-weight-heading);
  line-height: var(--type-leading-heading);
}
body:is([data-editorial],[data-client-report]) :where(.sh-link, .sh-cta, .footer-col-title) {
  font-weight: var(--type-weight-label);
}
body:is([data-editorial],[data-client-report]) :where(.sh-brand small, .sh-languages, .sh-avatar,
  .footer-brand p, .footer-bottom, .footer-cert-badge-text, .nav-logo-tld) {
  font-size: var(--type-caption);
  line-height: var(--type-leading-caption);
}
