/* Horizontal scroll for wide example/code output */
div.sourceCode pre,
pre.sourceCode {
  overflow-x: auto;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
}

div.sourceCode pre code,
pre.sourceCode code {
  word-wrap: normal;
  overflow-wrap: normal;
  white-space: inherit;
}

/* Footer like https://sedzinfo.github.io/: one centred line of small grey text under a full-width rule,
   with a link back to the home page at the right */
footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 1rem;
  margin-top: 3rem;
  padding: 1rem 0;
  font-size: .875em;
  color: var(--bs-secondary-color);
  border-top: 1px solid var(--bs-border-color);
  border-image: linear-gradient(var(--bs-border-color), var(--bs-border-color)) 1 / 1px 0 0 / 0 100vmax;
}

footer .pkgdown-footer-left {
  grid-column: 2;
  text-align: center;
}

footer .pkgdown-footer-right {
  grid-column: 3;
  justify-self: end;
}

footer a {
  color: inherit;
}

/* on phones the two parts stack, centred */
@media (max-width: 575.98px) {
  footer {
    grid-template-columns: 1fr;
    row-gap: .5rem;
  }
  footer .pkgdown-footer-left,
  footer .pkgdown-footer-right {
    grid-column: 1;
    justify-self: center;
  }
}

/* phones and small tablets (below Bootstrap's lg breakpoint, where the navbar collapses) */
@media (max-width: 991.98px) {
  /* wide display maths scrolls sideways in its own box instead of widening the page
     (the 1px padding keeps the anti-aliased edges of tall symbols from being clipped) */
  .katex-display {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1px 0;
  }
  /* inline svgs without a viewBox cannot shrink: their section scrolls sideways instead */
  .section:has(> svg) {
    overflow-x: auto;
  }
  /* bigger tap targets: ~43px menu items; the footer links get vertical padding,
     which on inline links enlarges the tap area without moving the text */
  .navbar-collapse .nav-link {
    padding-top: .75rem;
    padding-bottom: .75rem;
  }
  footer a {
    padding: .5rem 0;
  }
}
