/* Reversible helper for selected archive pages with wide data tables
   (TAPS, 1945 rosters, and a few high-traffic landing pages).
   Applied by scripts/wide_tables.py via contrib_overlay.py. */
@media (max-width: 800px) {
  /* Keep the page to the phone width. The FrontPage header images and
     wide grids would otherwise stretch the whole layout past the screen. */
  html, body {
    max-width: 100%;
    overflow-x: hidden;
  }
  div[align="center"] {
    box-sizing: border-box;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* The dir=ltr shell is the FrontPage layout table (nav + content).
     Fixed layout stops a wide grid from stretching that shell, so the
     scroll wrapper inside the content cell can actually pan. */
  table[dir="ltr"][width="100%"] {
    table-layout: fixed !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  table[dir="ltr"][width="100%"] > tbody > tr > td:first-child,
  table[dir="ltr"][width="100%"] > tr > td:first-child {
    width: 148px;
    max-width: 40%;
    vertical-align: top;
  }
  table[dir="ltr"][width="100%"] > tbody > tr > td:nth-child(2),
  table[dir="ltr"][width="100%"] > tr > td:nth-child(2) {
    overflow: hidden;
  }
}
.archive-table-scroll {
  box-sizing: border-box;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 1em;
}
.archive-table-scroll > table {
  width: max-content !important;
  max-width: none !important;
  margin-left: 0;
  margin-right: 0;
}
