/* Home: the bench ticket, five stops, and the deal docket. */

/* The closing ticket hands straight to the trade card: the footer's own top padding is the only gap. */
main { padding-block-end: 0; }

/* Section headings stand a step under the page title, so the h1 leads. */
main h2 { font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem); }

/* The opening ticket carries its own tighter rhythm so the whole first window holds. */
main > section:first-of-type {
  padding-block: 1.1rem clamp(1.25rem, 3vh, 2rem);
  row-gap: 0.875rem;
}
/* One centred stack: the framed picture in the middle, name, price and actions directly beneath at its width. */
main > section:first-of-type > :is(.mount, .pricetag, .pair) {
  inline-size: min(100%, 25.2rem);
  margin-inline: auto;
}
main > section:first-of-type > .mount > img {
  inline-size: 100%;
  aspect-ratio: 1 / 1;
}
main > section:first-of-type > .pair { margin-block-start: 0.5rem; }

/* Desk: the picture is cropped shallower so the price and both actions stay in the first window. */
@media (min-width: 60rem) {
  main > section:first-of-type > .mount > img { aspect-ratio: 3 / 2; }
}

main > section > h2 { margin-block-end: var(--worktop); }

/* Paired tickets end level; the photograph in a pair is shallow and fills its frame. */
.rack { align-items: stretch; }
.rack > .mount { display: flex; flex-direction: column; }
.rack > .mount > img { flex: 1 1 auto; min-block-size: 0; aspect-ratio: 16 / 9; }
.rack > .mount > figcaption { flex: none; }

/* A ticket's own h3 stands on the same 7px bar as the other headings, one step smaller again. */
.ticket > h3 {
  inline-size: fit-content;
  max-inline-size: 100%;
  padding-block-end: 0.3em;
  border-block-end: var(--bar) solid var(--magenta);
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
}

/* A photograph carried straight inside a ticket, cropped to one shape down the page. */
.ticket > img { inline-size: 100%; object-fit: cover; aspect-ratio: 4 / 3; }

/* The price list: name and price on one baseline, room to press, no rules between rows. */
.tariff { margin: 0; padding: 0; list-style: none; }
.tariff > li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem 1rem;
  min-block-size: 2.75rem;
  padding-block: 0.35rem;
}
.tariff > li > a { font-family: var(--jost); font-weight: 500; font-size: 1.0625rem; }
.tariff > li > span { font-variant-numeric: tabular-nums lining-nums; }

/* The deal docket: a shallow pale band pinned above the corner controls, on its own solid ground. */
.docket {
  position: fixed;
  inset-inline-end: calc(var(--bench) + 0.75rem);
  inset-block-end: calc(var(--bench) + 6.75rem);
  z-index: 47;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-inline-size: min(38rem, calc(100vw - 2 * var(--bench) - 1.5rem));
  padding: 0.55rem 0.55rem 0.55rem 1.25rem;
  background: var(--blush);
  color: var(--magenta);
  --hem: 0.3125rem;
  --seam: 0.5rem;
  outline: var(--twine) solid var(--magenta);
  outline-offset: calc(-1 * var(--hem));
  box-shadow: inset 0 0 0 var(--seam) var(--blush), inset 0 0 0 calc(var(--seam) + var(--thread)) var(--magenta);
}
.docket > p { margin: 0; font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem); line-height: 1.35; }
.docket > p > a { text-decoration-thickness: 0.1em; }
.docket > button {
  flex: none;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  border: 0;
  background: var(--magenta);
  color: var(--blush);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

/* Desk: the docket folds to two lines so it stays clear of the opening ticket's price and actions. */
@media (min-width: 60rem) {
  .docket { max-inline-size: 22rem; }
}

/* Motion: the docket unrolls from the right edge once, slowly, then rests. */
.js .docket {
  transform: translateX(calc(100% + 3rem));
  opacity: 0;
  transition: transform 900ms cubic-bezier(0.25, 0.8, 0.25, 1), opacity 400ms ease-out;
}
.js .docket[data-rolled="true"] { transform: none; opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .js .docket { transform: none; opacity: 1; }
}

/* Phone: the twin actions keep their even halves by giving up side padding. */
@media (max-width: 30rem) {
  .ticket .pair .action { padding-inline: 0.4rem; }
  .docket { padding-inline-start: 1rem; gap: 0.5rem; }
}
