/* Demographics page v2. Site tokens only: text #33383d, headings #1a1a2e (Fraunces via the theme), links #14527e,
   rules #d9d9d9, map surround #f4f4f4, brand indigo #28166C, muted #666; plus the charts' dark green #1f7a4d (the
   nearest larger area's line). No new fonts, no cards. */

.dm-sub { color: #666; font-size: 15px; margin: -4px 0 18px; }

/* ---- measure switcher: a row of numbers that sits on the map frame and selects its layer */
.dm-hint { font-size: 14px; color: #666; line-height: 1.4; margin: 0 0 6px; }
.dm-tabs { display: flex; border: 1px solid #d9d9d9; border-bottom: 0; background: #fff; }
.dm-tabgroup { display: flex; flex: 1 1 auto; border-left: 1px solid #b4b4b4; }
.dm-tabgroup:first-child { border-left: 0; }
.dm-tabgroup[data-group="population"], .dm-tabgroup[data-group="housing"] { flex-grow: 3; }
.dm-tabgroup[data-group="education"] { flex-grow: 2; }
.dm-tab { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 8px 10px 7px;
  border-left: 1px solid #e6e6e6; color: #33383d; text-decoration: none !important; line-height: 1.25; }
.dm-tab:first-child { border-left: 0; }
.dm-tab:hover { background: #f4f4f4; }
.dm-tab:focus-visible { outline: 2px solid #28166C; outline-offset: -2px; }
#dm-map { scroll-margin-top: 90px; }
/* label on top, value + change pinned to the bottom: every number sits on one line whether its label wraps or not */
.dm-tab-label { font-size: 13px; color: #666; }
.dm-tab-value { margin-top: auto; padding-top: 4px; font-size: 20px; font-weight: 600; color: #1a1a2e; }
.dm-tab-delta { font-size: 12px; color: #666; }
.dm-tab[aria-current="true"] { background: #28166C; }
.dm-tab[aria-current="true"] .dm-tab-label,
.dm-tab[aria-current="true"] .dm-tab-delta { color: rgba(255,255,255,.82); }
.dm-tab[aria-current="true"] .dm-tab-value { color: #fff; }

.dm-caption { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 8px 12px; border: 1px solid #d9d9d9; border-bottom: 0; background: #fff; font-size: 15px; line-height: 1.4; }
.dm-caption strong { color: #1a1a2e; }
.dm-caption a { font-size: 14px; }
.dm-more { font-size: 15px; color: #666; line-height: 1.6; margin: 12px 0 0; }

.dm-hint-touch { display: none; }
@media (max-width: 760px) {
  .dm-tabs { overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .dm-tabgroup { flex: 0 0 auto; }
  .dm-tab { flex: 0 0 auto; width: 96px; scroll-snap-align: start; }
  .dm-tab-value { font-size: 18px; }
  .dm-hint-wide { display: none; }
  .dm-hint-touch { display: inline; }
}

/* ---- one section per measure: chart | table, then a few sentences */
.dm-jump { margin: 22px 0 0; }
/* the tag rides on the heading of the measure the map is showing; indigo like the selected tab above */
.dm-current { display: inline-block; margin-left: 12px; padding: 2px 8px; border-radius: 3px; background: #28166C;
  color: #fff; font: 600 12px/1.5 'Open Sans', Arial, sans-serif; letter-spacing: .02em; vertical-align: middle;
  position: relative; top: -2px; }
.dm-h2 { scroll-margin-top: 90px; margin-top: 34px; }
.dm-h3 { scroll-margin-top: 90px; margin-top: 22px; }
.dm-anchor { display: block; position: relative; top: -90px; visibility: hidden; }
.dm-block { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: start;
  margin: 8px 0 14px; }
@media (max-width: 800px) { .dm-block { grid-template-columns: minmax(0, 1fr); gap: 14px; } }
.dm-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: #666; margin: 0 0 6px; }
.dm-key::before { content: ""; display: inline-block; width: 18px; border-top: 2px solid; vertical-align: middle;
  margin: -2px 6px 0 0; }
.dm-key-subject::before { border-color: #28166C; }
.dm-key-parent::before { border-color: #1f7a4d; }
.dm-key-us::before { border-color: #b3b7bd; border-top-style: dashed; }
.dm-chart { position: relative; height: 230px; }
/* beside its table (wider than 800 px) the chart ends where the table does: legend 31 + gap + 276 = the 312 px table */
@media (min-width: 801px) { .dm-chart { height: 276px; } }

/* site tables (gray header, zebra rows) with compact cells and right-aligned figures */
.entry-content table.dm-table { width: 100%; margin: 0; font-size: 15px; line-height: 1.4; border-collapse: collapse; }
.entry-content table.dm-table th, .entry-content table.dm-table td { padding: 6px 10px; text-align: right;
  vertical-align: bottom; font-variant-numeric: tabular-nums; }
.entry-content table.dm-table td { white-space: nowrap; }
.entry-content table.dm-table th:first-child, .entry-content table.dm-table td:first-child { text-align: left; }
.dm-table caption { caption-side: top; text-align: left; font-size: 13px; color: #666; padding: 0 0 6px; }
.dm-table .dm-change td { font-weight: 600; }
.dm-mapit { display: inline-block; font-size: 14px; margin-top: 8px; }
.dm-source { font-size: 13px; line-height: 1.5; color: #666; }

.dm-scroll { overflow-x: auto; margin-bottom: 6px; }
.entry-content table.dm-compare { font-size: 14px; }
.entry-content table.dm-compare th { padding: 6px 8px; }
.dm-compare .dm-self td { font-weight: 600; }
