/* MeteoAtlas v15.22 — safe wrapping for data-rich, responsive cards.
   Loaded after existing styles. No climate computations are changed. */

/* Grid and flex items must be allowed to shrink instead of forcing overflow. */
.site-main, .site-main > *,
.panel, .panel-heading, .panel-heading > *,
.grid-2 > *, .article-grid > *, .compare-grid > *,
.stats > *, .forecast-grid > *,
.map-v13-panel, .map-v13-stats > *,
.map-v13-toolbar > *, .map-exports,
.map-selected-row > *, .map-v13-search > *,
.forecast-details-grid > *, .forecast-day-facts > *,
.forecast-detail-metrics > *,
.forecast-hours-grid > *, .forecast-hour-button,
.trends-stat .trend-cell,
.map-city-badge, .map-city-climate,
.map-city-climate > * {min-width:0;}

/* These are textual data, not single-line controls. Do not truncate values. */
.map-mini-card > span,
.map-mini-card > strong,
.map-mini-card > small,
.stat .meta, .stat .value, .stat .detail,
.trends-stat .trend-value, .trends-stat .trend-label,
.forecast-hour-button b, .forecast-hour-button small,
.forecast-detail-metrics strong, .forecast-day-facts strong,
.forecast-hour-detail-heading strong,
.forecast-history-temperature, .forecast-history-date,
.map-selected-row .map-temperature,
.map-city-badge-title, .map-city-badge-sub,
.map-city-climate-label, .map-city-climate-value, .map-city-climate-source,
.panel-heading h2, .panel-heading p,
.article h3, .article p, .map-v13-status, .map-v13-note,
.map-period-info {max-width:100%;overflow-wrap:anywhere;word-break:normal;}

/* Compact two-sided ranges: units occur once on the following caption line. */
.map-v13-stats{grid-template-columns:repeat(4,minmax(0,1fr))}
.map-mini-card{min-width:0;max-width:100%}
.map-mini-card > strong.map-range{
  display:block;
  min-width:0;
  max-width:100%;
  font-size:clamp(13px,1.16vw,17px);
  line-height:1.28;
  letter-spacing:-.35px;
  font-variant-numeric:tabular-nums;
  white-space:normal;
  overflow-wrap:anywhere;
}
.map-mini-card > strong.map-period-value{display:block;white-space:normal;line-height:1.3}
.map-mini-card > small{line-height:1.45}

/* Other high-risk single-line figures on the site. */
.trends-stat .trend-value,
.trends-stat .trend-label,
.forecast-hour-button b,
.map-selected-row .map-temperature {white-space:normal;}
.trends-stat .trend-values{min-width:0;grid-template-columns:repeat(3,minmax(0,1fr))}
.trends-stat .trend-cell{min-width:0}

/* Ensure legends stay in the map panel at tablet/mobile widths. */
.map-v13-colorbar > span{
  min-width:0;
  flex:0 1 90px;
  max-width:26%;
  white-space:normal;
  overflow-wrap:anywhere;
  line-height:1.3;
}
.map-v13-colorbar > .map-v13-gradient{flex:1 1 50px;min-width:32px}
.map-v14-ticks{min-width:0}
.map-city-badge{box-sizing:border-box;max-width:min(280px,calc(100% - 20px))}
.map-city-climate-value{white-space:normal;line-height:1.23;font-variant-numeric:tabular-nums}
.map-v13-toolbar{min-width:0}
.map-exports{min-width:0;max-width:100%;flex-wrap:wrap}
.map-v13-search .select{max-width:100%}

/* Long names, temperatures and IDs are allowed to scroll in tables, not stretch the page. */
.table-wrap,.map-v13-table{max-width:100%;overflow-x:auto}
.data-table td{max-width:45vw}
.data-table td:not(.map-table-value){white-space:normal;overflow-wrap:anywhere}
.data-table td.map-table-value{white-space:normal;overflow-wrap:anywhere}
#catalog-rows .pill{max-width:100%;white-space:normal;overflow-wrap:anywhere}

@media(max-width:1100px){
  .map-v13-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:780px){
  .map-mini-card > strong.map-range{font-size:clamp(12px,3.2vw,16px)}
  .map-v13-colorbar > span{font-size:10px;flex-basis:70px}
  .map-city-badge{max-width:none}
  .forecast-hour-button b{font-size:clamp(10px,2.8vw,13px)}
}
@media(max-width:400px){
  .map-v13-stats{gap:8px}
  .map-mini-card{padding:10px}
  .map-mini-card > strong.map-range{font-size:12px;letter-spacing:-.4px}
  .map-v13-colorbar{gap:5px}
  .map-v13-colorbar > span{font-size:9px;flex-basis:62px}
  .trends-stat .trend-value{font-size:10px;letter-spacing:-.25px}
  .forecast-hours-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
