/* All declarations stay inside this media query, including after CSS optimisation. */
@media screen and (max-width: 767px) {
  html body #et-boc #main-content {
    --cfx-mobile-h1: clamp(1.75rem, 7.2vw, 1.875rem);
    --cfx-mobile-hero: clamp(2rem, 8.2vw, 2.125rem);
    --cfx-mobile-h2: clamp(1.5rem, 6.6vw, 1.75rem);
    --cfx-mobile-h3: clamp(1.1875rem, 5.2vw, 1.375rem);
    --cfx-mobile-card-title: clamp(1.25rem, 5.6vw, 1.5rem);
    --cfx-mobile-h1-tracking: -0.02em;
    --cfx-mobile-h2-tracking: -0.015em;
  }

  /* Allow headings to wrap without widening their grid or flex containers. */
  html body #et-boc #main-content :is(h1, h2, h3, h4, h5, h6) {
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    hyphens: manual;
    letter-spacing: normal !important;
  }
  html body #et-boc #main-content :is(h1, h2) {
    text-wrap: balance;
  }

  /* Legacy Divi modules otherwise inherit desktop sizes of 54 / 46 / 39 px. */
  html body #et-boc #main-content h1,
  html body.cfx-reviewed-page #et-boc #main-content .cfx-reviewed h1,
  html body.cfx-reviewed-page #et-boc #main-content .cfx-reviewed .index-hero h1,
  html body.cfx-reviewed-page #et-boc #main-content .cfx-reviewed .article-hero h1 {
    font-size: var(--cfx-mobile-h1) !important;
    line-height: 1.2 !important;
    letter-spacing: var(--cfx-mobile-h1-tracking) !important;
  }
  html body #et-boc #main-content .et_pb_text_inner > h2,
  html body #et-boc #main-content .et_pb_slide_content h2,
  html body #et-boc #main-content .et_pb_blurb_container > h2,
  html body #et-boc #main-content [class^="cfx-related-products--"] > h2 {
    font-size: var(--cfx-mobile-h2) !important;
    line-height: 1.25 !important;
    letter-spacing: var(--cfx-mobile-h2-tracking) !important;
  }
  html body #et-boc #main-content .et_pb_text_inner > h3,
  html body #et-boc #main-content .et_pb_blurb_container > h3,
  html body #et-boc #main-content .et_pb_toggle_title {
    font-size: var(--cfx-mobile-h3) !important;
    line-height: 1.35 !important;
  }
  html body #et-boc #main-content .et_pb_text_inner > h4 {
    font-size: 1.25rem !important;
    line-height: 1.35 !important;
  }
  html body #et-boc #main-content .et_pb_text_inner > h5 {
    font-size: 1.125rem !important;
    line-height: 1.35 !important;
  }
  html body #et-boc #main-content .et_pb_text_inner > h6 {
    font-size: 1rem !important;
    line-height: 1.4 !important;
  }
  html body #et-boc #main-content .meta .et_pb_module_header {
    font-size: 1.125rem !important;
    line-height: 1.35 !important;
  }
  html body #et-boc #main-content .et_pb_post h2.entry-title {
    font-size: var(--cfx-mobile-card-title) !important;
    line-height: 1.3 !important;
  }

  /* The home page adds another 10% inset to each heading on mobile. */
  html body #et-boc #main-content .cfx-home-2026 :is(h1, h2, h3) {
    width: 100% !important;
  }
  html body #et-boc #main-content .cfx-home-2026 h1 {
    font-size: var(--cfx-mobile-hero) !important;
  }
  html body #et-boc #main-content .cfx-home-2026 h2 {
    font-size: var(--cfx-mobile-h2) !important;
    line-height: 1.25 !important;
  }
  html body #et-boc #main-content .cfx-home-2026 h3,
  html body #et-boc #main-content .cfx-usp h3,
  html body #et-boc #main-content .cfx-brand-video h3 {
    font-size: var(--cfx-mobile-h3) !important;
    line-height: 1.35 !important;
  }

  /* Keep article and catalogue card headings below the page heading. */
  html body #et-boc #main-content .cfx-hub-card h2,
  html body.cfx-reviewed-page #et-boc #main-content .cfx-reviewed .card-copy h2 {
    font-size: var(--cfx-mobile-card-title) !important;
    line-height: 1.3 !important;
  }
  html body.cfx-reviewed-page #et-boc #main-content .cfx-reviewed .content h2 {
    font-size: var(--cfx-mobile-h2) !important;
    line-height: 1.3 !important;
  }

  /* A single unbroken medical word must not set a grid track's minimum width. */
  html body #et-boc #main-content .cfx-reviewed .article-hero-grid,
  html body #et-boc #main-content .cfx-reviewed .article-layout,
  html body #et-boc #main-content .cfx-reviewed .article-grid,
  html body #et-boc #main-content .cfx-rib-hero-grid,
  html body #et-boc #main-content .cfx-article-hero-grid {
    min-width: 0 !important;
  }
  html body #et-boc #main-content .cfx-reviewed .article-hero-grid > *,
  html body #et-boc #main-content .cfx-reviewed .article-layout > *,
  html body #et-boc #main-content .cfx-reviewed .article-grid > *,
  html body #et-boc #main-content .cfx-rib-hero-grid > *,
  html body #et-boc #main-content .cfx-article-hero-grid > * {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: anywhere;
  }

  /* Give benefit-card copy the full card width instead of a 142 px side column. */
  html body #et-boc #main-content .cfx-usp-cards {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  html body #et-boc #main-content .cfx-usp-card {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }
  html body #et-boc #main-content .cfx-usp-thumb {
    width: 100% !important;
    height: 112px !important;
    margin: 0 !important;
  }
  html body #et-boc #main-content .cfx-usp-thumb img {
    width: 128px !important;
    height: 112px !important;
  }
  html body #et-boc #main-content .cfx-usp-card-copy {
    min-width: 0;
  }

  /* Preserve natural character spacing and word grouping in these scripts. */
  html[lang^="ar"] body #et-boc #main-content,
  html[lang^="he"] body #et-boc #main-content,
  html[lang^="ko"] body #et-boc #main-content,
  html[lang^="zh"] body #et-boc #main-content {
    --cfx-mobile-h1-tracking: normal;
    --cfx-mobile-h2-tracking: normal;
  }
  html[lang^="ko"] body #et-boc #main-content :is(h1, h2, h3) {
    word-break: keep-all !important;
  }
}
