/**
 * Nonprofit page, final pass (2026-11-21): A page for every program (seasonboard). Loaded for its class prefix
 * (site/plugins/peanut-site/extensions/stylesheets.php); loads after ind-p10.css.
 *
 * Its parts (site/snippets/blocks/seasonboard.php, public/assets/js/seasonboard.js):
 * the place of the shared "Tap a season" hint over the season buttons,
 * one staff editor per season stacked in one cell (the tallest sets the
 * height, so nothing moves when the season changes), Save's pulse and the
 * caret while the field is retyped, and the cards' rows aligned across a
 * row of cards (subgrid: photo, title, schedule, contact, button), so a
 * title on two lines never pushes one button lower than the others. On
 * phones a card with a photo sets it small beside the text. Layer blocks,
 * then motion. Tokens only; ind-p10.css keeps the board's own rules.
 */

@layer blocks {
  /* the value before the edit, under the field: the saved state says what changed
     (and the old value is on the page without the script) */
  .p10s-was {
    margin: 0;
    font-size: 0.75rem;
    margin-top: -0.25rem;
    color: var(--color-on-ink-label);
  }

  /* ---------- The hint over the season buttons ---------- */

  /* the shared hint (snippets/demo/hint.php, industry.css), placed here */
  .p10s-hint {
    margin: 0 0 var(--space-2);
  }

  /* it keeps its space until the script makes the buttons work */
  .p10s-board:not(.is-live) .p10s-hint {
    visibility: hidden;
  }

  /* ---------- The editors: one per season, in one cell ---------- */

  .p10s-editors {
    display: grid;
  }

  .p10s-editors > .p10s-editor {
    grid-area: 1 / 1;
  }

  .p10s-editor[data-off] {
    visibility: hidden;
  }

  /* ---------- The cards ---------- */

  /* Each card spans four rows of the list (title, schedule, contact,
     button), shared with the cards beside it, so a title on two lines never
     pushes one button lower than the others. Below 64rem a photo sits small
     beside the text, across those rows; from 64rem it sits on top, in a
     fifth row. */
  .p10s-cards {
    row-gap: var(--space-2);
  }

  .p10s-card {
    grid-row: span 4;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: subgrid;
    gap: 0;
    align-items: start;
  }

  .p10s-card.seasonboard__card--photo {
    grid-template-columns: 5.5rem minmax(0, 1fr);
    column-gap: var(--space-2);
  }

  .p10s-card .seasonboard__body {
    display: contents;
  }

  .p10s-card .seasonboard__photo {
    grid-column: 1;
    grid-row: 1 / span 4;
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .p10s-card .seasonboard__program {
    grid-column: -2;
    grid-row: 1;
    margin: 0 0 0.625rem;
  }

  .p10s-card .p10s-when {
    grid-column: -2;
    grid-row: 2;
    margin-block-end: 0.5rem;
  }

  .p10s-card .p10s-who {
    grid-column: -2;
    grid-row: 3;
  }

  .p10s-card .seasonboard__support {
    grid-column: -2;
    grid-row: 4;
    align-self: end;
    justify-self: start;
    margin-block-start: var(--space-2);
  }

  /* the aside before the board on smaller screens: no wider than a phone
     screen, a little air under the caption */
  .p10s-board .seasonboard__aside {
    max-width: 26rem;
    margin-block-end: var(--space-1);
  }

  @media (min-width: 60rem) {
    .p10s-board .seasonboard__aside {
      max-width: none;
      margin-block-end: 0;
    }
  }

  @media (min-width: 64rem) {
    .p10s-card,
    .p10s-card.seasonboard__card--photo {
      grid-row: span 5;
      grid-template-columns: minmax(0, 1fr);
    }

    .p10s-card .seasonboard__photo {
      grid-row: 1;
      margin-block-end: var(--space-2);
    }

    .p10s-card .seasonboard__program {
      grid-row: 2;
    }

    .p10s-card .p10s-when {
      grid-row: 3;
    }

    .p10s-card .p10s-who {
      grid-row: 4;
    }

    .p10s-card .seasonboard__support {
      grid-row: 5;
    }
  }

}

@layer motion {
  @media screen and (prefers-reduced-motion: no-preference) {
    /* the caret blinks for as long as the field is being retyped */
    .p10s-board .seasonboard__editor.is-typing .seasonboard__field--live .seasonboard__fieldval::after {
      animation-iteration-count: infinite;
    }

    /* Save is pressed: a short squeeze and a ring that opens out */
    .p10s-board .seasonboard__save.is-tapped {
      animation: p10s-press 700ms var(--ease-out) both;
    }

    @keyframes p10s-press {
      0% {
        scale: 1;
        box-shadow: 0 0 0 0 var(--color-on-ink-line-strong);
      }

      25% {
        scale: 0.92;
      }

      100% {
        scale: 1;
        box-shadow: 0 0 0 0.75rem transparent;
      }
    }
  }
}
