/* Spec 145: an order's own page (the confirmation right after paying, else its live status), the orders list's cover,
   chip and day, and the header's "My orders" with its dot. Tokens only (constitution X). */

/* The header's "My orders": round like the gear, with a pink dot while a book is on its way. */
.nav a.nav-orders {
  position: relative;
}

.nav-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--crayon-pink);
  border: 2px solid var(--surface);
}

/* The status chip: crayon colours with dark ink, the same on the list and the order's page. */
.order-chip {
  display: inline-block;
  align-self: flex-start;
  padding: 2px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: var(--font-sm);
  line-height: 1.6;
  color: var(--on-crayon);
  background: var(--crayon-orange);
}

.order-chip[data-tone="paid"] {
  background: var(--crayon-blue);
}

.order-chip[data-tone="printing"] {
  background: var(--crayon-purple);
}

.order-chip[data-tone="shipped"] {
  background: var(--crayon-green);
}

.order-chip[data-tone="ended"] {
  background: var(--crayon-red);
}

/* The list: the cover, the title, the chip and the day; a paid order's head is one link to its page. */
.print-order-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--touch-standard);
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-sm);
}

a.print-order-head:hover .print-order-title {
  text-decoration: underline;
}

.print-order-cover {
  /* Spec 164: the phone's size, so the title keeps its room at 320 px. */
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--crayon-blue);
}

.print-order-words {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.print-order-words .print-order-title {
  overflow-wrap: anywhere;
  /* Spec 164: a long word (German) breaks with a hyphen in the page's language, not anywhere. */
  hyphens: auto;
}

.print-order-chevron {
  width: 22px;
  height: 22px;
  color: var(--text-secondary);
}

/* The order's page. */
.order-status {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 720px;
}

.status-sky {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: var(--space-3);
  min-height: 200px;
  padding: var(--space-5) var(--space-4) 0 var(--space-5);
  border-radius: var(--radius-md);
  background: var(--hero-deep);
  background-image: var(--gradient-header);
  color: var(--text);
}

.status-sky-words {
  align-self: center;
  padding-bottom: var(--space-4);
}

.status-sky h1 {
  margin: 0 0 var(--space-2);
  font-size: clamp(1.7rem, 5vw, 2.3rem);
  line-height: 1.15;
  color: var(--text);
}

.status-lead {
  margin: 0;
  font-size: var(--font-lg);
  color: var(--text);
}

.status-dragon {
  width: clamp(96px, 26vw, 150px);
  height: auto;
  align-self: end;
  margin-bottom: -6px;
}

.status-dragon.is-bouncing {
  animation: status-dragon-hop 900ms ease-in-out infinite;
}

@keyframes status-dragon-hop {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }

  50% {
    transform: translateY(-10px) rotate(-4deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-dragon.is-bouncing {
    animation: none;
  }
}

.status-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.status-details[hidden] {
  display: none;
}

.status-book {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--space-4);
}

.status-cover {
  width: 112px;
  height: 86px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--crayon-blue);
}

.status-book-words {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.status-title {
  margin: 0;
  font-weight: 700;
  font-size: var(--font-lg);
  overflow-wrap: anywhere;
}

.status-facts {
  margin: 0;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

.status-fact {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 2px var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--hairline);
}

.status-fact:last-child {
  border-bottom: 0;
}

.status-fact dt {
  color: var(--text-secondary);
}

.status-fact dd {
  margin: 0 0 0 auto;
  font-weight: 600;
  text-align: right;
}

.status-receipt {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}

.status-receipt[hidden] {
  display: none;
}

.status-receipt .icon {
  width: 24px;
  height: 24px;
  color: var(--crayon-purple);
  flex: none;
}

.status-steps {
  list-style: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.status-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: start;
}

.status-step-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--hairline);
  background: var(--surface);
}

.status-step[data-state="current"] .status-step-mark {
  border-color: var(--accent);
}

.status-step[data-state="done"] .status-step-mark {
  border-color: var(--crayon-green);
  background: var(--crayon-green);
  color: var(--on-crayon);
}

.status-step-mark .icon {
  width: 20px;
  height: 20px;
}

.status-step-words {
  display: flex;
  flex-direction: column;
}

.status-actions {
  flex-wrap: wrap;
  gap: var(--space-3);
}

.status-actions .button {
  min-height: var(--touch-standard);
}
