/* salary.css — layout for the generated /salary/ content pages.
   Inherits the design tokens (:root custom properties) from styles.css, which
   is linked first, so light/dark themes and the colour system stay in sync. */

.doc {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.5rem) clamp(1rem, 4vw, 2rem) 4rem;
  line-height: 1.6;
}

/* Light-mode contrast: the default --muted (#898781, ~3.5:1) and --accent
   (#2a78d6, ~4.3:1) both fall below the WCAG AA 4.5:1 floor on the light
   surface. --muted drives small text (breadcrumbs, notes, table headers,
   footer); --accent drives every link, the current-page pill and the CTA
   button (white-on-accent). Darken both, scoped to these content pages in
   light mode only — dark mode already passes and the calculator is untouched. */
@media (prefers-color-scheme: light) {
  .doc {
    --muted: #6b6a65;    /* ~5.3:1 on --surface */
    --accent: #1f66c0;   /* ~5.3:1 text, and white-on-accent for the button */
  }
}

.doc a { color: var(--accent); }

.crumbs {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.doc__head h1 {
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  line-height: 1.15;
  margin: 0 0 .6rem;
  letter-spacing: -0.02em;
}
.lead { font-size: 1.08rem; color: var(--ink); margin: 0 0 1.5rem; }
.also { font-size: .92rem; color: var(--muted); margin: -0.5rem 0 1.5rem; }

.doc h2 {
  font-size: 1.15rem;
  margin: 2.4rem 0 .8rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  letter-spacing: -0.01em;
}

/* --- stat cards ------------------------------------------------------------ */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: .75rem;
  margin: .5rem 0 0;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .9rem 1rem;
  box-shadow: var(--shadow);
}
.stat__label { display: block; font-size: .78rem; color: var(--muted); }
.stat__value { display: block; font-size: 1.35rem; font-weight: 700; margin-top: .2rem; }
/* The national-rank card is the site's USP — give it emphasis. */
.stat--rank { border-color: var(--accent); background: var(--accent-tint); }
.stat--rank .stat__value { color: var(--accent); }

/* --- tables ---------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }   /* let the 4-col band table scroll on tiny screens */
.ledger, .bands {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.ledger th, .ledger td, .bands th, .bands td {
  padding: .55rem .4rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.ledger td, .bands td:not(:first-child) { text-align: right; }
.ledger th[scope="row"], .bands th[scope="row"] { font-weight: 400; }
.ledger .is-gross th, .ledger .is-gross td { font-weight: 600; }
.ledger .is-net th, .ledger .is-net td {
  font-weight: 700;
  border-top: 2px solid var(--ink);
  border-bottom: none;
  color: var(--success);
}
.bands thead th { font-size: .78rem; color: var(--muted); font-weight: 600; }

.note { font-size: .9rem; color: var(--muted); margin: .7rem 0 0; }
.sources { line-height: 1.9; }

/* --- FAQ ------------------------------------------------------------------- */
.faq {
  border-bottom: 1px solid var(--line);
  padding: .2rem 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: .7rem .2rem;
  list-style-position: inside;
}
.faq__a { padding: 0 .2rem .9rem; color: var(--ink); }

/* --- navigation rails ------------------------------------------------------ */
.prevnext {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 2rem 0 1rem;
}
.pn {
  text-decoration: none;
  font-weight: 600;
  padding: .5rem .9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.pn:hover { border-color: var(--accent); }

.rail h2 { border: none; padding: 0; margin: 1.5rem 0 .6rem; font-size: 1rem; }
.rail ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.rail a {
  display: inline-block;
  text-decoration: none;
  font-size: .9rem;
  padding: .35rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.rail a:hover { border-color: var(--accent); background: var(--accent-tint); }
/* The current page: a solid pill (white on accent) rather than the old
   accent-on-tint, which was near-invisible. */
.rail a[aria-current="page"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

/* --- hub grid -------------------------------------------------------------- */
.hub-grid {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  gap: .4rem;
}
.hub-grid--wide { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
.hub-grid a {
  display: block;
  text-decoration: none;
  text-align: center;
  padding: .5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}
/* comparison table: highlight the second (higher) salary column */
.compare td:last-child { font-weight: 600; }
.hub-grid a:hover { border-color: var(--accent); background: var(--accent-tint); }

/* --- call to action + footer ---------------------------------------------- */
.cta { margin: 2rem 0; }
/* Selector is `.doc a.button` (specificity 0,2,1) so its colour beats the
   generic `.doc a` link rule (0,1,1) above — otherwise the label renders in
   --accent on an --accent background and disappears. */
.doc a.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 600;
  padding: .8rem 1.3rem;
  border-radius: var(--radius-sm);
}
.doc a.button:hover { filter: brightness(1.05); color: var(--accent-ink); }

.doc__foot {
  margin-top: 3rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  font-size: .82rem;
  color: var(--muted);
}
.doc__foot p { margin: .4rem 0; }

.sitenav {
  margin: 2.5rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: .85rem;
  line-height: 2;
  color: var(--muted);
}
.sitenav a { text-decoration: none; }
.sitenav a:hover { text-decoration: underline; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
