/* Crypto payment guide (order-guide.html) — layout, route picker, stepper.
   Uses theme.css tokens; supports html[data-theme="dark"]. */

* { box-sizing: border-box; }

/* ---------- Base layout ---------- */

.guide-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 16px 64px;
}

/* ---------- Hero ---------- */

.guide-hero {
  padding: 24px 0 8px;
}

.guide-eyebrow {
  display: inline-block;
  background: var(--accent, #c41e3a);
  color: var(--accent-on, #ffffff);
  font-family: "Prompt", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
}

.guide-title {
  font-family: "Prompt", "Oswald", system-ui, sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  letter-spacing: -0.01em;
  line-height: 1;
  margin: 14px 0 12px;
}

.guide-title-accent { color: var(--accent, #c41e3a); }

.guide-intro {
  max-width: 560px;
  font-family: "Rubik", "Inter", system-ui, sans-serif;
  color: var(--text-secondary, #3a3a3a);
}

/* ---------- PDF actions ---------- */

.guide-pdf-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* .btn-primary comes from theme.css — only add sizing/typography here. */
.guide-pdf-btn {
  padding: 12px 20px;
  font-family: "Prompt", system-ui, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s var(--ease-hard, ease), color 0.12s var(--ease-hard, ease),
    border-color 0.12s var(--ease-hard, ease);
}

.guide-pdf-btn--ghost {
  background: var(--bg, #ffffff);
  color: var(--text, #000000);
  border: 1px solid var(--border-strong, #000000);
}

.guide-pdf-btn--ghost:hover {
  background: var(--ink, #000000);
  color: var(--bg, #ffffff);
}

.guide-pdf-btn:focus-visible {
  outline: 2px solid var(--accent, #c41e3a);
  outline-offset: 2px;
}

/* ---------- Section titles ---------- */

.guide-section-title {
  font-family: "Prompt", "Oswald", system-ui, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
}

.guide-section-lede {
  max-width: 640px;
  margin-top: 8px;
  font-family: "Rubik", "Inter", system-ui, sans-serif;
  color: var(--text-secondary, #3a3a3a);
  font-size: 0.92rem;
}

/* ---------- Route picker ---------- */

.guide-routes { margin-top: 44px; }

.route-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.route-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  padding: 18px 16px;
  border: 1px solid var(--border, #d4d4d4);
  background: var(--bg, #ffffff);
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.12s var(--ease-hard, ease), box-shadow 0.12s var(--ease-hard, ease);
}

.route-card:hover { border-color: var(--border-strong, #000000); }

.route-card[aria-selected="true"] {
  border: 2px solid var(--accent, #c41e3a);
  padding: 17px 15px;
  box-shadow: 0 0 0 3px var(--accent-glow, rgba(196, 30, 58, 0.22));
}

.route-card:focus-visible {
  outline: 2px solid var(--accent, #c41e3a);
  outline-offset: 2px;
}

.route-card-badge {
  align-self: flex-start;
  background: var(--accent, #c41e3a);
  color: var(--accent-on, #ffffff);
  font-family: "Prompt", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
}

.route-card-name {
  font-family: "Prompt", "Oswald", system-ui, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1.05rem;
}

.route-card-desc {
  font-family: "Rubik", "Inter", system-ui, sans-serif;
  font-size: 0.82rem;
  color: var(--text-secondary, #3a3a3a);
  line-height: 1.45;
}

.route-card-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid var(--border, #d4d4d4);
  padding-top: 12px;
}

.route-card-meta span {
  display: flex;
  flex-direction: column;
  font-family: "Rubik", "Inter", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
}

.route-card-meta small {
  font-weight: 400;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  /* --text-secondary (darker than --muted) to clear WCAG AA 4.5:1 on the
     --bg-secondary card surface; --muted (#7a7471) only reached 4.22:1. */
  color: var(--text-secondary, #3a3a3a);
  margin-bottom: 2px;
}

.route-card-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--accent, #c41e3a);
  color: var(--accent-on, #ffffff);
  font-size: 0.7rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}

.route-card[aria-selected="true"] .route-card-check { display: inline-flex; }

/* ---------- Stepper ---------- */

.guide-steps { margin-top: 36px; }

.guide-step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 28px;
}

.guide-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 28px;
  align-items: start;
  border-top: 1px solid var(--border, #d4d4d4);
  padding-top: 24px;
}

.guide-step-body {
  position: relative;
  padding-left: 44px;
}

.guide-step-num {
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  background: var(--ink, #000000);
  color: var(--bg, #ffffff);
  font-family: "Prompt", system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --ink stays black in dark mode, so the light-mode badge (black circle /
   white number) would render as a near-black number on a black circle.
   Invert the badge for dark mode: light circle, dark number. */
html[data-theme="dark"] .guide-step-num {
  background: var(--text);
  color: var(--bg);
}

.guide-step-title {
  font-family: "Prompt", "Oswald", system-ui, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.guide-step-body p {
  font-family: "Rubik", "Inter", system-ui, sans-serif;
  color: var(--text-secondary, #3a3a3a);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.guide-step-body p:last-child { margin-bottom: 0; }

.guide-note {
  border-left: 3px solid var(--accent, #c41e3a);
  background: var(--bg-secondary, #f5f5f5);
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--text-secondary, #3a3a3a);
}

.guide-step-figure {
  border: 1px solid var(--border, #d4d4d4);
  background: var(--bg-secondary, #f5f5f5);
}

.guide-step-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.guide-step-figure figcaption {
  font-family: "Rubik", "Inter", system-ui, sans-serif;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  /* --text-secondary to clear WCAG AA 4.5:1 on the --bg-secondary figure
     surface; --muted (#7a7471) only reached 4.22:1 for this small caption. */
  color: var(--text-secondary, #3a3a3a);
  padding: 8px 10px;
  border-top: 1px solid var(--border, #d4d4d4);
}

/* ---------- Safety block ---------- */

.guide-safety {
  margin-top: 44px;
  border: 1px solid var(--border, #d4d4d4);
  padding: 22px 20px;
  background: var(--bg-secondary, #f5f5f5);
}

.guide-safety-list {
  margin: 12px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
  font-family: "Rubik", "Inter", system-ui, sans-serif;
  font-size: 0.88rem;
  color: var(--text-secondary, #3a3a3a);
}

/* ---------- Wayfinding footer ---------- */

.guide-wayfinding { margin-top: 36px; }

.guide-wayfinding-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.guide-wayfinding-links a {
  font-family: "Prompt", system-ui, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.85rem;
}

.guide-wayfinding-links a:hover { color: var(--accent, #c41e3a); }
.guide-wayfinding-links a:focus-visible {
  outline: 2px solid var(--accent, #c41e3a);
  outline-offset: 2px;
}

/* ---------- No-JS default / enhanced toggle hook ----------
   Without JS: show both route panels stacked (progressive enhancement
   baseline). Route panels use the `hidden` attribute for state; this
   override makes `hidden` cosmetic only until guide.js adds
   `is-enhanced` to <html> and takes over tab/panel switching. */

#panel-route-a[hidden], #panel-route-b[hidden] { display: block; }
html.is-enhanced #panel-route-a[hidden], html.is-enhanced #panel-route-b[hidden] { display: none; }

/* ---------- Entrance micro-animations ---------- */
/* Guide-specific keyframes (not .reveal/.reveal-stagger, which theme.css
   globally freezes). Enhanced-only so the no-JS stacked view stays static.
   Toggling a panel flips display none->block, which replays the animation, so
   the steps cascade in fresh on every route switch as well as first load. */

@keyframes guideStepIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes guideCheckPop {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}

html.is-enhanced .guide-steps:not([hidden]) .guide-step {
  animation: guideStepIn 0.42s var(--ease-snap, cubic-bezier(0.16, 1, 0.3, 1)) both;
}
html.is-enhanced .guide-steps:not([hidden]) .guide-step:nth-child(1) { animation-delay: 0.03s; }
html.is-enhanced .guide-steps:not([hidden]) .guide-step:nth-child(2) { animation-delay: 0.09s; }
html.is-enhanced .guide-steps:not([hidden]) .guide-step:nth-child(3) { animation-delay: 0.15s; }
html.is-enhanced .guide-steps:not([hidden]) .guide-step:nth-child(4) { animation-delay: 0.21s; }
html.is-enhanced .guide-steps:not([hidden]) .guide-step:nth-child(5) { animation-delay: 0.27s; }
html.is-enhanced .guide-steps:not([hidden]) .guide-step:nth-child(6) { animation-delay: 0.33s; }
html.is-enhanced .guide-steps:not([hidden]) .guide-step:nth-child(7) { animation-delay: 0.39s; }

/* The crimson check pops in when its route becomes selected (display flips
   none->inline-flex, replaying the keyframe on each selection). */
.route-card[aria-selected="true"] .route-card-check {
  animation: guideCheckPop 0.28s var(--ease-snap, cubic-bezier(0.16, 1, 0.3, 1)) both;
}

/* ---------- Dark mode ---------- */

html[data-theme="dark"] .route-card,
html[data-theme="dark"] .guide-step-figure,
html[data-theme="dark"] .guide-note,
html[data-theme="dark"] .guide-safety {
  background-color: var(--bg-secondary, #161616);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .route-card,
  .guide-pdf-btn,
  .guide-wayfinding-links a {
    transition: none;
  }
  html.is-enhanced .guide-steps:not([hidden]) .guide-step,
  .route-card[aria-selected="true"] .route-card-check {
    animation: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 880px) {
  .route-picker { grid-template-columns: 1fr; }
  .guide-step { grid-template-columns: 1fr; gap: 16px; }
  .route-card-meta { grid-template-columns: repeat(3, 1fr); }
}
