/* Canonical FnS QA polish. Keep the existing content, source crops and palette.
   Loaded after fns-typography.css; no shared portfolio styles are changed. */

/* The frozen footer removes the Close focus ring. Restore the modal's existing
   purple keyboard-focus treatment on this page only, without changing hover. */
.fns-case-study .hello-dialog .hello-close:focus-visible {
  outline: 2px solid #7754bf;
  outline-offset: 4px;
}

/* Identify the existing research crops without another heading or card. */
.fns-case-study .fns-tested-label {
  display: block;
  margin-top: 12px;
  font-size: var(--fns-label);
  line-height: 1.45;
  font-weight: 400;
  color: var(--case-muted);
}

/* Hear participants first, then review the two findings and our responses. */
.fns-case-study #research .story-recordings + .fns-paired-findings {
  margin-top: var(--research-block-gap);
}

/* The plastic hand sits beside the full prototype-preference result. */
.fns-case-study #research .case-preference {
  display: flex;
  align-items: center;
  gap: 18px;
}
.fns-case-study #research .fns-preference-thumb {
  display: block;
  width: 104px;
  height: auto;
  flex: none;
  object-fit: contain;
}
.fns-case-study #research .fns-preference-copy { min-width: 0; }
.fns-case-study #research .fns-preference-copy > p {
  margin: 10px 0 0;
}

/* Route the prototype-to-result arrow through the outer gutter, not the text. */
.fns-case-study #research { position: relative; }
.fns-case-study #research .fns-prototype-response {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  overflow: visible;
  pointer-events: none;
  color: var(--case-blue-ink);
  opacity: .55;
  transition: opacity .3s ease .35s;
}
.fns-case-study #research .fns-prototype-response[hidden] { display: none; }
.fns-case-study #research .fns-prototype-response path {
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.fns-case-study #research:has(.case-research-board.case-can-reveal:not(.is-revealed)) .fns-prototype-response {
  opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
  .fns-case-study #research .fns-prototype-response { transition: none; }
}

/* Align the two caption headings and the bottoms of their media. Subgrid shares
   the caption row without equal-height boxes, new crops or stretched imagery. */
@media (min-width: 701px) {
  .fns-case-study #research .case-research-board {
    grid-template-columns: minmax(300px, .95fr) minmax(0, 1fr);
  }
  .fns-case-study .story-size-cut-grid { align-items: end; }

  @supports (grid-template-rows: subgrid) {
    .fns-case-study .story-size-cut-grid:not(:has([data-video-error]:not([hidden]))) {
      grid-template-rows: auto auto;
      row-gap: 25px;
    }
    .fns-case-study .story-size-cut-grid:not(:has([data-video-error]:not([hidden]))) > figure {
      display: grid;
      grid-row: span 2;
      grid-template-rows: subgrid;
      row-gap: 25px;
    }
    .fns-case-study .story-size-cut-grid:not(:has([data-video-error]:not([hidden]))) > figure > :is(a, video) {
      grid-column: 1;
      grid-row: 1;
      align-self: end;
    }
    .fns-case-study .story-size-cut-grid:not(:has([data-video-error]:not([hidden]))) > figure > figcaption {
      grid-column: 1;
      grid-row: 2;
      align-self: start;
      margin-top: 0;
    }
  }
}

/* Four chapter links form two predictable rows before tablet widths can force
   a 3+1 wrap. Native playback and the existing 44px control heights stay intact. */
@media (max-width: 900px) {
  .fns-case-study #research .case-film-chapters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 24px;
  }
  .fns-case-study #research .case-film-chapters button {
    justify-self: start;
  }
}

@media (max-width: 767px) {
  .fns-case-study #research .case-preference { gap: 12px; }
  .fns-case-study #research .fns-preference-thumb { width: 80px; }
  /* Match Mutton's existing mobile roles instead of introducing more sizes.
     Hero, navigation and contact remain outside the unified type selectors. */
  .fns-case-study.fns-type-unified {
    --fns-body: 1rem;
    --fns-subhead: 1.375rem;
    --fns-note: 1.25rem;
  }

  /* Each offline step becomes an open illustration-and-copy row. The original
     five-step order, artwork, gross/net details and all source crops remain. */
  .fns-case-study #the-challenge .case-counter-flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    margin: 28px 0 32px;
    padding: 0;
  }
  .fns-case-study #the-challenge .case-counter-flow > li {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: 20px;
    row-gap: 4px;
    align-content: center;
    min-height: 104px;
    width: 100%;
    grid-column: 1;
    justify-self: stretch;
    text-align: left;
  }
  .fns-case-study #the-challenge .case-counter-flow > li::before,
  .fns-case-study #the-challenge .case-counter-flow > li::after {
    display: none;
  }
  .fns-case-study #the-challenge .case-step-art {
    grid-column: 1;
    grid-row: 1 / span 3;
    align-self: center;
    width: 112px;
    max-width: 100%;
    height: 104px;
    margin: 0;
  }
  .fns-case-study #the-challenge .case-step-index {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
  }
  .fns-case-study #the-challenge .case-counter-flow > li > strong {
    grid-column: 2;
    grid-row: 2;
  }
  .fns-case-study #the-challenge .case-counter-flow > li > span {
    grid-column: 2;
    grid-row: 3;
    max-width: none;
    margin: 0;
  }

  /* The offline price reference needs less height, while the original online
     card keeps the full reading width. Do not make two thumbnail columns. */
  .fns-case-study #price-perception .fns-perception-pair {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    margin-top: 28px;
  }
  .fns-case-study #price-perception .fns-perception-pair > figure {
    width: 100%;
    max-width: 480px;
    margin-inline: auto;
  }
  .fns-case-study #price-perception .fns-perception-offline {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    column-gap: 20px;
    row-gap: 8px;
    align-content: center;
  }
  .fns-case-study #price-perception .fns-perception-offline .fns-perception-art {
    grid-column: 1;
    grid-row: 1 / span 2;
    height: 128px;
    align-self: center;
  }
  .fns-case-study #price-perception .fns-perception-offline figcaption {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    margin: 0;
  }
  .fns-case-study #price-perception .fns-perception-offline > p {
    grid-column: 2;
    grid-row: 2;
    margin: 0;
  }
  .fns-case-study #price-perception .fns-perception-online figcaption {
    margin-bottom: 16px;
  }
  .fns-case-study #price-perception .fns-original-card { margin-top: 0; }
  .fns-case-study #price-perception .fns-perception-online > p { margin-top: 12px; }
  .fns-case-study #price-perception .fns-perception-change { display: none; }

  /* Retain the familiar 2+2+1 questions, with the shared 22px mobile subhead.
     Extend the existing small-screen arrangement through the same breakpoint. */
  .fns-case-study #core-problems .fns-pain-points {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px 24px;
  }
  .fns-case-study #core-problems .fns-pain-point {
    grid-column: span 1;
  }
  .fns-case-study #core-problems .fns-pain-point:last-child {
    grid-column: 1 / -1;
  }
}

/* Preserve the existing narrow-phone gutter; the type-role change provides the
   extra breathing room without taking more width away from either question. */
@media (max-width: 420px) {
  .fns-case-study #core-problems .fns-pain-points { column-gap: 18px; }
}
