/* ============================================
    annoying mobile fixes for the methodology page
   ============================================ */

@media (max-width: 768px) {
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;      /* stop rightward scroll inside iframe */
    -webkit-text-size-adjust: 100%;
  }

  /* Bring titles back to normal flow (Word exported negative text-indent) */
  h1, h2, h3 {
    margin-left: 0 !important;
    text-indent: 0 !important;
    padding-left: 0 !important;
  }

  /* Word list paragraphs: reduce the extreme left margins/indents */
  p.MsoListParagraph,
  p.MsoListParagraphCxSpFirst,
  p.MsoListParagraphCxSpMiddle,
  p.MsoListParagraphCxSpLast,
  li.MsoListParagraph,
  li.MsoListParagraphCxSpFirst,
  li.MsoListParagraphCxSpMiddle,
  li.MsoListParagraphCxSpLast {
    margin-left: 18px !important;
    text-indent: 0 !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
  }

  /* Tighter base typography for the Word body */
  p.MsoNormal, li.MsoNormal, div.MsoNormal {
    font-size: 13px !important;
    line-height: 1.35 !important;
  }

  /* Shrink footnote superscripts */
  sup { font-size: 0.75em !important; }

  /* --- TABLE FIXES --- */

  /* Make all Word-exported tables responsive and prevent horizontal overflow */
  table, .MsoTableGrid {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;      /* allow columns to shrink */
    border-collapse: collapse !important;
    display: table !important;
  }

  /* Remove hardcoded column widths from inline styles and width attrs */
  table td[style*="width"],
  table th[style*="width"],
  table td[width],
  table th[width] {
    width: auto !important;
    max-width: 100% !important;
  }

  /* Tighter, smaller cell content + strong wrapping */
  table.MsoTableGrid td,
  table.MsoTableGrid th,
  table td,
  table th {
    padding: 6px 6px !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    vertical-align: top !important;

    /* wrap aggressively to avoid overflow */
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    hyphens: auto !important;

    /* allow columns to shrink (works with table-layout: fixed) */
    max-width: 0 !important;
  }

  /* Reduce default border thickness so grids don’t look cramped on mobile */
  table,
  table td,
  table th {
    border-width: 1px !important;
  }

  /* Prevent any rogue wide elements from forcing horizontal scroll */
  img, svg {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Keep the inner page padding sensible on mobile */
  .WordSection1 {
    padding: 12px !important;
  }

  /* === TABLE 2: Word-specific column widths === */
  table.MsoTableGrid td[width="170"] {
    width: 33% !important;
    max-width: 33% !important;
  }

  table.MsoTableGrid td[width="431"] {
    width: 67% !important;
    max-width: 67% !important;
  }

  /* === TABLES 3 & 4 FIX — guarantee right border === */
  table.MsoTableGrid td[width="590"],
  table.MsoTableGrid td[width="286"] {
    max-width: none !important;
    width: 100% !important;
    padding: 12px !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
  }

  table.MsoTableGrid {
    border-right: 1px solid #000 !important;
  }

  /* Remove left margins Word sometimes bakes into inline styles */
  table.MsoTableGrid[style*="margin-left:18.0pt"] {
    margin-left: 0 !important;
    width: 100% !important;
  }

  table.MsoTableGrid[style*="margin-left:18.0pt"] td {
    padding-left: 6px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
}