/* Ontario Extern Tracker v0.3: editorial directory.
   One accent (ink blue) used only for links, the primary action and focus.
   Hierarchy comes from type, rules and alignment, not cards, shadows or pills. */
:root {
  /* colour */
  --paper: #fbfaf7;
  --ink: #1a1a1a;
  --ink-2: #454545;
  --muted: #6b6a66;
  --rule: #e2dfd8;
  --rule-strong: #1a1a1a;
  --control: #c8c4bb;
  --accent: #1f4f8f;
  --accent-hover: #163b6c;
  --tint: #f1efe9;                 /* expanded panels, selected-free hover */
  /* status (text colour only) */
  --st-positive: #1d6b3b;          /* positions listed, meets criteria */
  --st-caution: #8a5600;           /* talent pool, unconfirmed, check with employer */
  --st-negative: #a3262e;          /* doesn't meet listed criteria, closing within 7 days */
  /* type */
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --t-title: 30px;   /* page title */
  --t-h2: 20px;      /* section titles */
  --t-name: 18px;    /* hospital names */
  --t-body: 15px;
  --t-small: 13.5px;
  /* space */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --radius: 3px;     /* controls only; nothing else is rounded */
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: var(--t-body)/1.5 var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
button, select, input { font: inherit; color: inherit; }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 var(--s4); }

/* Masthead: a wordmark and one link, on a hairline */
.masthead { border-bottom: 1px solid var(--rule); }
.mast { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); padding-top: var(--s3); padding-bottom: var(--s3); }
.wordmark { font-weight: 650; font-size: 15px; color: var(--ink); text-decoration: none; letter-spacing: -.005em; }
.mast-link { font-size: var(--t-small); }

/* Intro: title, one sentence of facts, a dateline */
.intro { padding: var(--s5) 0 var(--s4); max-width: 640px; }
h1 { font: 700 var(--t-title)/1.12 var(--serif); letter-spacing: -.012em; margin: 0 0 var(--s3); }
.standfirst { font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.standfirst strong { color: var(--ink); font-weight: 600; }
.dateline { margin-top: var(--s2); font-size: var(--t-small); color: var(--muted); }

/* Filters: label + segmented control, sitting on the list's top rule */
.filters { border-top: 2px solid var(--rule-strong); padding: var(--s3) 0 var(--s2); }
.fgroup { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: var(--s2); margin-bottom: var(--s2); }
.flabel { font-size: var(--t-small); color: var(--muted); }
.seg { display: flex; border: 1px solid var(--control); border-radius: var(--radius); overflow: hidden; background: #fff; }
.seg button { flex: 1 1 0; min-width: 0; height: 36px; padding: 0 10px; border: 0; border-left: 1px solid var(--control); background: transparent; font-size: 14px; color: var(--ink); cursor: pointer; white-space: nowrap; }
.seg button:first-child { border-left: 0; }
.seg button:hover { background: var(--tint); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg button[aria-pressed="true"] + button { border-left-color: var(--ink); }
#year-row.dim { opacity: .45; }
select { height: 38px; border: 1px solid var(--control); border-radius: var(--radius); background: #fff; padding: 0 8px; max-width: 100%; font-size: 14px; }
.more { display: none; }
.more.open { display: block; padding-top: var(--s1); }
.checks { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s5); padding: var(--s1) 0 var(--s2) 72px; font-size: 14px; color: var(--ink-2); }
.checks label { display: inline-flex; align-items: center; gap: var(--s2); min-height: 32px; }
.checks input { width: 17px; height: 17px; margin: 0; accent-color: var(--ink); }
.fbar { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s4); }
.tlink { background: none; border: 0; padding: var(--s1) 0; color: var(--accent); font-size: 14px; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; cursor: pointer; }
.tlink:hover { color: var(--accent-hover); }
.privacy { font-size: 12.5px; color: var(--muted); }

/* Result line (like a search result count) */
.resultline { padding: var(--s3) 0; border-top: 1px solid var(--rule); font-size: 14px; color: var(--ink-2); }
.resultline strong { color: var(--ink); font-weight: 600; }

/* Sections */
.section { margin-top: var(--s5); }
.section-h { display: flex; align-items: baseline; gap: var(--s2); margin: 0; padding-bottom: var(--s2); border-bottom: 1px solid var(--rule-strong); font: 700 var(--t-h2)/1.25 var(--serif); }
.section-h .n { font: 400 var(--t-small) var(--sans); color: var(--muted); }
.section-h .tlink { margin-left: auto; font: 400 14px var(--sans); }
.colhead { display: none; }

/* Listing rows: a single column on mobile, a comparison grid on desktop */
.row { padding: var(--s4) 0; border-bottom: 1px solid var(--rule); }
.c-hosp { min-width: 0; }
.c-status { margin-top: var(--s2); }
.c-when { display: flex; flex-wrap: wrap; gap: 0 var(--s4); margin-top: 2px; }
.c-fit { margin-top: 2px; }
.c-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin-top: var(--s3); }
.c-links { display: flex; flex-wrap: wrap; gap: 0 var(--s4); }
.c-links:empty { display: none; }
.name { margin: 0; font: 700 var(--t-name)/1.25 var(--serif); }
.meta { font-size: var(--t-small); color: var(--muted); }
.c-status .meta { display: inline; }
.c-status .meta::before { content: " · "; }
.status { display: inline; font-weight: 600; font-size: 14.5px; }
.st-positive { color: var(--st-positive); }
.st-caution { color: var(--st-caution); }
.st-neutral { color: var(--ink); }
.st-quiet { color: var(--muted); font-weight: 500; }
.close-date, .pay { font-size: 14.5px; }
.close-date .lbl { color: var(--muted); }
.close-date.soon b { color: var(--st-negative); }
.close-date b { font-weight: 600; }
.c-close .meta { display: inline; }
.c-close .meta::before { content: " · "; }
.none { color: var(--muted); }
.fit { font-size: 14px; font-weight: 600; }
.fit::before { display: inline-block; width: 1.1em; }
.fit-meets { color: var(--st-positive); } .fit-meets::before { content: "✓"; }
.fit-check { color: var(--st-caution); } .fit-check::before { content: "?"; }
.fit-not_met { color: var(--st-negative); } .fit-not_met::before { content: "✕"; }
.fit-incomplete { color: var(--muted); font-weight: 500; }
.fit.fit-quiet { color: var(--muted); font-weight: 500; }  /* criteria of a listing that isn't open: informative, not a call to act */
.dash { display: none; }

.btn { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: var(--radius); background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--accent-hover); color: #fff; }
.c-act a.sec { font-size: 14px; }
.tlink[aria-expanded="true"] { color: var(--ink); text-decoration-style: solid; }

.panel { margin-top: var(--s3); padding: var(--s3) var(--s4); background: var(--tint); font-size: 14px; color: var(--ink-2); }
.panel p + p, .panel ul + p { margin-top: var(--s2); }
.reqs { list-style: none; margin: 0; padding: 0; }
.reqs li { display: grid; grid-template-columns: 1.3em minmax(0, 1fr); padding: 1px 0; }
.reqs .mk { font-weight: 700; }
.reqs .ok .mk { color: var(--st-positive); } .reqs .no .mk { color: var(--st-negative); } .reqs .check .mk { color: var(--st-caution); } .reqs .info .mk { color: var(--muted); }
.src { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }

.row.is-closed .name, .row.is-closed .close-date, .row.is-closed .pay { color: var(--muted); }

/* Footer */
.foot { margin: var(--s7) 0 0; padding: var(--s4) 0 140px; border-top: 1px solid var(--rule); font-size: 12.5px; color: var(--muted); }
.foot p { max-width: 720px; }
.foot p + p { margin-top: var(--s2); }
.err { color: var(--st-negative); }

/* Feedback: a plain bar, not a floating card */
.toast { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 2px solid var(--rule-strong); padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s2) var(--s4); }
.toast p { font-size: 14.5px; }
.toast-actions { display: flex; gap: var(--s2); }
.toast-actions button { height: 34px; padding: 0 16px; border: 1px solid var(--control); border-radius: var(--radius); background: #fff; font-size: 14px; cursor: pointer; }
.toast-actions button:hover { background: var(--tint); }
.toast-actions .toast-close { border-color: transparent; color: var(--muted); text-decoration: underline; padding: 0 6px; }

/* Desktop: the list becomes a comparison table */
@media (min-width: 900px) {
  :root { --t-title: 42px; }
  .wrap { padding: 0 var(--s6); }
  .mast { padding-top: var(--s4); padding-bottom: var(--s4); }
  .intro { padding: var(--s6) 0 var(--s5); max-width: 780px; }
  .standfirst { font-size: 17px; }
  .filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s3) var(--s5); }
  .fgroup { display: block; margin: 0; }
  .flabel { display: block; margin-bottom: var(--s1); }
  .seg button { flex: none; padding: 0 14px; }
  .more, .more.open { display: contents; }
  .checks { padding: 0; align-self: center; flex-direction: column; gap: 0; }
  .checks label { min-height: 26px; }
  .fbar { flex-basis: 100%; }
  #more-btn { display: none; }
  .colhead, .row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.6fr) minmax(0, 1.15fr) minmax(0, .85fr) minmax(0, 1.7fr) 120px; column-gap: 20px; }
  .colhead { padding: var(--s3) 0 var(--s2); border-bottom: 1px solid var(--rule); font-size: 12.5px; color: var(--muted); }
  .row { grid-template-areas: "hosp status close pay fit act" "links status close pay fit act" "panel panel panel panel panel panel"; grid-template-rows: auto 1fr auto; align-items: start; }
  .c-when, .c-actions { display: contents; }
  .c-hosp { grid-area: hosp; } .c-status { grid-area: status; } .c-close { grid-area: close; } .c-pay { grid-area: pay; }
  .c-fit { grid-area: fit; } .c-act { grid-area: act; } .c-links { grid-area: links; } .c-panel { grid-area: panel; }
  .c-links { margin-top: var(--s2); font-size: 13.5px; }
  .c-links .tlink { font-size: 13.5px; padding: 0; }
  .row > div, .c-when > div, .c-actions > div { margin-top: 0; }
  .c-links { margin-top: var(--s2); }
  .c-status .meta, .c-close .meta { display: block; }
  .c-status .meta::before, .c-close .meta::before { content: none; }
  .close-date .lbl { display: none; }
  .dash { display: block; }
  .c-act { margin-top: 0; text-align: right; }
  .c-act .btn { width: 100%; justify-content: center; }
  .c-act a.sec { display: inline-block; padding-top: 2px; }
  .panel { margin-left: 0; }
}
@media (max-width: 370px) {
  .fgroup { grid-template-columns: 52px minmax(0, 1fr); }
  .checks { padding-left: 60px; }
  .seg button { padding: 0 6px; font-size: 13.5px; }
  :root { --t-title: 27px; }
}

/* Article page: same type system */
.article { max-width: 680px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s7); }
.article h1 { font-size: 32px; margin-top: var(--s4); }
.article h2 { font: 700 var(--t-h2)/1.3 var(--serif); margin: var(--s6) 0 var(--s2); padding-top: var(--s3); border-top: 1px solid var(--rule); }
.article p, .article li { line-height: 1.6; }
.article p + p { margin-top: var(--s3); }
.article table { width: 100%; border-collapse: collapse; font-size: 14px; margin: var(--s3) 0; }
.article th, .article td { border-bottom: 1px solid var(--rule); padding: var(--s2) var(--s2) var(--s2) 0; text-align: left; vertical-align: top; }
.article th { border-bottom-color: var(--rule-strong); font-weight: 600; }
.article .cta { margin: var(--s4) 0; }
.article a.btn { color: #fff; }
.article .src { margin-top: var(--s2); }
