/* Veridian Health 2.6.27
   Mobile rich-text cleanup.
   Prevents CMS/category/product copy from showing exaggerated spacing,
   artificial line breaks from inline formatting, and detached punctuation.
   Desktop/tablet styling is intentionally unchanged. */

@media (max-width: 767.98px) {
  /* Rich-text containers used by category, CMS, product, manufacturer and
     supplier content. Force normal mobile text flow even when content pasted
     from an editor contains inline justify/spacing styles. */
  body#category #category-description,
  body#category .category-additional-description,
  body#category .category-description,
  body#cms .page-content.page-cms,
  body#product #product-description-short,
  body#product .product-description,
  body#product .tabs .tab-content,
  body#manufacturer #manufacturer-short_description,
  body#manufacturer #manufacturer-description,
  body#supplier #supplier-description {
    text-align: left !important;
    text-justify: auto !important;
    word-spacing: normal !important;
    letter-spacing: normal !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }

  body#category #category-description p,
  body#category #category-description div,
  body#category #category-description li,
  body#category .category-additional-description p,
  body#category .category-additional-description div,
  body#category .category-additional-description li,
  body#category .category-description p,
  body#cms .page-content.page-cms p,
  body#cms .page-content.page-cms div,
  body#cms .page-content.page-cms li,
  body#product #product-description-short p,
  body#product #product-description-short div,
  body#product .product-description p,
  body#product .product-description div,
  body#product .tabs .tab-content p,
  body#product .tabs .tab-content div,
  body#product .tabs .tab-content li,
  body#manufacturer #manufacturer-short_description p,
  body#manufacturer #manufacturer-description p,
  body#supplier #supplier-description p {
    text-align: left !important;
    text-justify: auto !important;
    word-spacing: normal !important;
    letter-spacing: normal !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }

  /* Formatting tags inside prose must remain inline. Some pasted editor
     markup carries display:block/inline-block and makes a highlighted phrase
     jump to its own line. */
  body#category #category-description :is(span, strong, b, em, i, u, small, mark),
  body#category .category-additional-description :is(span, strong, b, em, i, u, small, mark),
  body#category .category-description :is(span, strong, b, em, i, u, small, mark),
  body#cms .page-content.page-cms :is(span, strong, b, em, i, u, small, mark),
  body#product #product-description-short :is(span, strong, b, em, i, u, small, mark),
  body#product .product-description :is(span, strong, b, em, i, u, small, mark),
  body#product .tabs .tab-content :is(span, strong, b, em, i, u, small, mark),
  body#manufacturer #manufacturer-short_description :is(span, strong, b, em, i, u, small, mark),
  body#manufacturer #manufacturer-description :is(span, strong, b, em, i, u, small, mark),
  body#supplier #supplier-description :is(span, strong, b, em, i, u, small, mark) {
    display: inline !important;
    float: none !important;
    width: auto !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    word-spacing: normal !important;
    letter-spacing: normal !important;
    white-space: normal !important;
  }

  /* Keep paragraphs compact and consistent. The JS companion merges only
     obvious editor-created sentence fragments; genuine completed paragraphs
     keep their normal separation. */
  body#category #category-description p,
  body#category .category-additional-description p,
  body#category .category-description p,
  body#cms .page-content.page-cms p,
  body#product #product-description-short p,
  body#product .product-description p,
  body#product .tabs .tab-content p,
  body#manufacturer #manufacturer-short_description p,
  body#manufacturer #manufacturer-description p,
  body#supplier #supplier-description p {
    margin-top: 0 !important;
    margin-bottom: 0.9rem !important;
    line-height: 1.6 !important;
  }

  /* Remove visual space from editor-generated empty paragraphs after the JS
     marks them. */
  .vh-mobile-empty-copy {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}
