/* The Australian pay page — page-specific presentation.

   Shared shell, panels, hero (.rp-hero), stat tiles (.rp-tiles), result actions, the bar and its
   legend, FAQ, related cards and Cozy's pick come from styles.css and results.css. This file adds
   the pay-period switch, the wage breakdown, the two pay tables and the five facts. Everything is
   scoped to .pay-page, the body class this page opts into, so no rule here reaches another page.

   Every colour is a token from styles.css, which is what gives both themes for free. */

/* ---------------------------------------------------------------- The editorial rhythm */

/* A little more air between the cards under the results than the site-wide 24px, and the card's
   full inner width for every paragraph, list and formula inside them. */
.pay-page .calc-info { gap: 28px; }
.pay-page .calc-info > .panel { min-width: 0; width: 100%; }
.pay-page .calc-info p,
.pay-page .calc-info li,
.pay-page .calc-info .formula { max-width: none; width: auto; }

/* ---------------------------------------------------------------- The results */

.pay-page #hero .value { overflow-wrap: anywhere; }

/* Four small targets that wrap rather than scroll: the hero's own period switch. */
.pay-page .pay-period-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
}
.pay-page .pay-period-switch .chip { min-height: 44px; }
.pay-page .pay-period-switch .chip:focus-visible { outline: 2px solid var(--highlight); outline-offset: 2px; }

/* The wage breakdown: one quiet line per deduction, with the net pay closing the list. */
.pay-page .pay-breakdown {
  margin: 4px 0 0;
  padding: 4px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.pay-page .pay-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.9rem;
}
.pay-page .pay-line:last-child { border-bottom: 0; }
/* The page's own display values are more specific than the shared .hidden rule, so the two places
   that toggle a row or a note have to say what hidden means here as well. */
.pay-page .pay-line.hidden,
.pay-page .pay-line-note.hidden { display: none; }
.pay-page .pay-line-label { min-width: 0; }
.pay-page .pay-line-note {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--muted);
}
.pay-page .pay-line-value {
  flex: none;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pay-page .pay-line.is-total {
  margin-top: 2px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
  font-weight: 700;
}
.pay-page .pay-line.is-total .pay-line-value { font-size: 1.05rem; }

/* The legend swatches for the two categories this page adds to the shared bar colours. */
.pay-page .bar .surcharge,
.pay-page .legend .dot.surcharge { background: var(--growth); }
.pay-page .bar > div { transition: width 220ms ease; }
.pay-page .pay-bar-caption {
  margin: 10px 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
}

/* Five supporting figures: two or three balanced columns on a wide card, one on a phone. The
   190px minimum is what stops a currency value being squeezed into a tall sliver. */
.pay-page .pay-tiles { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.pay-page .pay-tiles .stat { min-width: 0; }
.pay-page .pay-tiles .stat .value { white-space: normal; }

/* A quiet note under a table or a paragraph; never a filled banner. */
.pay-page .pay-note {
  margin: 12px 0 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------------------------------------------------------------- The pay tables */

/* Both tables live in a bounded scroll container: the period table has six columns of currency,
   and a 320px phone should scroll the table rather than the page. */
.pay-page .scroll-x {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 10px;
  margin-bottom: 0;
}
.pay-page .pay-table { font-size: 0.84rem; }
.pay-page .pay-table th,
.pay-page .pay-table td { padding: 9px 8px; }
.pay-page .pay-table td { font-variant-numeric: tabular-nums; }
.pay-page .pay-table tr:last-child th,
.pay-page .pay-table tr:last-child td { border-bottom: 0; }
.pay-page .pay-table .total-row th,
.pay-page .pay-table .total-row td { font-weight: 700; }
.pay-page .pay-rate-table { margin: 12px 0 0; }
.pay-page .pay-rate-table caption {
  padding: 0 0 8px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: left;
}

/* ---------------------------------------------------------------- The prose sections */

/* One full-width card per row at every width: the five approved facts read as a single list, never
   a multi-column grid or a sideways rail. */
.pay-page .fact-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.pay-page .fact {
  min-width: 0;
  width: 100%;
  padding: 14px 16px;
  border-left: 3px solid var(--highlight);
  border-radius: 0 12px 12px 0;
  background: var(--accent);
}
.pay-page .fact h3 { font-size: 0.95rem; margin: 0 0 6px; }
.pay-page .fact p { font-size: 0.88rem; line-height: 1.6; margin: 0; }

.pay-page #how-it-works h3 { margin-top: 22px; font-size: 1rem; }
.pay-page .formula-wrap { display: grid; gap: 8px; margin: 12px 0; }
/* The shared .formula scrolls sideways; these are long enough that half of each would be off the
   edge of a phone, so here they wrap and the monospace face keeps them reading as formulas. */
.pay-page .formula {
  margin: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.pay-page .pay-sources {
  margin: 10px 0 0;
  padding-left: 20px;
  font-size: 0.88rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.pay-page .pay-sources li { margin-bottom: 6px; }

/* Two related cards, so the desktop grid is two columns rather than the three the shared sheet
   reserves for pages that qualify for a third article. One column on a phone. */
.pay-page .related-articles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) {
  .pay-page .related-articles-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- Narrow screens */

@media (max-width: 600px) {
  .pay-page .calc-info { gap: 20px; }
  .pay-page .fact { padding: 12px 14px; }
  .pay-page .pay-breakdown { padding: 2px 12px; }
  .pay-page .pay-line { font-size: 0.86rem; }
  .pay-page .pay-tiles { grid-template-columns: minmax(0, 1fr); }
  .pay-page .pay-period-switch .chip { flex: 1 1 auto; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .pay-page .bar > div { transition: none; }
}
