/* ============================================================================
   EMS-Trade Cooling · assets/pages-worker-8.css
   Bundle worker-8 — five sheets, all of them on the one sheet discipline the
   design language fixes (paper, hairlines, mono utility, plate + number):

     /fill-and-flush/                        line 07 hub      hero H2 split
     /fill-and-flush/service-carts/          line 07.1        hero H2 split
     /fill-and-flush/commissioning/          line 07.2        hero H7 stacked
     /industries/ev-and-power-electronics/   industry sheet   hero H6 wide
     /design-guides/                         reference index  hero H4 doc

   NAMESPACE. check-css-conflicts counts a class defined in two stylesheets as
   a failure, so every selector in this file carries the w8- prefix. No shared
   class from site.css or design-tokens.css is redefined or extended here.

   GRID TRACKS. Every track that carries a plate, a drawing or a table is
   written minmax(0, 1fr). A bare 1fr has an automatic minimum, so an image
   with an intrinsic width pushes its track wider than the sheet and the page
   goes sideways. That is a measured defect, not a theory.

   NO STYLE ATTRIBUTES. CSP is style-src 'self'; the interface to a component
   is a class (w8-grid3, w8-span-5, w8-facts--2), never an inline variable.
   ========================================================================= */

/* ---------------------------------------------------------- 1. BANDS ----- */

/* A band is one visual strip of the sheet: a header line, a table, a row of
   plates, a diagram. Padding is the only thing a band owns; the rules above
   and below it belong to the framing. */
.w8-band {
  border-top: var(--hair-soft);
  padding-block: var(--sp-6);
}

.w8-band--first {
  border-top: 0;
}

.w8-band--tight {
  padding-block: var(--sp-4);
}

.w8-band--ink {
  border-top: var(--bw-2) solid var(--ink);
  padding-top: var(--sp-4);
}

/* ---------------------------------------------------------- 2. GRIDS ----- */

.w8-grid2,
.w8-grid3,
.w8-grid4 {
  display: grid;
  gap: var(--sp-5);
  align-items: start;
}

.w8-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.w8-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.w8-grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.w8-grid2 > *,
.w8-grid3 > *,
.w8-grid4 > * { min-width: 0; }

/* Two tracks with different weights, still minmax(0, 1fr) on both sides. */
.w8-grid--5-7 { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.w8-grid--7-5 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.w8-grid--4-8 { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }

/* Twelve column field for copy that has to line up with the ruled sheet. */
.w8-row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--sp-5);
}

.w8-span-4 { grid-column: span 4; }
.w8-span-5 { grid-column: span 5; }
.w8-span-6 { grid-column: span 6; }
.w8-span-7 { grid-column: span 7; }
.w8-span-8 { grid-column: span 8; }
.w8-span-12 { grid-column: span 12; }

/* A framed block of copy that is not a plate: used where a note has to be
   visibly outside the running text. */
.w8-frame {
  border: var(--hair);
  background: var(--raise);
  padding: var(--sp-4);
}

.w8-frame--head {
  border-top: var(--bw-2) solid var(--ink);
}

.w8-sub {
  display: block;
  font-family: var(--f-util);
  font-size: var(--fs-micro);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tr-micro);
  color: var(--muted);
  margin-bottom: var(--sp-2);
}

/* ------------------------------------------------- 3. HERO — SPLIT (H2) -- */

.w8-hero--split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  border-bottom: var(--hair-strong);
}

.w8-hero__copy {
  padding: var(--sp-9) var(--sp-8) var(--sp-8);
  border-right: var(--hair-soft);
}

.w8-hero__copy h1 {
  margin-top: var(--sp-4);
  max-width: 17ch;
  font-size: var(--fs-h1);
  letter-spacing: var(--tr-display);
}

.w8-hero__lede {
  margin-top: var(--sp-4);
  max-width: 46ch;
  font-size: var(--fs-lede);
  line-height: 1.5;
  color: var(--ink);
}

.w8-hero__acts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-4);
  align-items: center;
  margin-top: var(--sp-5);
}

.w8-hero__fig {
  padding: var(--sp-6);
  background: var(--paper-2);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* The facts the page is indexed on, stacked under the copy rather than parked
   in a row beside it: on this sheet they are the argument, not a footer. */
.w8-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: var(--sp-6);
  border-top: var(--hair);
}

.w8-facts > div {
  padding: var(--sp-3) var(--sp-3) var(--sp-3) 0;
  border-bottom: var(--hair-soft);
  border-right: var(--hair-soft);
}

.w8-facts > div:nth-child(2n) {
  padding-left: var(--sp-3);
  border-right: 0;
}

.w8-facts b {
  display: block;
  font-family: var(--f-util);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.w8-facts span {
  display: block;
  margin-top: var(--sp-1);
  font-family: var(--f-util);
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: var(--tr-label);
  color: var(--muted);
}

.w8-facts--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.w8-facts--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ------------------------------------------------ 4. HERO — STACKED (H7) -- */

/* Title above, plate in full below, no type on the photograph. The plate is
   inset into the paper so the sheet edge still reads. */
.w8-hero--stack {
  border-bottom: var(--hair-strong);
}

.w8-hero__title {
  padding: var(--sp-9) 0 var(--sp-6);
}

.w8-hero__title h1 {
  margin-top: var(--sp-4);
  max-width: 26ch;
  font-size: var(--fs-h1);
  letter-spacing: var(--tr-display);
}

.w8-hero__title .w8-hero__lede {
  max-width: 66ch;
  color: var(--body);
}

.w8-hero__plate {
  padding: 0 0 var(--sp-7);
}

/* --------------------------------------------------- 5. HERO — DOC (H4) -- */

.w8-hero--doc {
  border-bottom: var(--hair-strong);
  padding: var(--sp-8) 0 var(--sp-7);
}

.w8-hero--doc .w8-row {
  align-items: start;
}

.w8-hero__head h1 {
  margin-top: var(--sp-4);
  max-width: 22ch;
  font-size: var(--fs-h1);
  letter-spacing: var(--tr-display);
}

.w8-hero__head .w8-hero__lede {
  max-width: 62ch;
  color: var(--body);
}

.w8-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-6);
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: var(--hair);
  font-family: var(--f-util);
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: var(--tr-micro);
  color: var(--muted);
}

.w8-hero__meta b {
  color: var(--ink);
  font-weight: 500;
}

/* The small plate on the right of a document head: 4 of 12, no crop. */
.w8-hero__mini {
  padding-top: var(--sp-4);
}

/* --------------------------------------------------- 6. HERO — WIDE (H6) -- */

/* 21:9 field. The ratio is expressed as a height, not as aspect-ratio: the
   project whitelist allows 3/2, 2/3, 1/1 and 3/4 only. 43vw is 21:9 at 1440. */
.w8-hero--wide {
  border-bottom: var(--hair-strong);
  background: var(--ink);
}

.w8-hero__shot {
  position: relative;
  overflow: hidden;
  background: var(--ink);
}

.w8-hero__shot > img {
  width: 100%;
  height: clamp(400px, 43vw, 640px);
  object-fit: cover;
}

/* z-index is stated, not inherited: the band sits over a photograph and a
   later sibling in the flow would otherwise paint on top of the copy. */
.w8-hero__band {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(40%, 580px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 3vw, 44px) var(--band-x);
  background-color: var(--scrim);
  background-image: linear-gradient(
    90deg,
    var(--scrim) 0%,
    var(--scrim-deep) 78%,
    rgba(22, 19, 15, 0.42) 100%
  );
}

.w8-hero__band h1 {
  margin-top: var(--sp-4);
  max-width: 24ch;
  color: var(--on-scrim);
  font-size: var(--fs-h1);
  letter-spacing: var(--tr-display);
  text-shadow: var(--shadow-text);
}

.w8-hero__band .w8-hero__lede {
  color: var(--on-scrim-2);
  font-size: var(--fs-lede);
  line-height: 1.45;
  max-width: 40ch;
  text-shadow: var(--shadow-text);
}


/* The anchors of the page, as three mono fragments inside the band. */
.w8-hero__anchors {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-5);
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: var(--hair-plate);
  font-family: var(--f-util);
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: var(--tr-micro);
  color: var(--on-scrim-2);
  text-shadow: var(--shadow-text);
}

.w8-hero__anchors b {
  color: var(--on-scrim);
  font-weight: 500;
}

/* Bars under a wide plate: the reading the industry page is built on, set in
   the same mono as a table so it is not mistaken for prose. */
.w8-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  border-top: var(--hair-strong);
  border-bottom: var(--hair);
}

.w8-bars > div {
  padding: var(--sp-4) var(--sp-3);
  border-right: var(--hair-soft);
}

.w8-bars > div:last-child {
  border-right: 0;
}

.w8-bars b {
  display: block;
  font-family: var(--f-util);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.w8-bars span {
  display: block;
  margin-top: var(--sp-1);
  font-family: var(--f-util);
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: var(--tr-label);
  color: var(--muted);
}

.w8-bars small {
  display: block;
  margin-top: var(--sp-2);
  font-size: var(--fs-cap);
  line-height: 1.45;
  color: var(--body);
}

/* ------------------------------------------------------- 7. PROCESS ----- */

/* The four-step spine. Step cards carry a number, a name and the one figure
   that has to be met at that step; the return line closes the loop back to
   the first card, so the diagram is a cycle and not a list. */
.w8-spine {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: var(--hair);
  background: var(--raise);
}

.w8-spine > div {
  padding: var(--sp-4);
  border-right: var(--hair-soft);
}

.w8-spine > div:last-child {
  border-right: 0;
}

.w8-spine__no {
  display: block;
  font-family: var(--f-util);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--tr-label);
  color: var(--link);
}

.w8-spine__name {
  display: block;
  margin-top: var(--sp-2);
  font-family: var(--f-display);
  font-size: var(--fs-data);
  font-weight: 600;
  color: var(--ink);
}

.w8-spine__spec {
  display: block;
  margin-top: var(--sp-2);
  font-family: var(--f-util);
  font-size: var(--fs-micro);
  letter-spacing: 0.06em;
  color: var(--muted);
}

.w8-spine__return {
  grid-column: 1 / -1;
  border-top: 1px dashed var(--rule-strong);
  padding: var(--sp-2) var(--sp-4);
  font-family: var(--f-util);
  font-size: var(--fs-micro);
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* A step-numbered list of the things that have to be true before the next
   step: written as rows, not as a paragraph. */
.w8-steps {
  list-style: none;
  border-top: var(--hair);
  counter-reset: w8step;
}

.w8-steps li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: var(--hair-soft);
  font-size: var(--fs-data);
  line-height: var(--lh-ui);
  color: var(--body);
}

.w8-steps li::before {
  counter-increment: w8step;
  content: counter(w8step, decimal-leading-zero);
  font-family: var(--f-util);
  font-size: var(--fs-micro);
  color: var(--stamp);
}

/* -------------------------------------------------- 8. SECTION CUT ------ */

/* Drawing on the left, numbered key on the right, one row per callout. The
   drawing is inline SVG: the design language asks for a cut-away, and a
   cut-away with leader numbers is a diagram, not decoration. */
.w8-cut {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 250px);
  border: var(--hair);
  background: var(--raise);
}

.w8-cut__figure {
  padding: var(--sp-5);
  overflow-x: auto;
}

.w8-cut__figure svg {
  display: block;
  width: 100%;
  min-width: 560px;
  height: auto;
}

.w8-cut__key {
  border-left: var(--hair-soft);
  padding: var(--sp-4);
  background: var(--paper-2);
}

.w8-cut__key ol {
  list-style: none;
}

.w8-cut__key li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  border-bottom: var(--hair-soft);
  font-size: var(--fs-cap);
  line-height: 1.45;
  color: var(--body);
}

.w8-cut__key li:last-child {
  border-bottom: 0;
}

.w8-cut__key li b {
  font-family: var(--f-util);
  font-size: var(--fs-micro);
  font-weight: 600;
  color: var(--stamp);
}

/* ------------------------------------------------------ 9. MATRIX ------- */

.w8-marks {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: var(--fs-data);
}

.w8-marks caption {
  caption-side: top;
  text-align: left;
  padding: var(--sp-3);
  font-family: var(--f-util);
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: var(--tr-micro);
  color: var(--muted);
  border-bottom: var(--hair);
}

.w8-marks th,
.w8-marks td {
  text-align: left;
  vertical-align: middle;
  padding: 6px var(--sp-3);
  height: 34px;
  border-bottom: var(--hair-soft);
}

.w8-marks thead th {
  font-family: var(--f-util);
  font-size: var(--fs-micro);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tr-micro);
  color: var(--body);
  background: var(--paper-2);
  border-top: var(--hair);
  border-bottom: var(--hair);
  white-space: nowrap;
}

.w8-marks tbody th {
  font-family: var(--f-display);
  font-size: var(--fs-data);
  font-weight: 600;
  color: var(--ink);
}

.w8-marks td {
  text-align: center;
}

.w8-mark {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: -3px;
}

.w8-mark path {
  fill: none;
  stroke-width: 2;
  stroke-linecap: square;
}

.w8-yes { stroke: var(--link-brand); }
.w8-cond { stroke: var(--stamp-brand); stroke-dasharray: 3 2; }
.w8-no { stroke: var(--body); }

/* --------------------------------------------------- 10. GUIDE INDEX ---- */

/* Four guides, each one a row: number, judgement, and the figure the
   judgement turns on. This is an index, so the rows are the content. */
.w8-guide {
  display: grid;
  grid-template-columns: 46px minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--sp-4);
  padding: var(--sp-5) 0;
  border-bottom: var(--hair-soft);
  align-items: start;
}

.w8-guide__no {
  font-family: var(--f-util);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--tr-label);
  color: var(--stamp);
  padding-top: 3px;
}

.w8-guide__body h3 {
  font-size: var(--fs-h3);
  letter-spacing: var(--tr-title);
}

.w8-guide__body p {
  margin-top: var(--sp-2);
  font-size: var(--fs-body);
  line-height: var(--lh-prose);
  color: var(--body);
}

.w8-guide__turn {
  border-left: var(--bw-bar) solid var(--stamp-brand);
  padding-left: var(--sp-3);
  font-family: var(--f-util);
  font-size: var(--fs-cap);
  line-height: 1.5;
  color: var(--ink);
}

.w8-guide__turn b {
  color: var(--stamp);
  font-weight: 500;
}

/* A caption band sitting on a photograph takes a stacking order of its own:
   the band is positioned, so z-index applies to it, and a later sibling in the
   flow can no longer paint over the type. */
.w8-over {
  z-index: 2;
}

/* A judgement stated as a pair, so the misuse and the rule sit side by side. */
.w8-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-5);
}

.w8-pair h3 {
  font-family: var(--f-util);
  font-size: var(--fs-micro);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tr-micro);
  color: var(--muted);
  padding-bottom: var(--sp-2);
  border-bottom: var(--hair);
}

.w8-pair ul {
  list-style: none;
  margin-top: var(--sp-2);
}

.w8-pair li {
  padding: var(--sp-2) 0;
  border-bottom: var(--hair-soft);
  font-size: var(--fs-data);
  line-height: var(--lh-ui);
  color: var(--body);
}

/* ------------------------------------------------- 11. SAMPLE / LINKS --- */

/* Real material on a white ground: contain, never crop, because a cut-away
   drawing that is cropped is a drawing with a dimension missing. */
.w8-samples {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: var(--hair);
  background: var(--raise);
}

.w8-samples > figure {
  padding: var(--sp-3);
  border-right: var(--hair-soft);
  border-bottom: var(--hair-soft);
}

.w8-samples > figure:nth-child(4n) {
  border-right: 0;
}

.w8-samples img {
  width: 100%;
  height: auto;
  background: var(--raise);
}

.w8-samples figcaption {
  margin-top: var(--sp-3);
  font-family: var(--f-util);
  font-size: var(--fs-micro);
  letter-spacing: 0.06em;
  color: var(--muted);
}

.w8-samples figcaption b {
  display: block;
  color: var(--stamp);
  font-weight: 600;
}

/* A row of onward links, set as a schedule line rather than a button. */
.w8-next {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-5);
  padding-top: var(--sp-3);
  border-top: var(--hair);
  font-family: var(--f-util);
  font-size: var(--fs-micro);
  letter-spacing: 0.06em;
  color: var(--muted);
}

.w8-next b {
  color: var(--ink);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tr-label);
}

/* -------------------------------------------------------- 12. NARROW ---- */

@media (max-width: 1080px) {
  .w8-hero--split {
    grid-template-columns: minmax(0, 1fr);
  }

  .w8-hero__copy {
    border-right: 0;
    border-bottom: var(--hair-soft);
  }

  .w8-cut {
    grid-template-columns: minmax(0, 1fr);
  }

  .w8-cut__key {
    border-left: 0;
    border-top: var(--hair-soft);
  }
}

@media (max-width: 900px) {
  .w8-grid3,
  .w8-grid4,
  .w8-samples {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .w8-samples > figure:nth-child(4n) {
    border-right: var(--hair-soft);
  }

  .w8-samples > figure:nth-child(2n) {
    border-right: 0;
  }

  .w8-grid--5-7,
  .w8-grid--7-5,
  .w8-grid--4-8 {
    grid-template-columns: minmax(0, 1fr);
  }

  .w8-row {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .w8-span-4,
  .w8-span-5 { grid-column: span 6; }
  .w8-span-7,
  .w8-span-8 { grid-column: span 6; }

  .w8-spine {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .w8-spine > div:nth-child(2n) {
    border-right: 0;
  }

  .w8-spine > div:nth-child(-n+2) {
    border-bottom: var(--hair-soft);
  }

  .w8-guide {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .w8-guide__turn {
    grid-column: 2;
    margin-top: var(--sp-3);
  }

  .w8-hero__band {
    width: min(58%, 460px);
  }
}

@media (max-width: 720px) {
  .w8-hero__copy,
  .w8-hero__fig {
    padding: var(--sp-6) var(--sp-5);
  }

  .w8-hero__title {
    padding: var(--sp-7) 0 var(--sp-5);
  }

  .w8-hero__shot > img {
    height: 380px;
  }

  /* On a phone the band stops being an overlay: the type would have to be set
     at a size that no longer reads, so the plate goes above the copy instead. */
  .w8-hero__band {
    position: static;
    width: auto;
    background-image: none;
  }

  .w8-hero__band h1,
  .w8-hero__band .w8-hero__lede,
  .w8-hero__band .w8-hero__anchors {
    color: var(--ink);
    text-shadow: none;
  }

  .w8-hero__band .w8-hero__anchors {
    border-top-color: var(--rule);
  }

  .w8-hero__band .w8-hero__anchors b {
    color: var(--ink);
  }


  .w8-grid2,
  .w8-grid3,
  .w8-grid4,
  .w8-pair,
  .w8-facts,
  .w8-facts--2,
  .w8-facts--4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .w8-facts > div {
    padding-left: 0;
    border-right: 0;
  }

  .w8-spine {
    grid-template-columns: minmax(0, 1fr);
  }

  .w8-spine > div {
    border-right: 0;
    border-bottom: var(--hair-soft);
  }

  .w8-spine > div:last-child {
    border-bottom: 0;
  }

  .w8-samples {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .w8-marks {
    min-width: 520px;
  }
}
