/* Camelback Flowershop: what a product page needs beyond site.css. */

/* ---------- pieces ---------- */

/* the handoff crop on this page is 16:10 (16:9 on a phone) so the price and both pills stay in the first window; the small crops are 4:3 */
.caf-pas { --shape-of-the-crop: 16 / 10; }
.caf-pas.caf-sm { --shape-of-the-crop: 4 / 3; }

/* the slogan is one sentence, set a little tighter than running copy */
.caf-slo { line-height: 1.35; }

/* caf-opn = open: the button that wraps the photograph and opens it large (script only) */
.caf-opn {
  display: block;
  inline-size: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  line-height: 0;
}
.js .caf-opn { cursor: zoom-in; }
.caf-opn:focus-visible { outline-offset: -0.375rem; }

/* the lead and the body copy: a little air between the big sentence and the paragraphs */
.caf-blk > .caf-say + .caf-txt { margin-block-start: 1.5rem; }

/* caf-fct = facts on this page: no plate, dotted rules above and below every row, the value set larger than its label */
.caf-fct { border-block-start: var(--thickness-of-an-outline) dotted currentColor; }
.caf-fct > div { align-items: baseline; padding-block: 0.875rem; }
.caf-fct dt { font-size: var(--size-of-reading-type); }
.caf-fct dd {
  font-size: clamp(1.3125rem, 1.2rem + 0.6vw, 1.5rem);
  line-height: 1.25;
}

/* caf-aln = aloud: the one sentence a customer reads down the phone; name and price are dotted-underlined, never bold */
.caf-aln {
  margin-block: 1rem 1.5rem;
  font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2rem);
  line-height: 1.3;
}
.caf-aln strong {
  text-decoration: underline dotted;
  text-decoration-thickness: var(--thickness-of-an-outline);
  text-underline-offset: 0.25em;
}

/* caf-lad = ladder: the pair of hand-off links; caf-stp = step: one link naming the neighbour by price.
   Both labels start on the text edge of the aubergine plate above: same padding, less the outline. */
.caf-lad { display: grid; gap: 0.75rem; }
.caf-pil.caf-stp {
  display: grid;
  grid-template-columns: 1fr;
  justify-content: stretch;
  justify-items: start;
  gap: 0.125rem;
  padding-block: 0.875rem;
  padding-inline: calc(clamp(1.25rem, 0.9rem + 2vw, 2rem) - var(--thickness-of-an-outline));
  border-radius: var(--corner-of-a-panel);
  text-align: start;
}
.caf-stp span + span { font-size: var(--size-of-a-product-line); line-height: 1.3; }

/* the lead-on list: three crops of one width, passed down the column left, right, left */
.caf-fwd > .caf-lst { margin-block-start: 1.75rem; }
.caf-lst > li { inline-size: min(100%, 27rem); justify-self: start; }
.caf-lst > li:nth-child(even) { justify-self: end; }
.caf-lst .caf-pas.caf-sm { inline-size: 100%; }
/* the price stays on the name's line; a long name wraps inside its own share */
.caf-lst .caf-tag { flex-wrap: nowrap; }
.caf-lst .caf-nam { flex: 0 1 auto; min-inline-size: 0; }
.caf-lst .caf-tag a { text-decoration-thickness: 0.0625em; }

/* ---------- chrome ---------- */

/* caf-lrg = large: the dialog the script builds; caf-lgb = its bar with the name, price and close control */
.caf-lrg {
  inline-size: min(60rem, calc(100% - 1.5rem));
  max-block-size: calc(100dvh - 1.5rem);
  padding: clamp(0.75rem, 0.5rem + 1.2vw, 1.25rem);
  border: 0;
  border-radius: var(--corner-of-a-photograph);
  background: var(--colour-of-the-pills);
  color: var(--colour-of-the-type);
}
.caf-lrg::backdrop { background: rgb(33 25 66 / 0.82); }
.caf-lrg figure { margin: 0; }
.caf-lrg img {
  inline-size: 100%;
  max-block-size: calc(100dvh - 9rem);
  object-fit: contain;
  border-radius: calc(var(--corner-of-a-photograph) - 1rem);
}
.caf-lgb {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-block-start: 0.75rem;
}
.caf-lgb .caf-tag { flex: 1; padding: 0; }
.caf-lgb .caf-rnd { flex: none; border-color: var(--colour-of-the-type); }
.caf-lgb .caf-rnd:hover { background: var(--colour-of-the-type); color: var(--colour-of-the-pills); }

@media (max-width: 40rem) {
  /* the first window on a phone: a shallower crop and closer rows, so both pills show without scrolling */
  .caf-pas { --shape-of-the-crop: 16 / 9; }
  .caf-pas.caf-sm { --shape-of-the-crop: 4 / 3; }
  .caf-shf { padding-block-start: 0.5rem; }
  .caf-slo { margin-block-start: 0.25rem; font-size: 1.0625rem; line-height: 1.3; }
  .caf-shf + .caf-pas { padding-block-start: 0.75rem; }
  .caf-shf + .caf-pas > .caf-tag { padding-block-start: 0.5rem; }
  .caf-duo { margin-block-start: 0.75rem; }
}
