/* Health profiles (pages/health-profile.php). Built on css/topics.css (tp-*, pdv-*); the county map is in css/map-key.css. */

.hp-flag img { display: block; width: 40px; height: 30px; border-radius: 4px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }

/* At a glance: one sentence per lead measure, its source as a numbered note */
.hp-glance { padding: 20px 22px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; }
.hp-glance h2 { margin: 0 0 10px; font-size: 1.2rem; font-weight: 500; color: var(--navy); }
.hp-glance-list { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 8px; font-size: .95rem; line-height: 1.6; color: var(--text); }
.hp-glance-list sup a { color: var(--teal); text-decoration: none; font-weight: 600; }
.hp-notes { display: grid; gap: 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.hp-notes .cite { margin: 0; scroll-margin-top: 100px; }
.hp-notes .cite:target { background: color-mix(in srgb, var(--teal) 10%, transparent); border-radius: 6px; }

/* Topics: jump links, then each topic's measures as cards */
.hp-jump small { padding: 0 6px; border-radius: 999px; background: var(--gray-100); color: var(--text-muted); font-size: .72rem; }
.hp-topic { margin: 26px 0 0; scroll-margin-top: 90px; }
.hp-topic-h { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 1.05rem; font-weight: 600; color: var(--navy); }
.hp-measure h4 { margin: 0; font-size: .95rem; font-weight: 600; line-height: 1.35; }
.hp-measure h4 a { color: var(--navy); text-decoration: none; }
.hp-measure h4 a::after { content: ''; position: absolute; inset: 0; border-radius: 16px; }   /* the whole card opens the dashboard */
.hp-measure h4 a:focus-visible { outline: none; }
.hp-now { margin: 0; font-size: .86rem; color: var(--text-muted); }
.hp-now b { font-size: 1.5rem; font-weight: 700; color: var(--teal); font-variant-numeric: tabular-nums; }
.hp-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 2px 0 0; }
.hp-facts div { min-width: 0; }
.hp-facts dt { font-size: .74rem; color: var(--text-muted); }
.hp-facts dd { margin: 0; font-size: .88rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* A state's counties: the measure, the map and its key, then the table */
.hp-county-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 6px; }
.hp-county-bar label { font-weight: 600; font-size: .92rem; color: var(--text); }
.hp-county-bar select { min-width: 260px; max-width: 100%; padding: 8px 10px; border: 1px solid var(--gray-200); border-radius: 10px;
  background: var(--white); color: var(--text); font: inherit; font-size: .9rem; }
.hp-png { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--white); color: var(--text); font: inherit; font-size: .88rem; cursor: pointer; }
.hp-png:hover { border-color: var(--teal); color: var(--teal); }
.hp-county-note { margin: 0 0 10px; font-size: .88rem; line-height: 1.5; color: var(--text-muted); }
.hp-map { position: relative; height: 480px; padding: 8px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.hp-map-wait { margin: 0; padding: 40px 10px; text-align: center; color: var(--text-muted); font-size: .9rem; }
.hp-county-find { margin: 18px 0 10px; max-width: 360px; }
.hp-table-wrap { max-height: 520px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.hp-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.hp-table caption { padding: 10px 12px; text-align: left; font-size: .84rem; color: var(--text-muted); }
.hp-table th, .hp-table td { padding: 7px 12px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; color: var(--text); }
.hp-table thead th { position: sticky; top: 0; z-index: 1; background: var(--gray-100); }
.hp-table th:nth-child(2), .hp-table td:first-child, .hp-table thead th:first-child { text-align: left; }
.hp-table tbody th { font-weight: 500; }
.hp-table tbody tr:hover { background: color-mix(in srgb, var(--teal) 5%, transparent); }
.hp-counties .cite { margin-top: 10px; }

/* Sources, and the market reports (our own research) */
.hp-src-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: .92rem; line-height: 1.5; color: var(--text); }
.hp-src-list a { color: var(--teal); font-weight: 500; }
.hp-sources p a { text-decoration: underline; }   /* a link inside a sentence shows by more than its colour */
.hp-markets { padding: 18px 22px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(160deg, var(--white) 60%, rgba(26,95,168,.06)); }
.hp-markets .tp-sec-head { margin: 0; }

/* Keyboard focus */
.hp-county-bar select:focus-visible, .hp-png:focus-visible, .hp-table-wrap:focus-visible, .hp-glance-list sup a:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

html[data-theme="dark"] .hp-glance, html[data-theme="dark"] .hp-map, html[data-theme="dark"] .hp-table-wrap { background: #0F1A2B; }
html[data-theme="dark"] .hp-markets { background: linear-gradient(160deg, #0F1A2B 60%, rgba(130,180,240,.08)); }
html[data-theme="dark"] .hp-glance h2, html[data-theme="dark"] .hp-topic-h, html[data-theme="dark"] .hp-measure h4 a { color: var(--text); }

@media (max-width: 700px) {
  .hp-map { height: 340px; }
  .hp-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hp-png { margin-left: 0; }
  .hp-county-bar select { min-width: 0; width: 100%; }
}
