/* ------------------------------------------------------------------
   Mobile / tablet overrides for the legacy fixed-width (950px) layout.
   Loaded last by header.asp, mmheader.asp and header1.asp together with
   <meta name="viewport" content="width=device-width, initial-scale=1">.
   Screens wider than 1000px are not affected at all.
   ------------------------------------------------------------------ */

@media (max-width: 1000px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { margin: 0; }

  /* Fixed-width page containers become fluid */
  #main, header, #top_container, #site_content, .slideshow, ul.slideshow,
  #menubar, #menuBar, #mainmenubar, #menuBar02, #header_div,
  #content, #sidebar_container, .sidebar, #memberNewBox {
    width: auto !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  ul.slideshow { height: auto !important; }

  /* Inline fixed pixel widths (e.g. footer.asp's 964px bar) */
  [style*="width:600px"], [style*="width: 600px"],
  [style*="width:700px"], [style*="width: 700px"],
  [style*="width:750px"], [style*="width: 750px"],
  [style*="width:780px"], [style*="width: 780px"],
  [style*="width:788px"], [style*="width: 788px"],
  [style*="width:920px"], [style*="width: 920px"],
  [style*="width:940px"], [style*="width: 940px"],
  [style*="width:942px"], [style*="width: 942px"],
  [style*="width:950px"], [style*="width: 950px"],
  [style*="width:960px"], [style*="width: 960px"],
  [style*="width:962px"], [style*="width: 962px"],
  [style*="width:964px"], [style*="width: 964px"],
  [style*="width:985px"], [style*="width: 985px"] {
    width: auto !important;
    max-width: 100% !important;
  }

  /* Banner and all other images scale down instead of overflowing */
  img { max-width: 100%; height: auto; }
  iframe, video, embed, object { max-width: 100%; }

  /* Tables / cells with hard pixel widths may shrink */
  table { max-width: 100% !important; }
  table[width]:not([width="100%"]), td[width], th[width] { width: auto !important; }

  /* Form controls never wider than the screen; 16px stops iOS zooming on focus */
  input:not([type="checkbox"]):not([type="radio"]):not([type="image"]),
  select, textarea {
    max-width: 100%;
    box-sizing: border-box;
    font-size: 16px;
  }

  /* Main menu wraps instead of running off-screen, with finger-sized links */
  #menubar { padding: 6px 8px !important; line-height: 2; text-align: center !important; }
  #menubar a.menuBar, #menubar a { display: inline-block; padding: 2px 2px; }

  /* Login / signup popups fit the screen */
  .popupContainer {
    left: 50% !important;
    transform: translateX(-50%);
    width: 92vw !important;
    max-width: 380px;
    box-sizing: border-box;
  }

  /* Long words / e-mail addresses wrap instead of widening the page */
  td, p, li { overflow-wrap: break-word; }

  /* home page "New Feature" bubble: keep the word whole */
  .newfeature { width: auto !important; display: inline-block; overflow-wrap: normal; }
}

/* Phones: stack the table-based columns vertically */
@media (max-width: 700px) {
  table { width: 100% !important; }
  table, tbody, tr, td, th { display: block; box-sizing: border-box; }
  td, th { width: auto !important; }
  tr, td, th { height: auto !important; }  /* rows used fixed heights (style="height:27px") and overlapped once stacked */

  /* the side boxes (Member Login, Matchmaker Login, ...) become full-width cards */
  #memberNewBox { background-size: 100% 100%; margin: 0 auto 8px auto; }

  #site_content { padding: 0 10px !important; }
  #content { float: none !important; padding: 12px 0 !important; }
  #sidebar_container, .sidebar { float: none !important; }

  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  h3 { font-size: 18px; }
}
