/* The blog posts' own stylesheet, and the only new one either post adds.
 *
 * Every rule is scoped to the .post-page body class, so nothing here can reach a page that has
 * not been given it, and nothing already in styles.css is redefined — only what the articles and
 * their widgets need on top of it. Every colour, radius and shadow is a token from styles.css, so
 * the light and dark schemes, and the Auto setting, come for free.
 *
 * Two posts share it. The time-cost article is a flow of prose with seven cards in it; the
 * doubling article is the same shape with four. The prose is held to a readable measure and the
 * cards are the site's .panel, spaced generously, which is what gives each page its rhythm
 * without a wall of text.
 */

/* ---------------------------------------------------------------- The article */

.post-page .post-meta { margin: 8px 0 0; font-size: 0.9rem; color: var(--muted); }
.post-page .post-body { padding: 20px 0 8px; }
.post-page .post-body > p { max-width: 68ch; margin: 0 0 18px; font-size: 1.02rem; line-height: 1.65; }
.post-page .post-body > h2 {
  max-width: 68ch;
  margin: 38px 0 12px;
  font-size: clamp(1.3rem, 2.6vw, 1.55rem);
  line-height: 1.25;
}
.post-page .post-body > h3 { max-width: 68ch; margin: 26px 0 8px; font-size: 1.1rem; line-height: 1.35; }
.post-page .post-body > :first-child { margin-top: 8px; }
/* A rule above each section heading marks the break, since the headings themselves sit close to
   the prose they introduce. */
.post-page .post-body > h2 + p { margin-top: 0; }
.post-page .post-body > .post-widget + p,
.post-page .post-body > .post-widget + h2 { margin-top: 28px; }

/* ---------------------------------------------------------------- The widgets, together */

.post-page .post-widget { margin: 26px 0; }
.post-page .post-widget-note { max-width: 68ch; margin: 14px 0 0; font-size: 0.82rem; line-height: 1.55; color: var(--muted); }
.post-page .widget-lead { margin: 0 0 14px; font-weight: 600; }
.post-page .post-widget .error { margin: 12px 0 0; }
.post-page .post-widget .btn-secondary.cat-link { margin-top: 16px; }
/* The slider label, the same shape the life-cost page uses for its own. */
.post-page .slider-label { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; margin: 16px 0 8px; }
.post-page .slider-label output { font-weight: 700; }
.post-page input[type="range"] { width: 100%; min-width: 0; min-height: 44px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.post-page input[type="range"]:focus-visible { outline: 2px solid var(--highlight); outline-offset: 3px; border-radius: 5px; }

/* ---------------------------------------------------------------- 1. The hero receipt */

.post-page .hero-receipt-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 26px;
  align-items: center;
}
.post-page .receipt {
  min-width: 0;
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--accent);
}
.post-page .receipt-shop {
  margin: 0 0 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-page .receipt-lines { margin: 0; }
.post-page .receipt-line { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.post-page .receipt-line dt { color: var(--muted); }
.post-page .receipt-line dd { margin: 0; font-weight: 700; }
.post-page .receipt-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin: 16px 0 4px;
  font-size: 0.9rem;
  color: var(--muted);
}
.post-page .receipt-total strong { font-size: clamp(1.35rem, 3.4vw, 1.8rem); color: var(--highlight); line-height: 1.2; }
.post-page .receipt-under { margin: 0; font-size: 0.85rem; font-weight: 600; }
/* The ring is the one the life-cost page draws its pay comparison with: the site's orange swept
   round a navy circle, with the figure in the middle of it. */
.post-page .clock-ring {
  width: 150px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  padding: 12px;
  border-radius: 50%;
  background: conic-gradient(var(--highlight) 100%, var(--border) 0);
}
.post-page .clock-ring > div {
  height: 100%;
  border-radius: 50%;
  background: var(--card);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.post-page .clock-ring strong { font-size: 1.9rem; line-height: 1; }
.post-page .clock-ring span { font-size: 0.75rem; color: var(--muted); }
.post-page .clock-ring-small { width: 104px; padding: 9px; }
.post-page .clock-ring-small strong { font-size: 1.4rem; }
/* Six shifts, lighting up one after another the first time the card is seen. */
.post-page .shift-row { display: flex; gap: 6px; margin: 16px 0 0; padding: 0; list-style: none; }
.post-page .shift-row li {
  flex: 1;
  height: 28px;
  border-radius: 6px;
  background: var(--highlight);
  opacity: 0.18;
  animation: post-shift-in 0.45s ease forwards;
}
.post-page .shift-row li:nth-child(2) { animation-delay: 0.08s; }
.post-page .shift-row li:nth-child(3) { animation-delay: 0.16s; }
.post-page .shift-row li:nth-child(4) { animation-delay: 0.24s; }
.post-page .shift-row li:nth-child(5) { animation-delay: 0.32s; }
.post-page .shift-row li:nth-child(6) { animation-delay: 0.4s; }
@keyframes post-shift-in { to { opacity: 1; } }

/* ---------------------------------------------------------------- 2. The small calculator */

.post-page .inline-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.post-page .inline-fields .field { margin-bottom: 0; }
.post-page .inline-answer { margin: 18px 0 0; padding: 18px; border-radius: var(--radius); background: var(--accent); }
.post-page .inline-headline { margin: 0 0 4px; line-height: 1.3; }
.post-page .inline-headline strong { font-size: clamp(1.4rem, 3.4vw, 1.8rem); }
.post-page .inline-units { margin: 0 0 12px; font-size: 0.9rem; color: var(--muted); }
.post-page .inline-bar-note { margin: 8px 0 0; font-size: 0.8rem; color: var(--muted); }

/* ---------------------------------------------------------------- 3. The pay-rate bars */

.post-page .wage-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.post-page .wage-list li {
  display: grid;
  grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}
.post-page .wage-rate { font-size: 0.9rem; }
.post-page .wage-bars .gauge { height: 14px; border-radius: 7px; }
.post-page .wage-hours { font-weight: 700; white-space: nowrap; }
/* The rate the article works its own example at wears the orange, so the row that matches the
   prose above it can be found at a glance. */
.post-page .wage-list li.is-example .wage-rate { font-weight: 700; }
.post-page .wage-list li.is-example .fill { background: var(--highlight); }
.post-page .widget-table { margin-top: 20px; border-top: 1px solid var(--border); }
.post-page .widget-table summary { cursor: pointer; font-weight: 600; padding: 14px 0; min-height: 48px; }
.post-page .widget-table summary:focus-visible { outline: 2px solid var(--highlight); outline-offset: 3px; border-radius: 4px; }
.post-page .widget-table caption { text-align: left; color: var(--muted); font-size: 0.85rem; padding: 10px 0; }
.post-page .widget-table th[scope="row"] { text-align: left; font-weight: 600; }

/* ---------------------------------------------------------------- 4. The three purchases */

/* The fieldset carries the .panel card, so only what a fieldset brings with it is reset. */
.post-page .choice-set { min-width: 0; }
.post-page .choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.post-page .choice { position: relative; min-width: 0; }
.post-page .choice-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.post-page .choice-card {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.post-page .choice-card:hover { border-color: var(--highlight); }
.post-page .choice-input:checked + .choice-card { border-color: var(--highlight); box-shadow: var(--shadow); }
.post-page .choice-input:focus-visible + .choice-card { outline: 2px solid var(--highlight); outline-offset: 2px; }
.post-page .choice-icon { font-size: 1.5rem; line-height: 1; }
.post-page .choice-name { font-size: 0.85rem; color: var(--muted); }
.post-page .choice-price { font-size: 1.2rem; font-weight: 700; }
.post-page .choice-hours { font-size: 0.9rem; font-weight: 600; }
/* The receipt opens under the card it belongs to on a click, with no script at all: a radio and
   its label are the whole mechanism, so the widget works with JavaScript off. */
.post-page .choice-receipt {
  display: none;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--accent);
}
.post-page .choice-input:checked ~ .choice-receipt { display: block; }
.post-page .choice-receipt p { margin: 0 0 8px; font-size: 0.88rem; line-height: 1.5; }
.post-page .choice-receipt p:last-child { margin-bottom: 0; }
.post-page .choice-sum { color: var(--muted); }

/* ---------------------------------------------------------------- 5. The spend explorer */

.post-page .spend-answer { margin: 18px 0 0; padding: 18px; border-radius: var(--radius); background: var(--accent); }
.post-page .spend-year { margin: 0 0 4px; line-height: 1.3; }
.post-page .spend-year strong { font-size: clamp(1.4rem, 3.4vw, 1.8rem); }
.post-page .spend-year span { font-size: 0.9rem; color: var(--muted); }
.post-page .spend-hours { margin: 0 0 12px; }
.post-page .shift-stack { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.post-page .shift-block {
  position: relative;
  width: 34px;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card);
  overflow: hidden;
}
.post-page .shift-block::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--shift-fill, 100%);
  background: var(--highlight);
}
.post-page .shift-more { font-size: 0.8rem; color: var(--muted); }
.post-page .spend-shifts-text { margin: 10px 0 0; font-size: 0.9rem; }

/* ---------------------------------------------------------------- 6. The three questions */

.post-page .worth-faq summary { font-weight: 600; }
.post-page .worth-faq p { font-size: 0.92rem; }

/* ---------------------------------------------------------------- 7. The closing card */

.post-page .final-cta-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: center; }
.post-page .final-lead { margin: 0 0 12px; font-weight: 600; }
.post-page .final-copy .btn-primary { margin-top: 0; }
.post-page .final-copy .share-note { margin: 12px 0 0; }

/* ---------------------------------------------------------------- 8. The two envelopes */

/* The choice cards the earlier post uses for its three purchases, in two columns rather than
   three: the mechanism (a radio and its label) is the same, so this widget also works with
   JavaScript off. */
.post-page .choice-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.post-page .widget-reveal {
  max-width: 68ch;
  margin: 16px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--highlight);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--accent);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ---------------------------------------------------------------- 9. The day-by-day chart */

/* Capped rather than stretched: the chart is drawn in a 2:1 box, and much past about 520px the
   marker and the reference line start to read as furniture rather than as a chart. */
.post-page .scrubber-chart { max-width: 520px; margin: 0 auto; }
.post-page .scrubber-chart svg { display: block; width: 100%; height: auto; }
.post-page .scrubber-axis { stroke: var(--border); stroke-width: 1; }
/* The one reference the article names: a million dollars, level with where the run passes it. */
.post-page .scrubber-mark { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 6 5; }
.post-page .scrubber-mark-label { fill: var(--muted); font-size: 10px; font-weight: 600; }
.post-page .scrubber-tick { fill: var(--muted); font-size: 10px; }
.post-page .scrubber-fill { fill: var(--highlight); opacity: 0.14; }
.post-page .scrubber-line {
  fill: none;
  stroke: var(--highlight);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.post-page .scrubber-stem { stroke: var(--highlight); stroke-width: 1.5; stroke-dasharray: 3 3; opacity: 0.55; }
/* The marker is filled with the card's own colour so the curve passes behind it rather than
   through it. */
.post-page .scrubber-point { fill: var(--card); stroke: var(--highlight); stroke-width: 2.5; }

.post-page .scrubber-answer { margin: 18px 0 0; padding: 18px; border-radius: var(--radius); background: var(--accent); }
.post-page .scrubber-day { margin: 0 0 4px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.post-page .scrubber-balance { margin: 0 0 6px; line-height: 1.2; }
.post-page .scrubber-balance strong { font-size: clamp(1.5rem, 4.4vw, 2rem); overflow-wrap: anywhere; }
.post-page .scrubber-note { margin: 0; font-size: 0.88rem; }

/* The six days the article names, as chips that jump the marker to them. */
.post-page .milestone-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.post-page .milestone-chips button {
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.post-page .milestone-chips button:hover { border-color: var(--highlight); }
.post-page .milestone-chips button:focus-visible { outline: 2px solid var(--highlight); outline-offset: 2px; }
.post-page .milestone-chips button.is-active { border-color: var(--highlight); background: var(--accent); font-weight: 700; }

/* ---------------------------------------------------------------- 10. The two equal halves */

.post-page .half-bar {
  display: flex;
  height: 54px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
}
/* flex: 1 1 0 on both, so the segments stay exactly equal whatever the label inside them says.
   The whole point of the widget is that the two halves are the same width. */
.post-page .half-seg {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  align-items: center;
  justify-content: center;
  animation: post-half-in 0.5s ease both;
}
.post-page .half-seg-before { background: var(--accent); color: var(--text); }
/* The navy on the orange is one of the site's few hard-coded colours, for the same reason the
   white on the budget page's red card is: it is the one that reads on this surface in both
   themes. The orange is the same orange in each of them. */
.post-page .half-seg-last { background: var(--highlight); color: #0a1b3c; animation-delay: 0.35s; }
.post-page .half-seg-label { font-size: 0.82rem; font-weight: 700; }
@keyframes post-half-in { from { opacity: 0.35; } to { opacity: 1; } }

.post-page .half-key { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.post-page .half-key li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  font-size: 0.92rem;
  line-height: 1.5;
}
.post-page .half-swatch { width: 22px; height: 14px; margin-top: 4px; border: 1px solid var(--border); border-radius: 4px; }
.post-page .half-swatch-before { background: var(--accent); }
.post-page .half-swatch-last { background: var(--highlight); }

/* ---------------------------------------------------------------- 11. The playground */

.post-page .preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.post-page .preset-chip {
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.post-page .preset-chip:hover { border-color: var(--highlight); }
.post-page .preset-chip:focus-visible { outline: 2px solid var(--highlight); outline-offset: 2px; }
.post-page .preset-chip.is-active { border-color: var(--highlight); background: var(--accent); }
.post-page .play-answer { margin: 18px 0 0; padding: 18px; border-radius: var(--radius); background: var(--accent); }
/* The three figures the brief asks the widget to show — the starting amount, the day and the
   amount on that day — as a small two-column list, so each one keeps its unit spelled out. */
.post-page .play-lines { margin: 0; }
.post-page .play-lines > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.post-page .play-lines > div:first-child { padding-top: 0; }
.post-page .play-lines > div:last-child { padding-bottom: 0; border-bottom: 0; }
.post-page .play-lines dt { font-size: 0.85rem; color: var(--muted); }
.post-page .play-lines dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.post-page .play-lines .play-total { line-height: 1.2; }
.post-page .play-lines .play-total strong { font-size: clamp(1.25rem, 4.5vw, 1.7rem); }

/* ---------------------------------------------------------------- Narrow screens */

@media (max-width: 760px) {
  .post-page .inline-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-page .choice-grid { grid-template-columns: minmax(0, 1fr); }
  /* The two-column variant needs its own line here: it carries a second class, so the rule above
     — which is one class lighter — cannot collapse it. */
  .post-page .choice-grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .post-page .hero-receipt-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .post-page .clock-ring { width: 132px; }
  /* The label and the figure keep one line and the bar takes the next, which is what holds the
     chart inside a 320px screen without anything scrolling sideways. */
  .post-page .wage-list li { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .post-page .wage-list .gauge { grid-column: 1 / -1; }
  .post-page .final-cta-grid { grid-template-columns: minmax(0, 1fr); }
  .post-page .final-art { display: flex; justify-content: center; }
  .post-page .post-body > p { font-size: 1rem; }
  /* The labels inside the two halves go at this width — a half of 320px is about 150px — and the
     key under the bar carries the same two lines at a size that fits. */
  .post-page .half-bar { height: 40px; }
  .post-page .half-seg-label { display: none; }
  .post-page .widget-reveal { font-size: 0.88rem; }
}
@media (prefers-reduced-motion: reduce) {
  .post-page .shift-row li { animation: none; opacity: 1; }
  .post-page .choice-card { transition: none; }
  .post-page .half-seg { animation: none; opacity: 1; }
}

/* ---------------------------------------------------------------- The blog list, and the foot */

.post-page .post-more { margin-bottom: 32px; }
.post-page .post-list { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.post-page .post-item { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.post-page .post-item h2 { margin: 0 0 6px; font-size: 1.25rem; }
.post-page .post-item h2 a { text-decoration: none; }
.post-page .post-item h2 a:hover { text-decoration: underline; }
.post-page .post-item p { margin: 0 0 12px; color: var(--muted); }
.post-page .post-item .post-meta { margin: 0; font-size: 0.85rem; }
