/* Data sources page (September 2026): the coverage map, the levels of government,
   what official listings say and the index of every publisher.
   Layered over site.v2.css and release.v35.1.css; every rule is scoped to ds- classes.
   Cached one year: bump the filename on any change after deploy. */

.ds-page {
  /* Sequential teal ramp: listed places per state, fewest to most. */
  --ds-bin-1: #CBE7ED;
  --ds-bin-2: #9CD2DD;
  --ds-bin-3: #5FB3C5;
  --ds-bin-4: #1F7F93;
  --ds-bin-5: #0D5E6F;
  --ds-tile-ink-low: #24313A;   /* labels on bins 1-3 */
  --ds-tile-ink-high: #FFFFFF;  /* labels on bins 4-5 */
  --ds-bar: #1F7F93;
  --ds-track: rgba(36, 49, 58, 0.07);
  --ds-route: #B97A1F;          /* the dashed centre line of the levels route */
}
@media (prefers-color-scheme: dark) {
  .ds-page {
    --ds-bin-1: #1E3740;
    --ds-bin-2: #22505D;
    --ds-bin-3: #2A6D7D;
    --ds-bin-4: #4AA3B6;
    --ds-bin-5: #8FD4E2;
    --ds-tile-ink-low: #ECE6D9;
    --ds-tile-ink-high: #14181D;
    --ds-bar: #4FC3D8;
    --ds-track: rgba(236, 230, 217, 0.08);
    --ds-route: #D89A3F;
  }
}

/* ---------- intro, numbers and the jump row ---------- */
.ds-intro { padding-bottom: 36px; max-width: 900px; }
.ds-intro h1 { max-width: 17ch; margin-inline: auto; font-size: clamp(2.6rem, 5.6vw, 4.5rem); }
.ds-intro .launch-lede { max-width: 58ch; }
.ds-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.ds-stats li { display: flex; flex-direction: column; gap: 6px; padding: 26px 24px 24px; border-left: 1px solid var(--line); }
.ds-stats li:first-child { border-left: 0; padding-left: 4px; }
.ds-stats strong { font-size: clamp(2.3rem, 4.6vw, 3.6rem); font-weight: 600; letter-spacing: -.035em; line-height: 1; color: var(--ink); }
.ds-stats span { font-size: .95rem; color: var(--ink-2); }
.ds-stats-note { font-size: .84rem; color: var(--muted); margin: 14px 0 0; max-width: 88ch; }
.ds-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; padding: 0; list-style: none; }
.ds-jump a { display: inline-block; font-size: .8rem; font-weight: 600; line-height: 1; padding: 9px 13px; border-radius: 999px; color: var(--ink-2); background: var(--card); border: 1px solid var(--line); text-decoration: none; white-space: nowrap; }
.ds-jump a:hover { color: var(--brand-ink); border-color: var(--brand-ink); }
.ds-top { padding-bottom: 56px; }
.ds-stats-eyebrow { margin: 0 0 12px; }

/* ---------- how the layers fit together ---------- */
.ds-layers-wrap { padding-block: 8px 72px; }
.ds-layers-wrap .section-intro { margin-bottom: 28px; }
.ds-layers { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 14px; align-items: stretch; }
.ds-layer { display: flex; flex-direction: column; padding: 22px 22px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); }
.ds-layer.is-focus { border: 2px solid var(--brand-ink); box-shadow: var(--shadow-card); }
.ds-layer .eyebrow { margin: 0 0 6px; }
.ds-layer h3 { font-size: 1.2rem; margin: 0 0 8px; }
.ds-layer p { font-size: .93rem; margin: 0 0 14px; }
.ds-layer a { margin-top: auto; font-size: .88rem; font-weight: 600; }
.ds-plus { align-self: center; font-size: 2rem; font-weight: 300; line-height: 1; color: var(--brand-ink); }
.ds-layers-wrap .ds-jump { margin-top: 32px; }

/* ---------- the coverage map ---------- */
.ds-atlas { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 20px 44px; padding: clamp(18px, 3.2vw, 36px); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-card); position: relative; }
.ds-map { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: clamp(3px, .5vw, 6px); align-self: start; }
.ds-tile { width: 100%; aspect-ratio: 1 / 1; min-width: 0; border-radius: clamp(4px, .7vw, 8px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; background: var(--ds-bin-1); color: var(--ds-tile-ink-low); position: relative; transition: transform .16s ease, box-shadow .16s ease; }
.ds-tile[data-bin="2"] { background: var(--ds-bin-2); }
.ds-tile[data-bin="3"] { background: var(--ds-bin-3); }
.ds-tile[data-bin="4"] { background: var(--ds-bin-4); color: var(--ds-tile-ink-high); }
.ds-tile[data-bin="5"] { background: var(--ds-bin-5); color: var(--ds-tile-ink-high); }
.ds-tile b { font-size: clamp(.62rem, 1.3vw, .98rem); font-weight: 700; letter-spacing: .03em; line-height: 1; }
.ds-tile small { font-size: clamp(.5rem, .82vw, .68rem); font-weight: 500; line-height: 1; opacity: .92; }
.ds-tile:hover, .ds-tile:focus-visible, .ds-tile.is-active { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink), 0 10px 22px -10px rgba(0, 0, 0, .45); z-index: 2; outline: none; }
.ds-atlas-side h3 { font-size: 1.3rem; margin: 0 0 8px; }
.ds-atlas-side > p { font-size: .94rem; margin: 0 0 18px; }
.ds-legend { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 9px; }
.ds-legend li { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 10px; font-size: .9rem; color: var(--ink); }
.ds-legend small { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.ds-swatch { width: 18px; height: 18px; border-radius: 5px; background: var(--ds-bin-1); }
.ds-swatch[data-bin="2"] { background: var(--ds-bin-2); }
.ds-swatch[data-bin="3"] { background: var(--ds-bin-3); }
.ds-swatch[data-bin="4"] { background: var(--ds-bin-4); }
.ds-swatch[data-bin="5"] { background: var(--ds-bin-5); }
.ds-atlas-side .small { color: var(--muted); }
.ds-table-view { grid-column: 1 / -1; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.ds-table-view summary { cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--brand-ink); width: fit-content; }
.ds-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: .88rem; }
.ds-table th, .ds-table td { text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ds-table th:first-child { text-align: left; }
.ds-table thead th { font-size: .76rem; color: var(--ink-2); font-weight: 600; }
.ds-table tbody th { font-weight: 500; }
.ds-table a { color: var(--ink); text-decoration: none; }
.ds-table a:hover { color: var(--brand-ink); text-decoration: underline; }
.ds-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 200px; max-width: 250px; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lift); transform: translate(-50%, calc(-100% - 12px)); font-size: .84rem; line-height: 1.45; color: var(--ink-2); }
.ds-tip.is-below { transform: translate(-50%, 12px); }
.ds-tip span { display: block; }
.ds-tip strong { display: block; font-size: 1.35rem; font-weight: 600; letter-spacing: -.02em; color: var(--ink); line-height: 1.1; }
.ds-tip .ds-tip-name { display: block; font-weight: 600; color: var(--ink); font-size: .92rem; margin-bottom: 6px; }
.ds-tip .ds-tip-hint { display: block; margin-top: 6px; color: var(--brand-ink); font-weight: 600; font-size: .78rem; }

/* ---------- levels of government, as a route ---------- */
.ds-levels-wrap { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 56px; align-items: start; }
.ds-levels-wrap .section-intro { position: sticky; top: 96px; margin: 0; }
.ds-levels { list-style: none; margin: 0; padding: 0; position: relative; }
.ds-levels::before { content: ""; position: absolute; left: 12px; top: 20px; bottom: 44px; width: 3px; background: repeating-linear-gradient(to bottom, var(--ds-route) 0 12px, transparent 12px 22px); border-radius: 2px; opacity: .85; }
.ds-level { position: relative; padding: 0 0 38px 54px; }
.ds-level:last-child { padding-bottom: 0; }
.ds-level::before { content: ""; position: absolute; left: 1px; top: 6px; width: 25px; height: 25px; border-radius: 50%; background: var(--card); border: 3px solid var(--sign-blue-ink); box-shadow: 0 0 0 5px var(--paper); }
.ds-level-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.ds-level-head h3 { font-size: 1.35rem; margin: 0; }
.ds-level-meta { font-size: .86rem; color: var(--muted); margin: 0; }
.ds-level > p { font-size: .95rem; margin: 10px 0 0; max-width: 60ch; }
.ds-bar { position: relative; padding-right: 108px; margin-top: 12px; }
.ds-bar span { display: block; position: relative; width: var(--w); min-width: 4px; height: 12px; background: var(--ds-bar); border-radius: 0 4px 4px 0; }
.ds-bar b { position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); font-size: .92rem; font-weight: 600; color: var(--ink); white-space: nowrap; }

/* ---------- what a listing tells you ---------- */
.ds-details { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 36px 56px; align-items: start; }
.ds-chart { margin: 0; padding: clamp(18px, 3vw, 30px); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-card); }
.ds-chart h3 { font-size: 1.2rem; margin: 0 0 4px; }
.ds-chart > p { font-size: .88rem; margin: 0 0 16px; color: var(--muted); }
.ds-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ds-facts li { display: grid; grid-template-columns: minmax(0, 13.5em) minmax(0, 1fr); align-items: center; gap: 14px; }
.ds-fact-label { font-size: .9rem; color: var(--ink); line-height: 1.3; }
.ds-facts .ds-bar { margin: 0; padding-right: 64px; }
.ds-chart-foot { font-size: .84rem; color: var(--ink-2); margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.ds-appears { list-style: none; margin: 0; padding: 0; display: grid; gap: 26px; }
.ds-appears li { border-top: 1px solid var(--line); padding-top: 18px; }
.ds-appears h3 { font-size: 1.15rem; margin: 0 0 6px; }
.ds-appears p { font-size: .95rem; margin: 0; }
.ds-quote { font-weight: 600; color: var(--ink); }
.ds-quote::before { content: "\201C"; }
.ds-quote::after { content: "\201D"; }

/* ---------- maps, places and community ---------- */
.ds-sources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.ds-source { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 18px; align-items: start; padding: 24px 26px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); }
.ds-source img { width: 116px; height: 116px; max-width: none; margin: -14px 0 0 -12px; }
.ds-source .eyebrow { margin: 0 0 4px; }
.ds-source h3 { font-size: 1.25rem; margin: 0 0 8px; }
.ds-source p { font-size: .94rem; margin: 0 0 12px; }
.ds-credit { font-size: .8rem; color: var(--muted); }
.ds-source .ds-credit { margin: 0; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.ds-credit a { color: var(--ink-2); }
.ds-also { font-size: .92rem; color: var(--ink-2); max-width: 80ch; margin: 26px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- what RestMap adds ---------- */
.ds-own { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.ds-own article { border-top: 2px solid var(--brand-ink); padding-top: 16px; }
.ds-own h3 { font-size: 1.15rem; margin: 0 0 8px; }
.ds-own p { font-size: .93rem; margin: 0 0 10px; }
.ds-own a { font-size: .88rem; font-weight: 600; }
.ds-own-note { font-size: .88rem; margin: 30px 0 0; color: var(--ink-2); }

/* ---------- rules ---------- */
.ds-rules.purpose-list { row-gap: 36px; }

/* ---------- the publisher index ---------- */
.ds-index > .ds-index-tools, .ds-index > .ds-national, .ds-index > .ds-states, .ds-index > .ds-empty, .ds-index > .ds-index-note { max-width: 920px; }
.ds-get { display: flex; align-items: center; gap: 18px 28px; flex-wrap: wrap; max-width: 920px; padding: 22px 24px; margin: 0 0 26px; background: var(--card); border: 2px solid var(--brand-ink); border-radius: var(--r-m); box-shadow: var(--shadow-card); }
.ds-get-copy { flex: 1 1 320px; }
.ds-get h3 { font-size: 1.25rem; margin: 0 0 4px; }
.ds-get p { font-size: .94rem; margin: 0; }
.ds-qr { margin: 0; display: flex; align-items: center; gap: 10px; }
.ds-qr img { width: 84px; height: 84px; border-radius: 8px; background: #fff; padding: 4px; }
.ds-qr figcaption { font-size: .8rem; color: var(--ink-2); max-width: 8ch; line-height: 1.3; }
.ds-state-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin: 22px 0 0; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); font-size: .94rem; color: var(--ink); }
.ds-state-cta .launch-button { min-height: 42px; padding: 9px 18px; font-size: .9rem; }
.ds-index-tools[hidden], .ds-empty[hidden] { display: none; }
.ds-index-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 0 0 22px; }
.ds-search { position: relative; flex: 1 1 340px; max-width: 520px; }
.ds-search label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ds-search input { width: 100%; min-height: 48px; padding: 12px 16px 12px 44px; border: 1px solid var(--control-border); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; font-size: 1rem; }
.ds-search input::placeholder { color: var(--muted); opacity: 1; }
.ds-search input:focus { outline: 2px solid var(--brand-ink); outline-offset: 1px; }
.ds-search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ds-count { font-size: .88rem; color: var(--ink-2); margin: 0; min-height: 1.4em; }
.ds-national { padding: 20px 22px; margin: 0 0 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); }
.ds-national h3 { font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-ink); margin: 0 0 10px; }
.ds-states { border-top: 1px solid var(--line); }
.ds-state { border-bottom: 1px solid var(--line); scroll-margin-top: 84px; }
.ds-state summary { display: flex; align-items: baseline; gap: 12px; padding: 15px 34px 15px 2px; cursor: pointer; list-style: none; position: relative; }
.ds-state summary::-webkit-details-marker { display: none; }
.ds-state summary::after { content: "+"; position: absolute; right: 6px; top: 12px; font-size: 1.3rem; font-weight: 400; color: var(--ink-2); }
.ds-state[open] summary::after { content: "\2212"; }
.ds-state summary:hover .ds-state-name { color: var(--brand-ink); }
.ds-state-name { font-weight: 600; color: var(--ink); }
.ds-leader { flex: 1; min-width: 24px; border-bottom: 2px dotted var(--line); transform: translateY(-5px); }
.ds-state-meta { font-size: .88rem; color: var(--ink-2); white-space: nowrap; }
.ds-state-body { padding: 0 2px 24px; }
.ds-group h4 { font-size: .74rem; letter-spacing: .11em; text-transform: uppercase; color: var(--brand-ink); margin: 16px 0 8px; }
.ds-entries { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 40px; }
.ds-entries li { break-inside: avoid; padding: 5px 0 6px; font-size: .92rem; line-height: 1.4; }
.ds-entries a { color: var(--ink); font-weight: 500; text-decoration: none; background-image: linear-gradient(var(--line), var(--line)); background-size: 100% 1px; background-position: 0 100%; background-repeat: no-repeat; }
.ds-entries a:hover { color: var(--brand-ink); background-image: linear-gradient(currentColor, currentColor); }
.ds-entries span { display: block; color: var(--muted); font-size: .8rem; margin-top: 1px; }
.ds-index-note { font-size: .84rem; color: var(--muted); margin: 22px 0 0; }
.ds-empty { padding: 22px 2px; color: var(--ink-2); }

/* ---------- for public agencies ---------- */
.ds-agencies img { width: 132px; height: 132px; display: block; margin: 0 0 12px -10px; }
.ds-agencies .ds-mail { font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .ds-atlas { grid-template-columns: 1fr; }
  .ds-atlas-side { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
  .ds-atlas-side h3, .ds-atlas-side > p { grid-column: 1 / -1; }
  .ds-levels-wrap, .ds-details { grid-template-columns: 1fr; gap: 30px; }
  .ds-levels-wrap .section-intro { position: static; }
  .ds-sources { grid-template-columns: 1fr; }
  .ds-layers { grid-template-columns: 1fr; gap: 8px; }
  .ds-plus { justify-self: center; font-size: 1.7rem; }
  .ds-own { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .ds-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ds-stats li { padding: 18px 14px; }
  .ds-stats li:nth-child(odd) { border-left: 0; padding-left: 2px; }
  .ds-stats li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .ds-tile small { display: none; }
  .ds-tile b { font-size: .6rem; letter-spacing: 0; }
  .ds-atlas { padding: 14px; }
  .ds-atlas-side { display: block; }
  .ds-tip { display: none; }
  .ds-level { padding-left: 44px; }
  .ds-levels::before { left: 10px; }
  .ds-level::before { width: 21px; height: 21px; }
  .ds-facts li { grid-template-columns: 1fr; gap: 6px; }
  .ds-own { grid-template-columns: 1fr; }
  .ds-qr { display: none; }
  .ds-get .launch-button, .ds-state-cta .launch-button { width: 100%; }
  .ds-source { grid-template-columns: 1fr; gap: 4px; padding: 18px 20px 20px; }
  .ds-source img { width: 96px; height: 96px; margin: -12px 0 -8px -14px; }
  .ds-entries { columns: 1; }
  .ds-state-meta { font-size: .8rem; }
  .ds-quote { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .ds-tile { transition: none; }
  .ds-tile:hover, .ds-tile:focus-visible, .ds-tile.is-active { transform: none; }
}
@media (forced-colors: active) {
  .ds-tile { border: 1px solid CanvasText; }
  .ds-tile:hover, .ds-tile:focus-visible, .ds-tile.is-active { outline: 3px solid Highlight; outline-offset: 2px; }
  .ds-bar span { background: CanvasText; }
}
