/*
 * The Single Location tier page's own drawings (owner review, 2026-11-26),
 * each in a showcase block:
 *   sl-arrive  "They come to you": five questions beside a sample page on a
 *              phone and a sample business profile card (sl-arrive.js)
 *   sl-calls   under sl-arrive's systems block: the Sample list from the call
 *              (three rows, a real table that stacks on phones)
 *   sl-move    the move plan: four rows from old address to new, ticked
 * Linked only on pages whose markup has a class starting with sl-
 * (site/plugins/peanut-site/extensions/stylesheets.php), so every selector
 * here names one. The hint, progress bar and sample controls are the shared
 * ones (industry.css); sl-move takes the bp-sheet table look from blog.css.
 *
 * Tokens only, no hex or rgb() value. Layer blocks for the static state,
 * layer motion for what moves. Nothing loops.
 */

@layer blocks {
  /* ---------- sl-arrive: the demo ---------- */

  .sl-arrive {
    display: grid;
    gap: var(--space-5);
  }

  .sl-arrive__demo {
    position: relative;
    display: grid;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-3) var(--space-3);
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-sm);
  }

  /* the demo's one Sample label, just above its top-left corner */
  .sl-arrive__sample,
  .sl-move__sample {
    margin: 0;
    padding: 0.125rem 0.5rem;
    background: var(--color-paper);
    color: var(--color-ink);
    border: var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    line-height: 1.5;
    text-transform: uppercase;
  }

  .sl-arrive__sample {
    position: absolute;
    top: calc(-0.75rem - 1px);
    left: var(--space-3);
  }

  .sl-arrive__ask {
    display: grid;
    align-content: start;
    gap: var(--space-2);
  }

  /* the number shared by a question, its part of the page and its card line */
  .sl-arrive__num {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid var(--color-ink);
    border-radius: 50%;
    background: var(--color-white);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
  }

  /* no script: the questions as a plain numbered list */
  .sl-arrive__list,
  .sl-arrive__qs {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .sl-arrive__list[hidden],
  .sl-arrive__pick[hidden] {
    display: none;
  }

  .sl-arrive__item {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    font-size: var(--text-body);
    line-height: 1.45;
  }

  .sl-arrive__pick {
    display: grid;
    gap: var(--space-2);
  }

  .sl-arrive__q {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    min-height: 2.75rem;
    margin: 0;
    padding: 0.5rem 1rem 0.5rem 0.625rem;
    background: var(--color-white);
    border: 1px solid var(--color-ink);
    border-radius: var(--radius-sm);
    color: var(--color-ink);
    font: inherit;
    font-size: var(--text-body);
    font-weight: 500;
    line-height: 1.4;
    text-align: start;
    cursor: pointer;
  }

  .sl-arrive__q[aria-pressed="true"] {
    background: var(--color-ink);
    color: var(--color-white);
  }

  .sl-arrive__q[aria-pressed="true"] .sl-arrive__num {
    background: var(--color-brand);
    color: var(--color-ink);
  }

  .sl-arrive__q:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
  }

  /* the phone and the card */
  .sl-arrive__screens {
    display: grid;
    gap: var(--space-3);
    align-items: start;
  }

  .sl-arrive__phone {
    overflow: hidden;
    width: 100%;
    max-width: 22rem;
    justify-self: center;
    background: var(--color-white);
    border: 1px solid var(--color-ink);
    border-radius: 1.75rem;
    box-shadow: var(--shadow-hard);
  }

  .sl-arrive__bar {
    margin: 0;
    padding: 0.625rem 1rem 0.5rem;
    background: var(--color-paper);
    border-block-end: 1px solid var(--color-ink);
    font-size: 0.75rem;
    text-align: center;
  }

  .sl-arrive__page {
    display: grid;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .sl-arrive__brand {
    margin: 0 0 0.25rem;
    font-family: var(--font-heading);
    font-size: var(--step-1);
    font-weight: var(--weight-heading);
    line-height: 1.2;
  }

  .sl-arrive__where {
    display: block;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
  }

  .sl-arrive__part {
    display: flex;
    gap: 0.625rem;
    padding: 0.625rem;
    border: 1px solid var(--color-ink-line-faint);
    border-radius: var(--radius-sm);
    background: var(--color-white);
  }

  .sl-arrive__part.is-lit,
  .sl-arrive__line.is-lit {
    background: var(--color-mint-pale);
    border-color: var(--color-ink);
  }

  .sl-arrive__parttext {
    display: grid;
    gap: 0.125rem;
    min-width: 0;
  }

  .sl-arrive__kicker,
  .sl-arrive__cardcap {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  .sl-arrive__title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
  }

  .sl-arrive__text {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
  }

  /* a drawn button (the shared sample-btn look: an ink line, no fill) */
  .sl-arrive__btn {
    justify-self: start;
    margin: 0.375rem 0 0;
    padding: 0.375rem 0.75rem;
    border-radius: 2px;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .sl-arrive__card {
    display: grid;
    gap: 0.25rem;
    width: 100%;
    max-width: 22rem;
    justify-self: center;
    padding: var(--space-3);
    background: var(--color-white);
    border: 1px solid var(--color-ink);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hard);
  }

  .sl-arrive__cardname {
    margin: 0.25rem 0 0;
    font-family: var(--font-heading);
    font-size: var(--step-1);
    font-weight: var(--weight-heading);
    line-height: 1.2;
  }

  .sl-arrive__cardtype {
    margin: 0;
    font-size: 0.8125rem;
  }

  .sl-arrive__lines {
    display: grid;
    gap: 0.375rem;
    margin: 0.5rem 0 0;
  }

  .sl-arrive__line {
    display: grid;
    gap: 0.125rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--color-ink-line-faint);
    border-radius: var(--radius-sm);
  }

  .sl-arrive__line dt {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
  }

  .sl-arrive__line dd {
    margin: 0;
    font-size: 0.875rem;
  }

  .sl-arrive__cardnote {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
  }

  /* the systems block, the closing line and the button under the demo */
  .sl-arrive__after {
    display: grid;
    gap: var(--space-3);
    max-width: 44rem;
  }

  /* under the centered head and the full-width sample: the systems block in
     the middle too, its words left-aligned (bulk fixes A1, 2026-11-29) */
  @media (min-width: 64rem) {
    .sl-arrive__after {
      margin-inline: auto;
    }
  }

  .sl-arrive__more {
    display: grid;
    gap: var(--space-1);
  }

  .sl-arrive__moretitle {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--step-2);
    font-weight: var(--weight-heading);
    line-height: 1.25;
  }

  .sl-arrive__moretext > * {
    margin: 0;
  }

  .sl-arrive__moretext > * + * {
    margin-top: var(--space-1);
  }

  .sl-arrive__outro {
    margin: 0;
  }

  .sl-arrive__actions {
    margin: 0;
  }

  /* tablets: the questions above, the phone and the card side by side */
  @media (min-width: 40rem) {
    .sl-arrive__screens {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .sl-arrive__phone,
    .sl-arrive__card {
      justify-self: stretch;
    }
  }

  /* wide: the questions with the profile card under them on the left, the
     phone on the right, so neither column is left half empty */
  @media (min-width: 64rem) {
    .sl-arrive__demo {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      grid-template-areas:
        "ask phone"
        "card phone";
      grid-template-rows: auto 1fr;
      align-items: start;
      column-gap: var(--space-5);
      padding: var(--space-5) var(--space-5) var(--space-4);
    }

    .sl-arrive__ask {
      grid-area: ask;
    }

    .sl-arrive__screens {
      display: contents;
    }

    .sl-arrive__phone {
      grid-area: phone;
      max-width: 24rem;
      justify-self: center;
    }

    .sl-arrive__card {
      grid-area: card;
      max-width: none;
    }
  }

  /* ---------- sl-calls: the Sample list from the call (under the systems block) ---------- */

  .sl-calls {
    display: grid;
    gap: var(--space-2);
    margin: 0;
  }

  .sl-calls__table {
    min-width: 0;
  }

  .sl-calls__table :is(th, td) {
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: top;
  }

  .sl-calls__table tbody .sl-calls__ask {
    background: none;
    font-weight: 600;
  }

  /* phones: each row stacks (the question, then where it is answered, then the system), each cell
     after its column's name, so the page never scrolls sideways */
  @media (max-width: 39.99rem) {
    .sl-calls__table thead {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
    }

    .sl-calls__table,
    .sl-calls__table tbody,
    .sl-calls__row {
      display: block;
    }

    .sl-calls__row {
      padding: 0.75rem;
      border-block-end: var(--border);
    }

    .sl-calls__row:last-child {
      border-block-end: 0;
    }

    .sl-calls__table :is(.sl-calls__ask, .sl-calls__where, .sl-calls__system) {
      display: block;
      padding: 0;
      border: 0;
    }

    .sl-calls__where,
    .sl-calls__system {
      margin-block-start: 0.25rem;
    }

    .sl-calls__where::before,
    .sl-calls__system::before {
      content: attr(data-label) ": ";
      font-weight: 600;
    }
  }

  /* ---------- sl-move: the move plan ---------- */

  .sl-move {
    display: grid;
    gap: var(--space-2);
    margin: 0;
  }

  .sl-move__cap {
    display: flex;
    gap: 0.625rem;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  .sl-move__sheet {
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-sm);
  }

  .sl-move__table {
    min-width: 0;
  }

  /* the addresses wrap, so the four columns always fit their box */
  .sl-move__table :is(th, td) {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .sl-move__table tbody .sl-move__what {
    background: none;
  }

  .sl-move__what {
    font-weight: 600;
    text-align: start;
    white-space: normal;
  }

  .sl-move__old {
    color: var(--color-ink);
    text-decoration: line-through;
    text-decoration-thickness: 1px;
  }

  .sl-move__arrow {
    margin-inline-end: 0.375rem;
  }

  .sl-move__done {
    width: 3rem;
  }

  .sl-move__tick {
    display: block;
    fill: var(--color-brand);
    stroke: var(--color-ink);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* phones: each row stacks, so the page never scrolls sideways */
  @media (max-width: 39.99rem) {
    .sl-move__table thead {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
    }

    .sl-move__table,
    .sl-move__table tbody {
      display: block;
    }

    .sl-move__row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 0.25rem 0.75rem;
      padding: 0.75rem;
      border-block-end: var(--border);
    }

    .sl-move__row:last-child {
      border-block-end: 0;
    }

    .sl-move__table :is(.sl-move__what, .sl-move__old, .sl-move__new, .sl-move__done) {
      padding: 0;
      border: 0;
      white-space: normal;
      overflow-wrap: anywhere;
    }

    .sl-move__what {
      grid-column: 1;
    }

    .sl-move__done {
      grid-column: 2;
      grid-row: 1 / span 3;
      align-self: center;
    }

    .sl-move__old,
    .sl-move__new {
      grid-column: 1;
    }
  }
}

@layer motion {
  @media screen and (prefers-reduced-motion: no-preference) {
    /* a lit part or card line fades its fill in */
    .sl-arrive__part,
    .sl-arrive__line {
      transition: background-color 250ms var(--ease), border-color 250ms var(--ease);
    }

    /* the move plan: the ticks wait for the drawing to be seen, then tick one by one */
    html.js-motion .showcase__visual[data-play]:not(.is-in) .sl-move__tick {
      opacity: 0;
      scale: 0.6;
    }

    .showcase__visual[data-play].is-in .sl-move__tick {
      transition: opacity 300ms var(--ease), scale 300ms var(--ease);
    }

    .showcase__visual[data-play].is-in .sl-move__row:nth-child(2) .sl-move__tick {
      transition-delay: 450ms;
    }

    .showcase__visual[data-play].is-in .sl-move__row:nth-child(3) .sl-move__tick {
      transition-delay: 900ms;
    }

    .showcase__visual[data-play].is-in .sl-move__row:nth-child(4) .sl-move__tick {
      transition-delay: 1350ms;
    }
  }
}
