/* ============================================================
 * FabricsMaker — dedicated custom order page.
 *
 * Scoped to `.fm-order-page` (a class the Owner puts on one Group
 * block) and to `.fm-order-moved` (the legacy product signpost).
 * No selector here is bare, so nothing on any other page — another
 * product, the shop, the cart, checkout, an account page — can be
 * reached by these rules.
 *
 * Everything is composed from the existing --fm-* tokens. No new
 * palette, no new font stack, no gradient, no filter, no remote
 * asset, no @font-face.
 *
 * Step numbers are CSS counters, not typed text. That way the Owner
 * can reorder, insert or delete a step in the block editor and the
 * numbering cannot drift out of order.
 * ============================================================ */

.fm-order-page {
  max-width: 68rem;
  margin: 0 auto var(--fm-space-8);
  padding-inline: var(--fm-gutter);
  counter-reset: fm-order-step;
}

/* ---------- hero ---------- */

.fm-order-hero {
  padding-bottom: var(--fm-space-6);
  border-bottom: 1px solid var(--fm-rule);
}
.fm-order-hero .fm-order-hero__kicker {
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-xs);
  letter-spacing: var(--fm-tracking-meta);
  text-transform: uppercase;
  color: var(--fm-ink-muted);
  margin: 0 0 var(--fm-space-2);
}
.fm-order-hero .fm-order-hero__title {
  font-family: var(--fm-font-serif);
  font-size: var(--fm-text-3xl);
  line-height: var(--fm-leading-tight);
  color: var(--fm-ink);
  margin: 0 0 var(--fm-space-3);
}
.fm-order-hero .fm-order-hero__lead {
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-lg);
  color: var(--fm-ink);
  margin: 0 0 var(--fm-space-3);
  max-width: 40rem;
}
.fm-order-hero .fm-order-hero__note {
  font-size: var(--fm-text-base);
  color: var(--fm-ink-muted);
  margin: 0;
  max-width: 40rem;
}

/* ---------- steps ---------- */

.fm-order-step {
  border-top: 1px solid var(--fm-rule);
  padding-top: var(--fm-space-6);
  margin-top: var(--fm-space-7);
  scroll-margin-top: var(--fm-space-8);
}
.fm-order-step > h2 {
  counter-increment: fm-order-step;
  font-family: var(--fm-font-serif);
  font-size: var(--fm-text-xl);
  line-height: var(--fm-leading-snug);
  color: var(--fm-ink);
  margin: 0 0 var(--fm-space-3);
  display: flex;
  align-items: baseline;
  gap: var(--fm-space-3);
  flex-wrap: wrap;
}
.fm-order-step > h2::before {
  content: counter(fm-order-step, decimal-leading-zero);
  flex: 0 0 auto;
  font-family: var(--fm-font-mono);
  font-size: var(--fm-text-xs);
  letter-spacing: var(--fm-tracking-meta);
  color: var(--fm-primary);
  border: 1px solid var(--fm-primary-soft);
  border-radius: var(--fm-radius-sm);
  padding: 2px var(--fm-space-2);
}
.fm-order-step > p,
.fm-order-step > .wp-block-paragraph {
  max-width: 44rem;
  color: var(--fm-ink-muted);
}
.fm-order-step > p:first-of-type {
  margin-top: 0;
  margin-bottom: var(--fm-space-5);
}

/* the anchor the Owner requires, landing on the form area */
.fm-order-step--form {
  border-top-color: var(--fm-rule-strong);
}
/* ---------- two-column guide ---------- */

.fm-order-split {
  display: grid;
  gap: var(--fm-space-5);
}
@media (min-width: 56rem) {
  .fm-order-split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--fm-space-7);
    align-items: start;
  }
}

/* ---------- numbered instruction list ---------- */

.fm-order-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: fm-order-item;
}
.fm-order-list > li {
  counter-increment: fm-order-item;
  display: flex;
  gap: var(--fm-space-3);
  padding: var(--fm-space-3) 0;
  border-top: 1px solid var(--fm-rule);
  font-size: var(--fm-text-sm);
  line-height: var(--fm-leading-normal);
  color: var(--fm-ink);
}
.fm-order-list > li:first-child {
  border-top: 0;
  padding-top: 0;
}
.fm-order-list > li::before {
  content: counter(fm-order-item);
  flex: 0 0 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--fm-rule-strong);
  border-radius: 999px;
  font-family: var(--fm-font-mono);
  font-size: 0.75rem;
  color: var(--fm-ink-muted);
}
/* A paragraph-y List block wraps its runs in a <p> inside the <li>, so
   these are descendants rather than children. */
.fm-order-list > li p {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--fm-ink);
}

/* ---------- order rules ledger ---------- */

.fm-order-ledger {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--fm-rule);
  border-radius: var(--fm-radius-md);
  background-color: var(--fm-surface);
  padding: var(--fm-space-5);
}
.fm-order-ledger > li {
  padding: var(--fm-space-3) 0;
  border-top: 1px solid var(--fm-rule);
  font-size: var(--fm-text-sm);
  line-height: var(--fm-leading-normal);
  color: var(--fm-ink);
}
.fm-order-ledger > li:first-child {
  border-top: 0;
  padding-top: 0;
}
.fm-order-ledger > li:last-child {
  padding-bottom: 0;
}
.fm-order-ledger > li > p > strong:first-child,
.fm-order-ledger > li > strong:first-child {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}
.fm-order-ledger em {
  font-style: normal;
  color: var(--fm-ink-muted);
}
.fm-order-ledger code {
  font-family: var(--fm-font-mono);
  font-size: 0.95em;
  background-color: var(--fm-surface-sunk);
  border-radius: var(--fm-radius-sm);
  padding: 1px 5px;
}

/* ---------- platform chips ---------- */

.fm-order-platforms {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--fm-space-2);
}
.fm-order-platforms > li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--fm-space-2);
  font-size: var(--fm-text-sm);
  color: var(--fm-ink);
  padding: var(--fm-space-2) var(--fm-space-3);
  border: 1px solid var(--fm-rule);
  border-radius: var(--fm-radius-sm);
  background-color: var(--fm-surface);
}
.fm-order-platforms > li strong {
  font-weight: 600;
  flex: 0 0 auto;
}
.fm-order-platforms em {
  /* When there is no room beside the platform name, the qualifier drops
     to its own line rather than being pinched into a narrow column. */
  flex: 1 1 14rem;
  font-style: normal;
  color: var(--fm-ink-muted);
  font-size: var(--fm-text-xs);
}

/* ---------- callouts ---------- */

.fm-order-callout {
  border-left: 3px solid var(--fm-attention-token);
  padding: var(--fm-space-2) 0 var(--fm-space-2) var(--fm-space-4);
  margin: var(--fm-space-4) 0 0;
  max-width: 42rem;
}
.fm-order-callout--info {
  border-left-color: var(--fm-primary-soft);
}
.fm-order-callout > p {
  margin: 0 0 var(--fm-space-3);
  font-size: var(--fm-text-sm);
  line-height: var(--fm-leading-normal);
  color: var(--fm-ink-muted);
}
.fm-order-callout > p:last-child {
  margin-bottom: 0;
}
/* Only the first strong is the title. Any later strong belongs to the
   sentence — "Tell us whether it is Yes — seamless, No — needs repeat
   design or Unsure" — and must stay on the line. */
.fm-order-callout > p > strong:first-child {
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
  color: var(--fm-ink);
}
.fm-order-callout > p > strong:not(:first-child) {
  font-weight: 600;
  color: var(--fm-ink);
}

/* ---------- "what happens next" ---------- */

.fm-order-next {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--fm-space-4);
  counter-reset: fm-order-next;
}
@media (min-width: 48rem) {
  .fm-order-next {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--fm-space-5) var(--fm-space-6);
  }
}
.fm-order-next > li {
  counter-increment: fm-order-next;
  border-top: 2px solid var(--fm-rule);
  padding-top: var(--fm-space-3);
}
.fm-order-next > li::before {
  content: counter(fm-order-next);
  display: block;
  font-family: var(--fm-font-mono);
  font-size: var(--fm-text-xs);
  color: var(--fm-primary);
  margin-bottom: var(--fm-space-1);
}
.fm-order-next > li p:first-child > strong,
.fm-order-next > li > strong:first-child {
  display: block;
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-base);
  font-weight: 600;
  line-height: var(--fm-leading-snug);
  color: var(--fm-ink);
  margin-bottom: var(--fm-space-2);
}
.fm-order-next > li p {
  font-size: var(--fm-text-sm);
  line-height: var(--fm-leading-normal);
  color: var(--fm-ink-muted);
  margin: 0;
}

/* ---------- helper links ---------- */

.fm-order-links {
  margin: var(--fm-space-4) 0 0;
}
.fm-order-links a {
  font-size: var(--fm-text-sm);
}

/* ============================================================
 * Legacy product signpost — outside the order page on purpose.
 * ============================================================ */

.fm-order-moved {
  max-width: 46rem;
  margin: var(--fm-space-7) auto;
  padding: var(--fm-space-6);
  border: 1px solid var(--fm-rule-strong);
  border-left: 3px solid var(--fm-primary);
  border-radius: var(--fm-radius-lg);
  background-color: var(--fm-surface);
}
.fm-order-moved__title {
  font-family: var(--fm-font-serif);
  font-size: var(--fm-text-xl);
  line-height: var(--fm-leading-snug);
  color: var(--fm-ink);
  margin: 0 0 var(--fm-space-3);
}
.fm-order-moved__copy {
  font-size: var(--fm-text-sm);
  line-height: var(--fm-leading-normal);
  color: var(--fm-ink-muted);
  margin: 0 0 var(--fm-space-4);
  max-width: 40rem;
}
.fm-order-moved__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--fm-space-3);
  margin: 0;
}
.fm-order-moved__actions a {
  font-size: var(--fm-text-sm);
}
.fm-order-moved__note {
  margin: var(--fm-space-4) 0 0;
  padding-top: var(--fm-space-3);
  border-top: 1px solid var(--fm-rule);
  font-size: var(--fm-text-xs);
  color: var(--fm-ink-muted);
  max-width: 40rem;
}

/* ============================================================
 * Download control meta line — the button itself is plugin CSS.
 * ============================================================ */

.fmcor-download {
  display: block;
}
.fmcor-download__meta {
  display: block;
  font-size: var(--fm-text-xs);
  font-weight: 400;
  letter-spacing: var(--fm-tracking-meta);
  opacity: 0.75;
}
