/* ============ how-it-works components ============
   Shared by /how-it-works, /how-it-works-greenhouse, /how-it-works-ashby.
   Builds on the p2 design system (p2.css must be loaded first). */

.hiw-hero-lockup {
  margin-top: 30px;
  max-width: 294px;
  width: 100%;
  height: auto;
}

/* ============ video ============ */
.hiw-video-link {
  position: relative;
  display: block;
  max-width: 880px;
  margin: 36px auto 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--p2-shadow);
  line-height: 0;
}

.hiw-video-link img.hiw-video-thumb {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.35s ease;
}

.hiw-video-link:hover img.hiw-video-thumb {
  transform: scale(1.02);
}

.hiw-play-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(34, 60, 49, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 2;
}

.hiw-video-link:hover .hiw-play-wrap {
  background: var(--p2-green);
  transform: translate(-50%, -50%) scale(1.06);
}

.hiw-play-wrap img {
  width: 30px;
  height: 30px;
  margin-left: 4px;
}

/* ============ steps ============ */
.hiw-steps {
  display: flex;
  flex-direction: column;
  gap: 72px;
  margin-top: 56px;
}

.hiw-step {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hiw-step-num {
  font-family: 'PT Serif', Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--p2-green);
  margin-bottom: 12px;
}

.hiw-step h3 {
  font-family: 'PT Serif', Georgia, serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.18;
  color: var(--p2-olive);
  margin: 0 0 16px;
}

.hiw-step p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--p2-ink);
  margin: 0 0 20px;
}

.hiw-step-callout {
  border-left: 3px solid var(--p2-lime);
  background: var(--p2-mist);
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--p2-forest);
  font-weight: 500;
}

.hiw-shot {
  background: linear-gradient(160deg, var(--p2-mist) 0%, #e2efe9 100%);
  border-radius: 20px;
  padding: 28px;
}

.hiw-shot img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 10px 34px rgba(15, 38, 30, 0.16);
}

.hiw-shot-caption {
  font-size: 13px;
  color: #6b7265;
  text-align: center;
  margin-top: 12px;
}

/* ============ inline demo video player ============ */
.hiw-demo-player {
  position: relative;
  line-height: 0;
}

.hiw-demo-player video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 10px 34px rgba(15, 38, 30, 0.16);
  cursor: pointer;
}

.hiw-demo-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(34, 60, 49, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.hiw-demo-player.is-paused .hiw-demo-play {
  opacity: 1;
}

.hiw-demo-play img {
  width: 30px;
  height: 30px;
  margin-left: 4px;
}

@media (max-width: 640px) {
  .hiw-demo-play {
    width: 64px;
    height: 64px;
  }

  .hiw-demo-play img {
    width: 22px;
    height: 22px;
  }
}

/* ============ composite screenshot (popover over base) ============ */
.hiw-composite {
  position: relative;
}

.hiw-composite::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 38, 30, 0.22);
  border-radius: 12px;
  z-index: 1;
  pointer-events: none;
}

.hiw-composite img.hiw-composite-popover {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40%;
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(15, 38, 30, 0.5);
  z-index: 2;
}

/* ============ click-to-enlarge lightbox ============ */
.hiw-shot img.hiw-zoomable {
  cursor: zoom-in;
}

.hiw-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 38, 30, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.hiw-lightbox.is-open {
  opacity: 1;
}

.hiw-lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.hiw-step--flip > .hiw-step-media {
  order: -1;
}

/* ============ feature tour full-width video ============ */
.hiw-tour-video {
  max-width: 880px;
  width: 100%;
  margin: -24px auto 0;
}

/* ============ feature tour chapter dividers ============ */
.hiw-tour-chapter {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: -24px;
}

.hiw-tour-chapter::before,
.hiw-tour-chapter::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--p2-line);
}

.hiw-tour-chapter span {
  font-family: 'PT Serif', Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--p2-green);
  text-align: center;
}

/* ============ integration strip ============ */
.hiw-integration {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
}

.hiw-integration h2 {
  font-family: 'PT Serif', Georgia, serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.18;
  color: var(--p2-olive);
  margin: 0 0 16px;
}

.hiw-integration p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--p2-ink);
  margin: 0;
}

.hiw-integration-logo {
  background: #fff;
  border-radius: var(--p2-radius);
  box-shadow: var(--p2-shadow);
  padding: 40px 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hiw-integration-logo img {
  max-width: 260px;
  width: 100%;
  height: auto;
}

/* ============ advantages ============ */
.hiw-adv-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.hiw-adv-card {
  background: #fff;
  border: 1px solid var(--p2-line);
  border-radius: var(--p2-radius);
  box-shadow: var(--p2-shadow);
  padding: 30px 26px;
}

.hiw-adv-card img {
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
}

.hiw-adv-card h3 {
  font-family: 'PT Serif', Georgia, serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--p2-olive);
  margin: 0 0 10px;
}

.hiw-adv-card p {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--p2-ink);
  margin: 0;
}

/* ============ tools logo wall ============ */
.hiw-tools-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 40px;
}

.hiw-tool {
  background: #fff;
  border: 1px solid var(--p2-line);
  border-radius: var(--p2-radius);
  padding: 22px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 84px;
}

.hiw-tool img {
  max-width: 110px;
  max-height: 40px;
  width: auto;
  height: auto;
}

/* ============ band buttons ============ */
.hiw-band-buttons {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.p2-btn--outline-light {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  color: #fff;
}

.p2-btn--outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
  transform: translateY(-1px);
}

/* ============ responsive ============ */
@media (max-width: 991px) {
  .hiw-step {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hiw-step--flip > .hiw-step-media {
    order: 0;
  }

  .hiw-integration {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hiw-adv-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hiw-tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .hiw-steps {
    gap: 52px;
    margin-top: 40px;
  }

  .hiw-step h3,
  .hiw-integration h2 {
    font-size: 26px;
  }

  .hiw-shot {
    padding: 16px;
  }

  .hiw-adv-grid {
    grid-template-columns: 1fr;
  }

  .hiw-tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hiw-play-wrap {
    width: 64px;
    height: 64px;
  }

  .hiw-play-wrap img {
    width: 22px;
    height: 22px;
  }
}
