/* A product page: the opening spread, the particulars, the leading-on row, the octave and the large picture. */

/* The opening spread: one slim label line (the kind, with the count-in mark at cap height beside it),
   then the name and line, the picture at the right. */
.Product-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
}
.Product-kind {
  font-size: inherit;
  font-weight: 500;
  font-variation-settings: "wght" 500;
  line-height: 1.3;
}
.Product-label .Count {
  --size-of-a-beat: 0.45em;
  flex: none;
  padding-block-start: calc(var(--size-of-a-beat) * 0.3);
  border-block-end-width: 0.1875rem;
}
.Product-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; }
.Product-mail { display: inline-flex; align-items: center; min-block-size: 2.75rem; }
.Product-head .Intro-sentence { margin-block-end: 1.25rem; }

/* On a desk screen the label line, the name and the story all start at the left edge and run
   across the first two lanes, the story in two columns; the picture holds the right lane beside them. */
@media (min-width: 56em) {
  .Product-open .Product-label { grid-column: 1 / span 8; grid-row: 1; }
  .Product-open .Product-head { grid-column: 1 / span 8; grid-row: 2; }
  .Product-open .Spread-side { grid-row: 1 / span 3; }
  .Product-open .Product-text {
    grid-column: 1 / span 8;
    grid-row: 3;
    columns: 2;
    column-gap: var(--space-between-columns);
  }
  .Product-open .Product-text > * { break-inside: avoid-column; }
}

/* The picture is a button once the script has wrapped it. */
.Photo-press {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: zoom-in;
}
.Photo-press:focus-visible { outline-offset: -0.5rem; }
.Photo-press > img { inline-size: 100%; block-size: 100%; object-fit: cover; }

/* The particulars, on deep slate: six pairs set as one clear two-row grid, three to a row,
   the label pale and quiet, the value solid beside it. */
.Product-panel {
  --depth-of-the-step: clamp(1.5rem, 4vw, 3.5rem);
  --colour-of-the-panel-label: #b9c7ce;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  background: var(--colour-of-the-deep-slate);
  color: 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%);
}
.Product-particulars {
  grid-template-columns: minmax(0, 1fr);
  gap: 0 1.5rem;
  margin-block-start: 1.25rem;
  font-size: var(--size-of-running-type);
  line-height: 1.4;
}
.Product-particulars > div {
  display: grid;
  grid-template-columns: minmax(6rem, 8.5rem) minmax(0, 1fr);
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  padding-block: 0.5rem;
}
.Product-particulars dt {
  font-weight: 400;
  font-variation-settings: "wght" 400;
  color: var(--colour-of-the-panel-label);
}
.Product-particulars dd { font-weight: 500; font-variation-settings: "wght" 500; }
@media (min-width: 48em) {
  .Product-particulars { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* The housekeeping line: a pull line, a size under the headings so it leads without outshouting the h1. */
.Product-pull {
  font-size: clamp(1.5rem, 1.15rem + 0.55vw, 1.75rem);
  font-weight: 500;
  font-variation-settings: "wght" 500;
  line-height: 1.3;
}

/* Other places to start: three pictures of unequal width on one common bottom edge,
   their captions level, the name given a two-line box so every price sits on one line. */
.Elsewhere-list { display: grid; gap: 1.5rem var(--space-between-columns); }
.Elsewhere-link { display: block; text-decoration: none; }
.Elsewhere-link .Photo { grid-template-rows: auto auto; align-content: start; }
.Elsewhere-link .Photo-frame {
  aspect-ratio: auto;
  block-size: clamp(10rem, 19vw, 15.5rem);
}
.Elsewhere-link .Photo-words { display: grid; gap: 0.125rem; }
.Elsewhere-name {
  display: block;
  min-block-size: 2.5em;
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem);
  font-weight: 500;
  font-variation-settings: "wght" 500;
  line-height: 1.25;
}
.Elsewhere-link:hover .Elsewhere-name, .Elsewhere-link:focus-visible .Elsewhere-name {
  text-decoration: underline;
  text-decoration-color: var(--colour-of-the-ochre);
  text-decoration-thickness: 0.1875rem;
  text-underline-offset: 0.2em;
}
@media (min-width: 48em) {
  .Elsewhere-list { grid-template-columns: 5fr 4fr 3fr; align-items: end; }
}

/* The octave: twelve slim keys in keyboard order on one ochre rail, the white ones tinted ivory,
   the black ones narrow and dark, the current one pressed down in ochre. */
.Octave {
  --colour-of-the-white-key: #dbe5e8;
  padding-inline: var(--space-at-the-page-edge);
  padding-block-end: var(--space-between-sections);
}
.Octave-scroll { position: relative; overflow-x: auto; margin-block-start: 1.5rem; padding: 0.5rem 0 0.625rem; }
.Octave-keys {
  display: grid;
  grid-template-columns: repeat(12, minmax(5rem, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}
.Octave-link { display: block; color: inherit; text-decoration: none; }
.Octave-stand {
  display: flex;
  align-items: flex-start;
  block-size: clamp(5.5rem, 13vh, 7rem);
  padding-inline: clamp(0.35rem, 0.9vw, 0.7rem);
  border-block-end: var(--thickness-of-the-bar) solid var(--colour-of-the-ochre);
}
.Octave-key {
  --depth-of-the-step: 0.6rem;
  flex: 1 1 auto;
  block-size: 100%;
  background: var(--colour-of-the-white-key);
  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: translate 160ms var(--ease-with-weight), background-color 300ms var(--ease-with-weight);
}
.Octave-place[data-reach="short"] .Octave-key {
  --depth-of-the-step: 0.4rem;
  flex: 0 0 56%;
  margin-inline: auto;
  background: var(--colour-of-the-deep-slate);
}
.Octave-place[data-state="pressed"] .Octave-key { background: var(--colour-of-the-ochre); translate: 0 0.3rem; }
a.Octave-link:hover .Octave-key { translate: 0 0.15rem; }
.Octave-name {
  display: block;
  padding: 0.625rem 0.25rem 0;
  font-size: clamp(0.9375rem, 0.85rem + 0.3vw, 1.0625rem);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
a.Octave-link:hover .Octave-name { text-decoration: underline; text-decoration-color: var(--colour-of-the-ochre); text-decoration-thickness: 0.1875rem; }
.Octave-place[data-state="pressed"] .Octave-name { font-weight: 500; font-variation-settings: "wght" 500; }
.Octave-link:focus-visible { outline-offset: 0; }

/* The hand-off on a product page: the line held inside the heading range so it never outshouts the h1,
   and the second tab set in deep slate beside the ochre one. */
.Product .Onward-line { font-size: clamp(1.5rem, 1rem + 1.6vw, 2.375rem); }
.Key.Onward-write {
  --colour-of-the-key: var(--colour-of-the-deep-slate);
  color: var(--colour-of-the-pale-ink);
}

/* The large picture, opened by the script. */
.Large {
  max-inline-size: min(92vw, 70rem);
  max-block-size: 94vh;
  padding: 0;
  border: 0;
  background: var(--colour-of-the-deep-slate);
  color: var(--colour-of-the-pale-ink);
}
.Large::backdrop { background: rgb(7 23 29 / 0.82); }
.Large-body { display: grid; gap: 1rem; justify-items: start; padding: 1rem; }
.Large-picture {
  --depth-of-the-step: clamp(1.5rem, 4vw, 3.5rem);
  inline-size: 100%;
  block-size: auto;
  max-block-size: 74vh;
  object-fit: contain;
  background: var(--colour-of-the-deep-slate);
  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%);
}

@media (prefers-reduced-motion: reduce) {
  .Octave-key { transition: none; }
}
