/* The index roll, lessons.html. Read top to bottom, in the order the page is read. */

/* The spread: on phones one column in reading order - the h1, its sentence, the photograph,
   the note on tuition, then the count; the side pictures wait for the wide layout. */
.Roll { row-gap: 1.25rem; }
.Roll-start { display: contents; }
.Roll-start > .Intro-sentence { max-inline-size: 34ch; margin-block: 0; }
.Roll-count { display: grid; gap: 0.625rem; justify-items: start; }
.Roll-count .Count { --size-of-a-beat: 1.125rem; }
.Roll-count .Photo-words { max-inline-size: 22ch; }
.Roll-note { max-inline-size: 42ch; margin-block-end: 0; }
.Roll-note a:hover { background: var(--colour-of-the-ochre); color: var(--colour-of-the-ink); }
.Roll-call { display: none; }
.Roll-aside { display: none; }

/* The frame: one shot at a time. On a phone only the shown one takes room. */
.Roll-frame { display: grid; min-inline-size: 0; }
.Roll-shot { grid-area: 1 / 1; align-content: start; }
.Roll-shot[data-state="hidden"] { display: none; }

@media (max-width: 55.99em) {
  .Roll-start > .Heading, .Roll-start > .Intro-sentence { order: -2; }
  .Roll-frame { order: -1; }
}

/* The filter keys: on a phone one tidy row that scrolls inside its own box; on a desk they wrap onto lines. */
.Sorter { display: grid; gap: 0.25rem; min-inline-size: 0; }
html:not(.js) .Sorter { display: none; }
.Sorter-keys {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.375rem 0.375rem 0.625rem;
  scrollbar-width: thin;
}
.Sorter-key { flex: none; white-space: nowrap; font-size: 1rem; }
/* The keys at rest are deep slate with pale words; the pressed one alone is ochre. */
.Sorter-key[data-state="released"] {
  --colour-of-the-key: var(--colour-of-the-deep-slate);
  color: var(--colour-of-the-pale-ink);
}
/* Every key stands on one line: the pressed one is told by its ochre and its weight, not by sinking. */
.Sorter-key:hover, .Sorter-key[data-state="pressed"] { translate: none; }
.Sorter-key[data-state="pressed"] { font-weight: 500; font-variation-settings: "wght" 500; }
.Sorter-status { min-block-size: 1.5em; font-size: var(--size-of-small-type); }

/* A run: a heading on its bar, one sentence, then the numbered rows between firm rules. */
.Roll-run > p { max-inline-size: 40ch; margin-block: 1rem 0.75rem; }
.Roll-run[hidden], .Roll-aside[hidden] { display: none; }
.Roll-run[data-run="band"], .Roll-run[data-run="camp"],
.Roll-aside[data-run="band"], .Roll-aside[data-run="camp"] { margin-block-start: clamp(1.5rem, 5vh, 3rem); }
.Roll-list {
  display: grid;
  margin: 0;
  margin-block-start: 1rem;
  padding: 0;
  border-block-end: 0.125rem solid var(--colour-of-the-ink);
  list-style: none;
}

/* A beat row: stepped-key bullet, its hanging number, the name as a large heavy link, its one line. */
.Roll-row {
  --size-of-a-roll-name: clamp(1.5rem, 1.1rem + 1.5vw, 2.25rem);
  --depth-of-the-step: 0.4rem;
  display: grid;
  grid-template-columns: 1.25rem 2.25rem minmax(0, 1fr);
  column-gap: 0.5rem;
  align-items: baseline;
  padding-block: 0.875rem 1rem;
  border-block-start: 0.125rem solid var(--colour-of-the-ink);
}
.Roll-row[hidden] { display: none; }
.Roll-row::before {
  content: "";
  align-self: start;
  inline-size: 1.25rem;
  block-size: 1.25rem;
  margin-block-start: calc(var(--size-of-a-roll-name) * 0.575 - 0.625rem);
  background: var(--colour-of-the-pale-ink);
  clip-path: polygon(0 0, calc(100% - var(--depth-of-the-step)) 0, calc(100% - var(--depth-of-the-step)) var(--depth-of-the-step), 100% var(--depth-of-the-step), 100% 100%, 0 100%);
  transition: background-color 300ms var(--ease-with-weight);
}
.Roll-row[data-state="pressed"]::before { background: var(--colour-of-the-ochre); }
.Roll-number {
  font-size: 1rem;
  font-weight: 500;
  font-variation-settings: "wght" 500;
  font-variant-numeric: tabular-nums;
}
/* The name is a block, so its first line, not its last, gives the row its baseline. */
.Roll-name {
  display: block;
  inline-size: fit-content;
  max-inline-size: 100%;
  font-size: var(--size-of-a-roll-name);
  font-weight: 600;
  font-variation-settings: "wght" 600;
  line-height: 1.15;
  text-decoration: none;
}
.Roll-name:hover, .Roll-name:focus-visible, .Roll-row[data-state="pressed"] .Roll-name {
  text-decoration: underline;
  text-decoration-color: var(--colour-of-the-ochre);
  text-decoration-thickness: 0.1875rem;
  text-underline-offset: 0.2em;
}
.Roll-line { max-inline-size: 38ch; margin-block-start: 0.375rem; }
.Roll-picture { --depth-of-the-step: 1.75rem; margin-block-start: 0.875rem; }

/* The wide spread: three lanes of three, five and four columns. The opening stands in the first
   rows beside the swapping frame; each run then crosses the middle and right lanes, names in the
   middle lane and their lines in the right, with its photograph in the left lane. */
@media (min-width: 56em) {
  .Roll { grid-template-rows: auto auto auto 1fr; }
  .Roll-call { display: inline-flex; }
  .Roll-picture { display: none; }

  /* The opening: its parts take their own rows, so the note in the left lane ends on the h1's bar. */
  .Roll-start > * { grid-column: 4 / span 5; }
  .Roll-start > .Heading { grid-row: 1; }
  .Roll-start > .Intro-sentence { grid-row: 2; }
  .Roll-start > .Roll-note { grid-row: 3; }
  .Roll-start > .Roll-call { grid-row: 4; justify-self: start; align-self: start; }
  .Roll-count { grid-column: 1 / span 3; grid-row: 1; align-self: end; }

  /* The keys wrap onto lines across the two lanes, a size smaller, each line filled to its end. */
  .Sorter { grid-column: 4 / -1; grid-row: 5; }
  .Sorter-keys { flex-wrap: wrap; overflow-x: visible; padding: 0; }
  .Sorter-key {
    flex: 1 1 auto;
    min-block-size: 2.5rem;
    padding: 0.375rem 0.75rem;
    padding-inline-end: 1.125rem;
    font-size: 0.9375rem;
  }

  /* A run: heading in the middle lane, its sentence in the right lane, both on the top line
     of the photograph in the left lane; the rows across both. */
  .Roll-run {
    grid-column: 4 / -1;
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    column-gap: var(--space-between-columns);
    align-items: start;
  }
  .Roll-run > .Heading { grid-column: 1 / span 5; }
  .Roll-run > p { grid-column: 6 / span 4; margin-block: 0; }
  .Roll-run > .Roll-list { grid-column: 1 / -1; margin-block-start: 1.25rem; }

  /* A row: bullet, number, name, then the line in a track exactly as wide as the right lane. */
  .Roll-row {
    grid-template-columns: 1.25rem 2.25rem minmax(0, 1fr) calc((100% - 8 * var(--space-between-columns)) / 9 * 4 + 3 * var(--space-between-columns));
  }
  .Roll-body { display: contents; }
  .Roll-name { justify-self: start; }
  .Roll-line { margin-block-start: 0; }

  /* Each side picture stays in its own row beside its run: not pinned, so captions never meet. */
  .Roll-aside {
    display: grid;
    grid-column: 1 / span 3;
    gap: 1.25rem;
  }
  .Roll-run[data-run="private"], .Roll-aside[data-run="private"] { grid-row: 6; }
  .Roll-run[data-run="band"], .Roll-aside[data-run="band"] { grid-row: 7; }
  .Roll-run[data-run="camp"], .Roll-aside[data-run="camp"] { grid-row: 8; }
  .Roll-aside .Photo-frame { --depth-of-the-step: 1.75rem; }
  .Roll-tall { aspect-ratio: 3 / 4; }
  .Roll-square { aspect-ratio: 1 / 1; }
  .Roll-wide { aspect-ratio: 4 / 3; }
}

/* The swapping frame: every shot stands in one cell beside the opening, so nothing shifts when the picture changes. */
@media (min-width: 56em) {
  .Roll-frame {
    grid-column: 9 / span 4;
    grid-row: 1 / span 4;
  }
  .Roll-shot .Photo-frame { aspect-ratio: 1 / 1; }
  .Roll-shot[data-state="hidden"] { display: grid; visibility: hidden; }
}

/* The hand-off keeps clear of the footer's large links. */
.Onward { margin-block-end: var(--space-between-sections); }
