/* Product page - one enlarged ledger entry. Order: layout, type, colour, motion. */

/* ============ LAYOUT ============ */

/* The kind sits on its own line under the title, never on the title's baseline. */
.piece_head { display: grid; gap: 0.25rem; justify-items: start; }
.piece_pair { display: grid; gap: 1.25rem 2rem; margin-top: 1.25rem; align-items: start; }
.piece_pair[data-state="bare"] { grid-template-columns: minmax(0, 1fr); }
/* A taller mount and a higher crop keep the whole specimen inside, clear of the punched foot. */
.piece_figure > .specimen_mount { aspect-ratio: 11 / 10; cursor: zoom-in; }
.piece_figure > .specimen_mount img { object-position: 50% 18%; }
.piece_figure .specimen_caption { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1rem; }
.loupe_pull { min-height: 2.75rem; padding: 0.25rem 0; border: 0; background: none; cursor: pointer; }

.spec_stack { border-bottom: var(--measure-rule) solid; }
.spec_cell { display: grid; gap: 0.125rem; padding: 0.75rem 0 0.8125rem; border-top: var(--measure-rule) solid; }

.piece_words { display: grid; gap: 1rem 2.5rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: var(--measure-rule) solid; }

.intake_body > .shelf_title { margin-bottom: 1.25rem; }
.compare_pair { display: grid; border-top: var(--measure-rule) solid; border-bottom: var(--measure-rule) solid; }
.compare_cell { padding: 1rem 1rem 1rem 0; }
.compare_cell + .compare_cell { border-top: var(--measure-rule) solid; }
.compare_name { display: flex; align-items: center; gap: 0.5rem; }
.compare_text { margin-top: 0.375rem; max-width: 46ch; }
.compare_link { display: inline-flex; align-items: center; min-height: 2.75rem; margin-top: 0.25rem; }

/* Each item shares the list's three rows (mount, name, price): the mounts stand on one
   bottom edge and the captions start on one line, whatever the size of the picture. */
.also_list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: stretch; }
.also_item { grid-row: span 3; display: grid; grid-template-rows: subgrid; row-gap: 0.25rem; }
.also_item:first-child { grid-column: 1 / -1; }
.also_link { grid-row: 1 / -1; display: grid; grid-template-rows: subgrid; row-gap: 0.25rem; text-decoration: none; }
.also_link .specimen_mount { grid-row: 1; align-self: end; display: block; aspect-ratio: 4 / 3; margin-bottom: 0.375rem; }
.also_name, .also_price { display: block; }
.also_name { grid-row: 2; }
.also_price { grid-row: 3; }

/* The hand-off is one ruled ledger entry: the buttons in the first cell, a link in each cell after. */
.also_list + .handover_row { margin-top: 1.75rem; }
.handover_row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; align-items: stretch; justify-content: normal;
  border-top: var(--measure-rule) solid; border-bottom: var(--measure-rule) solid; }
.handover_actions { margin-top: 0; padding: 1rem 0; align-content: center; }
.handover_mail { max-width: 100%; min-width: 0; overflow-wrap: anywhere; }
.handover_links { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); }
.handover_links li { border-top: var(--measure-rule) solid; }
.handover_links a { display: flex; align-items: center; min-height: 2.75rem; height: 100%; padding: 0.5rem 0; }

.loupe_frame { padding: 1rem; border: var(--measure-rule) solid; max-width: min(94vw, 62rem); max-height: 94vh; overflow: auto; }
.loupe_frame[open] { display: grid; gap: 1rem; justify-items: start; }
.loupe_frame .specimen_mount { width: 100%; }
.loupe_frame img { width: 100%; height: auto; max-height: 72vh; object-fit: contain; }

/* Pinned plates (menu bookmark, consent panel, the phone's call tag) carry their own opaque
   ground, so the page passes beneath them. The punched foot is kept by masking the plate itself. */
.bookmark_strip, #storage, .call_tag {
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--measure-bite) + 0.0625rem) no-repeat,
    radial-gradient(40% 100% at 50% 100%, #0000 94%, #000 100%) bottom / calc(var(--measure-bite) * 3) var(--measure-bite) round no-repeat;
  mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--measure-bite) + 0.0625rem) no-repeat,
    radial-gradient(40% 100% at 50% 100%, #0000 94%, #000 100%) bottom / calc(var(--measure-bite) * 3) var(--measure-bite) round no-repeat;
}
/* The mask would cut a ring drawn outside the bookmark or the call tag: draw it inside. */
.bookmark_strip :focus-visible, .call_tag:focus-visible { outline-offset: -0.25rem; }

/* Phone: the consent sheet is pinned to the bottom edge and scalloped along its TOP, so the
   plate itself is masked along the top (the same shape as its outline), never along its foot. */
@media (max-width: 40rem) {
  #storage {
    -webkit-mask: linear-gradient(#000 0 0) bottom / 100% calc(100% - var(--measure-bite) + 0.0625rem) no-repeat,
      radial-gradient(40% 100% at 50% 0, #0000 94%, #000 100%) top / calc(var(--measure-bite) * 3) var(--measure-bite) round no-repeat;
    mask: linear-gradient(#000 0 0) bottom / 100% calc(100% - var(--measure-bite) + 0.0625rem) no-repeat,
      radial-gradient(40% 100% at 50% 0, #0000 94%, #000 100%) top / calc(var(--measure-bite) * 3) var(--measure-bite) round no-repeat;
  }
}

@container entry_column (min-width: 34rem) {
  .compare_pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .compare_cell + .compare_cell { border-top: 0; border-left: var(--measure-rule) solid; padding-left: 1.25rem; }
  .handover_links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .handover_links a { padding: 0.75rem 1rem 0.75rem 0; }
  .handover_links li + li { border-left: var(--measure-rule) solid; }
  .handover_links li + li a { padding-left: 1rem; }
}
@container entry_column (min-width: 46rem) {
  .piece_pair:not([data-state="bare"]) { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .spec_cell { grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1rem; }
  .piece_words { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .also_list { grid-template-columns: 5fr 4fr 3fr; }
  .also_item:first-child { grid-column: auto; }
  .handover_row { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .handover_actions { padding-right: 1rem; }
  .handover_links li { border-top: 0; border-left: var(--measure-rule) solid; }
  .handover_links a { padding: 1rem; }
}

/* ============ TYPE ============ */

.piece_title { font-family: var(--face-outfit); font-weight: 600; font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); line-height: 1.1; }
.piece_head .entry_kind { margin-top: 0; font-size: 1rem; }
.spec_term { font-size: var(--step-small); font-weight: 600; line-height: 1.35; }
.spec_text { font-size: 1.0625rem; line-height: 1.45; }
.piece_lead { font-size: var(--step-entry); font-weight: 500; line-height: 1.45; }
.piece_notes .entry_text { font-size: 1.0625rem; line-height: 1.55; }
.compare_name { font-size: var(--step-entry); font-weight: 600; line-height: 1.25; }
.compare_text { font-size: 1.0625rem; line-height: 1.5; }
.compare_link, .handover_links a { font-weight: 600; }
.handover_links a { line-height: 1.3; }
.also_name { font-size: var(--step-entry); font-weight: 600; line-height: 1.25; }
.also_price { font-size: var(--step-small); font-weight: 500; line-height: 1.35; }
.action_plate span { font-weight: 400; }
.loupe_pull { font-size: var(--step-small); font-weight: 600; text-decoration: underline; text-decoration-thickness: 0.125rem; text-underline-offset: 0.2em; }

/* ============ COLOUR ============ */

/* The pinned plates' own opaque grounds. The site sheet clears these grounds with !important
   (it paints them on a ::before); here they are put back on the plates themselves, with the
   same selectors and later in the cascade, so the letters stand on a solid ground of their own. */
.call_tag { background-color: var(--tone-cyan); }
nav.bookmark_strip { background-color: var(--tone-cyan) !important; }
nav.bookmark_strip .bookmark_pull { background-color: var(--tone-cyan) !important; }
@media (max-width: 40rem) {
  #storage, #storage .consent_text, #storage .consent_text span, #storage .consent_text a, #storage .consent_choices {
    background-color: var(--tone-plum) !important; }
}
.loupe_pull { color: var(--tone-aubergine); }
.loupe_frame { background: var(--tone-plum); color: var(--tone-aubergine); border-color: var(--tone-aubergine); }
.loupe_frame::backdrop { background: rgb(23 12 29 / 0.78); }
.compare_cell[data-state="current"] .compare_name { color: var(--tone-aubergine); }
.also_link:hover .also_name, .also_link:focus-visible .also_name { text-decoration: underline; text-decoration-thickness: 0.125rem; }
.compare_link:hover, .handover_links a:hover { text-decoration-thickness: 0.1875rem; }

/* ============ MOTION ============ */

/* Nothing on this page moves. Hover, focus and the enlarged picture change at once. */
.loupe_frame, .loupe_frame::backdrop { animation: none; transition: none; }
