/* Mobile reading contract · 2026-10-08
   Unified gutters and collision-free controls on all public pages.
   The desktop scrollytelling/reading progress indicators are intentionally
   disabled on touch-size viewports: they formerly painted across article cards. */
@media (max-width:760px) {
  :root { --mobile-reading-gutter:clamp(16px,4.5vw,24px); }
  html { scroll-padding-top:16px; }
  main, main > section, main article { min-width:0; }
  .site-reading-progress,
  .chapter-progress,
  .section-wipe,
  .timeline-v4-stage::before { display:none!important; }
  .timeline-v4-stage::before { content:none!important; }
  .section-pad,
  .topic-timeline-section,
  .factcheck-section {
    padding-left:var(--mobile-reading-gutter)!important;
    padding-right:var(--mobile-reading-gutter)!important;
  }
  .topic-timeline-shell,
  .topic-detail,
  .topic-detail-head,
  .topic-rail,
  .topic-point,
  .factcheck-grid,
  .fact-card { box-sizing:border-box; min-width:0; max-width:100%; }
  .topic-detail-head h3,
  .topic-point h4,
  .topic-point p,
  .fact-card h3 { overflow-wrap:anywhere; }
  .topic-tabs { max-width:100%; scroll-padding-inline:3px; }
  .topic-tab { max-width:calc(100vw - var(--mobile-reading-gutter) - var(--mobile-reading-gutter)); }
  .topic-timeline-section .section-heading { max-width:100%; }

  /* Dynamic case-map cards used on the Flávio/Lula topic panels.
     Their two-column status field squeezed long judicial/procedural labels
     into the right edge on narrow phones. */
  .ia-case-map,
  .ia-timeline-matrix {
    width:100%!important;
    max-width:100%!important;
    margin-inline:auto!important;
    box-sizing:border-box;
    padding:clamp(12px,3vw,18px)!important;
  }
  .ia-case-grid { min-width:0; grid-template-columns:minmax(0,1fr)!important; gap:12px; }
  .ia-case-card {
    display:grid;
    min-width:0!important;
    width:100%;
    max-width:100%;
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:auto auto 24px auto;
    gap:12px;
    min-height:0;
    padding:clamp(15px,4vw,20px)!important;
    overflow:hidden;
    box-sizing:border-box;
  }
  .ia-case-card > b { max-width:100%; overflow-wrap:anywhere; }
  .ia-case-top { flex-wrap:wrap; min-width:0; gap:8px 14px; }
  .ia-case-top > * { min-width:0; }
  .ia-case-status {
    grid-template-columns:minmax(0,1fr)!important;
    gap:6px!important;
    align-items:start!important;
    min-width:0;
    padding-top:12px!important;
  }
  .ia-case-status small { font-size:.64rem!important; line-height:1.4; }
  .ia-case-status strong {
    justify-self:start!important;
    max-width:100%!important;
    text-align:left!important;
    overflow-wrap:anywhere;
    font-size:clamp(.78rem,2.6vw,.92rem)!important;
    line-height:1.4!important;
  }
  .ia-case-track { min-width:0; max-width:100%; }

  /* Floating share/source buttons used to hide the final paragraphs and cards. */
  .public-tools {
    position:relative!important;
    inset:auto!important;
    z-index:1!important;
    box-sizing:border-box;
    width:calc(100% - var(--mobile-reading-gutter) - var(--mobile-reading-gutter))!important;
    max-width:560px;
    margin:0 var(--mobile-reading-gutter) calc(18px + env(safe-area-inset-bottom,0px))!important;
    padding:12px 0 0;
    display:flex;
    flex-wrap:wrap;
    align-items:stretch;
    gap:8px;
  }
  .public-tools button {
    flex:1 1 120px;
    min-height:44px;
    padding:12px 14px!important;
    font-size:10px!important;
    line-height:1.2!important;
  }
  .source-drawer { width:100vw!important; max-width:100vw!important; height:100dvh!important; }
  .source-drawer-head h2 { font-size:clamp(1.8rem,9vw,2.8rem); overflow-wrap:anywhere; }
  .source-list-all { padding-bottom:calc(24px + env(safe-area-inset-bottom,0px)); }
  .source-row-all { min-width:0; }
  .source-row-all a { overflow-wrap:anywhere; }

  /* Uniform content gutters: hero edges and responsive comparison sections. */
  .gov-hero,
  .gov-section,
  .cg-hero,
  .pg-hero { padding-left:var(--mobile-reading-gutter)!important; padding-right:var(--mobile-reading-gutter)!important; }
  .gov-hero > *,
  .gov-section > *,
  .cg-hero > *,
  .pg-hero > *,
  .cg-river-section > *,
  .cg-how > *,
  .cg-method > * { min-width:0; max-width:100%; }
  .pg-method,
  .pg-controls,
  .pg-graph-section,
  .pg-notes,
  .pg-sources-section,
  .pg-reference-section,
  .cv-section,
  .cc-section {
    width:calc(100% - var(--mobile-reading-gutter) - var(--mobile-reading-gutter))!important;
    max-width:100%;
    box-sizing:border-box;
  }
  .gov-series-grid,
  .gov-series-card,
  .gov-chart-shell,
  .gov-method,
  .cg-river-section,
  .cg-how,
  .cg-method,
  .cv-section,
  .cc-section,
  .pg-graph-section { min-width:0; }
  .gov-series-head,
  .pg-section-head,
  .cc-section-head,
  .cv-head { min-width:0; }
  .gov-series-head h3,
  .pg-section-head h2,
  .cc-section-head h3,
  .cv-head h2 { overflow-wrap:anywhere; }
  .site-header.global-header.pg-global-header > .subject-switch a {
    font-size:.5rem!important;
    line-height:1.12!important;
  }
}
@media (max-width:360px) {
  .site-header.global-header.pg-global-header > .subject-switch a {
    font-size:.46rem!important;
  }
}
@media (prefers-reduced-motion:reduce) {
  .site-reading-progress,.chapter-progress,.section-wipe { display:none!important; }
}
