/* Services - the sorting row and eight ledger rows. Order: layout, type, colour, motion. */

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

/* Shelf heading: a ledger row labelled by name only; its rail cell stays blank, numbers belong to the entries. */
.shelf_head { display: grid; grid-template-columns: var(--measure-rail) minmax(0, 1fr); border-bottom: var(--measure-rule) solid; }
.shelf_rail { padding: var(--measure-entry) var(--measure-space); }
.shelf_text { min-width: 0; border-left: var(--measure-rule) solid; padding: var(--measure-entry) calc(var(--measure-space) * 1.25); }
.shelf_intro { max-width: 64ch; margin-top: 0.75rem; }
.shelf_group[data-state="empty"] { display: none; }

/* A specimen beside its text: one fixed text-column edge; only the photo width varies inside its bay. */
.service_pair { display: grid; gap: var(--measure-space); align-items: start; }
.service_figure { margin: 0; width: 100%; max-width: 30rem; }
.service_figure a { display: block; }
/* The photo stops one bite short of the mount's foot, so the scallops are punched out of the mount's own fill. */
.service_pair .specimen_mount { max-height: 22rem; padding-bottom: var(--measure-bite-photo); }
.service_text { min-width: 0; display: flex; flex-direction: column; }
.service_text .answer_set { grid-template-columns: 1fr; }
.service_text .answer_cell + .answer_cell { border-left: 0; border-top: var(--measure-rule) solid; padding-left: 0; }
.opening_line + .entry_text { margin-top: 0.875rem; }
@container entry_column (min-width: 40rem) {
  .service_pair { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: stretch; }
  .service_pair .service_figure { max-width: none; }
  /* A narrow photo stands against the text side of its bay, so the gap to the text is the same in every entry. */
  .service_pair[data-bay="narrow"] .service_figure { width: 72%; justify-self: end; }
  /* The three ruled answers share the height of the photo, so the row is filled to its foot. */
  .service_text .answer_set { flex: 1 1 auto; grid-auto-rows: 1fr; }
  /* The opening note sits at the foot of the photo. */
  .opening_pair .service_text { justify-content: flex-end; }
}

/* The sorting row: five plates in one row that scrolls sideways when it must. */
.sorting_set { display: flex; flex-wrap: nowrap; gap: 0.75rem; margin-top: 1.25rem; padding: 0.25rem 0.25rem 0.5rem;
  overflow-x: auto; scroll-padding-inline: 0.25rem; }
.sorting_plate { flex: 0 0 auto; white-space: nowrap; }
.sorting_status { margin-top: 0.5rem; min-height: 1.35em; }
html:not(.js) .sorting_row { display: none; }

/* Rows lifted to the top, then the ruled line that parts them from the rest. */
.sorted_top:empty { display: none; }
.other_line { display: grid; grid-template-columns: var(--measure-rail) minmax(0, 1fr); border-bottom: var(--measure-rule) solid; }
.other_text { grid-column: 2; border-left: var(--measure-rule) solid; padding: 0.625rem calc(var(--measure-space) * 1.25); }
.intake_number .tick_marker { display: none; margin-left: 0.5rem; vertical-align: 0.1em; }
.intake_row[data-state="matched"] .tick_marker { display: inline-block; }

@container page_column (max-width: 40rem) {
  .shelf_head, .other_line { grid-template-columns: 3.25rem minmax(0, 1fr); }
  .shelf_rail { padding: 1rem 0.5rem; }
  .shelf_text { padding: 0.75rem var(--measure-space) 1.25rem; }
  .other_text { padding-inline: var(--measure-space); }
  .intake_number .tick_marker { display: none !important; }
  .intake_row[data-state="matched"] .intake_number { box-shadow: inset 0.375rem 0 0 var(--tone-cyan); }
}

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

.shelf_intro { font-size: var(--step-entry); line-height: 1.45; }
.sorting_title { font-family: var(--face-slab); font-weight: 900; font-size: var(--step-title); line-height: 1.15; }
.other_text { font-weight: 600; font-size: var(--step-small); line-height: 1.3; }
.service_text .entry_head { font-size: var(--step-title); }
.service_text .entry_head a { text-decoration: none; }
.service_text .entry_head a:hover { text-decoration: underline; }
.service_text .answer_text { font-size: 1.0625rem; }
.intake_row[data-state="matched"] .intake_number { text-decoration: underline; text-decoration-thickness: 0.125rem; text-underline-offset: 0.2em; }
.sorting_plate { font-size: 1rem; }
.sorting_plate[data-state="pressed"] { text-decoration: underline; }

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

.shelf_head, .other_line { border-color: var(--tone-aubergine); }
.shelf_intro, .other_text { color: var(--tone-aubergine); }
.sorting_title { color: var(--tone-aubergine); }
/* A button's own default ground would show through the punched bites: clear it, so the scallops are cut in plum. */
.sorting_plate { background: none; background-color: transparent; }
.sorting_plate[data-state="pressed"] { --tone-plate: var(--tone-cyan); color: var(--tone-aubergine); }
.intake_number .tick_marker { box-shadow: 0 0 0 0.125rem var(--tone-aubergine); }
.service_text .entry_head a { color: var(--tone-aubergine); }
/* Every mount carries one slightly darker plum fill, so its scalloped foot reads against the ground whatever the photo. */
.service_pair .specimen_mount { background-color: color-mix(in srgb, var(--tone-aubergine) 22%, var(--tone-plum)); }

/* What stands over the page carries an opaque ground of its own, on the element itself, so the
   page passes beneath it. It is clipped to the content box: the punched edge stays in the padding.
   The site sheet clears these grounds with !important, so they are set here with a longer
   selector and !important, or they would never arrive. */
html nav.bookmark_strip { background: var(--tone-cyan) content-box !important; }
html nav.bookmark_strip .bookmark_pull { background: var(--tone-cyan) !important; }
html aside#storage { background: var(--tone-paper) content-box !important; }
html aside#storage .consent_text { background: var(--tone-paper) !important; }
@media (max-width: 40rem) {
  /* Phone: the pinned sheet is plum, so its own ground is plum too. */
  html aside#storage { background: var(--tone-plum) content-box !important; }
  html aside#storage .consent_text { background: var(--tone-plum) !important; }
}
/* The pinned call on phones: the page's text passes beneath its own cyan ground. */
.call_tag { background-color: var(--tone-cyan); background-clip: content-box; }

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

/* Mechanical: the cyan tick drops into the rail in three equal jumps, then stops. */
@keyframes tick_step { from { transform: translateY(-0.9rem); } to { transform: none; } }
.intake_row[data-state="matched"] .tick_marker { animation: tick_step 135ms steps(3, end) both; }
@media (prefers-reduced-motion: reduce) {
  .intake_row[data-state="matched"] .tick_marker { animation: none; }
}
