/**
 * Healthcare practice page, final pass (2026-11-21). Loaded for its class
 * prefix (site/plugins/peanut-site/extensions/stylesheets.php).
 *
 * What brings you in? (visuals/p09x-explore): a numbered flow of concern
 * and money chips beside a sample practice page in a browser frame (stacked
 * above it when the visual is narrow), the answer chosen last highlighted
 * (concern mint, money butter). What to expect (visuals/p09x-expect): six
 * practice-type buttons, a progress bar while it plays, and the chosen
 * type's three steps on a line (stacked down a line on phones), drawn in
 * one after another. The HTML is the still in both; answers and sequences
 * share one cell, so nothing moves when a script runs. Tokens only. Layer
 * blocks for the static state, layer motion for what moves. Nothing loops.
 */

@layer blocks {
  /* ---------- What brings you in? (visuals/p09x-explore) ---------- */

  /* the visual's own width decides the layout inside */
  .showcase__visual:has(> .p09x-explore) {
    min-width: 0;
    container: p09x-explore / inline-size;
  }

  /* beside the copy, the visual takes the wider column, so the flow and
     the sample page fit side by side */
  @media (min-width: 60rem) {
    .showcase--right:has(> .showcase__visual > .p09x-explore),
    .showcase--left:has(> .showcase__visual > .p09x-explore) {
      grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    }

    .showcase--left:has(> .showcase__visual > .p09x-explore) {
      grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    }
  }

  .p09x-explore {
    display: grid;
    gap: var(--space-3);
    align-items: start;
  }

  .p09x-explore__flow {
    display: grid;
    gap: var(--space-3);
    align-content: start;
    min-width: 0;
  }

  /* the hints are the shared ones (snippets/demo/hint.php, industry.css);
     each keeps its space until the script makes the chips buttons */
  .p09x-explore:not(.is-live) .p09x-explore__hint,
  .p09x-expect:not(.is-live) .p09x-expect__hint {
    visibility: hidden;
  }

  .p09x-explore__step {
    display: grid;
    gap: 0.75rem;
  }

  .p09x-explore__q {
    display: flex;
    gap: 0.625rem;
    align-items: center;
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--step-1);
    font-weight: var(--weight-heading);
    line-height: 1.2;
  }

  .p09x-explore__num {
    display: grid;
    flex: none;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    background: var(--color-brand);
    border: var(--border);
    border-radius: 50%;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
  }

  .p09x-explore__step:nth-child(3) .p09x-explore__num {
    background: var(--color-butter);
  }

  .p09x-explore__chips,
  .p09x-expect__types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .p09x-explore__chips > li,
  .p09x-expect__types > li {
    display: flex;
    min-width: 0;
  }

  .p09x-explore__chip,
  .p09x-expect__type {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    margin: 0;
    padding: 0.5rem 1rem;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
    color: var(--color-ink);
    font: inherit;
    font-size: var(--step--1);
    font-weight: 500;
    line-height: 1.25;
    text-align: start;
  }

  button.p09x-explore__chip,
  button.p09x-expect__type {
    cursor: pointer;
  }

  /* chosen: the still (drawn) and the buttons once the script runs */
  .p09x-explore__chip.is-chosen,
  .p09x-explore__chip[aria-pressed="true"],
  .p09x-expect__type.is-chosen,
  .p09x-expect__type[aria-pressed="true"] {
    background: var(--color-brand);
  }

  .p09x-explore__chip--money.is-chosen,
  .p09x-explore__chip--money[aria-pressed="true"] {
    background: var(--color-butter);
  }

  .p09x-explore__chip:focus-visible,
  .p09x-expect__type:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
  }

  .p09x-explore__mock {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
    margin: 0;
  }

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

  .p09x-explore__frame {
    overflow: hidden;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-sm);
  }

  .p09x-explore__bar {
    display: flex;
    gap: 0.625rem;
    align-items: center;
    min-width: 0;
    margin: 0;
    padding: 0.5rem 0.875rem;
    border-block-end: var(--border);
    font-size: 0.75rem;
  }

  /* three small dots, the browser frame's buttons */
  .p09x-explore__dots {
    flex: none;
    width: 0.375rem;
    height: 0.375rem;
    margin-inline-end: 1.25rem;
    background: var(--color-ink);
    border-radius: 50%;
    box-shadow: 0.625rem 0 0 var(--color-ink), 1.25rem 0 0 var(--color-ink);
    opacity: 0.45;
  }

  .p09x-explore__tag {
    flex: none;
    padding: 0.0625rem 0.5rem;
    background: var(--color-brand);
    border-radius: var(--radius-pill);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .p09x-explore__url {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .p09x-explore__page {
    display: grid;
    gap: 0.75rem;
    padding: var(--space-2);
  }

  /* each kind's answers share one cell: the tallest sets the height */
  .p09x-explore__part {
    display: grid;
    padding: var(--space-2);
    background: var(--color-white);
    border: var(--border);
    border-radius: 0.625rem;
  }

  /* the answer chosen last: concern mint, money butter */
  .p09x-explore[data-last="concern"] .p09x-explore__part--concern {
    background: var(--color-brand);
    box-shadow: var(--shadow-hard);
  }

  .p09x-explore[data-last="money"] .p09x-explore__part--money {
    background: var(--color-butter);
    box-shadow: var(--shadow-hard);
  }

  .p09x-explore__answer {
    display: grid;
    grid-area: 1 / 1;
    gap: 0.5rem;
    align-content: start;
    justify-items: start;
    min-width: 0;
  }

  .p09x-explore__answer[data-off] {
    visibility: hidden;
  }

  .p09x-explore__title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--step-1);
    font-weight: var(--weight-heading);
    line-height: 1.2;
  }

  .p09x-explore__text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
  }

  .p09x-explore__first {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
  }

  .p09x-explore__key {
    display: block;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  /* the sample site's drawn button: a picture, not a control */
  .p09x-explore__btn {
    display: inline-block;
    margin-block-start: 0.25rem;
    padding: 0.4375rem 0.875rem;
    background: var(--color-ink);
    border-radius: var(--radius-pill);
    color: var(--color-white);
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .p09x-explore__cap {
    margin: 0;
    font-size: 0.75rem;
  }

  /* room for both: the flow beside the page */
  @container p09x-explore (min-width: 40rem) {
    .p09x-explore {
      grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
      gap: var(--space-4);
    }
  }

  /* ---------- What to expect (visuals/p09x-expect) ---------- */

  .p09x-expect {
    display: grid;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-sm);
  }

  /* the progress while it plays: the shared bar (snippets/demo/progress.php),
     no wider than the buttons */
  .p09x-expect__progress {
    max-width: 30rem;
  }

  /* the six sequences share one cell: the tallest sets the height */
  .p09x-expect__sets {
    display: grid;
    margin-block-start: var(--space-1);
    padding-block-start: var(--space-3);
    border-block-start: var(--border);
  }

  .p09x-expect__set {
    display: grid;
    grid-area: 1 / 1;
    gap: var(--space-3);
    align-content: start;
    min-width: 0;
  }

  .p09x-expect__set[data-off] {
    visibility: hidden;
  }

  .p09x-expect__kind {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  .p09x-expect__tag {
    padding: 0.0625rem 0.5rem;
    background: var(--color-brand);
    border-radius: var(--radius-pill);
    font-size: 0.625rem;
    letter-spacing: 0.08em;
  }

  .p09x-expect__row {
    --disc: 2.25rem;
    --gap: var(--space-4);
    --p09x-reach: 1 0;
    display: grid;
    gap: var(--space-3) var(--gap);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .p09x-expect__step {
    position: relative;
    display: grid;
    grid-template-columns: var(--disc) minmax(0, 1fr);
    gap: 0.125rem 0.75rem;
    align-content: start;
    align-items: start;
  }

  .p09x-expect__disc {
    grid-row: 1 / 3;
    display: grid;
    place-items: center;
    width: var(--disc);
    height: var(--disc);
    background: var(--color-brand);
    border: var(--border);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
  }

  .p09x-expect__name {
    font-family: var(--font-heading);
    font-size: var(--step-2);
    font-weight: var(--weight-heading);
    line-height: 1.15;
  }

  .p09x-expect__line {
    font-size: var(--step--1);
    line-height: 1.5;
  }

  /* the line: down the disc's column on phones, across to the next disc
     from 48rem */
  .p09x-expect__step:not(:last-child)::before {
    content: "";
    position: absolute;
    top: calc(var(--disc) + 0.375rem);
    bottom: calc(0.375rem - var(--space-3));
    left: calc(var(--disc) / 2 - 0.75px);
    width: 1.5px;
    background: var(--color-ink);
    opacity: 0.45;
    transform-origin: top;
  }

  @media (min-width: 48rem) {
    .p09x-expect {
      padding: var(--space-4);
    }

    .p09x-expect__row {
      --p09x-reach: 0 1;
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .p09x-expect__step {
      grid-template-columns: minmax(0, 1fr);
      gap: 0.375rem;
    }

    .p09x-expect__disc {
      grid-row: auto;
      margin-block-end: 0.375rem;
    }

    .p09x-expect__step:not(:last-child)::before {
      top: calc(var(--disc) / 2 - 0.75px);
      right: calc(0.5rem - var(--gap));
      bottom: auto;
      left: calc(var(--disc) + 0.5rem);
      width: auto;
      height: 1.5px;
      transform-origin: left;
    }
  }

  /* Print: the still as it stands, without the hints and the bar */
  @media print {
    .p09x-explore__part {
      box-shadow: none;
    }

    .p09x-explore__part,
    .p09x-expect__set {
      break-inside: avoid;
    }
  }
}

@layer motion {
  @media screen and (prefers-reduced-motion: no-preference) {
    .p09x-explore.is-live .p09x-explore__chip,
    .p09x-expect.is-live .p09x-expect__type {
      transition: background-color 250ms var(--ease-out), scale 200ms var(--ease-out);
    }

    /* the auto-play's tap: a short press on the chip before it is chosen */
    .p09x-explore__chip.is-tapped {
      scale: 0.93;
    }

    .p09x-explore.is-live .p09x-explore__part {
      transition: background-color 350ms var(--ease-out), box-shadow 350ms var(--ease-out);
    }

    .p09x-explore.is-live .p09x-explore__answer {
      transition: opacity 400ms var(--ease-out), visibility 0s;
    }

    .p09x-explore.is-live .p09x-explore__answer[data-off] {
      opacity: 0;
      transition: opacity 200ms var(--ease-out), visibility 0s 200ms;
    }

    /* a chosen type: the three steps draw in along the line, one after
       another (disc, then words, then the line on to the next) */
    .p09x-expect__set.is-drawing .p09x-expect__disc {
      animation: p09x-pop 420ms var(--ease-out) both;
      animation-delay: calc(var(--i) * 600ms);
    }

    .p09x-expect__set.is-drawing :is(.p09x-expect__name, .p09x-expect__line) {
      animation: p09x-rise 450ms var(--ease-out) both;
      animation-delay: calc(var(--i) * 600ms + 120ms);
    }

    .p09x-expect__set.is-drawing .p09x-expect__step::before {
      animation: p09x-reach 420ms var(--ease-out) both;
      animation-delay: calc(var(--i) * 600ms + 260ms);
    }

    @keyframes p09x-pop {
      from {
        opacity: 0;
        scale: 0.4;
      }
    }

    @keyframes p09x-rise {
      from {
        opacity: 0;
        translate: 0 0.5rem;
      }
    }

    @keyframes p09x-reach {
      from {
        scale: var(--p09x-reach);
      }
    }
  }
}
