/* Carbon Reduction Plan (PPN 006), document page. Links after base.css.
   Content sits in <main class="crp">, which base.css already lifts above .atmos. */

.crp {
  max-width: 860px;
  margin: 0 auto;
  padding: 96px var(--pad) 120px;
}

/* ===== document header ===== */
.crp-head {
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 40px;
  margin-bottom: 8px;
}
.crp-eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 20px;
}
.crp h1 {
  font-family: "Fraunces", serif;
  font-weight: 200;
  font-size: clamp(36px, 5.4vw, 60px);
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 28px;
  color: var(--ink);
  font-variation-settings: "opsz" 144;
}
.crp-org {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-2);
  margin: 0;
}
.crp-org b {
  color: var(--ink);
  font-weight: 500;
}
.crp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}
.crp-meta span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 6px 13px;
  white-space: nowrap;
}
.crp-meta span b {
  color: var(--ink);
  font-weight: 500;
}

/* ===== headline figures ===== */
.crp-figures {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  overflow: hidden;
  margin: 44px 0 8px;
}
.crp-fig {
  background: var(--bg-2);
  padding: 22px 18px;
}
.crp-fig.is-total {
  background: color-mix(in oklab, var(--accent) 9%, var(--bg-2));
}
.crp-fig .k {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  display: block;
}
.crp-fig.is-total .k {
  color: var(--accent);
}
.crp-fig .v {
  font-family: "Fraunces", serif;
  font-weight: 300;
  font-size: clamp(26px, 3.4vw, 34px);
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  display: block;
  margin-top: 10px;
  line-height: 1;
}
.crp-fig .u {
  font-size: 12px;
  color: var(--ink-4);
  display: block;
  margin-top: 8px;
}
.crp-figures-note {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin: 0 0 8px;
}

/* ===== sections ===== */
.crp h2 {
  font-family: "Fraunces", serif;
  font-weight: 300;
  font-size: clamp(24px, 2.9vw, 34px);
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 72px 0 22px;
  color: var(--ink);
  padding-top: 34px;
  border-top: 1px solid var(--line);
}
/* base.css only gives scroll-margin to section[id]/header[id], so a linked
   heading would otherwise land under the sticky topbar. */
.crp h2[id] {
  scroll-margin-top: 96px;
}
.crp h2 .num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.5em;
  color: var(--accent);
  letter-spacing: 0.08em;
  vertical-align: 0.35em;
  margin-right: 14px;
  font-weight: 400;
}
.crp h3 {
  font-family: "Fraunces", serif;
  font-weight: 300;
  font-size: 21px;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 44px 0 14px;
  color: var(--ink);
}
.crp h4 {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 34px 0 12px;
}
.crp p {
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.78;
  margin: 0 0 18px;
  font-weight: 300;
}
.crp p.lead {
  font-size: 17px;
  color: var(--ink);
  line-height: 1.7;
}
.crp strong {
  color: var(--ink);
  font-weight: 500;
}
.crp a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  transition:
    color 0.2s,
    border-color 0.2s;
}
.crp a:hover {
  color: var(--accent-strong);
  border-bottom-color: var(--accent);
}

/* ===== callouts ===== */
.crp-note {
  border-left: 2px solid var(--accent);
  background: color-mix(in oklab, var(--accent) 5%, transparent);
  border-radius: 0 10px 10px 0;
  padding: 22px 24px;
  margin: 30px 0;
}
.crp-note.is-warn {
  border-left-color: var(--gold);
  background: color-mix(in oklab, var(--gold) 6%, transparent);
}
.crp-note h4 {
  margin-top: 0;
}
.crp-note.is-warn h4 {
  color: var(--gold);
}
.crp-note p:last-child {
  margin-bottom: 0;
}

/* ===== tables =====
   .crp-table is the scroll shell; .stack tables collapse into cards on narrow
   screens using the data-label on each cell. */
.crp-table {
  margin: 24px 0 30px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  overflow: hidden;
}
.crp-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  /* fixed + a <colgroup> per table. Auto layout let the long "Why" column
     squeeze the others until the numbers sat a long way from their header. */
  table-layout: fixed;
}
.crp-table th,
.crp-table td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink-2);
  font-weight: 300;
  line-height: 1.62;
}
.crp-table thead th {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  background: var(--bg-2);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.crp-table tbody tr:last-child td {
  border-bottom: none;
}
.crp-table td strong,
.crp-table th strong {
  color: var(--ink);
  font-weight: 500;
}
.crp-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* a numeric cell that carries a word beside the number. nowrap would push it
   out of a fixed-width column and over the next one. */
.crp-table .num.is-wrapped {
  white-space: normal;
}
.crp-table thead th.num {
  text-align: right;
}
/* deliberately not nowrap: these carry real labels, not short keys, and a
   fixed-width column clips rather than widens. */
.crp-table .rowhead {
  color: var(--ink);
  font-weight: 400;
}
.crp-table .ref {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--accent);
  white-space: nowrap;
}
.crp-table tr.is-total td {
  background: color-mix(in oklab, var(--accent) 8%, transparent);
  color: var(--ink);
  font-weight: 500;
  border-top: 1px solid var(--line-2);
}
.crp-table .zero {
  color: var(--ink-4);
}

/* ===== lists ===== */
.crp ul {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}
.crp ul > li {
  position: relative;
  padding: 9px 0 9px 22px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.75;
  font-weight: 300;
}
.crp ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  width: 10px;
  height: 1px;
  background: var(--accent);
  opacity: 0.7;
}

/* ===== sign-off ===== */
.crp-sign {
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--bg-2);
  padding: 28px 30px;
  margin: 32px 0;
}
.crp-sign dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 28px;
  margin: 0;
  font-size: 15px;
}
.crp-sign dt {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding-top: 4px;
}
.crp-sign dd {
  margin: 0;
  color: var(--ink);
  font-weight: 400;
}

/* ===== document footer note ===== */
.crp-docfoot {
  margin-top: 64px;
  padding-top: 26px;
  border-top: 1px solid var(--line-2);
}
.crp-docfoot p {
  font-size: 13.5px;
  color: var(--ink-4);
  line-height: 1.7;
  margin: 0 0 10px;
}

/* ===== responsive =====
   Every query below is `screen and`, deliberately. An A4 page at these margins
   is about 690 CSS px wide, so an unscoped max-width:760px query fires when
   printing and the tables come out as dark mobile cards. */
@media screen and (max-width: 900px) {
  .crp-figures {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 760px) {
  .crp {
    padding: 64px var(--pad) 80px;
  }
  .crp-head {
    padding-bottom: 30px;
  }
  .crp h2 {
    margin-top: 52px;
    padding-top: 26px;
  }
  .crp h2 .num {
    display: block;
    margin: 0 0 8px;
    vertical-align: baseline;
    font-size: 11px;
  }

  /* stacked tables: header row hidden, each cell labelled by its column */
  .crp-table.stack {
    border: none;
    border-radius: 0;
    overflow: visible;
  }
  .crp-table.stack table,
  .crp-table.stack tbody,
  .crp-table.stack tr,
  .crp-table.stack td {
    display: block;
    width: 100%;
  }
  .crp-table.stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .crp-table.stack tr {
    border: 1px solid var(--line-2);
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 6px 0;
    background: var(--bg-2);
  }
  .crp-table.stack td {
    border-bottom: none;
    padding: 9px 16px;
  }
  .crp-table.stack td:empty {
    display: none;
  }
  .crp-table.stack td::before {
    content: attr(data-label);
    display: block;
    font-family: "IBM Plex Mono", monospace;
    font-size: 9.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-4);
    margin-bottom: 5px;
  }
  .crp-table.stack td:not([data-label])::before {
    display: none;
  }
  /* the bare index cell reads as the card's number, not as a data field */
  .crp-table.stack td.cardnum {
    padding-bottom: 2px;
  }
  .crp-table.stack td.cardnum strong {
    color: var(--accent);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
  }
  .crp-table.stack td.num {
    text-align: left;
  }
  .crp-table.stack tr.is-total {
    background: color-mix(in oklab, var(--accent) 8%, var(--bg-2));
    border-color: var(--accent-soft);
  }
  .crp-table.stack tr.is-total td {
    background: none;
    border-top: none;
  }

  .crp-sign {
    padding: 22px 20px;
  }
  .crp-sign dl {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .crp-sign dt {
    padding-top: 12px;
  }
  .crp-sign dt:first-child {
    padding-top: 0;
  }
  .crp-note {
    padding: 18px 18px;
  }
}

/* only the narrowest phones drop to one column: four stacked cards for four
   numbers is a lot of scrolling on a 390px screen. */
@media screen and (max-width: 359px) {
  .crp-figures {
    grid-template-columns: 1fr;
  }
}

/* ===== print: a contracting authority will save this as a PDF ===== */
@media print {
  @page {
    margin: 16mm 14mm;
  }
  .atmos,
  .topbar,
  .mobile-drawer,
  .backdrop,
  footer,
  .cert-widget {
    display: none !important;
  }
  html,
  body {
    background: #fff !important;
    color: #14181d !important;
  }
  .crp {
    max-width: none;
    padding: 0;
    color: #14181d;
  }
  /* four across is too narrow on A4; two rows of two reads properly */
  .crp-figures {
    grid-template-columns: repeat(2, 1fr);
  }
  .crp h1,
  .crp h2,
  .crp h3,
  .crp-org b,
  .crp strong,
  .crp-fig .v,
  .crp-sign dd {
    color: #14181d !important;
  }
  .crp p,
  .crp ul > li,
  .crp-table td,
  .crp-org {
    color: #2b333c !important;
  }
  .crp h2 .num,
  .crp h4,
  .crp-eyebrow {
    color: #0f5c4a !important;
  }
  .crp-meta span,
  .crp-fig .k,
  .crp-fig .u,
  .crp-sign dt,
  .crp-table thead th,
  .crp-figures-note,
  .crp-docfoot p {
    color: #5b6672 !important;
  }
  /* the chip values are <b>, which otherwise keeps the dark-theme near-white */
  .crp-meta span b {
    color: #14181d !important;
  }
  .crp-head,
  .crp h2,
  .crp-table,
  .crp-table th,
  .crp-table td,
  .crp-sign,
  .crp-docfoot,
  .crp-meta span,
  .crp-figures {
    border-color: #d8dde3 !important;
  }
  .crp-fig,
  .crp-sign,
  .crp-table thead th {
    background: #f5f7f9 !important;
  }
  .crp-fig.is-total,
  .crp-table tr.is-total td {
    background: #eef5f2 !important;
  }
  .crp-figures {
    background: #d8dde3 !important;
  }
  .crp-note {
    background: #f5f7f9 !important;
    border-left-color: #0f5c4a !important;
  }
  .crp a {
    color: #0f5c4a !important;
    border-bottom: none;
  }
  .crp h2,
  .crp h3 {
    break-after: avoid;
    page-break-after: avoid;
  }
  /* rows, not whole tables. Keeping a long table intact pushes it to the next
     page and leaves most of the previous one blank. */
  .crp-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .crp-table thead {
    display: table-header-group;
  }
  .crp-sign,
  .crp-note,
  .crp-figures {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
