/* NMH Provider Directory — simple, fast, accessible. No frameworks. */
:root {
  --ink: #16202b;
  --muted: #5a6b7b;
  --line: #e2e8ee;
  --bg: #ffffff;
  --panel: #f6f8fa;
  --brand: #0b6b5e;
  --brand-ink: #084f45;
  --accent: #e8f3f1;
  --focus: #0a84ff;
  --radius: 10px;
  --wrap: 1080px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
a { color: var(--brand-ink); }
a:hover { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; color: var(--ink); }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin: 0 0 .4em; }
img { max-width: 100%; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff;
  padding: 10px 14px; border-radius: 0 0 8px 0; z-index: 10;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* header / footer */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; color: var(--ink); }
.site-header nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-header nav a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem; }
.site-header nav a:hover { color: var(--brand); }

.site-footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 28px 0; background: var(--panel); color: var(--muted); font-size: .9rem; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.site-footer strong { color: var(--ink); }

main.wrap { padding-top: 28px; }
.muted { color: var(--muted); }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 60ch; }

/* hero + stats */
.hero { padding: 8px 0 4px; }
.stats { list-style: none; display: flex; gap: 28px; padding: 0; margin: 18px 0 0; flex-wrap: wrap; }
.stats li { color: var(--muted); font-size: .95rem; }
.stats strong { display: block; font-size: 1.8rem; color: var(--brand-ink); line-height: 1; }

/* finder / filters */
.finder { margin: 24px 0 8px; }
#filters { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 12px; align-items: end;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
#filters input, #filters select {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); width: 100%;
}
.reset, .linkbtn, .count { font: inherit; }
.reset { padding: 10px 16px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font-weight: 600; height: fit-content; }
.reset:hover { background: var(--accent); border-color: var(--brand); }
.count { margin: 12px 2px 0; color: var(--muted); font-weight: 600; }
.geostatus { margin: 4px 2px 0; color: var(--brand-ink); font-size: .88rem; }
.sortnote { margin: 2px 2px 0; color: var(--muted); font-size: .82rem; }
.linkbtn { background: none; border: 0; color: var(--brand-ink); text-decoration: underline; cursor: pointer; padding: 0; }

/* location field: institution / postcode toggle */
#filters { align-items: start; }
.field-label { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.loc-modes { display: inline-flex; margin: 5px 0 6px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.loc-mode { font: inherit; font-size: .82rem; font-weight: 600; border: 0; background: #fff; color: var(--muted); padding: 6px 10px; cursor: pointer; }
.loc-mode + .loc-mode { border-left: 1px solid var(--line); }
.loc-mode.is-active { background: var(--brand); color: #fff; }
.postcode-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.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; }
.card .dist { display: inline-block; margin-left: 8px; font-weight: 700; color: var(--brand-ink); background: var(--accent); border-radius: 999px; padding: 1px 8px; font-size: .8rem; }

/* listing grid + cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 8px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: #fff; }
.card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card .summary { margin: 0 0 10px; color: var(--muted); font-size: .92rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin: 8px 0 0; color: var(--muted); font-size: .85rem; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* tags */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; text-decoration: none;
  background: var(--accent); color: var(--brand-ink); padding: 3px 10px; border-radius: 999px; border: 1px solid transparent; }
.tag:hover { border-color: var(--brand); }

/* breadcrumb */
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 14px; font-size: .85rem; color: var(--muted); }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; color: var(--line); }
.breadcrumb a { text-decoration: none; }

/* provider page */
.provider-head { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 20px; }
.provider-head .tags { margin-top: 12px; }
.provider-grid { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }
.provider-main section { margin-bottom: 28px; }
.provider-main h2 { font-size: 1.2rem; border-bottom: 2px solid var(--accent); padding-bottom: 6px; }
.coverage-role { margin-bottom: 16px; }
.coverage-role h3 { font-size: 1rem; margin: 0 0 6px; }
.loc-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 16px; }
.loc-list li { font-size: .9rem; color: var(--ink); padding: 3px 0; border-bottom: 1px dotted var(--line); display: flex; justify-content: space-between; gap: 8px; }
.rate { color: var(--brand-ink); font-weight: 600; white-space: nowrap; }
.campuses { margin-top: 6px; }
.campuses summary { cursor: pointer; font-size: 1rem; color: var(--brand-ink); padding: 4px 0; }
.campus-list { max-height: 320px; overflow: auto; margin-top: 8px; padding-right: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.campus-list li { border-bottom: 1px dotted var(--line); }

.provider-side { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: sticky; top: 76px; }
.provider-side h2 { font-size: 1.05rem; margin-top: 0; }
.contact, .facts { margin: 0 0 14px; }
.contact div, .facts div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.contact dt, .facts dt { color: var(--muted); font-size: .85rem; }
.contact dd, .facts dd { margin: 0; text-align: right; font-weight: 600; word-break: break-word; }
.contact a { word-break: break-word; }
.disclaimer { font-size: .78rem; color: var(--muted); margin: 6px 0 0; }

/* add-provider form */
.subform { max-width: 720px; }
.subform fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin: 0 0 20px; }
.subform legend { font-weight: 700; padding: 0 6px; color: var(--brand-ink); }
.subform label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 4px; }
.subform input[type=text], .subform input[type=url], .subform input[type=email],
.subform input[type=tel], .subform input[type=number], .subform textarea, .subform select {
  width: 100%; font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.subform textarea { min-height: 90px; resize: vertical; }
.subform .roles { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.subform .role-row { display: flex; align-items: center; gap: 12px; }
.subform .role-row label { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: .9rem; margin: 0; }
.subform .role-row label input[type=checkbox] { width: auto; flex: 0 0 auto; }
.subform .role-price { width: 72px; flex: 0 0 72px; }
.subform .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.subform .hint { color: var(--muted); font-size: .8rem; font-weight: 400; margin: 3px 0 0; }
.subform .submit { background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: 12px 22px; font: inherit; font-weight: 700; cursor: pointer; }
.subform .submit:hover { background: var(--brand-ink); }
.subform .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.banner { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-weight: 600; }
.banner.ok { background: #e6f6ef; color: #0a6b45; border: 1px solid #b7e4cd; }
.banner.err { background: #fdecec; color: #a1281f; border: 1px solid #f3c2bd; }
@media (max-width: 560px) { .subform .row { grid-template-columns: 1fr; } }

/* prose */
.prose { max-width: 70ch; }
.prose h2 { font-size: 1.25rem; margin-top: 1.6em; }

@media (max-width: 820px) {
  #filters { grid-template-columns: 1fr 1fr; }
  #filters .field:first-child { grid-column: 1 / -1; }
  .provider-grid { grid-template-columns: 1fr; }
  .provider-side { position: static; }
}
@media (max-width: 520px) {
  #filters { grid-template-columns: 1fr; }
  .reset { width: 100%; }
}
