/* Outpatient Physician Directory — styles. Self-contained, no external fonts/CDNs. */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #16202c;
  --ink-soft: #4a5867;
  --ink-faint: #6b7886;
  --line: #dde3ea;
  --line-strong: #c4cdd8;
  --brand: #0b6b6b;        /* teal */
  --brand-dark: #084e4e;
  --brand-tint: #e4f1f1;
  --blue: #1c50b5;
  --blue-tint: #e8effb;
  --amber: #8a5a00;
  --amber-tint: #fbf0d8;
  --purple: #5b3aa6;
  --purple-tint: #efe9fb;
  --green: #1f7a3d;
  --green-tint: #e2f3e7;
  --grey-tint: #eceff3;
  --danger: #b3261e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16,32,44,.06), 0 4px 16px rgba(16,32,44,.06);
  --maxw: 1240px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.5;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.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;
}
.skip-link {
  position: absolute; left: 8px; top: -48px; background: var(--brand); color: #fff;
  padding: 10px 14px; border-radius: 8px; z-index: 100; transition: top .15s;
}
.skip-link:focus { top: 8px; }

a { color: var(--blue); }
button { font-family: inherit; }

/* ---------- header ---------- */
.site-header { background: var(--brand-dark); color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; flex-wrap: wrap; }
.brand h1 { margin: 0; font-size: 1.4rem; letter-spacing: -.01em; }
.tagline { margin: 2px 0 0; color: #bfe0e0; font-size: .9rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--brand); background: var(--brand); color: #fff;
  padding: 9px 14px; border-radius: var(--radius-sm); font-size: .92rem; font-weight: 600;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn.ghost:hover { background: rgba(255,255,255,.12); }
.btn.link { background: none; border: none; color: var(--brand); padding: 4px 6px; font-weight: 600; }
.btn.link:hover { text-decoration: underline; background: none; }
.btn.icon { padding: 6px 10px; }
.results-col .btn { color: #fff; }
:focus-visible { outline: 3px solid #2a8fd6; outline-offset: 2px; border-radius: 4px; }

/* ---------- search bar ---------- */
.searchbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.searchbar-inner { display: flex; gap: 14px; padding: 12px 20px; flex-wrap: wrap; align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field.grow { flex: 1 1 280px; min-width: 200px; }
.field label { font-size: .76rem; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; }
input[type="search"], input[type="text"], select {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 9px 11px; min-height: 42px;
}
input[type="search"] { width: 100%; }
#zip { width: 110px; }
select { cursor: pointer; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 300px 1fr; gap: 26px; padding-top: 24px; padding-bottom: 60px; align-items: start; }
.filters { position: sticky; top: 84px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 16px 16px; max-height: calc(100vh - 104px); overflow: auto; }
.filters-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; position: sticky; top: 0; background: var(--surface); }
.filters-head h2 { margin: 0; font-size: 1.05rem; }

details.panel { border-top: 1px solid var(--line); padding: 6px 0; }
details.panel > summary { cursor: pointer; list-style: none; font-weight: 700; font-size: .95rem; padding: 8px 2px; display: flex; justify-content: space-between; align-items: center; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: "▾"; color: var(--ink-faint); transition: transform .15s; }
details.panel[open] > summary::after { transform: rotate(180deg); }
.panel-body { padding: 4px 2px 10px; display: flex; flex-direction: column; gap: 7px; }
.opt { display: flex; align-items: center; gap: 9px; font-size: .9rem; color: var(--ink-soft); cursor: pointer; line-height: 1.3; }
.opt input { width: 17px; height: 17px; accent-color: var(--brand); flex: none; cursor: pointer; }
.opt .count { margin-left: auto; color: var(--ink-faint); font-size: .8rem; font-variant-numeric: tabular-nums; }
.opt-group-label { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); margin: 8px 0 2px; }
.panel-body input[type="text"] { min-height: 38px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 6px; }
.radio-row label { font-size: .85rem; border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 11px; cursor: pointer; color: var(--ink-soft); }
.radio-row input { position: absolute; opacity: 0; }
.radio-row input:checked + span { font-weight: 700; }
.radio-row label:has(input:checked) { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-dark); }

/* ---------- results ---------- */
.results-toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: baseline; margin-bottom: 12px; }
.result-count { margin: 0; font-weight: 700; font-size: 1.05rem; }
.active-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--grey-tint); border: 1px solid var(--line); border-radius: 999px; padding: 3px 6px 3px 10px; font-size: .82rem; color: var(--ink-soft); }
.chip button { border: none; background: var(--line-strong); color: #fff; border-radius: 999px; width: 18px; height: 18px; line-height: 1; cursor: pointer; font-size: .72rem; }

.results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.card-top { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
.card h3 { margin: 0; font-size: 1.18rem; letter-spacing: -.01em; }
.card .spec { margin: 2px 0 0; color: var(--brand-dark); font-weight: 600; }
.card .subspec { color: var(--ink-faint); font-weight: 400; font-size: .9rem; }
.distance { white-space: nowrap; background: var(--brand-tint); color: var(--brand-dark); font-weight: 700; border-radius: 999px; padding: 4px 11px; font-size: .85rem; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.badge { font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.badge.structure { background: var(--blue-tint); color: var(--blue); }
.badge.payment { background: var(--amber-tint); color: var(--amber); }
.badge.nonabms { background: var(--purple-tint); color: var(--purple); }
.badge.abms { background: var(--grey-tint); color: var(--ink-soft); }
.badge.team { background: var(--green-tint); color: var(--green); }
.badge.verified { background: var(--green); color: #fff; border-color: var(--green); }
.badge.flag { background: #fff; border-color: var(--line-strong); color: var(--ink-soft); }
.badge.role { background: #eef2f7; border-color: #64748b; color: #334155; } /* practice-role tag (e.g. Hospitalist) — distinct from credential/setting badges */
.badge.help { cursor: help; }

.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; margin-top: 6px; }
@media (max-width: 560px) { .meta-grid { grid-template-columns: 1fr; } }
.meta-row { display: flex; gap: 8px; font-size: .92rem; align-items: baseline; }
.meta-row .ico { color: var(--ink-faint); flex: none; width: 18px; text-align: center; }
.meta-row .val { color: var(--ink); }
.meta-row a.val { color: var(--blue); word-break: break-word; }
.muted { color: var(--ink-faint); }
.interests { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.interests .lbl { font-size: .78rem; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; }
.tag { font-size: .82rem; background: var(--brand-tint); color: var(--brand-dark); border-radius: 6px; padding: 2px 8px; }
.phone-cta { font-weight: 700; }
.card-foot { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: .8rem; color: var(--ink-faint); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.correct-link { color: var(--ink-faint); text-decoration: none; border-bottom: 1px dotted currentColor; white-space: nowrap; }
.correct-link:hover, .correct-link:focus { color: var(--brand); }

.empty { text-align: center; padding: 50px 20px; color: var(--ink-faint); }
.empty .btn { color: #fff; margin-top: 10px; }
.coverage { margin-top: 22px; font-size: .82rem; color: var(--ink-faint); }

/* ---------- footer ---------- */
.site-footer { background: #0d1822; color: #aebac6; padding: 26px 0; margin-top: auto; }
.site-footer p { margin: 0 0 8px; font-size: .85rem; }
.brand-by { color: #cdd8e2; font-size: .9rem; }
.brand-by a { color: #7fd0d0; text-decoration: none; }
.brand-by a:hover, .brand-by a:focus { text-decoration: underline; }
.footer-actions a { color: #7fd0d0; font-weight: 600; text-decoration: none; }
.footer-actions a:hover, .footer-actions a:focus { text-decoration: underline; }
.about { margin-top: 16px; padding-top: 14px; border-top: 1px solid #1b2a38; }
.about h2 { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: #cdd8e2; margin: 0 0 8px; }
.about p { color: #8696a5; font-size: .8rem; line-height: 1.55; break-inside: avoid; }
.about a { color: #7fd0d0; }
@media (min-width: 760px) { .about { column-count: 2; column-gap: 44px; } .about h2 { column-span: all; } }

/* ---------- consent / terms gate ---------- */
.consent { position: fixed; inset: 0; z-index: 1000; background: rgba(8,30,30,.78);
  display: flex; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
.consent[hidden] { display: none; }
.consent-card { background: #fff; max-width: 580px; width: 100%; border-radius: 12px;
  padding: 26px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.4); max-height: 92vh; overflow-y: auto; }
.consent-card h2 { margin: 0 0 12px; color: var(--brand-dark); font-size: 1.3rem; }
.consent-card p { margin: 0 0 12px; color: var(--ink); font-size: .94rem; line-height: 1.5; }
.consent-card ul { margin: 0 0 14px; padding-left: 20px; }
.consent-card li { margin: 0 0 9px; font-size: .9rem; line-height: 1.5; color: var(--ink); }
.consent-sources { font-size: .82rem; color: var(--ink-faint); }
.consent-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.consent-actions .btn { font-size: 1rem; padding: 11px 24px; }
body.consent-open { overflow: hidden; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(11,24,34,.55); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: var(--radius); max-width: 760px; width: 100%; max-height: 86vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.25rem; }
.modal-head .btn.ghost { color: var(--ink-soft); border-color: var(--line-strong); }
.modal-body { padding: 8px 22px 22px; overflow: auto; }
.gloss-section h3 { margin: 18px 0 6px; font-size: 1.02rem; color: var(--brand-dark); }
.gloss-item { margin: 9px 0; }
.gloss-item dt { font-weight: 700; }
.gloss-item dd { margin: 1px 0 0; color: var(--ink-soft); font-size: .93rem; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; }
  .searchbar { position: static; }
}
