/* Where an order has got to (templates/order-progress.html), on its own
   page and on the landing page: its pill, filled in the look's colours;
   the two days that matter, large; and the four steps from ordered to
   delivered, joined by a line, solid as far as the order has got and
   dashed after. Then the order's own page (templates/order.html): its
   cards, its postage and payment, and ordering it again. */

/* The pill, filled: under way in the chosen vermilion, posted in green. */
.order-where [rst-status], .home-order [rst-status] {
  min-height: 1.75rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 650;
}
.order-where [rst-status][rst-tone~="warning"], .home-order [rst-status][rst-tone~="warning"] { background: var(--chosen); color: var(--chosen-ink); }
.order-where [rst-status][rst-tone~="positive"], .home-order [rst-status][rst-tone~="positive"] { background: var(--go); color: var(--go-ink); }

/* The two days, side by side between rules. */
.order-days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1rem 2rem;
}
.order-days > div { display: grid; gap: 0.3rem; align-content: start; }
.order-day-label, .order-day-note { font-size: 0.9375rem; color: var(--on-soft); }
.order-day {
  font: var(--display-weight) 2.6rem/1 var(--display);
  font-stretch: var(--size-stretch);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* The steps: a mark for each, joined to the next by a line from its
   right, solid once the step is done. */
.order-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}
.order-steps li { position: relative; display: grid; gap: 0.5rem; align-content: start; padding-right: 0.5rem; line-height: 1.25; }
.order-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 2.25rem;
  right: 0;
  top: calc(1.125rem - 1px);
  border-top: 2px dashed var(--rule);
}
.order-steps li.done:not(:last-child)::after { border-top-style: solid; border-top-color: var(--on); }
.order-step-mark {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px dashed var(--rule);
  background: var(--sheet);
  color: var(--on-soft);
}
.order-step-mark .icon { width: 1.125rem; height: 1.125rem; }
.order-steps .done .order-step-mark { border: 0; background: var(--on); color: var(--sheet); }
.order-steps .done .order-step-mark .icon { stroke-width: 3; }
.order-steps .now .order-step-mark { border: 0; background: var(--chosen); color: var(--chosen-ink); box-shadow: 0 0 0 4px var(--chosen-soft); }
.order-step-label { font-weight: 650; }
.order-steps .now .order-step-label { font-weight: 750; color: var(--chosen); }
.order-step-when { font-size: 0.875rem; color: var(--on-soft); }

/* On a phone the four don't fit across: they go down the page, the
   line running down from each mark to the next. */
@media (max-width: 30rem) {
  .order-steps { grid-template-columns: 1fr; gap: 1rem; }
  .order-steps li { grid-template-columns: 2.25rem 1fr; column-gap: 0.75rem; row-gap: 0.1rem; padding: 0; }
  .order-step-mark { grid-row: span 2; }
  .order-step-label { align-self: end; }
  .order-steps li:not(:last-child)::after {
    left: calc(1.125rem - 1px);
    right: auto;
    top: 2.25rem;
    bottom: -1rem;
    border-top: 0;
    border-left: 2px dashed var(--rule);
  }
  .order-steps li.done:not(:last-child)::after { border-left-style: solid; border-left-color: var(--on); }
}

/* ── The order's own page. ─────────────────────────────────────────── */
.order-back { margin: 0 0 0.5rem; font-size: 0.9375rem; }
.order-back a { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 2.75rem; }
.order-back .icon { width: 1rem; height: 1rem; }
.order-head [rst-page-header] { margin: 0; }
.order-where, .order-cards, .order-details { margin-top: 2.25rem; }
.order-where { display: grid; gap: 1.5rem; }
.order-where h2, .order-cards h2, .order-details h2 {
  margin: 0;
  font: var(--display-weight) 1.5rem/1.15 var(--display);
  font-stretch: var(--display-stretch);
  letter-spacing: -0.015em;
}
.order-where-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.875rem; }
.order-where .order-days { padding: 1.25rem 0; border-block: 1px solid var(--rule); }
.order-where-note { max-width: 32rem; font-size: 0.9375rem; line-height: 1.45; color: var(--on-soft); }
.order-where-note p { margin: 0; }
.order-where-note p + p { margin-top: 0.5rem; }

/* Its cards: the front, two askew if more than one was printed, what
   it is and on what paper, and how many, large, on the right. */
.order-cards { padding-top: 2rem; border-top: 1px solid var(--rule); }
.order-cards-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; margin-bottom: 0.5rem; }
.order-cards-head span { font-size: 0.9375rem; color: var(--on-soft); }
.order-cards ul { margin: 0; padding: 0; list-style: none; }
.order-item { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 1.75rem; padding: 1.5rem 0; border-bottom: 1px solid var(--doc-rule, light-dark(#cfcac0, #3a3631)); }
.order-item-fronts { position: relative; flex: none; display: grid; width: 8.25rem; }
.order-item-fronts > * { grid-area: 1 / 1; width: 6.25rem; box-shadow: 0 2px 6px rgb(var(--shade) / 0.25), 0 16px 22px -8px rgb(var(--shade) / 0.45); rotate: -3deg; }
.order-item-fronts > img:first-child:not(:last-child) { margin-left: 1.5rem; rotate: 7deg; box-shadow: 0 1px 3px rgb(var(--shade) / 0.25); }
.order-item-fronts.landscape { width: 10.5rem; }
.order-item-fronts.landscape > * { width: 8.75rem; }
.order-item-blank { display: block; aspect-ratio: 5 / 7; border: 1px dashed var(--rule); box-shadow: none !important; }
.order-item-fronts.landscape .order-item-blank { aspect-ratio: 7 / 5; }
.order-item-text { flex: 1 1 14rem; min-width: 0; display: grid; gap: 0.625rem; justify-items: start; }
.order-item h3 { margin: 0; font-size: 1.1875rem; line-height: 1.2; font-weight: 750; }
.order-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0; font-size: 0.9375rem; color: var(--on-soft); }
.order-item-paper { display: inline-flex; align-items: center; min-height: 1.875rem; padding: 0 0.625rem; border: 1px solid var(--rule); border-radius: var(--radius); color: var(--on); }
.order-item-paper strong { margin-right: 0.3rem; font-weight: 750; }
.order-item-text > a { font-size: 0.9375rem; }
.order-item-gone { margin: 0; font-size: 0.9375rem; color: var(--on-soft); }
.order-item-count { flex: none; display: grid; margin: 0; text-align: right; font-size: 0.875rem; color: var(--on-soft); }
.order-item-count span {
  font: var(--display-weight) 2.6rem/1 var(--display);
  font-stretch: var(--size-stretch);
  font-variant-numeric: tabular-nums;
  color: var(--on);
}

/* Postage and payment: a label beside each. */
.order-details { display: grid; gap: 1rem; }
.order-details dl { display: grid; grid-template-columns: minmax(6.5rem, max-content) minmax(0, 1fr); gap: 0.875rem 2rem; margin: 0; }
.order-details dt { padding-top: 0.1rem; font-size: 0.9375rem; color: var(--on-soft); }
.order-details dd { margin: 0; line-height: 1.45; }

/* The foot, under a heavy rule: the way back on the left, ordering it
   again on the right, its hint beside the button. */
.order-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--on);
}
.order-foot > a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.order-foot form { flex: 1 1 20rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.75rem 1.25rem; }
.order-foot form p { max-width: 17rem; margin: 0; font-size: 0.9375rem; line-height: 1.45; color: var(--on-soft); text-align: right; }
.order-foot [rst-btn] .icon { width: 1.125rem; height: 1.125rem; }

@media (max-width: 30rem) {
  .order-day { font-size: 2.1rem; }
  .order-item-count span { font-size: 2.1rem; }
  .order-foot form { justify-content: stretch; }
  .order-foot form p { text-align: left; }
  .order-foot [rst-btn] { width: 100%; justify-content: center; }
}
