/* Mobile-first layer for pages converted from the old ASP.NET site.
   Scoped to .legacy-page so the site header and footer are not affected.
   Base rules are for phones; wider screens only relax them. */

/* old pages set their own body width and margins; undo that */
body { max-width: none !important; margin: 0 !important; }

.legacy-page {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 0 12px 24px;
  overflow-x: hidden;
  overflow-wrap: break-word;
  word-wrap: break-word;
  font-size: 1rem;
  line-height: 1.55;
}
.legacy-page *, .legacy-page *::before, .legacy-page *::after { box-sizing: border-box; }

/* nothing may be wider than the screen */
.legacy-page div, .legacy-page section, .legacy-page article, .legacy-page header,
.legacy-page footer, .legacy-page nav, .legacy-page main, .legacy-page aside,
.legacy-page p, .legacy-page ul, .legacy-page ol, .legacy-page form,
.legacy-page [style*="width"] { max-width: 100% !important; }

/* pictures and video shrink to fit */
.legacy-page img, .legacy-page video, .legacy-page iframe, .legacy-page svg, .legacy-page embed, .legacy-page object {
  max-width: 100% !important;
  height: auto !important;
}

/* wide tables scroll sideways inside the page */
.legacy-page table {
  display: block;
  width: 100% !important;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
}
.legacy-page th, .legacy-page td { padding: 8px 10px; vertical-align: top; }

/* code and long words wrap */
.legacy-page pre { white-space: pre-wrap; word-break: break-word; overflow-x: auto; }
.legacy-page a { word-break: break-word; }

/* headings sized for phones */
.legacy-page h1 { font-size: 1.6em; line-height: 1.25; margin: 16px 0 12px; }
.legacy-page h2 { font-size: 1.35em; line-height: 1.3; }
.legacy-page h3 { font-size: 1.15em; line-height: 1.3; }

/* finger-sized tap targets for list and table links */
.legacy-page li > a, .legacy-page td > a, .legacy-page nav a {
  display: inline-block;
  min-height: 44px;
  padding: 10px 0;
}
.legacy-page button, .legacy-page input[type="submit"], .legacy-page .btn {
  min-height: 48px;
}

/* phones: stack columns, drop floats, single column text */
@media (max-width: 767px) {
  .legacy-page [style*="display:flex"], .legacy-page [style*="display: flex"],
  .legacy-page .row, .legacy-page .content-wrapper { flex-wrap: wrap !important; flex-direction: column !important; }
  .legacy-page [style*="float"], .legacy-page .float-left, .legacy-page .float-right,
  .legacy-page img[align] { float: none !important; margin-left: auto; margin-right: auto; display: block; }
  .legacy-page [style*="column-count"], .legacy-page [style*="columns"] { column-count: 1 !important; columns: auto !important; }
  .legacy-page [class*="col-"] { width: 100% !important; flex: 0 0 100% !important; max-width: 100% !important; }
  .legacy-page [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

/* tablets and up: a little more room */
@media (min-width: 768px) {
  .legacy-page { padding: 0 20px 32px; }
  .legacy-page h1 { font-size: 2em; }
}

/* desktop: centered reading width, tables back to normal */
@media (min-width: 1024px) {
  .legacy-page { max-width: 1200px; margin: 0 auto; }
  .legacy-page table { display: table; }
  .legacy-page h1 { font-size: 2.3em; }
}
