/*
 * Childcare center page (classes p03-) and the two blocks its brief
 * introduced, which any page can use: the Checklist demo (checklist) and the
 * Two-view flip (flip). Linked only on pages with those classes
 * (peanut_scoped_css()). Tokens only. Layer blocks for the static state,
 * layer motion for what moves (docs/design/components.md, "Industry pages").
 */

@layer blocks {
  /* ---------- Live card childcare-openings: three rooms, the tap, the
     "Book a tour" button with the room already picked ---------- */

  .p03-room {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
  }

  .p03-room--wait {
    opacity: 0.7;
  }

  .p03-room--open {
    background: var(--color-brand);
  }

  .p03-room.is-tapped {
    box-shadow: inset 0 0 0 1.5px var(--color-ink);
  }

  .p03-book {
    display: flex;
    gap: var(--space-1);
    align-items: center;
    margin-block-start: var(--space-2);
  }

  .p03-book__pick {
    padding: 0.3125rem 0.625rem;
    background: var(--color-brand);
    border: var(--border);
    border-radius: var(--radius-pill);
    font-weight: 500;
    white-space: nowrap;
  }

  .p03-book__btn {
    flex: 1;
    padding: 0.5625rem 0.5rem;
    background: var(--color-ink);
    color: var(--color-white);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: var(--tracking-caps);
    text-align: center;
    text-transform: uppercase;
  }

  /* ---------- The drawings' own parts (problems, the fan-out, the two
     small drawings): the static drawing is the finished one ---------- */

  .diagram .p03-grey {
    opacity: 0.5;
  }

  .diagram .p03-row {
    stroke: var(--color-ink);
    stroke-width: 1.2;
  }

  /* care-openings: the broken link between the page and its openings */
  .diagram .p03-link {
    fill: none;
    stroke: var(--color-ink);
    stroke-width: 1.5;
    stroke-dasharray: 3 3;
    opacity: 0.6;
  }

  /* care-tour: the dropdown's caret, and "Tour", tiny and grey at the bottom */
  .diagram .p03-caret {
    fill: none;
    stroke: var(--color-ink);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .diagram .p03-tiny {
    font-size: 6.5px;
    opacity: 0.4;
  }

  .diagram .p03-chip {
    opacity: 1;
    stroke-width: 1.2;
  }

  .diagram .p03-ontext {
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    fill: var(--color-white);
  }

  .diagram .p03-strong {
    font-weight: 600;
  }

  /* ---------- Every center, its own page (visuals/p03-centers.php): three
     sample center cards and a dashed "Your next center"; equal height,
     real padding, the pills wrap ---------- */

  .showcase:has(.p03-centers) .showcase__intro {
    max-width: 32rem;
  }

  .p03-centers {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .p03-cc {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
    padding: var(--space-3);
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--step--1);
    line-height: 1.45;
  }

  .p03-cc__head {
    display: flex;
    gap: var(--space-2);
    align-items: center;
  }

  .p03-cc__avatar {
    flex: none;
    width: 2.5rem;
    height: 2.5rem;
  }

  .p03-cc__avatar circle:first-child {
    stroke: var(--color-ink);
    stroke-width: 1.5;
  }

  .p03-cc__avatar--mint circle:first-child {
    fill: var(--color-brand);
  }

  .p03-cc__avatar--coral circle:first-child {
    fill: var(--color-accent-2);
  }

  .p03-cc__avatar--gold circle:first-child {
    fill: var(--color-gold-soft);
  }

  .p03-cc__face {
    fill: var(--color-white);
    stroke: var(--color-ink);
    stroke-width: 1.5;
  }

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

  .p03-cc__director {
    margin: 0.125rem 0 0;
  }

  .p03-cc__rooms {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-1);
  }

  .p03-cc__thumb {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 64 / 44;
    border: var(--border);
    border-radius: 0.375rem;
  }

  .p03-th__bg-mint,
  .p03-th__mint {
    fill: var(--color-brand);
  }

  .p03-th__bg-butter,
  .p03-th__butter {
    fill: var(--color-butter);
  }

  .p03-th__bg-coral,
  .p03-th__coral {
    fill: var(--color-accent-2);
  }

  .p03-th__bg-gold {
    fill: var(--color-gold-soft);
  }

  .p03-th__white {
    fill: var(--color-white);
  }

  :is(.p03-th__mint, .p03-th__butter, .p03-th__coral, .p03-th__white) {
    stroke: var(--color-ink);
    stroke-width: 1;
  }

  .p03-th__line {
    fill: none;
    stroke: var(--color-ink);
    stroke-width: 1;
    stroke-linecap: round;
  }

  .p03-cc__facts {
    display: grid;
    gap: 0.5rem;
    margin: 0;
  }

  .p03-cc__facts dt {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  .p03-cc__facts dd {
    margin: 0.125rem 0 0;
  }

  .p03-cc__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 0.25rem 0 0;
    padding: 0;
    list-style: none;
  }

  .p03-cc__pills li {
    padding: 0.125rem 0.625rem;
    background: var(--color-paper);
    border: var(--border);
    border-radius: var(--radius-pill);
    white-space: nowrap;
  }

  .p03-cc__special {
    margin: 0;
    padding: 0.625rem 0.75rem;
    background: var(--color-butter);
    border-radius: 0.375rem;
  }

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

  /* the sample button "Book a tour": a picture of one (S3), one line */
  .p03-cc__btn {
    margin-block-start: auto;
    padding: 0.75rem 0.5rem;
    background: var(--color-ink);
    color: var(--color-white);
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
  }

  /* pointing at a card with a mouse lifts it a little and its sample button
     reads "Book a tour at this center" (restored, owner, 2026-11-23): a
     mouse-only picture effect. The card stays a picture of a page (S3): not
     focusable, no pointer cursor, no focus style; the words are in the HTML
     either way, so the no-JavaScript text is the same. The lift moves only
     under motion allowed (motion layer); the fourth, dashed card never
     lifts */
  .p03-cc__more {
    display: none;
  }

  @media (hover: hover) and (pointer: fine) {
    .p03-cc:not(.p03-cc--next):hover {
      box-shadow: var(--shadow-hard);
    }

    .p03-cc:not(.p03-cc--next):hover .p03-cc__more {
      display: inline;
    }
  }

  .p03-cc--next {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: var(--space-1);
    min-height: 10rem;
    background: transparent;
    border-style: dashed;
    text-align: center;
  }

  .p03-cc__plus {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border: var(--border);
    border-radius: 50%;
    font-size: var(--step-2);
    line-height: 1;
  }

  @media (min-width: 40rem) {
    .p03-centers {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (min-width: 72rem) {
    .p03-centers {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: var(--space-2);
    }

    .p03-cc {
      padding: var(--space-3) 1.25rem;
    }
  }

  .p03-mini {
    display: block;
    width: 100%;
    max-width: 18rem;
    height: auto;
  }

  /* "What it needs to do": each small drawing centered in a framed panel of
     the same size, with room on every side; the two columns line up */
  .minis:has(.p03-mini) .minis__drawing {
    display: grid;
    place-items: center;
    max-width: none;
    aspect-ratio: 16 / 9;
    margin-block-end: var(--space-3);
    padding: var(--space-4);
    background: var(--color-paper);
    border: var(--border);
    border-radius: var(--radius-sm);
  }

  .minis:has(.p03-mini) .minis__list {
    align-items: start;
  }

  /* ---------- Checklist demo: the questions, the sample page beside them
     (site/snippets/blocks/checklist.php, public/assets/js/checklist.js).
     The static state is the finished one: every question ticked, the
     button on. Nothing sticks. ---------- */

  .checklist-demo__head {
    max-width: 44rem;
    margin-block-end: var(--space-5);
  }

  .checklist-demo__title {
    margin: 0;
  }

  .checklist-demo__intro {
    margin: var(--space-3) 0 0;
  }

  .checklist-demo__demo {
    display: grid;
    gap: var(--space-4);
  }

  .checklist-demo__card {
    display: flex;
    flex-direction: column;
    padding: var(--space-3) var(--space-3) var(--space-1);
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hard);
  }

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

  /* the tap hint (the shared one, industry.css): its place, and invisible
     with its space kept until checklist.js links the questions and parts */
  .checklist-demo__hint {
    margin: 0 0 var(--space-2);
  }

  .checklist-demo:not(.is-linked) .checklist-demo__hint {
    visibility: hidden;
  }

  .checklist-demo__list {
    display: grid;
    flex: 1;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .checklist-demo__item {
    display: grid;
    grid-template-columns: 1.5rem minmax(0, 1fr);
    gap: var(--space-2);
    align-items: start;
    margin-inline: calc(var(--space-1) * -1);
    padding: var(--space-2) var(--space-1);
    border-block-start: var(--border);
    border-radius: 0.375rem;
    transition: background-color 240ms var(--ease-out);
  }

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

  /* the question whose part is lit (pointer or focus, after the demo) */
  .checklist-demo__item.is-current {
    background: var(--color-brand);
  }

  /* the box shows the number until the question is answered, then the check */
  .checklist-demo__box {
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-block-start: 0.125rem;
    background: var(--color-white);
    border: var(--border);
    border-radius: 0.375rem;
    color: var(--color-ink);
    transition: background-color 240ms var(--ease-out);
  }

  .checklist-demo__box > * {
    grid-area: 1 / 1;
  }

  .checklist-demo__num {
    font-size: 0.6875rem;
    font-weight: 600;
  }

  .checklist-demo__mark {
    display: block;
  }

  .checklist-demo__item.is-ticked .checklist-demo__box {
    background: var(--color-brand);
  }

  .checklist-demo__item.is-current .checklist-demo__box {
    background: var(--color-white);
  }

  .checklist-demo__item.is-ticked .checklist-demo__num,
  .checklist-demo__item:not(.is-ticked) .checklist-demo__mark {
    opacity: 0;
  }

  .checklist-demo__question {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--step-1);
    font-weight: var(--weight-heading);
    line-height: 1.25;
  }

  .checklist-demo__answer {
    margin: 0.375rem 0 0;
    font-size: var(--step--1);
    line-height: var(--leading-body);
    transition: opacity 280ms var(--ease-out);
  }

  /* while the demo plays, an unanswered question's answer waits, quieter */
  .checklist-demo.is-live .checklist-demo__item:not(.is-ticked) .checklist-demo__answer {
    /* waiting for its tick: dimmed, still AA (0.55 was under 4.5:1, axe 2026-11-19) */
    opacity: 0.7;
  }

  .checklist-demo__label {
    display: block;
    margin-block-end: 0.125rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  .checklist-demo__outro {
    max-width: 30ch;
    margin: var(--space-4) 0 0;
    font-family: var(--font-heading);
    font-size: var(--step-2);
    font-weight: var(--weight-heading);
    line-height: var(--leading-heading);
  }

  .checklist-demo__needs {
    display: grid;
    gap: var(--space-4);
    margin: var(--space-5) 0 0;
    padding: var(--space-4) 0 0;
    list-style: none;
    border-block-start: var(--border);
  }

  .checklist-demo__needname {
    margin: 0 0 var(--space-1);
  }

  .checklist-demo__needtext {
    margin: 0;
  }

  /* the sample page's parts: quiet until answered, mint while current */
  .checklist-demo__part {
    padding: 0.625rem;
    border-radius: 0.5rem;
    transition: background-color 280ms var(--ease-out), opacity 280ms var(--ease-out), box-shadow 280ms var(--ease-out);
  }

  .checklist-demo.is-live .checklist-demo__part:not(.is-lit),
  .checklist-demo.is-tracking .checklist-demo__part:not(.is-now, [data-part="cta"]) {
    opacity: 0.4;
  }

  .checklist-demo__part.is-now {
    background: var(--color-brand);
    box-shadow: 0 0 0 0.1875rem var(--color-brand);
  }

  @media (min-width: 48rem) {
    .checklist-demo__needs {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: var(--space-5);
    }
  }

  /* wide: the sample page stands level with the questions, the same height */
  @media (min-width: 60rem) {
    .checklist-demo__demo {
      grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
      column-gap: var(--space-5);
      align-items: center;
    }
  }

  /* Numbered style: no ticks, the number stays; phones show the sample page
     first, then the list, in one column no wider than the container (a
     sample page's widest line never pushes it wider) */
  @media (max-width: 59.99rem) {
    .checklist-demo--numbered .checklist-demo__demo {
      grid-template-columns: minmax(0, 1fr);
    }
  }

  .checklist-demo--numbered .checklist-demo__stage {
    order: -1;
  }

  /* wide: the sample page as tall as the list, so both columns end together */
  @media (min-width: 60rem) {
    .checklist-demo--numbered .checklist-demo__demo {
      align-items: stretch;
    }

    .checklist-demo--numbered .checklist-demo__stage {
      order: 0;
    }
  }

  /* ---------- The sample center page (visuals/p03-center-page.php) ---------- */

  .p03-center {
    font-size: 0.8125rem;
    line-height: 1.35;
  }

  .p03-center__body {
    gap: var(--space-1);
    padding: var(--space-2);
  }

  .p03-center__hero {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 0.25rem var(--space-2);
    align-items: center;
    padding: 0.625rem;
    background: var(--color-paper);
    border-radius: 0.5rem;
  }

  .p03-center__photo {
    grid-row: span 2;
    height: 3.5rem;
    background: var(--color-butter);
    border: var(--border);
    border-radius: 0.375rem;
  }

  .p03-center__hero .mock__line {
    align-self: end;
  }

  .p03-center__hero .mock__line + .mock__line {
    align-self: start;
  }

  .p03-center__nav .mock__logo {
    font-family: var(--font-body);
    font-size: var(--step--1);
    font-weight: 600;
  }

  /* two columns, the day across both */
  .p03-center__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-1);
  }

  .p03-cp--day {
    grid-column: 1 / -1;
  }

  .p03-cp__label {
    margin: 0 0 0.375rem;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  .p03-cp__line {
    margin: 0 0 0.25rem;
  }

  .p03-cp__small {
    margin: 0.375rem 0 0;
    opacity: 0.7;
  }

  .p03-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .p03-chips li {
    padding: 0.1875rem 0.5rem;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
    font-weight: 500;
  }

  .p03-rooms {
    display: grid;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .p03-rooms__row {
    display: flex;
    justify-content: space-between;
    gap: var(--space-1);
    padding: 0.1875rem 0.5rem;
    background: var(--color-white);
    border: var(--border);
    border-radius: 0.375rem;
  }

  .p03-rooms__row b {
    font-weight: 600;
  }

  .p03-rooms__row--wait {
    opacity: 0.7;
  }

  .p03-rooms__row--open {
    background: var(--color-butter);
  }

  .p03-facts {
    display: grid;
    gap: 0.125rem;
    margin: 0;
    padding: 0 0 0 1rem;
  }

  .p03-day {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.625rem;
    text-align: center;
  }

  .p03-day li {
    position: relative;
    padding-block-start: 1rem;
  }

  .p03-day li::before {
    content: "";
    position: absolute;
    top: 0.125rem;
    left: 50%;
    width: 0.5rem;
    height: 0.5rem;
    margin-inline-start: -0.3125rem;
    background: var(--color-gold-soft);
    border: 1px solid var(--color-ink);
    border-radius: 50%;
  }

  .p03-day li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 0.4375rem;
    right: calc(-50% + 0.4375rem);
    left: calc(50% + 0.4375rem);
    height: 1px;
    background: var(--color-ink);
    opacity: 0.35;
  }

  /* the call to action: off (an outline) until every question is ticked */
  .p03-cp--cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
    padding-block: 0.25rem;
  }

  .p03-cp__badge {
    margin-inline-end: auto;
    padding: 0.1875rem 0.5rem;
    background: var(--color-butter);
    border: var(--border);
    border-radius: var(--radius-pill);
    font-size: 0.625rem;
    font-weight: 600;
    transition: opacity 320ms var(--ease-out);
  }

  .p03-cp__pick {
    padding: 0.1875rem 0.5rem;
    background: var(--color-brand);
    border: var(--border);
    border-radius: var(--radius-pill);
    font-weight: 500;
  }

  .p03-cp__btn {
    padding: 0.5rem 0.875rem;
    background: var(--color-ink);
    border: 1px solid var(--color-ink);
    color: var(--color-white);
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    transition: background-color 320ms var(--ease-out), color 320ms var(--ease-out), opacity 320ms var(--ease-out);
  }

  .checklist-demo:not(.is-done) .p03-cp__btn {
    background: var(--color-white);
    color: var(--color-ink);
    opacity: 0.45;
  }

  .checklist-demo:not(.is-done) :is(.p03-cp__badge, .p03-cp__pick) {
    opacity: 0;
  }

  /* ---------- Two-view flip: the toggle, the card, the two views ---------- */

  .flip__head {
    max-width: 44rem;
    margin-block-end: var(--space-5);
  }

  .flip__title {
    margin: 0;
  }

  .flip__intro {
    margin: var(--space-3) 0 0;
  }

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

  .flip__stage {
    perspective: 2000px;
  }

  /* the tap hint over the toggle (the shared one, industry.css) */
  .flip__hint {
    margin: 0 0 var(--space-2);
  }

  .flip__toggle {
    display: inline-flex;
    margin-block-end: var(--space-3);
    padding: 0.25rem;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
  }

  .flip__toggle[hidden] {
    display: none;
  }

  .flip__btn {
    margin: 0;
    padding: 0.625rem 1rem;
    background: none;
    border: 0;
    border-radius: var(--radius-pill);
    color: inherit;
    font: inherit;
    font-size: var(--step--1);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 240ms var(--ease-out), color 240ms var(--ease-out);
  }

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

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

  /* without the script the two views stand one under the other */
  .flip__card {
    display: grid;
    gap: var(--space-4);
  }

  .flip__view {
    padding: var(--space-3);
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-sm);
  }

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

  .flip__label {
    margin: 0 0 var(--space-3);
  }

  .flip__body {
    display: grid;
    gap: var(--space-3);
  }

  .flip__photo {
    display: grid;
  }

  .flip__page {
    display: grid;
    gap: var(--space-2);
    align-content: start;
    padding: var(--space-3);
    background: var(--color-paper);
    border: var(--border);
    border-radius: 0.5rem;
    font-size: var(--step--1);
    line-height: 1.4;
  }

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

  .flip__banner {
    margin: 0;
    padding: 0.5rem 0.75rem;
    background: var(--color-brand);
    border: var(--border);
    border-radius: 0.375rem;
    font-weight: 500;
  }

  .flip__lines,
  .flip__fields {
    display: grid;
    gap: 0.375rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .flip__lines li {
    padding: 0.375rem 0.625rem;
    background: var(--color-white);
    border: var(--border);
    border-radius: 0.375rem;
  }

  .flip__field {
    padding: 0.5rem 0.75rem;
    background: var(--color-white);
    border: 1px dashed var(--color-ink);
    border-radius: 0.375rem;
    opacity: 0.75;
  }

  .flip__text p {
    margin: 0 0 0.5rem;
  }

  .flip__text p:last-child {
    margin-block-end: 0;
  }

  .flip__cta {
    margin: 0;
  }

  .flip__fakebtn {
    display: inline-block;
    padding: 0.625rem 1rem;
    background: var(--color-ink);
    color: var(--color-white);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  /* an example of what not to do: muted and crossed out, flagged in text above */
  .flip__view--example .flip__heading,
  .flip__view--example .flip__banner,
  .flip__view--example .flip__lines li {
    text-decoration: line-through;
    opacity: 0.6;
  }

  .flip__aside {
    display: grid;
    gap: var(--space-4);
    align-content: start;
  }

  .flip__coltitle {
    margin: var(--space-1) 0 var(--space-2);
  }

  .flip__coltext {
    margin: 0;
  }

  .flip__outro {
    margin: var(--space-4) 0 0;
  }

  .flip--strip .flip__stage {
    max-width: 40rem;
  }

  .flip--strip .flip__view {
    padding: var(--space-2) var(--space-3);
  }

  /* with the script: the views share one cell and the card turns */
  .flip.is-live .flip__card {
    transform-style: preserve-3d;
  }

  .flip.is-live .flip__view {
    display: flex;
    flex-direction: column;
    grid-area: 1 / 1;
    backface-visibility: hidden;
  }

  .flip.is-live .flip__body {
    flex: 1;
  }

  .flip.is-live .flip__view[data-flip-view="1"] {
    transform: rotateY(180deg);
  }

  .flip.is-live .flip__card.is-turned {
    transform: rotateY(180deg);
  }

  .flip.is-live .flip__label {
    margin-block-end: var(--space-2);
    font-family: var(--font-body);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  @media (min-width: 48rem) {
    .flip__body {
      grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    }

    /* a view without a photo (the therapist page's availability demo): the sample page spans the card */
    .flip__body:not(:has(.flip__photo)) {
      grid-template-columns: minmax(0, 1fr);
    }

    /* beside the sample page the photo fills the card's height instead of keeping its ratio */
    .flip__photo .photo-slot {
      width: 100%;
      height: 100%;
      min-height: 16rem;
      aspect-ratio: auto;
    }

    .flip--strip .flip__body {
      grid-template-columns: minmax(0, 1fr);
    }
  }

  @media (min-width: 60rem) {
    .flip--aside .flip__grid {
      grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
      column-gap: var(--space-6);
      align-items: start;
    }
  }

  /* Print: no toggle, nothing turned; both views read the right way round,
     one after the other, as they do without the script */
  @media print {
    .flip__toggle {
      display: none;
    }

    .flip.is-live .flip__card,
    .flip.is-live .flip__card.is-turned {
      transform: none;
      transform-style: flat;
    }

    .flip.is-live .flip__view,
    .flip.is-live .flip__view[data-flip-view="1"] {
      grid-area: auto;
      transform: none;
      backface-visibility: visible;
      break-inside: avoid;
    }
  }
}

@layer motion {
  @media screen and (prefers-reduced-motion: no-preference) {
    /* the center cards lift under a resting mouse (blocks layer: the shadow) */
    .p03-cc {
      transition: transform 240ms var(--ease-out), box-shadow 240ms var(--ease-out);
    }

    @media (hover: hover) and (pointer: fine) {
      .p03-cc:not(.p03-cc--next):hover {
        transform: translateY(-0.25rem);
      }
    }

    /* The live card: the open room pulses in once as the card starts */
    html[data-fx~="diagrams"] .lcard.is-live .p03-room--open.is-on {
      animation: p03-pulse 900ms var(--ease-out) 500ms both;
    }

    /* The flip's turn; the swap is instant without this */
    html[data-fx~="diagrams"] .flip.is-live .flip__card {
      transition: transform 720ms var(--ease-out);
    }

    /* The checklist's tick draws */
    html[data-fx~="diagrams"] .checklist-demo.is-live .checklist-demo__mark path {
      stroke-dasharray: 1;
      transition: stroke-dashoffset 320ms var(--ease-out) 80ms;
    }

    html[data-fx~="diagrams"] .checklist-demo.is-live .checklist-demo__item:not(.is-ticked) .checklist-demo__mark path {
      stroke-dashoffset: 1;
    }

    /* The problem scene with its own drawings (problems/scene.php): a
       childcare drawing waits until it is seen. Wide screens: the drawing
       beside the rows plays when its row becomes current (and the scene is in
       view); phones: each still plays when it scrolls into view. The motion
       itself is motion-tiers.css ("Problems") and the cursor's below. */
    html.js-motion .pscene--own[data-play]:not(.is-in) .pscene__own .p03-drawing :is(.pb-step, .dg-cursor),
    html.js-motion .pscene--own .pscene__own:not(.is-active) .p03-drawing :is(.pb-step, .dg-cursor),
    html.js-motion .pscene--own .pscene__still[data-play]:not(.is-in) .p03-drawing :is(.pb-step, .dg-cursor) {
      animation-play-state: paused;
    }

    /* Problems 01 and 02: the cursor arrives and hesitates, then stays */
    html[data-fx~="diagrams"] .diagram--problem .p03-hesitate {
      animation: p03-hesitate 2200ms var(--ease-out) 1700ms both;
    }

    /* The rest of the needs: the program chips slide in, the summer chip
       leaves and registration takes its place; the search result slides in
       and lights up */
    html.js-motion .minis__drawing[data-play]:not(.is-in) :is(.p03-prog, .p03-result) {
      opacity: 0;
    }

    html.js-motion .minis__drawing[data-play].is-in .p03-prog {
      animation: p03-in 520ms var(--ease-out) both;
    }

    html.js-motion .minis__drawing[data-play].is-in .p03-prog--0 {
      animation: p03-in-out 3400ms var(--ease-out) 100ms both;
    }

    html.js-motion .minis__drawing[data-play].is-in .p03-prog--1 {
      animation-delay: 450ms;
    }

    html.js-motion .minis__drawing[data-play].is-in .p03-prog--2 {
      animation-delay: 800ms;
    }

    html.js-motion .minis__drawing[data-play].is-in .p03-prog--3 {
      animation-delay: 3200ms;
    }

    html.js-motion .minis__drawing[data-play].is-in .p03-result {
      animation: p03-in 600ms var(--ease-out) 300ms both;
    }

    html.js-motion .minis__drawing[data-play].is-in .p03-result__card {
      animation: p03-light 500ms var(--ease-out) 1000ms both;
    }
  }

  @keyframes p03-pulse {
    from {
      background-color: var(--color-white);
      transform: scale(0.97);
    }

    60% {
      transform: scale(1.03);
    }

    to {
      transform: none;
    }
  }

  @keyframes p03-hesitate {
    0% {
      opacity: 0;
      transform: translate(34px, 46px);
    }

    35% {
      opacity: 1;
      transform: none;
    }

    55% {
      transform: translate(5px, 3px);
    }

    75% {
      transform: translate(-2px, -1px);
    }

    100% {
      transform: none;
    }
  }

  @keyframes p03-in {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
  }

  @keyframes p03-in-out {
    0% {
      opacity: 0;
      transform: translateY(10px);
    }

    14% {
      opacity: 1;
      transform: none;
    }

    78% {
      opacity: 1;
      transform: none;
    }

    92% {
      opacity: 0;
      transform: translateY(-8px);
    }

    100% {
      opacity: 0;
    }
  }

  @keyframes p03-light {
    from {
      fill: var(--color-white);
    }
  }
}
