/* ================================================================
   Wilson & Farr: scroll animations (js/wf-molecules.js)
   Loaded only on the pages that use them. Uses the colour variables from site.css.
================================================================ */

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

/* ── Held animation: sits below a section's copy and photo. The picture holds in the middle of the
   screen while the scroll plays it through, then lets go. The runway is how much scrolling that takes. ── */
.wfx-hold { margin-top: 56px; }
.wfx-band { max-width: 560px; margin: 0 auto; }
/* the runway is a spacer inside the box, because a pinned element cannot travel into its parent's padding */
.wfx-on .wfx-hold::after { content: ''; display: block; height: 95vh; }
.wfx-on .wfx-hold .wfx-band { position: -webkit-sticky; position: sticky; top: 84px; }
.wfx-band .wfx-canvas { height: 300px; height: min(300px, calc(100vh - 190px)); height: min(300px, calc(100svh - 190px)); min-height: 160px; border-radius: 12px; background: #060606; }
/* the caption sits above the picture, so visitors know what they are about to see */
.wfx-band figcaption {
  font-size: 16px; font-weight: 600; color: var(--white); line-height: 1.5;
  margin: 0 auto 14px; max-width: 46ch; text-align: center;
}
.wfx-band figcaption::before {
  content: ''; display: block; width: 32px; height: 2px;
  background: var(--green); margin: 0 auto 12px;
}

/* ── Pinned animation: the picture holds under the nav while its steps scroll past ── */
.wfx-scene { --wfx-bg: var(--black); --wfx-nav: 68px; margin-top: 40px; }
.wfx-stage {
  position: -webkit-sticky; position: sticky; top: var(--wfx-nav); z-index: 2;
  height: 46vh; height: 46svh; min-height: 290px;
  background: var(--wfx-bg);
  border-bottom: 1px solid var(--dark-border);
  display: flex; align-items: center; justify-content: center;
  padding: 10px 0;
}
.wfx-stage .wfx-canvas { height: 100%; max-width: 480px; }
.wfx-steps { padding-bottom: 30vh; }
.wfx-step { min-height: 68vh; min-height: 68svh; padding-top: 36px; max-width: 46ch; }
.wfx-num {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--green); color: var(--black);
  font-size: 17px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.wfx-step h3 { font-size: 20px; font-weight: 800; color: var(--green); letter-spacing: 0.04em; margin-bottom: 6px; }
.wfx-step h4 {
  font-size: 13px; font-weight: 600; color: var(--gray);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px;
}
.wfx-step p { font-size: 16px; color: var(--gray); line-height: 1.7; }

/* Phones: each point's text holds just below the picture while it is the one being shown,
   so the number and title never slide up behind the picture. The script sets --wfx-text-top. */
@media (max-width: 899px) {
  .wfx-step-in { position: -webkit-sticky; position: sticky; top: var(--wfx-text-top, 60vh); }
  .wfx-body { display: flow-root; }
  .wfx-steps { padding-bottom: 0; }
}

/* only dim the inactive steps when the animation is running */
.wfx-on .wfx-step { opacity: 0.28; transition: opacity .35s ease; }
.wfx-on .wfx-step.wfx-active { opacity: 1; }
.wfx-on .wfx-step.wfx-active p { color: #c9c9c9; }

@media (min-width: 900px) {
  .wfx-band .wfx-canvas { height: 340px; height: min(340px, calc(100vh - 190px)); height: min(340px, calc(100svh - 190px)); }
  .wfx-on .wfx-hold::after { height: 85vh; }
  .wfx-body { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 72px; }
  .wfx-stage {
    height: calc(100vh - var(--wfx-nav)); height: calc(100svh - var(--wfx-nav));
    border-bottom: 0; align-self: start; padding: 24px 0;
  }
  .wfx-stage .wfx-canvas { max-width: 540px; }
  .wfx-steps { padding-bottom: 56vh; }
  .wfx-step { min-height: 92vh; min-height: 92svh; padding-top: 0; display: flex; flex-direction: column; justify-content: center; }
}

/* ── Small phones: a shorter picture leaves more room for the step text ── */
@media (max-width: 899px) and (max-height: 700px) {
  .wfx-stage { height: 36vh; height: 36svh; min-height: 190px; }
  .wfx-num { width: 32px; height: 32px; font-size: 15px; margin-bottom: 10px; }
  .wfx-step h3 { font-size: 18px; }
  .wfx-step h4 { margin-bottom: 10px; }
  .wfx-step p { font-size: 15px; line-height: 1.6; }
}

/* ── Phones turned sideways: picture and steps side by side, as on desktop ── */
@media (min-width: 560px) and (max-width: 899px) and (max-height: 540px) {
  .wfx-body { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 32px; }
  .wfx-stage {
    height: calc(100vh - var(--wfx-nav)); height: calc(100svh - var(--wfx-nav));
    min-height: 0; border-bottom: 0; align-self: start; padding: 12px 0;
  }
  .wfx-steps { padding-bottom: 50vh; }
  .wfx-step { min-height: 100vh; min-height: 100svh; padding-top: 0; display: flex; flex-direction: column; justify-content: center; }
  .wfx-step p { font-size: 15px; }
  .wfx-step-in { position: static; }
}
