/* One consistent text rhythm on Foundation pages and Elementor layouts.
   Target text, not every element: media, icons and layout boxes keep their sizes. */
body.saf-compact-typography {
  line-height: 1.3;
}

body.saf-compact-typography :is(
  h1, h2, h3, h4, h5, h6, p, ul, ol, li, blockquote, figcaption,
  address, dt, dd, label, legend, caption, td, th,
  .elementor-heading-title, .elementor-widget-text-editor,
  .elementor-icon-box-title, .elementor-icon-box-description,
  .elementor-image-box-title, .elementor-image-box-description,
  .elementor-testimonial-content, .elementor-testimonial-name,
  .elementor-icon-list-text, .elementor-button-text,
  .text-link, .button, .site-header nav a, .site-footer nav a, .footer-phones a,
  .saf-medical-writing, .board-description, .board-role,
  .testimonial-comment-text, .testimonial-quote, .footer-tax-identity
) {
  line-height: 1.3 !important;
}

/* Inline text inherits the same rhythm even when an editor supplied a line height. */
body.saf-compact-typography :is(h1, h2, h3, h4, h5, h6, p, li, blockquote)
  :is(span, strong, b, em, a):not(.icon):not([aria-hidden="true"]) {
  line-height: inherit !important;
}

/* Keep paragraph gaps compact without changing horizontal alignment or section padding. */
body.saf-compact-typography :is(p, .elementor-widget-text-editor p) {
  margin-block-start: 0 !important;
  margin-block-end: .65em !important;
}

body.saf-compact-typography :is(p, .elementor-widget-text-editor p):last-child {
  margin-block-end: 0 !important;
}
