/*
 * Shared styles for Virginia Faculty Pay (index, compare, lookup). Linked by each
 * page as assets/site.css; page-specific CSS stays inline in the page.
 *
 * Tokens (light and dark; dark applies via prefers-color-scheme unless
 * <html data-theme="light">, or always with <html data-theme="dark">):
 *   --bg --surface --ink --ink-2 --ink-3 --rule --grid --hover --ref
 *   --hl (selected institution; --accent is an alias)  --peer (everyone else)
 *   --t1..--t4 (administrator tiers)  --s1..--s6 (lookup series colors)
 *   --tip-bg --tip-ink (tooltips)  --sans --serif
 *
 * Classes:
 *   main                 reading column, max 1040px, 16px gutter on phones
 *   h1 h2 .dek .meta     page heading, section heading, subtitle, small gray text
 *   .notice              disclaimer box (left rule, surface background)
 *   .flag                small muted note with a left rule (coding caveats, footnote-style notes)
 *   .colophon            footer line
 *   .site-nav            top bar: <nav class="site-nav"><div class="inner"><a class="brand">...</a>
 *                        <a>...</a></div></nav>; mark the current page with aria-current="page"
 *   .picker              label + select group: <div class="picker"><label for="school">Institution</label>
 *                        <select id="school">...</select></div>
 *   .btn                 pill button or link (outline); .btn.primary filled; [aria-disabled="true"] dimmed
 *   .tablewrap           bordered scroll container for a table (overflow-x: auto)
 *   table th td          right-aligned numbers, first column left; .l forces left on th/td
 *   .sr-only             visually hidden text
 *   a, button, select, input: :focus-visible outlines use --hl
 */
:root {
  --bg: #fbfbf9; --surface: #ffffff; --ink: #16181d; --ink-2: #4f525a; --ink-3: #7b7e86;
  --rule: #e4e3de; --grid: #ecebe7; --hover: #f3f2ee; --ref: #b9b8b2;
  --hl: #2a78d6; --accent: var(--hl); --peer: #a9a8a2;
  --t1: #184f95; --t2: #3987e5; --t3: #86b6ef; --t4: #cde2fb;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300;
  --tip-bg: #16181d; --tip-ink: #ffffff;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17181a; --surface: #1e1f22; --ink: #f2f2f0; --ink-2: #c3c2b9; --ink-3: #95948c;
    --rule: #34353a; --grid: #2b2c30; --hover: #26272b; --ref: #5d5c58;
    --hl: #4b93ea; --peer: #6f6e69;
    --t1: #cde2fb; --t2: #86b6ef; --t3: #3987e5; --t4: #1c5cab;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300;
    --tip-bg: #f2f2f0; --tip-ink: #16181d; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17181a; --surface: #1e1f22; --ink: #f2f2f0; --ink-2: #c3c2b9; --ink-3: #95948c;
  --rule: #34353a; --grid: #2b2c30; --hover: #26272b; --ref: #5d5c58;
  --hl: #4b93ea; --peer: #6f6e69;
  --t1: #cde2fb; --t2: #86b6ef; --t3: #3987e5; --t4: #1c5cab;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300;
  --tip-bg: #f2f2f0; --tip-ink: #16181d; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); }
main { max-width: 1040px; margin: 0 auto; padding-inline: 16px; padding-block: 32px 56px; }
@media (min-width: 640px) { main { padding-inline: 20px; padding-block: 40px 64px; } }
h1 { font: 600 2rem/1.15 var(--serif); margin: 0 0 .4rem; text-wrap: balance; }
h2 { font: 600 1.35rem/1.2 var(--serif); margin: 2.4rem 0 .6rem; text-wrap: balance; }
p { max-width: 70ch; }
.dek { color: var(--ink-2); max-width: 70ch; margin: 0; }
.meta { color: var(--ink-3); font-size: .85rem; margin: .7rem 0 0; max-width: 90ch; }
a { color: var(--hl); }
.notice { margin: .8rem 0 0; padding: 8px 12px; border-left: 3px solid var(--rule); background: var(--surface); color: var(--ink-2); font-size: .88rem; max-width: 80ch; }
.flag { margin: .5rem 0 0; padding: 2px 0 2px 10px; border-left: 3px solid var(--rule); color: var(--ink-3); font-size: .82rem; line-height: 1.4; max-width: 80ch; }
.colophon { margin-top: 2.6rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: .85rem; color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* top nav */
.site-nav { background: var(--surface); border-bottom: 1px solid var(--rule); }
.site-nav .inner { max-width: 1040px; margin: 0 auto; padding: 0 16px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 20px; }
@media (min-width: 640px) { .site-nav .inner { padding-inline: 20px; } }
.site-nav a { display: inline-block; padding: 12px 0 10px; color: var(--ink-2); text-decoration: none; font-size: .92rem; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--hl); }
.site-nav .brand { font: 600 1.05rem var(--serif); color: var(--ink); margin-right: 8px; }

/* institution picker */
.picker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.picker label { font-weight: 600; font-size: .9rem; color: var(--ink-2); }
select { font: 1rem var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 8px 10px; min-width: 0; max-width: 100%; }
select:hover { border-color: var(--ref); }

/* pill buttons (buttons or links) */
.btn { display: inline-block; font: 500 .9rem var(--sans); color: var(--ink-2); background: transparent; border: 1px solid var(--rule); border-radius: 999px; padding: 6px 14px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ref); color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn[aria-disabled="true"] { opacity: .5; cursor: default; }

a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--hl); outline-offset: 2px; }

/* tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .88rem; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th:first-child, td:first-child, th.l, td.l { text-align: left; }
th { font-weight: 600; color: var(--ink-2); }
tbody tr:last-child td { border-bottom: 0; }
