/*
 * The /products hub and the product pages. Loaded after /styles/home.css,
 * whose .hm-* blocks these pages reuse unchanged (heads, the facts strip, the
 * before-and-after bars, the after-you-order row, the questions), and before
 * /styles/site.css, which supplies the tokens, bands, type classes and buttons.
 * site.css loads last, so a rule here that overrides a shared .dz-* class
 * carries one more class than the rule it overrides.
 *
 * Calm rules (review/DESIGN-SPEC.md): the home page's eight text styles and no
 * new ones; white bands, one snow band (the proof, or the 500 mm explainer on
 * the hub) and one Ink band (Print My Part); left-aligned except the hub hero;
 * no boxes. Orange marks one thing per chart: this machine's bar.
 *
 * Mobile first: the base rules are the 320px layout.
 */

/* The sticky bar sits under the sticky header, so an anchor clears both. */
html {
  scroll-padding-top: calc(var(--dz-head-h) + 84px);
}

/* These pages end with their own Print My Part band, worded for a product
   page, so the footer's copy of the offer is not shown a second time. */
.dz-products .dz-cta-band {
  display: none;
}

.pd dl,
.pd dd,
.pd figure {
  margin: 0;
}
.pd-note a,
.pd .hm-head .hm-sub a {
  color: inherit;
}

/* ---------- Product hero: copy, then the machine on the band ---------- */

.pd .dz-band.pd-hero {
  padding-bottom: clamp(24px, 3vw, 40px);
}
.pd-hero .dz-wrap {
  display: grid;
  gap: 24px;
  align-items: center;
}
.pd-hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.pd .pd-hero .dz-display {
  margin-top: 14px;
  font-size: clamp(38px, 7vw, 84px);
}
.pd-tag {
  max-width: 26ch;
  margin-top: 18px;
}
.pd-hero .hm-sub {
  max-width: 44ch;
  margin-top: 14px;
}
.pd-hero .dz-btn {
  margin-top: 28px;
}
.pd-hero .hm-small {
  margin-top: 12px;
}
.pd-hero .dz-link {
  margin-top: 4px;
}
.pd-hero-img {
  width: min(72vw, 420px);
  margin: 0 auto;
}
@media (min-width: 900px) {
  .pd-hero .dz-wrap {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 48px;
  }
  .pd-hero-img {
    width: 100%;
    max-width: 480px;
  }
}

/* ---------- Hub hero: centred, like the home page's ---------- */

.pd .pd-hub-hero .dz-display {
  max-width: 19ch;
  margin-top: 16px;
  font-size: clamp(34px, 6vw, 72px);
}
.pd-hub-hero .hm-sub {
  max-width: 52ch;
  margin-top: 24px;
}
.pd-hub-hero .dz-btn {
  margin-top: 28px;
}
.pd-hub-hero .hm-small {
  margin-top: 12px;
}
.pd-hub-hero .dz-link {
  margin-top: 4px;
}

/* ---------- The facts strip: three on a product page, four on the hub ---------- */

.pd .hm-stats:not(.pd-stats--four) {
  grid-template-columns: minmax(0, 1fr);
  gap: 20px 32px;
  border-bottom: 0;
}
@media (min-width: 640px) {
  .pd .hm-stats:not(.pd-stats--four) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- The bar that keeps the action in reach ---------- */

.pd-bar {
  position: sticky;
  top: calc(var(--dz-head-h) + 1px);
  z-index: 900;
  border-top: 1px solid var(--dz-line-strong);
  border-bottom: 1px solid var(--dz-line-strong);
  background: var(--dz-white);
}
.pd-bar .dz-wrap {
  display: flex;
  align-items: center;
  gap: 8px 28px;
  min-height: 60px;
}
.pd-bar-name {
  display: none;
  margin-right: auto;
  font-weight: 700;
  white-space: nowrap;
}
.pd-bar ul {
  display: none;
  gap: 28px;
}
.pd-bar ul a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  color: var(--dz-steel);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.pd-bar ul a:hover {
  color: var(--dz-ink);
  text-decoration-color: currentColor;
}
.pd-bar .dz-btn {
  flex: 1 1 auto;
}
@media (min-width: 560px) {
  .pd-bar-name {
    display: block;
  }
  .pd-bar .dz-btn {
    flex: none;
  }
}
@media (min-width: 1024px) {
  .pd-bar ul {
    display: flex;
  }
}

/* ---------- The numbers that decide it ---------- */

.pd-numbers {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.pd-charts {
  display: grid;
  align-content: start;
  gap: 36px;
}
.pd-chart h3 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}
.pd-chart ul {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
/* A row is the machine and its figure, with the bar under both. The bar is a
   share of the full row, so every bar in a chart is on one scale. */
.pd-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
}
.pd-row-name {
  font-size: 14px;
  color: var(--dz-steel);
}
.pd-row .dz-mono {
  font-size: 14px;
  color: var(--dz-steel);
}
.pd-row.is-current .pd-row-name,
.pd-row.is-current .dz-mono {
  color: var(--dz-ink);
}
.pd-row-bar {
  flex: none;
  width: calc(var(--w) * 1%);
  min-width: 4px;
  height: 10px;
  margin-right: calc(100% - var(--w) * 1%);
  border-radius: 0 var(--dz-radius) var(--dz-radius) 0;
  background: var(--dz-steel-light);
}
.pd-row.is-current .pd-row-bar {
  background: var(--dz-brand);
}
/* The charts sit side by side once there is room, one per column. */
@media (min-width: 860px) {
  .pd-charts {
    display: flex;
    flex-wrap: wrap;
    gap: 36px 56px;
  }
  .pd-chart {
    flex: 1 1 220px;
  }
  .pd-charts > .hm-small {
    flex-basis: 100%;
  }
}

/* ---------- What it prints well, and where it stops ---------- */

.pd-fit {
  display: grid;
  gap: 40px 56px;
}
.pd-fit figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--dz-radius-md);
}
.pd-fit figcaption {
  margin-top: 10px;
}
.pd-list {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}
.pd-list strong {
  display: block;
  font-weight: 700;
}
.pd-list .hm-small {
  max-width: 44ch;
  margin-top: 2px;
}
/* A quiet link to the machine that fits better. */
.pd-see {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  color: var(--dz-ink);
  text-decoration: underline;
  text-decoration-color: var(--dz-link-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.pd-see:hover {
  text-decoration-color: currentColor;
}
.pd-list .pd-see {
  margin-bottom: -10px;
}
@media (min-width: 760px) {
  .pd-fit {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pd-fit--photo figure {
    grid-column: 1 / -1;
    max-width: 560px;
  }
}
@media (min-width: 1100px) {
  .pd-fit--photo {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  }
  .pd-fit--photo figure {
    grid-column: auto;
  }
}

.pd-near {
  margin-top: var(--hm-gap);
  padding-top: 28px;
  border-top: 1px solid var(--dz-line-strong);
}
.pd-near ul {
  display: grid;
  gap: 20px 48px;
  margin-top: 16px;
}
.pd-near li a {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 88px;
  color: var(--dz-ink);
  text-decoration: none;
}
.pd-near .dz-scale {
  flex: none;
  width: 104px;
}
.pd-near li span {
  display: block;
}
.pd-near strong {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--dz-link-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.pd-near li a:hover strong {
  text-decoration-color: currentColor;
}
.pd-near .dz-link {
  margin-top: 16px;
}
@media (min-width: 760px) {
  .pd-near ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- The full specification ---------- */

.pd-specs {
  width: 100%;
  max-width: 920px;
  border-collapse: collapse;
  border-top: 1px solid var(--dz-line-strong);
}
.pd-specs,
.pd-specs tbody,
.pd-specs tr,
.pd-specs th,
.pd-specs td {
  display: block;
}
.pd-specs th,
.pd-specs td {
  text-align: left;
  vertical-align: top;
}
.pd-specs th {
  padding: 14px 0 4px;
}
.pd-specs td {
  padding: 0 0 14px;
  border-bottom: 1px solid var(--dz-line);
}
.pd-specs td .hm-small {
  display: block;
  margin-top: 4px;
}
.pd-note {
  max-width: 68ch;
  margin-top: 16px;
}
@media (min-width: 640px) {
  .pd-specs {
    display: table;
  }
  .pd-specs tbody {
    display: table-row-group;
  }
  .pd-specs tr {
    display: table-row;
  }
  .pd-specs th,
  .pd-specs td {
    display: table-cell;
    padding: 14px 0;
    border-bottom: 1px solid var(--dz-line);
  }
  .pd-specs th {
    width: 34%;
    padding-right: 24px;
  }
}

/* ---------- Proof: one case ---------- */

.pd-case {
  max-width: 620px;
}

/* ---------- Print My Part, on Ink ---------- */

.pd .dz-band--ink .hm-head {
  margin-bottom: 28px;
}

/* ---------- Hub: the range side by side ---------- */
/* Each machine is a row. On a phone a row is a block with its own labels; on a
   wide screen the rows share one set of columns under a single row of labels. */

.pd-cmp {
  border-top: 1px solid var(--dz-line-strong);
}
.pd-cmp-head {
  display: none;
}
.pd-cmp-row {
  position: relative;
  display: grid;
  gap: 20px;
  padding: 28px 0;
  border-bottom: 1px solid var(--dz-line-strong);
}
.pd-cmp-machine {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.pd-cmp-machine .dz-scale {
  flex: none;
  width: 104px;
}
.pd-cmp-machine .dz-h3 a {
  display: inline-block;
  padding: 10px 0;
  color: var(--dz-ink);
  text-decoration: underline;
  text-decoration-color: var(--dz-link-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.pd-cmp-machine .dz-h3 a:hover {
  text-decoration-color: currentColor;
}
.pd-cmp-row dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
}
.pd-cmp-row dl > div {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}
.pd-cmp-wide {
  grid-column: 1 / -1;
}
.pd-cmp .dz-mono {
  font-size: 14px;
}
.pd-cmp .hm-size {
  margin: 8px 0 0;
}
@media (min-width: 1100px) {
  .pd-cmp-head,
  .pd-cmp-row {
    display: grid;
    grid-template-columns: minmax(0, 2.3fr) minmax(0, 1.5fr) minmax(0, 0.7fr) minmax(0, 0.9fr) minmax(0, 2fr);
    gap: 32px;
    align-items: start;
  }
  .pd-cmp-head {
    padding: 14px 0;
    border-bottom: 1px solid var(--dz-line-strong);
  }
  .pd-cmp-row dl,
  .pd-cmp-row dl > div {
    display: contents;
  }
  .pd-cmp-row dt {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .pd-cmp-row dd {
    padding-top: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ---------- Photos of the jobs a machine is good for ---------- */
.pd-gallery {
  display: grid;
  gap: 24px;
  margin-bottom: 40px;
}
.pd-gallery img {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border-radius: var(--dz-radius-md);
}
.pd-gallery figcaption {
  margin-top: 10px;
}
@media (min-width: 760px) {
  .pd-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Watch it print ---------- */
.pd-videos {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}
.pd-videos > * {
  flex: 1 1 260px;
}

/* ---------- A discontinued machine ---------- */
.pd-discontinued {
  max-width: 56ch;
  margin: 16px 0 24px;
  padding: 16px 20px;
  border-left: 3px solid var(--dz-ink);
  background: var(--dz-snow);
}
.pd-discontinued ul {
  margin: 8px 0;
  padding-left: 18px;
  list-style: disc;
}
.pd-discontinued a {
  color: var(--dz-ink);
  text-decoration: underline;
  text-decoration-color: var(--dz-link-line);
  text-underline-offset: 3px;
}
