/* A lesson page: one sheet, one tall key of a picture, the question under it. It runs in the order the page is read. */

/* The opening spread: head and words on the right three columns, the picture and its question on the left three. */
.lessonSpread {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: var(--space-between-columns);
  row-gap: 1.25rem;
  align-items: start;
  padding: var(--room-under-the-upper-keys) var(--margin-of-the-spread) var(--space-between-sections);
}
.lessonSpread > * { grid-column: 1 / -1; }
.lessonHead { display: grid; gap: 0.6rem; }
.kindLine { display: flex; align-items: center; gap: 0.6rem; }
.kindLine::before {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.9rem;
  background: var(--colour-of-the-orange);
  border-radius: 0 0 0.2rem 0.2rem;
}

/* The picture as one tall key, pressed to open large; the ask key sits right under it, no wider than its question. */
.pictureColumn { display: grid; gap: 0.8rem; justify-items: start; }
.lessonPicture { display: grid; gap: 0.6rem; width: 100%; margin: 0; }
.pictureOpener {
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0 0 calc(var(--curve-of-a-key-foot) * 1.5) calc(var(--curve-of-a-key-foot) * 1.5);
  cursor: zoom-in;
}
.enlargeHint { font-size: var(--size-of-small-text); }
.askKey {
  display: grid;
  gap: 0.3rem;
  width: auto;
  max-width: 100%;
  padding: 0.8rem 1.2rem 1rem;
}
.askLabel { font-size: var(--size-of-small-text); text-decoration: underline; text-underline-offset: 0.25em; }
.askQuestion { font-size: 1.375rem; line-height: 1.25; }

/* The words: lead, the paragraphs at their full measure, the tuition key at the foot of the last one, and the text links. */
.lessonWords { display: grid; gap: 1.25rem; }
.lessonWords > .standfirst { margin-top: 0; }
.bodyColumn > p + p { margin-top: 1.1rem; }
.bodyColumn > .priceKey { margin-top: 1.5rem; }
.priceKey {
  width: fit-content;
  max-width: 100%;
  min-height: 0;
  gap: 0.35rem;
  padding: 0.85rem 1.2rem 1rem;
}
.priceLabel { font-size: var(--size-of-small-text); text-decoration: underline; text-underline-offset: 0.25em; }
.priceLine { font-size: 1.0625rem; line-height: 1.3; }
.routeLine a { text-underline-offset: 0.25em; }

@media (min-width: 56rem) {
  .lessonSpread { grid-template-rows: auto 1fr; }
  .lessonSpread > .lessonHead { grid-column: 4 / span 3; grid-row: 1; }
  .lessonSpread > .pictureColumn { grid-column: 1 / span 3; grid-row: 1 / span 2; }
  .lessonSpread > .lessonWords { grid-column: 4 / span 3; grid-row: 2; }
  .lessonPicture img { aspect-ratio: auto; height: clamp(18rem, calc(100vh - 18rem), 40rem); }
  .lessonWords { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--space-between-columns); }
  .lessonWords > .standfirst { grid-column: 1 / -1; grid-row: 1; }
  .bodyColumn { grid-column: 1 / -1; grid-row: 2; }
  .routeLine { grid-column: 1 / -1; grid-row: 3; }
  .wordsOnly > .lessonHead { grid-column: 1 / span 3; }
  .wordsOnly > .pictureColumn { grid-row: 2; }
  .wordsOnly > .lessonWords { grid-row: 1 / span 2; }
}

/* The particulars run the width of the grid as a set table: a small key at each label, a hairline per row, the value close by. */
.specSection { padding: 0 var(--margin-of-the-spread) var(--space-between-sections); }
.specSection h2 { margin-bottom: 0.75rem; }
.termSheet { display: block; }
.termSheet > div {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
  column-gap: 1.5rem;
  align-items: baseline;
  padding-block: 0.65rem;
  border-top: 0.0625rem solid color-mix(in srgb, currentColor 30%, transparent);
}
.termSheet > div:last-child { border-bottom: 0.0625rem solid color-mix(in srgb, currentColor 30%, transparent); }
.termSheet > div > dt, .termSheet > div > dd { grid-column: auto; }
.termSheet dt {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-top: 0;
  font-size: var(--size-of-small-text);
  line-height: 1.3;
  text-decoration: none;
}
.termSheet dt::before {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.9rem;
  background: color-mix(in srgb, currentColor 45%, transparent);
  border-radius: 0 0 0.2rem 0.2rem;
}
.termSheet .marked dt::before { background: var(--colour-of-the-orange); }
.termSheet dd { font-size: var(--size-of-reading-text); line-height: 1.45; }

/* The hand-off: two other lessons, the same crop height on both, each caption against its own picture on one baseline. */
.otherLessons { padding: 0 var(--margin-of-the-spread) var(--space-between-sections); }
.otherLessons h2 { margin-bottom: 0.5rem; }
.otherNote { margin-bottom: 1.25rem; }
.otherRun {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: var(--space-between-columns);
  row-gap: 1.5rem;
  align-items: start;
}
.otherRun > * { grid-column: 1 / -1; }
.otherLesson { align-content: start; padding-bottom: 0.6rem; text-decoration: none; }
.otherLesson img { aspect-ratio: auto; height: clamp(11rem, 17vw, 15rem); }
.otherCaption { display: grid; gap: 0.25rem; padding-inline: 0.1rem; }
.otherName { font-size: var(--size-of-a-minor-heading); }
.otherPrice { font-size: var(--size-of-reading-text); line-height: 1.35; }
@media (min-width: 56rem) {
  .otherRun > :first-child { grid-column: 1 / span 4; }
  .otherRun > :last-child { grid-column: 5 / span 2; }
  .otherRun > :only-child { grid-column: 1 / -1; }
}

/* The large picture: a dialog the script builds, in the same key silhouette. */
.pictureSheet {
  width: min(92vw, 72rem);
  max-width: 92vw;
  max-height: 94vh;
  padding: 0;
  overflow: auto;
  background: var(--colour-of-the-navy);
  color: var(--colour-of-the-lemon);
  border: 0;
  border-radius: 0 0 var(--curve-of-a-key-foot) var(--curve-of-a-key-foot);
}
.pictureSheet::backdrop { background: rgb(17 26 43 / 0.88); }
.pictureSheet :focus-visible { outline-color: var(--colour-of-the-orange); }
.sheetBody { display: grid; justify-items: start; gap: 0.75rem; padding: 0.75rem 0.75rem 1rem; }
.sheetBody img {
  width: 100%;
  max-height: calc(94vh - 7rem);
  object-fit: contain;
  filter: grayscale(1);
  border-radius: 0 0 var(--curve-of-a-key-foot) var(--curve-of-a-key-foot);
}
.shutKey { background: var(--colour-of-the-lemon); color: var(--colour-of-the-navy); }
.shutKey:hover, .shutKey:focus-visible { background: var(--colour-of-the-orange); color: var(--colour-of-the-navy); }
