/* Home: the first bar (timer strip, headline, three published prices), then the pinned 30 and six answers.
   Order as in site.css: layout, type, colour, motion. */

/* ============ LAYOUT ============ */

/* First bar: ten columns of words plus one track for the timer strip, flush to the right edge */
.firstbar {
  --sam-strip: 24vw;
  --sam-bite: clamp(0.8rem, 1.6vw, 1.5rem);
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr)) var(--sam-strip);
  grid-template-rows: 1fr auto;
  column-gap: var(--sam-rest);
  row-gap: clamp(1.75rem, 6vh, 3.5rem);
  min-height: calc(100vh - var(--sam-capsule-room));
  padding-left: var(--sam-rest);
}
@supports (height: 100svh) {
  .firstbar { min-height: calc(100svh - var(--sam-capsule-room)); }
}
.firstbar__words {
  grid-column: 1 / 11;
  grid-row: 1;
  align-self: center;
  display: grid;
  justify-items: start;
  gap: 1.1rem;
  padding-top: 0.75rem;
}
.firstbar__title { margin: 0; }
.firstbar__line { display: block; }
.firstbar__slogan { margin: 0; max-width: 36rem; }
.firstbar__timer {
  grid-column: 11 / 12;
  grid-row: 1 / 3;
  position: relative;
  z-index: 1;
  min-height: 12rem;
  margin: calc(var(--sam-capsule-room) * -1) 0 0;
}
.firstbar__dial { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* The price row: three comparable columns on scalloped silver labels, the foot of the first bar.
   It runs the full width of the field and tucks its end under the scalloped edge of the strip. */
.rates {
  grid-column: 1 / 12;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.4rem, 1.2vw, 1rem);
  margin: 0 calc(var(--sam-strip) - var(--sam-bite) - 0.5rem) 1.25rem 0;
  padding: 0;
  list-style: none;
}
.rates--above-ribbon { margin-bottom: calc(var(--sam-ribbon-h) + 1.5rem); }
.rates__column { min-width: 0; }
.rates__column:last-child { padding-right: calc(1.6rem + var(--sam-bite) + 0.5rem); }
.rates__name { justify-self: start; }
.rates__name, .rates__column .tag__label { min-width: 0; overflow-wrap: break-word; }

@media (max-width: 47.49em) {
  .firstbar { --sam-strip: 18vw; min-height: 0; row-gap: 1.25rem; }
  .firstbar__timer { grid-row: 1; margin-top: 0; }
  /* On the phone the three prices are rows: the sum at the left, its name and one short line beside it */
  .rates { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; margin-right: 0; padding-right: var(--sam-rest); }
  .rates__column,
  .rates__column:last-child {
    display: grid;
    grid-template-columns: 4.75rem minmax(0, 1fr);
    column-gap: 0.6rem;
    row-gap: 0;
    align-items: center;
    padding: 0.4rem 0.9rem 0.6rem;
  }
  .rates__column .tag__sum { grid-column: 1; grid-row: 1 / span 2; }
  .rates__name { grid-column: 2; display: inline-flex; align-items: center; min-height: 2.75rem; }
  .rates__column .tag__label { grid-column: 2; }
}

/* Pinned half: one plain line under the call plate */
.tally__proviso { margin: 0; max-width: 24rem; }

/* The scrolling half borrows the ten-column count inside its own width */
.halfstave {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  column-gap: var(--sam-rest);
  row-gap: 1rem;
}

/* Photographs in the answers */
.lesson__passage > .still { margin-block: 0.4rem 1.5rem; }
.still__photo--wide { height: auto; aspect-ratio: 16 / 9; }
.still__photo--shallow { height: auto; aspect-ratio: 16 / 7; }
.still__photo--insert { height: auto; aspect-ratio: 4 / 5; }

/* The school speaking: a silver tick beside the sentence */
.spoken {
  display: grid;
  grid-template-columns: 0.5rem minmax(0, 1fr);
  column-gap: 1rem;
  margin-block: 1.5rem;
}
.spoken::before { content: ""; }

/* Instrument families: both bands on one grid. Names on the left five columns,
   the photograph on the right five, same width and same edge in each band. */
.families { margin-bottom: 1.5rem; }
.families__groups { grid-column: 1 / 6; grid-row: 1; display: grid; align-content: start; gap: 0.9rem; }
.families__insert { grid-column: 6 / 11; grid-row: 1; align-self: start; }
.families__group { display: grid; align-content: start; }
.families__group h3 { margin: 0; }
.families__names { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin: 0; padding: 0; list-style: none; }
.families__names a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.families ~ .cue { margin-top: 0.25rem; }

/* Published examples: fees, registration and totals in aligned columns */
.published { width: 100%; margin-block: 0.5rem 1.5rem; border-collapse: collapse; }
.published caption { padding-bottom: 0.7rem; text-align: left; }
.published th, .published td { padding: 0.75rem 0.8rem; text-align: left; vertical-align: top; }
.published th:first-child, .published thead td { padding-left: 0; }
.published__basis { display: block; }
@media (max-width: 47.49em) {
  .published th, .published td { padding: 0.7rem 0.45rem; }
}

/* Two gift cards, five columns each */
.pair { margin-bottom: 0.5rem; }
.pair__gift--four { grid-column: 1 / 6; }
.pair__gift--eight { grid-column: 6 / 11; }

/* Three things to have ready: a real sequence, so it is numbered */
.count {
  display: grid;
  gap: 1rem;
  margin: 0.5rem 0 1.5rem;
  padding: 0;
  list-style: none;
  counter-reset: sam-beat;
}
.count__beat {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  column-gap: 1rem;
  align-items: center;
  counter-increment: sam-beat;
}
.count__beat::before {
  content: counter(sam-beat);
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
}

/* The last word before the case photograph */
.sendoff { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1rem; margin-bottom: 1.1rem; }
.sendoff__after { margin: 0; }

/* ============ TYPE ============ */

/* The headline runs in two lines, each a block of its own. On a desk screen it is set large
   and tight so the second line spans the field beside the timer strip. */
.firstbar__title { font-size: clamp(1.6rem, 7.4vw, 2.2rem); line-height: 1.08; }
.firstbar__line { line-height: inherit; }
@media (min-width: 47.5em) {
  .firstbar__title { font-size: 7.2vw; line-height: 1; }
}
.firstbar__slogan, .spoken, .count__beat { font-size: var(--sam-size-lede); line-height: 1.45; }
.rates__name { font-size: 1.05rem; line-height: 1.25; }
.tally__proviso { font-size: var(--sam-size-body); line-height: 1.45; }
.published caption, .published thead th, .published__basis { font-size: var(--sam-size-small); line-height: 1.35; font-weight: 400; }
.published tbody th { font-weight: 400; line-height: 1.3; }
.published td { font-size: var(--sam-size-lede); line-height: 1.25; font-variant-numeric: tabular-nums; }
.count__beat::before { font-size: 1.3rem; line-height: 1; }
.pair__gift h3 a, .families__names a { text-underline-offset: 0.22em; }
@media (max-width: 47.49em) {
  .rates__column .tag__sum { font-size: 1.6rem; }
  .rates__name { font-size: 1rem; }
  .rates__column .tag__label { font-size: 0.9rem; }
}

/* ============ COLOUR ============ */

.firstbar__slogan, .tally__proviso { color: var(--sam-chalk); }
/* The silver call plate carries near-black ink, like the price labels */
.cue:not(.cue--quiet) { color: var(--sam-lacquer); }
.rates__name { color: var(--sam-lacquer); }
.rates__column :focus-visible { outline-color: var(--sam-lacquer); outline-offset: 0.1rem; }
.spoken::before { background: var(--sam-aluminum); }
.published__total { background: var(--sam-aluminum); color: var(--sam-lacquer); }
.count__beat::before { background: var(--sam-aluminum); color: var(--sam-lacquer); }

/* ============ MOTION ============ */

/* Nothing of its own. The timer strip, every photograph and the pinned 30 hold still;
   the gift ribbon's one entrance and the count-in of text blocks are set in site.css. */
