/*
 * EncodeLabel: the few looks the money pages (Pricing, Credits, Orders) need
 * on top of the shared stylesheet. Everything else on those pages is the
 * ordinary site.css: cards, grids, tiles, tables, alerts, badges.
 *
 * Colours only ever come from the names at the top of site.css, so the light
 * and dark themes both work without anything extra here.
 *
 *   .tiles-3       three facts side by side (Credits)
 *   .pack          one credit pack: size, price, button
 *   .price-from    the "From $0.03 a label" line (Pricing)
 *   .fact-list     a name on the left, its value on the right; .is-prices for money
 *   .order-list / .order-row    the list of orders
 *   .order-thumb   the small picture of a label
 *   .order-what    that picture beside the label's name
 *   .order-steps   Paid > In production > Shipped > Completed
 */

/* ---- Credits: three facts in a row, one under another on a phone ------------- */
.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile-value small { color: var(--muted); font-size: .55em; font-weight: 600; letter-spacing: 0; }
@media (max-width: 560px) {
  .tiles-3 { grid-template-columns: minmax(0, 1fr); }
}

/* ---- A credit pack -------------------------------------------------------------- */
/* A column, so the Buy buttons of a row of packs line up along the bottom. */
.pack { display: flex; flex-direction: column; }
.pack > * { margin: 0; }
.pack-size { font: 800 1.9rem/1.1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pack-size span { color: var(--muted); font-size: .5em; font-weight: 600; letter-spacing: 0; }
.pack-price { margin-top: 10px; font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pack .btn { margin-top: 16px; }
/* Space between a row of cards and whatever comes straight after it (a button, small print, more cards). */
.grid + .button-row, .grid + p, .grid + .faq-list, .grid + .grid { margin-top: 20px; }
/* "Your credits are being added": only one of its sentences shows at a time, so they carry no space of their own,
   and the turning circle keeps a little air before the words. */
.shop-wait p { margin: 0; }
.shop-wait noscript p { margin-top: 8px; }
.shop-wait .spinner { margin-right: 6px; }

/* Lists inside a card start nearer its edge than a browser would put them. */
.card > ul { padding-left: 1.25em; }
.card > ul li + li { margin-top: 6px; }

/* ---- Pricing: "From $0.03 a label" ------------------------------------------- */
.price-from { margin-bottom: 28px; font-size: 1.15rem; }
.price-from strong { font: 800 1.9rem/1.1 var(--display); letter-spacing: -.02em; }
.price-from span { display: block; margin-top: 2px; }

/* ---- A name on the left, its value on the right ------------------------------ */
.fact-list { margin: 0 0 16px; }
.fact-list:last-child { margin-bottom: 0; }
.fact-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid var(--line); }
.fact-list > div:first-child { border-top: 0; }
.fact-list dt { flex: none; max-width: 50%; color: var(--muted); }
.fact-list dd { min-width: 0; margin: 0; text-align: right; }
/* Money: the words may run long and wrap, the amount never does. */
.fact-list.is-prices dt { flex: 1 1 auto; max-width: none; }
.fact-list.is-prices dd { flex: none; white-space: nowrap; }
.fact-list .fact-total { border-top-color: var(--ink); font-weight: 700; }
.fact-list .fact-total dt { color: var(--ink); }

/* ---- The picture of a label ---------------------------------------------------- */
/* Always white, in both themes: it shows what comes out of the printer. */
.order-thumb {
  display: block; flex: none; width: 72px; height: 72px; padding: 4px;
  border: 1px solid var(--line); border-radius: var(--radius-small);
  background: var(--sheet); object-fit: contain;
}
/* No picture came with the order: a quiet icon instead of an empty white square. */
.order-thumb.is-empty { display: grid; place-items: center; background: var(--soft); color: var(--muted); font-size: 1.4rem; }
.order-what { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; }
.order-what p { min-width: 0; margin: 0; }

/* ---- The list of orders ---------------------------------------------------------- */
.order-list { display: grid; gap: 12px; margin: 0 0 24px; padding: 0; list-style: none; }
/* (".order-list .order-row", not just ".order-row": a card that is a link is display: block in site.css, and this has to win.) */
.order-list .order-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 4px 16px; margin: 0; padding: 16px; }
.order-row-main > * { margin: 0; }
.order-row-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.order-row-total { margin: 0; font-weight: 700; }
@media (max-width: 560px) {
  /* The total moves under the words, so the words keep the width. */
  .order-list .order-row { grid-template-columns: auto minmax(0, 1fr); padding: 14px; }
  .order-row .order-thumb { width: 56px; height: 56px; }
  .order-row-total { grid-column: 2; }
}

/* ---- An order's four steps ------------------------------------------------------ */
/* A square for each step on one line: filled for the steps that are done, the
   accent colour for where the order is now, an outline for what is to come. */
.order-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 4px 0 20px; padding: 0; list-style: none; }
.order-steps li { position: relative; padding: 30px 4px 0; color: var(--muted); font-size: .85rem; line-height: 1.3; text-align: center; }
.order-steps li::before {
  content: ""; position: absolute; z-index: 1; top: 4px; left: 50%; width: 16px; height: 16px; margin-left: -8px;
  border: 2px solid var(--field-line); border-radius: 3px; background: var(--card);
}
/* The line from each square to the next one. */
.order-steps li::after { content: ""; position: absolute; top: 11px; left: 50%; width: 100%; height: 2px; background: var(--line); }
.order-steps li:last-child::after { display: none; }
.order-steps .is-done, .order-steps .is-now { color: var(--ink); }
.order-steps .is-done::before { border-color: var(--ink); background: var(--ink); }
.order-steps .is-done::after { background: var(--ink); }
.order-steps .is-now { font-weight: 700; }
.order-steps .is-now::before { border-color: var(--brand); background: var(--brand); box-shadow: 0 0 0 4px var(--soft); }
.order-steps small { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; }
@media (forced-colors: active) {
  .order-steps .is-done::before, .order-steps .is-now::before { background: ButtonText; }
}
