/* Home page. The design system covers site pages, the portal and datasheets but has no
   landing page sections, so the hero and the FAQ list are laid out here from its tokens and
   components. One deliberate step past the system: the hero title is 40px (its h1 is 32px).
   Content stays on white; tables carry the system's green rule. */

/* Hero: the part number box is the first step of the tool, beside the dimension drawing */
.wf-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-6);
  align-items: center;
  padding-top: var(--space-7);
  padding-bottom: var(--space-7);
  border-bottom: var(--hairline) solid var(--grey-100);
}

.wf-hero h1 {
  margin: var(--space-3) 0 0;
  font: 600 40px/48px var(--font-sans);
  color: var(--ink);
}

.wf-hero-lead {
  margin: var(--space-4) 0 0;
  max-width: 580px;
  font-size: 18px;
  line-height: 28px;
  color: var(--gray-700);
}

.wf-hero-form {
  margin-top: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 520px;
}

.wf-hero-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.wf-hero-form-row .rt-input {
  flex: 1 1 220px;
  min-height: 44px;
  font-size: 16px;
}

.wf-hero-alt {
  align-self: flex-start;
  font-size: 14px;
  line-height: 20px;
}

.wf-hero-note {
  margin: var(--space-4) 0 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--gray-500);
}

/* The drawing fills its column, about the height of the hero text */
.wf-hero-drawing {
  margin: 0;
  justify-self: center;
  width: 100%;
  max-width: 400px;
}

.wf-hero-drawing figcaption,
.wf-checks-figure figcaption {
  margin-top: var(--space-2);
  font-size: 12px;
  line-height: 16px;
  color: var(--gray-500);
}

/* Content blocks */
.wf-block {
  padding-top: var(--space-7);
  padding-bottom: var(--space-2);
}

.wf-block h2,
.wf-cta h2 {
  margin: 0;
  font: 600 24px/36px var(--font-sans);
  color: var(--ink);
}

.wf-block-intro {
  margin: var(--space-2) 0 0;
  max-width: 640px;
  font-size: 16px;
  line-height: 24px;
  color: var(--gray-500);
}

/* What goes wrong: the drawing (wake.js) with its readout, beside the four steps */
.wf-wake {
  margin-top: var(--space-5);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--space-5);
  align-items: start;
}

.wf-wake-stage {
  overflow: hidden;
  border: var(--hairline) solid var(--grey-100);
  border-radius: var(--radius-lg);
  background: var(--white);
}

.wf-wake-canvas {
  display: block;
  width: 100%;
}

.wf-wake-hud {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: var(--hairline) solid var(--grey-100);
}

.wf-wake-hud > div {
  padding: var(--space-2);
  border-left: var(--hairline) solid var(--grey-100);
}

.wf-wake-hud > div:first-child {
  border-left: 0;
}

.wf-wake-hud dt {
  font-size: 11px;
  line-height: 16px;
  color: var(--gray-500);
}

.wf-wake-hud dd {
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  line-height: 22px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.wf-wake-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: var(--hairline) solid var(--grey-100);
}

.wf-wake-step {
  position: relative;
  display: block;
  width: 100%;
  padding: var(--space-3) 0;
  border: 0;
  border-bottom: var(--hairline) solid var(--grey-100);
  background: none;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

/* Progress through the active step, drawn along its bottom rule */
.wf-wake-step::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: calc(var(--p, 0) * 100%);
  background: var(--green-700);
}

.wf-wake-step-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  font-size: 15px;
  line-height: 22px;
}

.wf-wake-step-n {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--grey-50);
  color: var(--gray-500);
  font-family: var(--font-mono);
  font-size: 12px;
}

.wf-wake-step:hover .wf-wake-step-head {
  color: var(--green-700);
}

.wf-wake-step.is-active .wf-wake-step-n {
  background: var(--green-700);
  color: var(--white);
}

.wf-wake-step-text {
  display: none;
  margin: var(--space-2) 0 0 30px;
  font-size: 14px;
  line-height: 22px;
  color: var(--gray-700);
}

.wf-wake-step.is-active .wf-wake-step-text {
  display: block;
}

.wf-wake-controls {
  margin-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* Replay is hidden once the play button offers it, and both are hidden without motion,
   where the steps are single frames */
.wf-wake [data-replay][hidden],
.wf-wake.is-static [data-play],
.wf-wake.is-static [data-replay] {
  display: none;
}

.wf-wake-note {
  margin: var(--space-3) 0 0;
  max-width: 720px;
  font-size: 13px;
  line-height: 20px;
  color: var(--gray-500);
}

/* What it checks: one table with the example's values; the example is named in the caption */
.wf-checks-figure {
  margin: var(--space-5) 0 0;
}

.wf-checks td,
.wf-checks th,
.wf-scope td,
.wf-scope th {
  font-size: 14px;
  line-height: 22px;
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
  vertical-align: middle;
}

.wf-checks td:first-child {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

.wf-checks td.num,
.wf-checks th.num {
  white-space: nowrap;
}

.wf-checks-figure figcaption {
  margin-top: var(--space-3);
  font-size: 14px;
  line-height: 22px;
}

.wf-checks-figure figcaption .wf-code {
  color: var(--green-700);
  font-size: 13px;
}

/* Open the example in the calculator: a small icon link at the end of the caption */
.wf-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: var(--space-1);
  /* Centers the arrow on the caption's capital letters */
  vertical-align: -3px;
  border-radius: var(--radius-sm);
  color: var(--green-700);
}

.wf-icon-link svg {
  width: 16px;
  height: 16px;
}

.wf-icon-link:hover {
  color: var(--green-800);
  background: var(--grey-25);
}

/* What it covers: a two-column key table under the system's green rule */
.wf-scope {
  margin-top: var(--space-5);
  border-top: 2px solid var(--green-700);
}

.wf-scope th {
  width: 180px;
  color: var(--ink);
  border-bottom: var(--hairline) solid var(--grey-100);
  vertical-align: top;
}

.wf-scope td {
  vertical-align: top;
}

/* Connection and shank options: two videos side by side */
.wf-videos {
  margin-top: var(--space-5);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

.wf-video-card {
  margin: 0;
}

.wf-video-card figcaption {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: 14px;
  line-height: 22px;
}

.wf-video-card figcaption strong {
  color: var(--ink);
  font-weight: 600;
}

/* Need a thermowell: one product photo, the configurator, and the three families */
.wf-cta-wrap {
  padding-top: var(--space-7);
}

.wf-cta {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-5) var(--space-6);
}

.wf-cta-photo {
  display: block;
  width: 160px;
  height: auto;
}

.wf-cta p {
  margin: var(--space-2) 0 0;
  max-width: 600px;
  line-height: 22px;
}

.wf-cta-actions {
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
}

.wf-family-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  font-weight: 600;
}

/* FAQs: native disclosure rows between hairlines */
#faqs {
  padding-bottom: var(--space-7);
}

.wf-faq {
  margin-top: var(--space-5);
  border-top: var(--hairline) solid var(--grey-100);
}

.wf-faq details {
  border-bottom: var(--hairline) solid var(--grey-100);
}

.wf-faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  list-style: none;
  cursor: pointer;
  font: 600 16px/24px var(--font-sans);
  color: var(--ink);
}

.wf-faq summary::-webkit-details-marker {
  display: none;
}

.wf-faq summary::after {
  content: "+";
  flex: none;
  font-size: 22px;
  line-height: 24px;
  font-weight: 400;
  color: var(--green-700);
}

.wf-faq details[open] summary::after {
  content: "\2212";
}

.wf-faq summary:hover {
  color: var(--green-700);
}

.wf-faq details p {
  margin: 0 0 var(--space-4);
  max-width: 720px;
  line-height: 22px;
}

.wf-faq-more {
  margin: var(--space-4) 0 0;
  color: var(--gray-500);
}

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

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

  .wf-wake-hud {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .wf-wake-hud > div:nth-child(4) {
    border-left: 0;
  }

  .wf-wake-hud > div:nth-child(n + 4) {
    border-top: var(--hairline) solid var(--grey-100);
  }

  .wf-hero-drawing {
    max-width: 380px;
  }
}

/* On phones the checks table stacks each row between hairlines, as the system's Table does */
@media (max-width: 720px) {
  .wf-videos {
    grid-template-columns: minmax(0, 1fr);
  }

  .wf-checks thead {
    display: none;
  }

  .wf-checks,
  .wf-checks tbody,
  .wf-checks tr,
  .wf-checks td {
    display: block;
    width: 100%;
  }

  .wf-checks {
    border-top: 2px solid var(--green-700);
  }

  .wf-checks tr {
    padding: var(--space-3) 0;
    border-bottom: var(--hairline) solid var(--grey-100);
  }

  .wf-checks td,
  .wf-checks td.num {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-1) 0;
    border: 0;
    text-align: right;
    white-space: normal;
  }

  .wf-checks td::before {
    content: attr(data-label);
    flex: none;
    max-width: 45%;
    text-align: left;
    color: var(--gray-500);
    font-weight: 400;
  }

  .wf-checks td:first-child {
    font-size: 16px;
  }

  .wf-checks td:first-child::before {
    content: none;
  }

  /* The sentence reads left-aligned under its label */
  .wf-checks td:nth-child(2) {
    display: block;
    text-align: left;
  }

  .wf-checks td:nth-child(2)::before {
    display: block;
    max-width: none;
  }

  .wf-checks tbody tr:hover td {
    background: none;
  }

  .wf-cta {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: var(--space-4);
    padding: var(--space-4);
  }

  .wf-cta-photo {
    width: 96px;
  }
}

@media (max-width: 600px) {
  .wf-hero {
    padding-top: var(--space-6);
    padding-bottom: var(--space-6);
  }

  .wf-hero h1 {
    font-size: 30px;
    line-height: 38px;
  }

  .wf-block,
  .wf-cta-wrap {
    padding-top: var(--space-6);
  }

  .wf-scope th {
    width: 110px;
  }
}
