/* Pollution city & country page polish.
   Scoped under .pollution-page so it cannot leak onto the other
   extended-indicator pages (crime, health-care) that share the same helper
   markup: table_indices, the jQuery-UI progress-bar table
   (.table_builder_with_value_explanation) and the *_standard value labels.
   Pollution has no gauge; instead the hero pairs the WHO air-quality widget
   with the Pollution Index. */

.pollution-page {
  --numbeo-blue: #1B3B6F;
  --numbeo-blue-light: #2E5090;
  --numbeo-blue-dark: #0F2444;
  --pl-text: #2a3340;
  --pl-muted: #50545e; /* #6c7689, */
  --pl-divider: #dbe3ef;
  --pl-row-hover: #f5f8fc;
  --pl-track: #eceff4;
  max-width: 720px;
  margin: 10px 0 6px;
}

/* ---------- Hero: WHO air data + Pollution Index ---------- */
.pollution-hero {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 34px;
  margin: 6px 0 2px;
  padding: 12px;
  background-color: #fbfbf8;
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
  border: 1px solid var(--pl-divider);
  border-radius: 5px;
  /*box-shadow: 0 1px 2px rgba(15, 36, 68, 0.04),
              0 14px 34px -16px rgba(15, 36, 68, 0.20); */
  overflow: hidden;
  border: 1px solid #dde3ec;
  
}

/*
.pollution-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--numbeo-blue) 0%, var(--numbeo-blue-light) 100%);
}*/

/* gauge (country page has one; city page does not) */
.pollution-hero #gauge_div {
  order: -1;
  float: none !important;
  margin: 0 !important;
  flex: none;
}

/* WHO widget (left) */
.pollution-hero .standard_margin {
  margin: 0 !important;
  padding: 0 !important;
  flex: 1 1 240px;
}

.pollution-hero .who_pollution_data_widget {
  width: 100%;
  border-collapse: collapse;
  border: 0;
  background: none;
}

.pollution-hero .who_pollution_data_widget th {
  text-align: left;
  padding: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  /*color: var(--pl-muted); */
  border: 0;
  background: none;
  line-height: 1.3;
}

.pollution-hero .who_pollution_data_widget td {
  padding: 3px 0 !important;
  border: 0 !important;
  background: none !important;
  font-size: 16px;
  color: var(--pl-muted);
}

.pollution-hero .who_pollution_data_widget td:last-child {
  text-align: right !important;
  font-weight: 700;
  color: var(--pl-text);
  font-variant-numeric: tabular-nums;
  padding-left: 16px !important;
}

/* Index stats (right) */
.pollution-hero aside {
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 1 1 200px;
}

.pollution-hero aside:not(:first-child) {
  border-left: 1px solid var(--pl-divider);
  padding-left: 30px !important;
}

.pollution-hero .table_indices {
  width: 100%;
  border-collapse: collapse;
  border: 0;
  background: none;
}

.pollution-hero .table_indices tr:first-child {
  display: none;
}

.pollution-hero .table_indices td {
  border: 0 !important;
  background: none !important;
  padding: 4px 0 !important;
  vertical-align: baseline;
}

.pollution-hero .table_indices td:first-child {
  text-align: left !important;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pl-muted);
}

.pollution-hero .table_indices td:last-child {
  text-align: right !important;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--numbeo-blue);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
  padding-left: 18px !important;
}

/* WHO pollution-level chip (keeps its inline severity background colour) */
.pollution-page .pollution_level {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  color: #2a3a1f;
}

/* ---------- Section headings ---------- */
.pollution-page h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--numbeo-blue-dark);
  letter-spacing: -0.01em;
}

.pollution-page h2::before {
  content: "";
  width: 5px;
  height: 20px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--numbeo-blue-light), var(--numbeo-blue));
}

/* ---------- Breakdown scorecard (bars) ---------- */
.pollution-page .table_builder_with_value_explanation {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0 8px;
  background: #ffffff;
  border: 1px solid var(--pl-divider);
  border-radius: 5px;
  overflow: hidden;
  /*box-shadow: 0 1px 2px rgba(15, 36, 68, 0.04),
              0 12px 30px -16px rgba(15, 36, 68, 0.18); */
}

.pollution-page .table_builder_with_value_explanation td {
  padding: 12px;
  border-bottom: 1px solid var(--pl-divider);
  vertical-align: middle;
}

.pollution-page .table_builder_with_value_explanation tr:last-child td {
  border-bottom: none;
}

.pollution-page .table_builder_with_value_explanation tr:hover td {
  background: var(--pl-row-hover);
}

.pollution-page .table_builder_with_value_explanation td.columnWithName {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--pl-text);
  line-height: 1.35;
}

.pollution-page .table_builder_with_value_explanation td:nth-child(2) {
  width: 38%;
}

.pollution-page .table_builder_with_value_explanation td.indexValueTd {
  text-align: right !important;
  width: 1%;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
  color: var(--numbeo-blue-dark);
  font-variant-numeric: tabular-nums;
}

.pollution-page .table_builder_with_value_explanation td.hidden_on_small_mobile {
  text-align: right !important;
  width: 1%;
  white-space: nowrap;
}

/* ---------- jQuery-UI progress bars ---------- */
.pollution-page .jquery_bar,
.pollution-page .jquery_bar.ui-progressbar {
  width: 100%;
  height: 9px;
  border: none;
  background: var(--pl-track);
  border-radius: 999px;
  overflow: hidden;
}

.pollution-page .jquery_bar .ui-progressbar-value {
  height: 100%;
  margin: 0;
  border: none;
  border-radius: 999px;
  background: var(--numbeo-blue);
}

/* severity-tinted bars, driven by the existing category label in the row.
   Works for both tables: pollution levels (high = bad = red) and cleanliness
   (good-to-be-high, so high = green) resolve correctly via the label class. */
.pollution-page tr:has(.green_standard) .ui-progressbar-value          { background: linear-gradient(90deg, #34b36b, #2e9e5b); }
.pollution-page tr:has(.green_light_standard) .ui-progressbar-value    { background: linear-gradient(90deg, #74c98f, #5cbf85); }
.pollution-page tr:has(.yellow_neutral_standard) .ui-progressbar-value { background: linear-gradient(90deg, #f0c64b, #e6b400); }
.pollution-page tr:has(.red_light_standard) .ui-progressbar-value      { background: linear-gradient(90deg, #ef9a55, #e8833f); }
.pollution-page tr:has(.red_standard) .ui-progressbar-value            { background: linear-gradient(90deg, #e25c54, #d6453d); }

/* ---------- Category labels rendered as pills ---------- */
.pollution-page .green_standard,
.pollution-page .green_light_standard,
.pollution-page .yellow_neutral_standard,
.pollution-page .red_light_standard,
.pollution-page .red_standard {
  display: inline-block;
  min-width: 70px;
  padding: 4px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
}

.pollution-page .green_standard        { background: #e3f6ea; color: #1c7a42; border-color: #c4e9d0; }
.pollution-page .green_light_standard  { background: #eef8f1; color: #2f8a4e; border-color: #d6ecdb; }
.pollution-page .yellow_neutral_standard { background: #fdf3da; color: #946800; border-color: #f3e2ad; }
.pollution-page .red_light_standard    { background: #fdeedd; color: #c15a25; border-color: #f6dcc2; }
.pollution-page .red_standard          { background: #fce9e7; color: #c0392b; border-color: #f5cec9; }

/* ---------- Data freshness meta ---------- */
.pollution-page > p {
  margin: 4px 0;
}

.pollution-page .reportees {
  font-size: 15px;
  color: var(--pl-muted);
}

/* ---------- Orchestrated entrance ---------- */
/*@media (prefers-reduced-motion: no-preference) {
  .pollution-hero,
  .pollution-page .table_builder_with_value_explanation {
    opacity: 0;
    transform: translateY(10px);
    animation: pollutionRise 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }
  .pollution-hero { animation-delay: 0.04s; }
  .pollution-page .table_builder_with_value_explanation { animation-delay: 0.12s; }
}

@keyframes pollutionRise {
  to { opacity: 1; transform: translateY(0); }
}*/

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .pollution-hero {
    padding: 18px 18px;
    gap: 14px 18px;
  }
  .pollution-hero aside:not(:first-child) {
    border-left: 0;
    padding-left: 0 !important;
    border-top: 1px solid var(--pl-divider);
    padding-top: 12px !important;
    flex-basis: 100%;
  }
  .pollution-page .table_builder_with_value_explanation td { padding: 10px 10px; }
  .pollution-page .table_builder_with_value_explanation td.columnWithName { font-size: 15px; }
  .pollution-page .green_standard,
  .pollution-page .green_light_standard,
  .pollution-page .yellow_neutral_standard,
  .pollution-page .red_light_standard,
  .pollution-page .red_standard {
    min-width: 0;
    padding: 3px 9px;
    font-size: 14px;
  }
}

/* ===========================================================
   Pollution comparison page (compare_cities / compare_countries)
   Scoped under .pollution-compare. Uses common.JqueryComparisonTableBuilder
   markup: <table class="visualizeComparison"> with 5 cells per row
   (name, city1 bar, city1 value, city2 bar, city2 value), jquery_bar_small
   bars and *_small labels. Desktop shows severity-coloured bars; mobile hides
   the bars and shows coloured pills in a compact 3-column layout.
   All fonts are >= 15px.
   =========================================================== */
.pollution-compare {
  --numbeo-blue: #1B3B6F;
  --numbeo-blue-light: #2E5090;
  --numbeo-blue-dark: #0F2444;
  --pl-text: #2a3340;
  --pl-muted: #50545e; /* #6c7689, */
  --pl-divider: #dbe3ef; /* #e7ecf3; */
  --pl-row-hover: #f5f8fc;
  --pl-track: #eceff4;
  max-width: 820px;
  margin: 10px 0 6px;
}

/* section heading ("Pollution ... vs ...", "Purity and Cleanliness ...") */
.pollution-compare h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--numbeo-blue-dark);
  letter-spacing: -0.01em;
}

.pollution-compare h2::before {
  content: "";
  width: 5px;
  height: 20px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--numbeo-blue-light), var(--numbeo-blue));
}

/* ---------- Headline scoreboard (index header) ---------- */
.pollution-compare .table_indices {
  width: 600px;
  max-width: 100%;
  /*border-collapse: collapse; */
  margin: 6px 0;
  background: #ffffff;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid #dde3ec;
  background-color: #fbfbf8;
}

.pollution-compare .table_indices th {
  padding: 10px 14px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--numbeo-blue-dark);
  background: var(--pl-row-hover);
  border-bottom: 1px solid var(--pl-divider);
}

.pollution-compare .table_indices th:first-child {
  text-align: left;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pl-muted);
  background: #ffffff;
}

.pollution-compare .table_indices td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--pl-divider);
}

.pollution-compare .table_indices tr:last-child td {
  border-bottom: none;
}

.pollution-compare .table_indices td:first-child {
  text-align: left !important;
  font-size: 15px;
  font-weight: 600;
  color: var(--pl-text);
}

.pollution-compare .table_indices td:nth-child(n+2) {
  text-align: center !important;
  font-size: 24px;
  font-weight: 800;
  color: var(--numbeo-blue);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.pollution-compare .table_indices th:nth-child(3),
.pollution-compare .table_indices td:nth-child(3) {
  border-left: 1px solid var(--pl-divider);
}

/* ---------- WHO air-pollution comparison widget ---------- */
.pollution-compare .standard_margin {
  margin: 6px 0 !important;
  padding: 0 !important;
}

.pollution-compare .who_pollution_data_widget {
  width: 600px;
  max-width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid var(--pl-divider);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid #dde3ec;
  background-color: #fbfbf8;
}

.pollution-compare .who_pollution_data_widget th {
  padding: 9px 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--pl-text);
  text-align: right;
  background: var(--pl-row-hover);
  border-bottom: 1px solid var(--pl-divider);
}

.pollution-compare .who_pollution_data_widget th[colspan="3"] {
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pl-muted);
}

.pollution-compare .who_pollution_data_widget td {
  padding: 8px 14px;
  font-size: 15px;
  color: var(--pl-muted);
  border-bottom: 1px solid var(--pl-divider);
}

.pollution-compare .who_pollution_data_widget tr:last-child td {
  border-bottom: none;
}

.pollution-compare .who_pollution_data_widget td:nth-child(n+2) {
  text-align: right !important;
  font-weight: 700;
  color: var(--pl-text);
  font-variant-numeric: tabular-nums;
}

.pollution-compare .who_pollution_data_widget th:nth-child(3),
.pollution-compare .who_pollution_data_widget td:nth-child(3) {
  border-left: 1px solid var(--pl-divider);
}

.pollution-compare .pollution_level {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  color: #2a3a1f;
}

/* ---------- Comparison scorecard ---------- */
.pollution-compare .visualizeComparison {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0 8px;
  background: #ffffff;
  border: 1px solid var(--pl-divider);
  border-radius: 5px;
  overflow: hidden;
}

/* city-name header row */
.pollution-compare .visualizeComparison th {
  padding: 11px 12px;
  text-align: center !important;
  font-size: 16px;
  font-weight: 700;
  color: var(--numbeo-blue-dark);
  background: var(--pl-row-hover);
  border-bottom: 1px solid var(--pl-divider);
}

.pollution-compare .visualizeComparison th:first-child {
  background: #ffffff;
}

.pollution-compare .visualizeComparison td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--pl-divider);
  vertical-align: middle;
}

.pollution-compare .visualizeComparison tr:last-child td {
  border-bottom: none;
}

.pollution-compare .visualizeComparison tr:hover td {
  background: var(--pl-row-hover);
}

/* statement / row name */
.pollution-compare .visualizeComparison td:first-child {
  text-align: left !important;
  font-size: 15px;
  font-weight: 600;
  color: var(--pl-text);
  line-height: 1.35;
}

/* bar cells (city1 = 2nd, city2 = 4th) */
.pollution-compare .visualizeComparison td:nth-child(2),
.pollution-compare .visualizeComparison td:nth-child(4) {
  width: 24%;
}

/* value cells (city1 = 3rd, city2 = 5th) */
.pollution-compare .visualizeComparison td:nth-child(3),
.pollution-compare .visualizeComparison td:nth-child(5) {
  text-align: right;
  white-space: nowrap;
  width: 1%;
  font-size: 15px;
  font-weight: 700;
  color: var(--numbeo-blue-dark);
  font-variant-numeric: tabular-nums;
}

.pollution-compare .visualizeComparison td:nth-child(3) .small_font,
.pollution-compare .visualizeComparison td:nth-child(5) .small_font {
  font-size: 15px;
}

/* desktop: hide the text label (kept in the DOM so the per-city bar
   colouring below still matches); the severity-coloured bar conveys it */
.pollution-compare .visualizeComparison td:nth-child(3) .hidden_on_small_mobile,
.pollution-compare .visualizeComparison td:nth-child(5) .hidden_on_small_mobile {
  display: none;
}

/* divider before the city2 group */
.pollution-compare .visualizeComparison th:nth-child(3),
.pollution-compare .visualizeComparison td:nth-child(4) {
  border-left: 1px solid var(--pl-divider);
}

/* "Improve Data" links + contributor / last-update meta rows — de-emphasized */
.pollution-compare .visualizeComparison tr:nth-child(2) td {
  padding-top: 6px;
  padding-bottom: 6px;
}

.pollution-compare .visualizeComparison tr:nth-child(2) .small_font a {
  font-size: 15px;
  font-weight: 500;
}

.pollution-compare .visualizeComparison tr:has(i) td {
  border-bottom: none;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 15px;
  color: var(--pl-muted);
  text-align: center !important;
}

.pollution-compare .visualizeComparison tr:has(i) td:first-child {
  text-align: left !important;
}

.pollution-compare .visualizeComparison tr:has(i) .small_font {
  font-size: 15px !important;
  font-weight: 400 !important;
  color: var(--pl-muted) !important;
}

.pollution-compare .visualizeComparison tr:has(i) i {
  font-style: normal;
}

/* ---------- jQuery-UI progress bars ---------- */
.pollution-compare .jquery_bar_small,
.pollution-compare .jquery_bar_small.ui-progressbar {
  width: 100%;
  height: 8px;
  border: none;
  background: var(--pl-track);
  border-radius: 999px;
  overflow: hidden;
}

.pollution-compare .jquery_bar_small .ui-progressbar-value {
  height: 100%;
  margin: 0;
  border: none;
  border-radius: 999px;
  background: var(--numbeo-blue);
}

/* severity-tinted bars, coloured per city from that city's own label
   (city1 bar = col2 keyed off col3's label; city2 bar = col4 keyed off col5) */
.pollution-compare tr:has(td:nth-child(3) .green_small) td:nth-child(2) .ui-progressbar-value,
.pollution-compare tr:has(td:nth-child(5) .green_small) td:nth-child(4) .ui-progressbar-value          { background: linear-gradient(90deg, #34b36b, #2e9e5b); }
.pollution-compare tr:has(td:nth-child(3) .green_light_small) td:nth-child(2) .ui-progressbar-value,
.pollution-compare tr:has(td:nth-child(5) .green_light_small) td:nth-child(4) .ui-progressbar-value    { background: linear-gradient(90deg, #74c98f, #5cbf85); }
.pollution-compare tr:has(td:nth-child(3) .yellow_neutral_small) td:nth-child(2) .ui-progressbar-value,
.pollution-compare tr:has(td:nth-child(5) .yellow_neutral_small) td:nth-child(4) .ui-progressbar-value { background: linear-gradient(90deg, #f0c64b, #e6b400); }
.pollution-compare tr:has(td:nth-child(3) .red_light_small) td:nth-child(2) .ui-progressbar-value,
.pollution-compare tr:has(td:nth-child(5) .red_light_small) td:nth-child(4) .ui-progressbar-value      { background: linear-gradient(90deg, #ef9a55, #e8833f); }
.pollution-compare tr:has(td:nth-child(3) .red_small) td:nth-child(2) .ui-progressbar-value,
.pollution-compare tr:has(td:nth-child(5) .red_small) td:nth-child(4) .ui-progressbar-value            { background: linear-gradient(90deg, #e25c54, #d6453d); }

/* category pills (shown on mobile when the bars are hidden) */
.pollution-compare .green_small,
.pollution-compare .green_light_small,
.pollution-compare .yellow_neutral_small,
.pollution-compare .red_light_small,
.pollution-compare .red_small {
  display: inline-block;
  padding: 3px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
}

.pollution-compare .green_small        { background: #e3f6ea; color: #1c7a42; border-color: #c4e9d0; }
.pollution-compare .green_light_small  { background: #eef8f1; color: #2f8a4e; border-color: #d6ecdb; }
.pollution-compare .yellow_neutral_small { background: #fdf3da; color: #946800; border-color: #f3e2ad; }
.pollution-compare .red_light_small    { background: #fdeedd; color: #c15a25; border-color: #f6dcc2; }
.pollution-compare .red_small          { background: #fce9e7; color: #c0392b; border-color: #f5cec9; }

/* ---------- Mobile: keep the small severity bars (like the crime comparison),
   just tighten spacing. The 5-column model is preserved so the colspan-2
   header / Improve / Contributors / Last-Update rows stay aligned. ---------- */
@media (max-width: 768px) {
  .pollution-compare { max-width: 100%; }

  .pollution-compare .visualizeComparison td,
  .pollution-compare .visualizeComparison th { padding: 9px 6px; }
  .pollution-compare .visualizeComparison td:first-child { font-size: 15px; }

  /* trim the bar columns a little to leave room for the (>=15px) name */
  .pollution-compare .visualizeComparison td:nth-child(2),
  .pollution-compare .visualizeComparison td:nth-child(4) { width: 20%; }

  /* tighten the index + WHO tables */
  .pollution-compare .table_indices th,
  .pollution-compare .table_indices td,
  .pollution-compare .who_pollution_data_widget th,
  .pollution-compare .who_pollution_data_widget td { padding: 8px 8px; }

  .pollution-compare .table_indices td:nth-child(n+2) { font-size: 20px; }
}
