/*
 * Narrow-screen content containment.
 *
 * Paired with responsive-tables-v1.js. The script adds scroll containers to
 * content tables and exposes accessibility metadata only when a table is wider
 * than its container.
 */

.handbook-table-scroll {
  max-width: 100%;
}

.handbook-table-scroll[data-overflowing="true"] {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.handbook-table-scroll:focus-visible {
  outline: 2px solid #0f7c82;
  outline-offset: 2px;
}

.handbook-table-scroll-hint {
  display: none;
  margin: 0.5rem 0;
  color: #52606d;
  font-size: 0.8125rem;
}

.handbook-table-scroll-hint[data-overflowing="true"] {
  display: block;
}

[data-bs-theme="dark"] .handbook-table-scroll-hint,
.quarto-dark .handbook-table-scroll-hint {
  color: #c5ced8;
}

@media (max-width: 768px) {
  #companion-handbooks > div {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .handbook-table-scroll > table {
    width: 100%;
  }

  .handbook-table-scroll > table th,
  .handbook-table-scroll > table td {
    min-width: 8rem;
  }

  main pre {
    max-width: 100%;
    overflow-x: auto;
  }

  main p,
  main li,
  main dd,
  main td,
  main th,
  main figcaption,
  main blockquote {
    overflow-wrap: anywhere;
  }
}
