/* Research report (/research/noi-case/): US Letter sheets on screen and in print.
   Inside [data-format="letter"] the type tokens switch to the letter scale (tokens.css). */

.wp-screen {
  min-height: 100vh;
  background: var(--andes-elevation-surface-sunken);
}

/* TOOLBAR */
.wp-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--andes-color-border);
  background: var(--andes-elevation-surface);
}
.wp-toolbar__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--andes-space-200);
  height: 56px;
}
.wp-toolbar__home {
  display: flex;
  align-items: center;
  gap: var(--andes-space-150);
}
.wp-toolbar__home img {
  width: auto;
  height: 20px;
}
.wp-toolbar__label {
  display: none;
}
@media (min-width: 640px) {
  .wp-toolbar__label {
    display: inline;
  }
}

/* FRAME: sheets keep their print size and scroll sideways on narrow screens */
.wp-frame {
  overflow-x: auto;
  padding: 40px var(--andes-space-200);
}
.wp-pages {
  display: flex;
  flex-direction: column;
  align-items: safe center;
  gap: var(--andes-space-400);
}

/* SHEET: 816 x 1056 CSS px = 8.5 x 11 in. Content must fit; overflow is a defect. */
.wp-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 816px;
  height: 1056px;
  overflow: hidden;
  background: var(--andes-elevation-surface);
  color: var(--andes-color-text);
}
.wp-sheet__footer {
  position: absolute;
  inset: auto var(--andes-space-600) var(--andes-space-300);
  display: flex;
  justify-content: space-between;
}
.wp-cover {
  display: flex;
  flex-direction: column;
  gap: var(--andes-space-100);
  padding: var(--andes-space-300) var(--andes-space-600) 20px;
  background: var(--andes-color-background-brand-bold);
}
.wp-cover__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wp-cover__top img {
  width: auto;
  height: 20px;
}
.wp-cover__title {
  margin-top: var(--andes-space-100);
}
.wp-running-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-inline: var(--andes-space-600);
  padding: 20px 0 var(--andes-space-150);
  border-bottom: 1px solid var(--andes-color-border);
}
.wp-running-head img {
  width: auto;
  height: 16px;
}
.wp-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--andes-space-150);
  padding: var(--andes-space-200) var(--andes-space-600) 56px;
}
.wp-body--page2 {
  gap: var(--andes-space-200);
}
.wp-block {
  display: flex;
  flex-direction: column;
  gap: var(--andes-space-150);
}
.wp-heading {
  font: var(--andes-font-body-small);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--andes-color-text-accent);
}
.wp-ref {
  margin-left: 1px;
  font: var(--andes-font-footnote);
  color: var(--andes-color-text-accent);
}

/* KPI and mechanism grids: rules come from the 1px gap showing the hairline background. */
.wp-kpis,
.wp-mechanisms {
  display: grid;
  gap: 1px;
  border-block: 1px solid var(--andes-color-border);
  background: var(--andes-color-border);
}
.wp-kpis {
  grid-template-columns: repeat(4, 1fr);
}
.wp-kpis div {
  display: flex;
  flex-direction: column-reverse;
  padding: var(--andes-space-050) var(--andes-space-100);
  background: var(--andes-elevation-surface);
}
.wp-mechanisms {
  grid-template-columns: repeat(3, 1fr);
}
.wp-mechanisms article {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--andes-space-150);
  background: var(--andes-elevation-surface);
}
.wp-mechanisms__label {
  margin-top: calc(-1 * var(--andes-space-050));
}
.wp-mechanisms__title {
  margin-top: var(--andes-space-050);
}

/* TABLES */
.wp-table {
  width: 100%;
  border-bottom: 1px solid var(--andes-color-border);
}
.wp-table thead tr {
  border-bottom: 2px solid var(--andes-color-text-brand);
}
.wp-table thead th {
  padding-block: var(--andes-space-050);
  font: var(--andes-font-body-small);
  font-weight: 500;
  text-align: left;
  color: var(--andes-color-text-secondary);
}
.wp-table tbody th,
.wp-table tbody td {
  padding-block: 6px;
  border-top: 1px solid var(--andes-color-border);
  font: var(--andes-font-body);
  vertical-align: top;
}
.wp-table tbody th {
  font-weight: 500;
  text-align: left;
}
.wp-table .wp-num {
  text-align: right;
}
.wp-table tbody .wp-num {
  font: var(--andes-font-data-small);
  font-variant-numeric: tabular-nums;
}
.wp-table .wp-table__total {
  border-top: 2px solid var(--andes-color-text-brand);
}
.wp-table .wp-table__total th,
.wp-table .wp-table__total td {
  border-top: 0;
}
.wp-table tbody .wp-table__uplift,
.wp-table tbody td.fw-medium {
  font-weight: 500;
}

/* CHART AND SIDE NOTES */
.wp-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--andes-space-400);
}
.wp-split figure {
  gap: var(--andes-space-100);
}
.wp-chart {
  width: 100%;
  height: auto;
}
.wp-chart__axis text {
  font-family: var(--font-mono);
  font-size: 7px;
  fill: var(--andes-color-text-secondary);
}
.wp-chart__legend text {
  font-size: 6.5px;
}
.wp-chart__note {
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 500;
  fill: var(--andes-color-text-accent);
}
.wp-rail {
  padding-left: var(--andes-space-150);
  border-left: var(--andes-border-width-emphasis) solid var(--andes-color-border-accent);
}
.wp-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--andes-space-300);
}
.wp-quote {
  padding-left: 20px;
  border-left: var(--andes-border-width-emphasis) solid var(--andes-color-border-accent);
}
.wp-quote figcaption {
  margin-top: var(--andes-space-100);
}
.wp-sources {
  gap: var(--andes-space-100);
  margin-top: auto;
}
.wp-sources__list {
  columns: 2;
  column-gap: var(--andes-space-300);
}
.wp-sources__list li {
  margin-bottom: 2px;
  break-inside: avoid;
}
.wp-sources__list .wp-ref {
  margin: 0 var(--andes-space-050) 0 0;
}
.wp-sources__disclaimer {
  margin-top: var(--andes-space-050);
}

/* PRINT: one US Letter sheet per page, no toolbar, exact colours. Scoped to the named page. */
@page letter-sheet {
  size: Letter;
  margin: 0;
}
@media screen {
  .wp-sheet {
    box-shadow: var(--andes-elevation-shadow-raised);
  }
}
@media print {
  .skip-link,
  .wp-toolbar {
    display: none;
  }
  .wp-screen,
  .wp-frame {
    min-height: 0;
    padding: 0;
    overflow: visible;
    background: none;
  }
  .wp-pages {
    gap: 0;
  }
  .wp-sheet {
    page: letter-sheet;
    break-after: page;
  }
  .wp-sheet:last-child {
    break-after: auto;
  }
  .wp-screen {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
