/* Mobile chapter chrome (all four handbooks).
 *
 * Below the sidebar breakpoint the page breadcrumb sits in the sticky header.
 * A long part and chapter title wrapped to two or three lines and held about
 * a fifth of a phone screen while reading. Show the chapter title alone, on
 * one line, cut with an ellipsis. The full trail stays in the sidebar, and
 * the desktop breadcrumb above the title is unchanged.
 */
@media (max-width: 991.98px) {
  .quarto-secondary-nav .quarto-page-breadcrumbs {
    min-width: 0;
    flex: 0 1 auto;
    overflow: hidden;
  }

  .quarto-secondary-nav .quarto-page-breadcrumbs .breadcrumb {
    flex-wrap: nowrap;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    margin-bottom: 0;
  }

  .quarto-secondary-nav .quarto-page-breadcrumbs .breadcrumb-item:not(:last-child) {
    display: none;
  }

  .quarto-secondary-nav .quarto-page-breadcrumbs .breadcrumb-item:last-child {
    flex: 0 1 auto;
    min-width: 0;
    padding-left: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .quarto-secondary-nav .quarto-page-breadcrumbs .breadcrumb-item:last-child::before {
    display: none;
  }
}

/* Life Sciences hides the breadcrumb trail on small screens
 * (styles/reader-experience.css), which left the Welcome page with an empty
 * header bar under the navbar. Hide that bar on the Welcome page only; the
 * navbar menu, search and Start Here remain the way into the book there.
 */
@media (max-width: 768px) {
  /* The site script rewrites the link to "/", keeping the source path in
   * data-original-href, so match both forms of the Welcome page link. */
  .quarto-secondary-nav:has(.breadcrumb-item:only-child > a[href="./index.html"]),
  .quarto-secondary-nav:has(.breadcrumb-item:only-child > a[data-original-href="https://lifesciencesaihandbook.com/index.html"]) {
    display: none !important;
  }
}
