/*
 * Scroll mockup, layout "callouts" (site/snippets/jobmap/callouts.php; the
 * play cafe page's "What it needs to do", 2026-11-18). On top of
 * jobmap.css: wide screens put the mockup in the middle column, larger, and
 * the items in the side columns (odd ones left, even ones right, each two
 * rows tall and offset by one, so they sit level with their parts), with
 * leader lines drawn by public/assets/js/jobmap-lines.js. Tablets: the
 * mockup on top, the items two across; phones: the mockup, then the list.
 * Linked in the body right before the section. Layer: blocks. Tokens only.
 */

@layer blocks {
  .jobmap--callouts .jobmap__board {
    position: relative;
    margin-block-start: var(--space-5);
  }

  .jobmap--callouts .jobmap__stage {
    max-width: 22rem;
    padding: var(--space-2) var(--space-2) 0;
  }

  /* the phone a size up from the scroll layout's */
  .jobmap--callouts .p02-mock {
    font-size: 0.8125rem;
  }

  /* markers: level with the middle of their part, on the callout's side,
     on the phone's edge, clear of the part's own content */
  .jobmap--callouts .mock__mark {
    inset-block-start: 50%;
    inset-inline-start: -1.625rem;
    translate: 0 -50%;
  }

  .jobmap--callouts .mock__mark--right {
    inset-inline-start: auto;
    inset-inline-end: -1.625rem;
  }

  .jobmap__lines {
    display: none;
  }

  @media (min-width: 64rem) {
    .jobmap--callouts .jobmap__board {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(19rem, 23rem) minmax(0, 1fr);
      grid-template-rows: repeat(var(--jobmap-rows, 6), auto);
      column-gap: var(--space-7);
      row-gap: var(--space-3);
      align-items: center;
    }

    .jobmap--callouts .jobmap__stage {
      grid-column: 2;
      grid-row: 1 / -1;
      width: 100%;
      max-width: none;
      padding: 0;
    }

    .jobmap--callouts .p02-mock {
      font-size: 0.875rem;
    }

    .jobmap--callouts .jobmap__jobs {
      display: grid;
      grid-column: 1 / -1;
      grid-row: 1 / -1;
      grid-template-columns: subgrid;
      grid-template-rows: subgrid;
      margin: 0;
      pointer-events: none;
    }

    .jobmap--callouts .jobmap__job {
      position: relative;
      z-index: 1;
      align-self: center;
      grid-row: var(--jobmap-row, 1) / span 2;
      pointer-events: auto;
    }

    .jobmap--callouts .jobmap__job--left {
      grid-column: 1;
    }

    .jobmap--callouts .jobmap__job--right {
      grid-column: 3;
    }

    /* the leader lines: one SVG over the whole board, below the callouts */
    .jobmap--callouts .jobmap__lines {
      position: absolute;
      inset: 0;
      z-index: 0;
      display: block;
      width: 100%;
      height: 100%;
      overflow: visible;
      pointer-events: none;
    }

    .jobmap__line {
      fill: none;
      stroke: var(--color-ink);
      stroke-width: 1;
      stroke-linecap: round;
      stroke-linejoin: round;
      opacity: 0.4;
      transition: opacity 200ms var(--ease-out), stroke-width 200ms var(--ease-out);
    }

    .jobmap__line-end {
      fill: var(--color-ink);
      opacity: 0.4;
      transition: opacity 200ms var(--ease-out);
    }

    .jobmap__line.is-lit,
    .jobmap__line-end.is-lit {
      opacity: 1;
    }

    .jobmap__line.is-lit {
      stroke-width: 1.5;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .jobmap__line,
    .jobmap__line-end {
      transition: none;
    }
  }
}
