/* H2Prism design round 3, 2026-12-01.
   Loaded after design-r2.css on every page. No HTML changes; no font sizes at or
   under 18px go down; no target goes under 44px. The home is not touched. */

/* ===== A. Tables ===== */

/* A1 + A2. Reading pages: the caption stays on the text column's left line; only
   the scrolling table box breaks out of the 720px column, centred on it, up to
   1040px or the viewport less 24px a side (15px+ a side with a desktop scrollbar).
   Round 2 widened the whole block, so the caption followed the table out. */
@media (min-width: 600px) {
  html body.r2.r2-reading:is(*, #r2) main article .guide-table-block {
    position: static;
    left: auto;
    transform: none;
    width: auto;
    min-width: 0;
    max-width: none;
  }
  html body.r2.r2-reading:is(*, #r2) main article .guide-table-block > .guide-table {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    min-width: 100%;
    max-width: min(1040px, calc(100vw - 48px));
  }
}

/* A3. Reading tables: the bridge gave every cell a 120px floor (first cell 140px),
   so a 7-column table could not go under 860px however short its words. Under
   1100px the words set the column widths; the type stays 13px. */
@media (max-width: 1099px) {
  html body.r2.r2-reading:is(*, #r2) main .guide-table :is(td, th),
  html body.r2.r2-reading:is(*, #r2) main .guide-table td:first-child { min-width: 0; }
}
@media (max-width: 760px) {
  html body.r2.r2-reading:is(*, #r2) main .guide-table :is(td, th) { padding-inline: 8px; }
}

/* A4. List tables (lists and rankings): 18px side padding -> 12px under 1100px, and
   the shared shell rule (.v1 td:first-child: 37%, 240px floor) no longer holds the
   short company column wide while project names wrap word by word */
@media (max-width: 1099px) {
  html body.r2:is(*, #r2) main .v1-table-wrap > table :is(th, td) { padding-inline: 12px; }
  html body.r2:is(*, #r2) main .v1-table-wrap > table td:first-child { width: auto; min-width: 0; }
}

/* A5. Dashboard project table: 14px side padding -> 10px under 1100px */
@media (max-width: 1099px) {
  html body.r2.r2-dashboard:is(*, #r2) main .dtable :is(th, td) { padding-inline: 10px; }
}

/* A6. Price calculator production table: a shared shell rule (.v1 td:first-child)
   gave the year column a 240px floor inside a 270px result column */
html body.r2.r2-tool:is(*, #r2) main .production-table :is(th, td):first-child {
  width: auto;
  min-width: 0;
}

/* A7. Price calculator "What moves the result": round 2 fixed the table to its
   column, but the cells stayed nowrap, so "6.10 USD/kg H2" ran over the next cell
   (18 cells at 1440, more at 820). Cells wrap inside their column; type unchanged. */
html body.r2.r2-tool:is(*, #r2) main .calc-results .calc-chart__table :is(th, td) { white-space: normal; }

/* A8. Price calculator finance switch: Off and Tax were 39px wide (44px tall) */
html body.r2.r2-tool:is(*, #r2) main .finance-switch .stage-button { min-inline-size: 44px; }

/* ===== B. Leftovers from the round-2 QA (agy) ===== */

/* B1. Stage: the shape and the words say the stage; the hairline under the words
   read as an underline (agy 7, Sol). Removed at every width. */
html body.r2:is(*, #r2) main .h2-stage-progress i { display: none; }
html body.r2:is(*, #r2) main .h2-stage-progress { gap: 0; }

/* B2. One left line: content starts on the logo's line.
   Insights index used a 1240px column (x=100 at 1440) under a 1280px header. */
html body.r2.r2-reading-index:is(*, #r2) main#main:has(.insight-index) {
  width: min(var(--brand-rail, 1280px), calc(100% - 2 * var(--brand-gutter, 32px)));
  max-width: var(--brand-rail, 1280px);
}
/* calculators index and search: keep the 1100px measure, start it on the line */
html body.r2:is(*, #r2) main :is(.calculator-index, .h2-search-page) { margin-inline-start: 0; }
/* price calculator: a centred 1240px app with 24px padding put the title at x=124.
   768px up: the page column starts at max(32px, (100vw - 1280px) / 2) while the logo
   sits at min(4vw, 48px) until the 1280px rail takes over, so the app fills the
   column and pads by the difference (0 from 1376px). Up to 760px the page column is
   the logo line; the app's 12px and the title group's 12px put the title 24px in
   (the calculator's own breakpoint is 767px). */
@media (max-width: 767px) {
  html body.r2.r2-tool:is(*, #r2) main #calculator-app.calc-app { padding-inline: 0; }
  /* 761-767px the bar is a column aligned to the end, which pushed the title right */
  html body.r2.r2-tool:is(*, #r2) main #calculator-app .topbar > .title-group { padding-inline-start: 0; align-self: flex-start; }
}
@media (min-width: 768px) {
  html body.r2.r2-tool:is(*, #r2) main .price-workspace #calculator-app,
  html body.r2.r2-tool:is(*, #r2) main #calculator-app.calc-app {
    width: auto;
    max-width: none;
    margin-inline: 0;
    padding-inline: max(0px, calc(min(4vw, 48px) - max(32px, (100vw - 1280px) / 2)));
  }
}

/* B3. Insights index title: same size as every other page title (was 44px at 1440,
   32px at 900). The shell sets this one with !important, so this has to as well. */
html body.r2.r2-reading-index:is(*, #r2) main#main:has(.insight-index) h1 {
  font-size: clamp(30px, 1.2vw + 22px, 40px) !important;
  line-height: 1.12;
}

/* B4. Dashboard: the filter panel drew a 1px rule 22px above itself, right under
   the head's own rule: one rule is enough */
html body.r2.r2-dashboard:is(*, #r2) main details.dcontrols::before { content: none; }

/* B5. Directory heads (projects, companies, countries, policies): one distance from
   the site header to the page title, 32px (was 8px on projects, 52px elsewhere) */
@media (min-width: 761px) and (max-width: 1099px) {
  /* the project heading sits 12px lower inside the page below 1100px */
  html body.r2.r2-projects-index:is(*, #r2) main { padding-block-start: 20px; }
}
@media (min-width: 1100px) {
  html body.r2.r2-projects-index:is(*, #r2) main { padding-block-start: 32px; }
}
@media (min-width: 761px) {
  html body.r2:is(.r2-companies-index, .r2-countries-index, .r2-policies-index):is(*, #r2) main { padding-block-start: 24px; }
}

/* Item 346: option text must not determine filter tracks or move the map. */
/* Keep slots even while Product is hidden by the global hidden-attribute rule. */
html body #pg-map .map-filter-fields>label:nth-child(1){grid-area:1 / 1}
html body #pg-map .map-filter-fields>label:nth-child(2){grid-area:1 / 2}
html body #pg-map .map-filter-fields>label:nth-child(3){grid-area:1 / 3}
html body #pg-map .map-filter-fields>label:nth-child(4){grid-area:2 / 1}
html body #pg-map .map-filter-fields>label:nth-child(5){grid-area:2 / 2}
html body #pg-map .map-filter-fields>button:nth-child(6){grid-area:2 / 3}
html body #pg-map .map-filter-fields>button:nth-child(7){grid-area:3 / 1}
body[data-legacy-tool-shell="/map"] #main>section[data-prerender]{visibility:hidden}
body[data-legacy-tool-shell="/map"] #pg-home,
body[data-legacy-tool-shell="/map"] [data-route-loading]{visibility:hidden}
body[data-legacy-tool-shell="/map"] #main:not(:has(#pg-map.active))>.v1-footer{visibility:hidden}
html body[data-legacy-tool-shell="/map"] #main{min-height:1300px}
html body #pg-map .map-filter-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:minmax(70px,auto);align-items:end;min-height:250px}
html body #pg-map .map-filter-fields>label{min-width:0}
html body #pg-map .map-filter-fields select{width:100%;min-width:0;max-width:100%}
html body #pg-map .map-filter-fields .map-reset{grid-column:auto;min-height:44px}
html body #pg-map .map-filter-fields #map-product-control[hidden]{display:flex;visibility:hidden}
html body #pg-map .mapwrap{min-height:clamp(430px,58vh,620px)}
@media(max-width:760px){
 html:has(.analytics-consent){scroll-padding-bottom:140px}
 html body[data-legacy-tool-shell="/map"] .site-metrics-strip{height:74px;min-height:74px}
 html body #pg-map .map-search #m-count{display:block;min-height:45px}
 html body #pg-map .map-filter-fields{grid-template-columns:repeat(2,minmax(0,1fr));min-height:330px}
 html body #pg-map .map-filter-fields>label:nth-child(3){grid-area:2 / 1}
 html body #pg-map .map-filter-fields>label:nth-child(4){grid-area:2 / 2}
 html body #pg-map .map-filter-fields>label:nth-child(5){grid-area:3 / 1}
 html body #pg-map .map-filter-fields>button:nth-child(6){grid-area:3 / 2}
 html body #pg-map .map-filter-fields>button:nth-child(7){grid-area:4 / 1}
 html body #pg-map .mapwrap{min-height:440px}
 /* Keep consent outside document flow without covering the masthead. */
 html body:not(.v1-home):is(*,#cls-panel) .analytics-consent{position:fixed;inset:auto 0 0;z-index:2147483000;width:auto;max-width:none;margin:0;padding:10px 16px;background:var(--surface,#fff);border:0;border-top:1px solid var(--line,#ccc);box-shadow:0 -3px 12px #0002}
 html body:not(.v1-home):is(*,#cls-panel) .app>.analytics-consent{margin-inline:0}
 /* Leave room under the fixed consent band so the footer stays scrollable and focusable. */
 html body.consent-open:not(.v1-home):is(*,#cls-panel){padding-bottom:var(--consent-space,140px)}
}
