/* Reading utilities that inherit the existing Quarto theme. */
main.content p,
main.content .references {
  overflow-wrap: break-word;
}

main.content img {
  max-width: 100%;
  height: auto;
}

main mjx-container[display="true"],
main .katex-display {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.post-code-controls {
  max-width: 100%;
}

.post-code-controls .dropdown-menu {
  max-width: calc(100vw - 2rem);
}

.mobile-contents {
  display: none;
}

/* Stack recent posts within the Jolla homepage's narrow content column. */
#listing-recent-notes .recent-writing-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

#listing-recent-notes .recent-writing-list a {
  display: block;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

#listing-recent-notes .recent-writing-date {
  display: block;
  margin-top: .25rem;
  font-size: .85em;
  color: var(--bs-secondary-color, currentColor);
}

/* Quarto hides its right margin TOC below the native md breakpoint. */
@media (max-width: 767.98px) {
  .mobile-contents {
    display: block;
    position: relative;
    z-index: 1;
    border: 1px solid var(--bs-border-color);
    margin-block: 0 1.5rem;
    padding: .75rem 1rem;
  }

  .mobile-contents summary {
    cursor: pointer;
    font-weight: 600;
  }

  .mobile-contents nav {
    max-height: 55vh;
    overflow: auto;
    padding-top: .75rem;
  }

  .mobile-contents ul {
    list-style: none;
    padding-left: 1rem;
  }

  .mobile-contents nav > ul {
    padding-left: 0;
  }

  .mobile-contents li {
    margin-block: .5rem;
  }

  .mobile-contents .collapse:not(.show) {
    display: block;
  }
}
