/* The 10,000-step walking article's three widgets.
 *
 * Everything is scoped to .post-page, so these rules cannot reach another page, and every colour
 * is a token from styles.css so both themes work without a second palette. The article's prose
 * and post.css are untouched.
 */

/* ---------------------------------------------------------------- Shared pieces */

.post-page .walk-receipt,
.post-page .walk-walkers,
.post-page .walk-fork { min-width: 0; }

.post-page .walk-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--accent);
  font-weight: 700;
}
.post-page .walk-flow-step { white-space: nowrap; }
.post-page .walk-flow-arrow { color: var(--muted); font-weight: 500; }

.post-page .walk-figure {
  margin: 16px 0 0;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--accent);
}
.post-page .walk-figure p { margin: 0; }
.post-page .walk-big {
  margin: 0;
  font-size: clamp(2rem, 8vw, 3.1rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.post-page .walk-big-label {
  display: block;
  margin-top: 5px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}
.post-page .walk-sub { margin: 10px 0 0; font-size: 0.92rem; line-height: 1.5; color: var(--muted); }
.post-page .walk-sub strong { color: var(--text); font-variant-numeric: tabular-nums; }

.post-page .walk-lines { margin: 0; }
.post-page .walk-lines > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.post-page .walk-lines > div:last-child { border-bottom: 0; }
.post-page .walk-lines dt { font-size: 0.87rem; color: var(--muted); }
.post-page .walk-lines dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.post-page .walk-live {
  min-height: 2.9em;
  margin: 14px 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

/* ---------------------------------------------------------------- 1. The receipt */

/* The two mode buttons sit under the big receipt figure, so they need a clear gap above them
   rather than starting immediately below the label. */
.post-page .walk-receipt-modes { margin: 20px 0 16px; }
.post-page .walk-receipt-bar {
  display: flex;
  width: 100%;
  height: 46px;
  margin: 18px 0 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
}
.post-page .walk-receipt-seg {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 0;
  padding: 4px 8px;
  border: 0;
  font: inherit;
  font-size: 0.76rem;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
  flex: 0 0 auto;
}
.post-page .walk-receipt-seg strong {
  display: block;
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
}
.post-page .walk-receipt-seg-active {
  /* The navy is fixed on the orange in both themes: it is the one ink that reads on this orange. */
  background: var(--highlight);
  color: #0a1b3c;
}
.post-page .walk-receipt-seg-rest { background: var(--rest); color: var(--text); }
.post-page .walk-receipt-seg:focus-visible { outline: 2px solid var(--text); outline-offset: -3px; }
.post-page .walk-receipt-seg[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--primary); }
.post-page .walk-receipt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.post-page .walk-key {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border: 1px solid var(--border);
  border-radius: 2px;
  vertical-align: -1px;
}
.post-page .walk-key-active { background: var(--highlight); }
.post-page .walk-key-rest { background: var(--rest); }

/* ---------------------------------------------------------------- 2. The walkers */

.post-page .walk-chip-note { display: block; font-size: 0.72rem; font-weight: 500; color: var(--muted); }
.post-page .walk-walker-readout {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--accent);
}
.post-page .walk-walker-bars {
  display: grid;
  gap: 6px;
  margin: 16px 0 10px;
  padding: 0;
  list-style: none;
}
.post-page .walk-walker-bars li {
  display: grid;
  grid-template-columns: 5.4rem minmax(0, 1fr) 3rem;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
}
.post-page .walk-walker-bars li.is-active { background: var(--accent); }
.post-page .walk-bar-name { font-size: 0.82rem; color: var(--muted); }
.post-page .walk-bar {
  display: flex;
  height: 16px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--border);
}
.post-page .walk-bar-active { height: 100%; background: var(--highlight); }
.post-page .walk-bar-rest { height: 100%; background: var(--rest); }
.post-page .walk-bar-total {
  font-size: 0.85rem;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.post-page .walk-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.post-page .walk-scale { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 3. The step-length fork */

.post-page .walk-fork-figure { margin: 16px 0 18px; }
.post-page .walk-fork-track {
  position: relative;
  height: 20px;
  margin: 6px 0 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--accent);
}
.post-page .walk-fork-fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  border-radius: 9px;
  background: var(--highlight);
  transition: width 300ms ease;
}
.post-page .walk-fork-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--primary);
}
.post-page .walk-fork-mark::after {
  content: "";
  position: absolute;
  top: -4px;
  left: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}
.post-page .walk-fork-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.post-page .walk-fork-caption {
  margin: 8px 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------------------------------------------------------------- Narrow screens */

@media (max-width: 760px) {
  .post-page .walk-walker-bars li { grid-template-columns: 4.8rem minmax(0, 1fr) 2.8rem; gap: 8px; }
  .post-page .walk-scale { margin-left: 0; width: 100%; }
}

@media (max-width: 480px) {
  .post-page .walk-figure { padding: 14px; }
  .post-page .walk-receipt-bar { height: 52px; }
  .post-page .walk-receipt-seg { font-size: 0.7rem; padding: 4px 5px; }
  .post-page .walk-receipt-seg strong { font-size: 0.9rem; }
  .post-page .walk-walker-bars li { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; }
  .post-page .walk-walker-bars .walk-bar { grid-column: 1 / -1; }
  .post-page .walk-walker-bars .walk-bar-total { grid-column: 2; grid-row: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .post-page .walk-fork-fill { transition: none; }
}
