/* responsive.css — layout fixes for phones, tablets and browser zoom (loaded after site.css). Owner request 28 Nov 2026.
   Layout/responsiveness only: no colour, font-family or content-order changes.
   Zoom note: browser zoom changes the CSS viewport width (200% at 1440px ≈ 720px wide, 50% ≈ 2880px),
   so the width ranges below cover zoom as well as device size.
   Card alignment to the results column is done live by site.js (alignTrailing) with inline margins — not touched here. */

/* ---------- All sizes: safety nets against sideways page scroll ---------- */
img,video{max-width:100%}
.panel,.card,.tool-results,.understanding,.page-references{min-width:0}
/* Long words/URLs and big numbers wrap inside their card instead of pushing it wider */
.panel p,.panel li,.page-references li,.understanding-point p,.data td,.data th{overflow-wrap:break-word}

/* ---------- Wide screens: keep reading lines comfortable ----------
   Results cards are ~1050px wide at 1440px+ (main is capped at 1440px), giving ~130-character lines.
   Prose inside the text cards stops at a readable measure; the cards themselves keep their full width. */
.panel.results-summary p,.panel.research-note>p,.panel.takeaways>p,.understanding-point p,.policy .panel p,.article-body .panel>p{max-width:95ch}

/* ---------- Charts: readable labels at every width ----------
   Plots are SVGs with fixed viewBoxes (~520-540 units wide) scaled to their box, so on-screen label size
   = CSS font-size × (box width ÷ viewBox width). These rules keep that at roughly 10-19px. */

/* Very wide screens: a single chart spanning the whole row was height-limited at 280px, which blew labels
   up to ~22-25px. A slightly lower cap keeps them in proportion with the page text. */
.plot-grid>:only-child .plot,.plot-grid>:last-child:nth-child(odd) .plot,.article-body>.panel>.plot{max-height:240px}

/* Small laptops / tablet landscape / 125-150% zoom (901-1199px): two charts side by side were only ~280-340px
   wide, shrinking labels to ~7-8px. Stack them one per row until there is room for two. */
@media(min-width:901px) and (max-width:1199px){
 .plot-grid,.plot-focus{grid-template-columns:minmax(0,1fr)}
}
/* The salary page gives its inputs a wider (34%) column, so its two lead charts need more room before pairing */
@media(min-width:901px) and (max-width:1359px){
 .salary-grid .plot-focus,.salary-grid .plot-grid{grid-template-columns:minmax(0,1fr)}
}

/* Phones (≤620px): charts are ~310-370px wide, so 15px labels showed at ~8.7px (now ~9.6-11px). Slightly larger labels, and the chart
   box follows the drawing's own shape (height:auto) instead of leaving a tall empty band above and below it. */
@media(max-width:620px){
 .plot,.research-main .plot,.plot-focus .plot,.plot-focus .lead-plot .plot,.calc-grid .plot,.article .plot,.article-body .lead-plot .plot{height:auto}
 /* 16px is the largest size at which dense year labels (e.g. 1983–84 … 2025–26) still keep a gap between them */
 .plot text{font-size:16px}
}

/* ---------- Home page ---------- */
/* Popular Calculators: four cards in a row are ~160px wide between 621 and 1000px (tablet portrait, 150-200% zoom),
   squeezing descriptions to one or two words per line. Use two columns there. */
@media(min-width:621px) and (max-width:1000px){
 .grid.four{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* ---------- Touch sizes: comfortable tap targets (~44px) ---------- */
@media(max-width:900px),(pointer:coarse){
 input:not([type=checkbox]):not([type=radio]):not([type=range]),select,button,.button{min-height:44px}
 /* "On this page" chips */
 .research-navigation .research-jump{min-height:40px;display:inline-flex;align-items:center}
 /* Disclosure rows (Data Table, References) */
 details>summary{padding-block:.6rem}
 /* Header and footer links get a bigger hit area without changing how they look */
 .bar nav a{display:inline-block;padding-block:.55rem}
 footer nav{row-gap:0}
 footer nav a{display:inline-block;padding-block:.4rem}
}

/* ---------- Phones: header nav wraps into tidy rows ---------- */
@media(max-width:620px){
 .bar nav{gap:0 .6rem}
 .bar{padding-bottom:.2rem}
}
