/*
 * Household staffing page (2026-11-20). Loaded for the class prefix p11-
 * (site/plugins/peanut-site/extensions/stylesheets.php).
 *
 * - Problem drawings: site/snippets/diagrams/problem-p11-names.php,
 *   -wall.php, -season.php (the problems block, variant scene, Scene
 *   drawing "own"): their parts beyond the shared drawing classes in
 *   blocks.css, and the cursor's own motion.
 * - The three sample visuals in showcase blocks (site/snippets/visuals/
 *   p11-questions.php, p11-listings.php, p11-seasons.php): a sample site
 *   in a browser or phone frame, the visitor's buttons above it, one sample
 *   shown at a time (public/assets/js/p11-switch.js).
 *
 * Tokens only, no hex or rgb() value. Layer blocks for the static state,
 * layer motion for what moves. Nothing here loops.
 */

/* ---------- Problem drawings ---------- */

@layer blocks {
  .diagram :is(.p11-ground, .p11-line, .p11-sep, .p11-trail) {
    fill: none;
    stroke: var(--color-ink);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* the ground line every drawing stands on */
  .diagram .p11-ground {
    opacity: 0.2;
  }

  .diagram .p11-sep {
    stroke-width: 1;
    opacity: 0.18;
  }

  .diagram .p11-trail {
    stroke-dasharray: 3 5;
    opacity: 0.55;
  }

  .diagram .p11-card {
    stroke: var(--color-ink);
    stroke-width: 1.2;
  }

  .diagram .p11-fade {
    opacity: 0.45;
  }

  .diagram .p11-grey {
    opacity: 0.55;
  }

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

  .diagram :is(.p11-query, .p11-tag) {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0;
  }

  .diagram .p11-stamp {
    letter-spacing: 0.14em;
  }

  /* the review's opening quotation mark */
  .diagram .p11-mark {
    font-family: var(--font-heading);
    font-size: 34px;
    font-weight: var(--weight-heading);
  }
}

@layer motion {
  @media screen and (prefers-reduced-motion: no-preference) {
    /* A drawing waits until it is seen: beside the rows, when its row
       becomes current; on phones, when its still scrolls into view */
    html.js-motion .pscene--own[data-play]:not(.is-in) .pscene__own .p11-drawing :is(.pb-step, .dg-cursor),
    html.js-motion .pscene--own .pscene__own:not(.is-active) .p11-drawing :is(.pb-step, .dg-cursor),
    html.js-motion .pscene--own .pscene__still[data-play]:not(.is-in) .p11-drawing :is(.pb-step, .dg-cursor) {
      animation-play-state: paused;
    }

    /* 01: the cursor moves along the empty tiles, finding nothing */
    html[data-fx~="diagrams"] .diagram--problem .p11-hover {
      animation: p11-hover 1800ms var(--ease-out) 1900ms both;
    }

    /* 02: the cursor leaves the form for the tab's close mark */
    html[data-fx~="diagrams"] .diagram--problem .p11-leave {
      animation: p11-leave 1500ms var(--ease-out) 2000ms both;
    }

    /* 03: the cursor comes up to the other agency's result */
    html[data-fx~="diagrams"] .diagram--problem .p11-tap {
      animation: p11-tap 1500ms var(--ease-out) 2000ms both;
    }
  }

  @keyframes p11-hover {
    0% {
      opacity: 0;
      transform: translate(-130px, 10px);
    }

    25% {
      opacity: 1;
    }

    60% {
      transform: translate(80px, 4px);
    }

    100% {
      transform: none;
    }
  }

  @keyframes p11-leave {
    0% {
      opacity: 0;
      transform: translate(-90px, 170px);
    }

    30% {
      opacity: 1;
    }

    100% {
      transform: none;
    }
  }

  @keyframes p11-tap {
    0% {
      opacity: 0;
      transform: translate(150px, 70px);
    }

    30% {
      opacity: 1;
    }

    100% {
      transform: none;
    }
  }
}

/* ---------- The sample visuals (visuals/p11-questions, p11-listings,
   p11-seasons, in showcase blocks): the caption, the visitor's buttons,
   then a sample site in a browser or phone frame ---------- */

@layer blocks {
  .p11-sw {
    container-type: inline-size;
    display: grid;
    gap: var(--space-2);
    margin: 0;
    font-size: var(--step--1);
    line-height: 1.5;
  }

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

  .p11-sw__chips {
    display: grid;
    gap: 0.5rem;
  }

  .p11-sw__chips[hidden] {
    display: none;
  }

  /* the hint (snippets/demo/hint.php) and the progress bar
     (snippets/demo/progress.php) are the shared ones: industry.css */

  .p11-sw__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .p11-sw__chip {
    min-height: 2.75rem;
    margin: 0;
    padding: 0.5rem 1rem;
    background: var(--color-white);
    border: 1px solid var(--color-ink);
    border-radius: var(--radius-pill);
    color: var(--color-ink);
    font: inherit;
    font-weight: 500;
    text-align: start;
    cursor: pointer;
  }

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

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

  /* the frame: a browser window, or a phone (p11-sw--phone) */
  .p11-sw__frame {
    overflow: hidden;
    background: var(--color-white);
    border: 1px solid var(--color-ink);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hard);
  }

  .p11-sw__bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin: 0;
    padding: 0.5rem 0.875rem;
    background: var(--color-paper);
    border-block-end: 1px solid var(--color-ink);
    font-size: 0.75rem;
    overflow-wrap: anywhere;
  }

  /* the window's three dots */
  .p11-sw__dots {
    flex: none;
    width: 1.75rem;
    height: 0.5rem;
    background:
      radial-gradient(circle at 0.25rem 50%, var(--color-ink) 0.1875rem, transparent 0.21875rem),
      radial-gradient(circle at 0.875rem 50%, var(--color-ink) 0.1875rem, transparent 0.21875rem),
      radial-gradient(circle at 1.5rem 50%, var(--color-ink) 0.1875rem, transparent 0.21875rem);
    opacity: 0.45;
  }

  .p11-sw__screen {
    display: grid;
    gap: var(--space-2);
    padding: var(--space-3);
  }

  .p11-sw__brand {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    align-items: baseline;
    justify-content: space-between;
    margin: 0;
    padding-block-end: 0.75rem;
    border-block-end: 1px solid var(--color-ink-line-faint);
    font-family: var(--font-heading);
    font-size: var(--step-1);
    font-weight: var(--weight-heading);
  }

  .p11-sw__nav {
    font-family: var(--font-body);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .p11-sw__stack {
    display: grid;
    gap: var(--space-4);
  }

  .p11-sw__set {
    display: grid;
    gap: 0.625rem;
    align-content: start;
  }

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

  .p11-sw__line {
    margin: 0;
  }

  .p11-sw__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .p11-sw__tag {
    padding: 0.25rem 0.75rem;
    background: var(--color-butter);
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 500;
  }

  /* the listing's rows */
  .p11-sw__rows {
    display: grid;
    margin: 0;
  }

  .p11-sw__rowline {
    display: grid;
    grid-template-columns: 4.75rem minmax(0, 1fr);
    gap: 0.75rem;
    padding-block: 0.5rem;
    border-block-start: 1px solid var(--color-ink-line-faint);
  }

  .p11-sw__rowline dt {
    font-weight: 600;
  }

  .p11-sw__rowline dd {
    margin: 0;
  }

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

  /* a drawn button: the sample page's, not a control */
  .p11-sw__btn {
    justify-self: start;
    margin: 0.25rem 0 0;
    padding: 0.5rem 0.875rem;
    background: var(--color-ink);
    color: var(--color-white);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  /* the phone: 2px ink edge, round corners, at most 20rem wide */
  .p11-sw--phone .p11-sw__frame {
    justify-self: center;
    width: 100%;
    max-width: 20rem;
    border-width: 2px;
    border-radius: 2rem;
  }

  .p11-sw--phone .p11-sw__bar {
    justify-content: center;
    padding-block: 0.875rem 0.625rem;
  }

  .p11-sw--phone .p11-sw__screen {
    padding: var(--space-2) var(--space-3) var(--space-3);
  }

  .p11-sw--phone .p11-sw__h {
    font-size: var(--step-1);
  }

  .p11-sw--phone :is(.p11-sw__cap, .p11-sw__chips) {
    justify-self: center;
    width: 100%;
    max-width: 24rem;
  }

  /* ---------- Market pages (visuals/p11-seasons): the search, the result
     and the page it opens, with the market's year ---------- */

  .p11-m {
    gap: 0.75rem;
  }

  .p11-m__query {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-self: start;
    margin: 0;
    padding: 0.375rem 0.875rem;
    background: var(--color-white);
    border: 1px solid var(--color-ink);
    border-radius: var(--radius-pill);
    font-weight: 500;
  }

  .p11-m__glass {
    position: relative;
    flex: none;
    width: 0.75rem;
    height: 0.75rem;
    border: 1.5px solid currentColor;
    border-radius: 50%;
  }

  .p11-m__glass::after {
    content: "";
    position: absolute;
    right: -0.25rem;
    bottom: -0.25rem;
    width: 0.3125rem;
    height: 1.5px;
    background: currentColor;
    transform: rotate(45deg);
  }

  .p11-m__result {
    display: grid;
    gap: 0.375rem;
    align-content: start;
    align-self: start;
    padding: var(--space-2);
    background: var(--color-brand);
    border: 1px solid var(--color-ink);
    border-radius: var(--radius-sm);
  }

  .p11-m__url {
    margin: 0;
    overflow-wrap: anywhere;
  }

  .p11-m__title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--step-1);
    font-weight: var(--weight-heading);
    line-height: 1.2;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
  }

  .p11-m__page {
    box-shadow: none;
  }

  /* the year: twelve cells, the season in butter, the search months in mint */
  .p11-m__year {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .p11-m__month {
    display: grid;
    place-items: center;
    min-height: 2rem;
    background: var(--color-white);
    border: 1px solid var(--color-ink);
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
  }

  /* lit months keep their color in print and in PDF captures */
  .p11-m__month,
  .p11-m__swatch {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .p11-m__month.is-season,
  .p11-m__swatch.is-season {
    background: var(--color-butter);
  }

  .p11-m__month.is-search,
  .p11-m__swatch.is-search {
    background: var(--color-brand);
  }

  .p11-m__key {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    align-items: center;
    margin: 0;
    font-size: 0.75rem;
  }

  /* the key: a small filled bar in the lit color, never a box or a ring
     that reads as a control */
  .p11-m__swatch {
    display: inline-block;
    width: 1rem;
    height: 0.5rem;
    border: 1px solid var(--color-ink);
    border-radius: 0.125rem;
  }

  .p11-m__key .p11-m__swatch:not(:first-child) {
    margin-inline-start: 0.5rem;
  }

  /* wide: the search and its result on the left, centred against the page
     they open on the right */
  @container (min-width: 44rem) {
    .p11-m {
      grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
      grid-template-rows: 1fr auto 1fr;
      gap: var(--space-2) var(--space-5);
    }

    .p11-m__query {
      grid-area: 1 / 1;
      align-self: end;
    }

    .p11-m__result {
      grid-area: 2 / 1;
    }

    .p11-m__page {
      grid-area: 1 / 2 / 4 / 3;
    }
  }

  /* the section's two case study notes side by side above the wide visual */
  @media (min-width: 48rem) {
    .showcase:has(.p11-m) .showcase__items {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: var(--space-3) var(--space-5);
    }
  }

  /* with the script: one sample at a time, all in one cell */
  .p11-sw.is-live .p11-sw__stack {
    gap: 0;
  }

  .p11-sw.is-live .p11-sw__set {
    grid-area: 1 / 1;
  }

  .p11-sw.is-live .p11-sw__set[data-off] {
    visibility: hidden;
  }

  /* without it: every sample, one after the other */
  .p11-sw:not(.is-live) .p11-sw__set + .p11-sw__set {
    padding-block-start: var(--space-4);
    border-block-start: 1px solid var(--color-ink-line-faint);
  }

  /* Print: no buttons; every sample, one after the other */
  @media print {
    .p11-sw__chips {
      display: none;
    }

    .p11-sw__frame {
      box-shadow: none;
    }

    .p11-sw.is-live .p11-sw__stack {
      display: block;
    }

    .p11-sw.is-live .p11-sw__set[data-off] {
      visibility: visible;
    }

    .p11-sw.is-live .p11-sw__set + .p11-sw__set {
      margin-block-start: var(--space-4);
      padding-block-start: var(--space-4);
      border-block-start: 1px solid var(--color-ink-line-faint);
    }

    .p11-sw__set {
      break-inside: avoid;
    }
  }
}

@layer motion {
  @media screen and (prefers-reduced-motion: no-preference) {
    .p11-sw__chip {
      transition: background-color 300ms var(--ease-out), color 300ms var(--ease-out);
    }

    .p11-sw.is-live .p11-sw__set {
      transition: opacity 500ms var(--ease-out), visibility 0s;
    }

    .p11-sw.is-live .p11-sw__set[data-off] {
      opacity: 0;
      transition: opacity 300ms var(--ease-out), visibility 0s 300ms;
    }
  }
}
