/* program page: a three-print hang, the name set as one phrase up top, a case-lid line under it */

/* the hang */
.the-small-hang { padding-top: clamp(1rem, 3vh, 2rem); }

/* the two words of the name sit together as one phrase at the top of the wall */
.the-split {
  display: block;
  --the-hang: 2 / span 15; --the-rung: 1;
  align-self: end;
  padding-bottom: 0.25rem;
  overflow-wrap: anywhere;
}
.the-corner-top, .the-corner-foot {
  display: inline;
  padding: 0;
  text-align: left;
}
/* a one-word name loses its second corner: the kind stands under the hang instead */
.the-wall > p.the-corner-foot {
  --the-hang: 2 / span 15;
  padding-inline: var(--the-edge);
  opacity: 0.75;
}

.the-print-main { --the-hang: 1 / 16; --the-rung: 2 / span 3; }
.the-print-main img { max-height: min(58vh, 34rem); }
.the-stamp-here {
  --the-hang: 14 / span 4; --the-rung: 2;
  justify-self: center; align-self: start;
  margin-top: 1.5rem;
}
.the-side-a { --the-hang: 17 / -1; --the-rung: 1 / span 2; align-self: end; }
.the-gap { --the-hang: 17 / -1; --the-rung: 3; padding-right: var(--the-edge); }
.the-side-b { --the-hang: 19 / -1; --the-rung: 4; }
.the-kind { margin: 0 0 0.6rem; font-size: 1rem; }

/* pressing a print opens it large; the button the script puts round it */
.the-press {
  display: block; width: 100%;
  cursor: zoom-in;
}
.the-press img { transition: transform var(--the-quick); }
.the-press:hover img, .the-press:focus-visible img { transform: translate(0.125rem, -0.125rem); }

.the-viewer {
  max-width: 94vw; max-height: 92vh; padding: 0;
  border: 0; background: var(--the-shade); color: var(--the-chalk);
}
.the-viewer::backdrop { background: rgba(21, 32, 43, 0.88); }
.the-viewer img { display: block; max-width: 94vw; max-height: calc(92vh - 3rem); width: auto; height: auto; }
.the-shut {
  display: block; min-height: 2.75rem; padding: 0 1rem; margin-left: auto;
  font: 400 1.125rem/1 var(--the-stencil);
  text-decoration: underline 0.125rem var(--the-brass); text-underline-offset: 0.22em;
}

/* the case-lid line */
.the-lid {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 0.35rem clamp(1.5rem, 5vw, 5rem);
  margin: 0; padding: clamp(1.25rem, 3vh, 2rem) var(--the-edge) 0;
  font: 400 clamp(1.2rem, 0.85rem + 1.5vw, 2.25rem)/1.2 var(--the-stencil);
  letter-spacing: 0.03em; text-transform: lowercase;
}
.the-lid-rung { margin-left: auto; color: var(--the-gleam); }

/* the body beside a second crop */
.the-crop { --the-hang: 1 / 13; --the-narrow: 1 / -1; }
.the-crop img { aspect-ratio: 4 / 5; object-position: 68% 45%; max-height: 78vh; }
.the-told {
  --the-hang: 14 / span 10;
  align-self: center;
  max-width: 38rem; padding-right: var(--the-edge);
}
.the-told > h2 { margin-bottom: 1.25rem; }
.the-told-wide { --the-hang: 4 / span 18; }

/* the plain facts: two staves of one ledger, each label hugging its value */
.the-plain { padding-inline: var(--the-edge); }
.the-plain > h2 { margin-bottom: 0.75rem; }
.the-tally-wide dd { font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.3rem); }
@container tally (min-width: 40rem) {
  .the-tally-wide { columns: 2; column-gap: clamp(2rem, 5vw, 4.5rem); }
  .the-tally-wide > div {
    break-inside: avoid;
    grid-template-columns: minmax(6rem, 8rem) minmax(0, 1fr);
    column-gap: clamp(0.75rem, 1.6vw, 1.35rem);
  }
  .the-tally-wide dd { text-align: left; }
}

/* leading on: three prints, three sizes, and one name dropped into the gap */
.the-more-head { padding: 0 var(--the-edge) 1.25rem; }
.the-more { row-gap: clamp(1rem, 3vh, 2rem); }
.the-more-print { display: block; text-decoration: none; }
.the-more-print:hover .the-stencil-small { text-decoration: underline 0.125rem var(--the-brass); text-underline-offset: 0.2em; }
.the-more-print .the-label { display: block; padding: 0.5rem 0 0; }

.the-more > :nth-child(1) { --the-hang: 1 / span 16; --the-rung: 1; }
.the-more > :nth-child(1) img { aspect-ratio: 16 / 9; }
.the-more > :nth-child(2) { --the-hang: 18 / -1; --the-rung: 1; align-self: end; }
.the-more > :nth-child(2) img { aspect-ratio: 4 / 5; }
.the-more > :nth-child(3) {
  --the-hang: 1 / span 13; --the-rung: 2;
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  column-gap: clamp(0.9rem, 2.2vw, 2rem);
  align-items: end;
}
.the-more > :nth-child(3) .the-print { grid-column: 1; }
.the-more > :nth-child(3) .the-label { grid-column: 2; padding: 0 0 0.15rem; }
.the-more > :nth-child(3) img { aspect-ratio: 1 / 1; }

/* narrow band: the two words read as one phrase, then the hang folds to two columns */
@container band (max-width: 44rem) {
  .the-split { --the-hang: 1 / -1; }
  .the-print-main { --the-narrow: 1 / -1; }
  .the-print-main img { max-height: 44vh; }
  .the-wall > .the-stamp-here {
    --the-sum: 1.9rem;
    --the-narrow: 1 / -1;
    justify-self: end;
    margin: 0 var(--the-edge) 0 0;
    width: 7.25rem;
    min-height: 7.25rem;
    aspect-ratio: auto;
    padding: 0.85rem;
    gap: 0.3rem;
    transform: none;
  }
  .the-stamp-here .the-stamp-word,
  .the-stamp-here .the-stamp-sum { line-height: 1.25; }
  .the-side-a, .the-side-b { align-self: start; }
  .the-side-a img { aspect-ratio: 1 / 1; }
  .the-wall > .the-gap { order: 3; }
  .the-crop img { max-height: 60vh; }
  .the-told { padding-left: var(--the-edge); }
  .the-more > a { padding-inline: 0; }
  .the-more > :nth-child(1),
  .the-more > :nth-child(2),
  .the-more > :nth-child(3) { --the-narrow: 1 / -1; }
  .the-more > :nth-child(2) img,
  .the-more > :nth-child(3) img { aspect-ratio: 3 / 2; }
  .the-more > :nth-child(3) { display: block; }
  .the-more-print .the-label,
  .the-more > :nth-child(3) .the-label { padding: 0.5rem var(--the-edge) 0; }
}
@media (max-width: 47.9rem) {
  .the-lid-rung { margin-left: 0; }
}
