/**
 * Narrow-screen corrections.
 *
 * The design was drawn on a fixed 1440px canvas, so its sizes are absolute:
 * headings in the 60-80px range, tables with min-widths, images at their
 * natural size. On a phone those push the page wider than the screen and the
 * whole layout can be scrolled sideways, which makes it feel broken.
 *
 * This sheet does not redesign anything. It stops the overflow and brings the
 * largest type down to a readable size, leaving the design untouched from the
 * tablet breakpoint upward.
 */

/* Padding should never add to a declared width. The design assumes this; the
   pages never say so, which is where most of the overflow comes from. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Nothing may force the page wider than the screen. */
img,
video,
svg {
  max-width: 100%;
  height: auto;
}

/* Wide data tables need no rule here: the design already wraps each one in a
   container with overflow-x: auto, so they scroll inside their own box. */

@media (max-width: 700px) {
  /* Headline sizes are absolute in the design. Cap them by level so the
     hierarchy survives but the text fits. */
  h1 {
    font-size: clamp(32px, 9vw, 52px) !important;
    line-height: 1.1 !important;
  }
  h2 {
    font-size: clamp(24px, 6.5vw, 34px) !important;
    line-height: 1.15 !important;
  }
  h3 {
    font-size: clamp(19px, 5vw, 24px) !important;
  }

  /* The canvas used 32-80px side padding; that leaves little room at 390px. */
  [style*="padding: 72px"],
  [style*="padding: 64px"],
  [style*="padding: 56px"],
  [style*="padding: 48px"],
  [style*="padding: 40px"] {
    padding: 28px 20px !important;
  }

  /* Long technical words (Elesdopa®, postesado) should break rather than
     push the line out. */
  h1,
  h2,
  h3 {
    overflow-wrap: break-word;
  }
}
