/* /funding: the national map. Same paper, same ink; the ground is the country instead of the parcels. */
body.funding { overflow: hidden; }
#fmap { position: fixed; inset: 0; background-color: var(--band); touch-action: none; cursor: grab; overflow: hidden; }
#fmap.drag { cursor: grabbing; }
#fmap.over { cursor: pointer; }
#fsvg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#stage .maptip { z-index: 4; }
.fstate { fill: var(--blue); stroke: var(--paper); stroke-width: 1.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; transition: fill-opacity .25s; }
.fstate:hover { stroke: var(--blue); stroke-width: 2; }
.fstate.sel { fill: var(--hi); stroke: var(--ink); stroke-width: 2; fill-opacity: .55 !important; }
.fcounty { fill: var(--blue); stroke: var(--paper); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linejoin: round; transition: fill-opacity .25s; }
.fcounty:hover { stroke: var(--blue); stroke-width: 2; }
.fcounty.sel { fill: var(--hi); stroke: var(--ink); stroke-width: 2.4; fill-opacity: .9 !important; }
.fcity { display: none; fill: rgba(0, 0, 0, 0); pointer-events: all; stroke: var(--ink); stroke-opacity: .7; stroke-width: 1.1; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
#fmap.cities .fcity, .fcity.sel { display: inline; }
.fcity:hover { stroke-opacity: 1; stroke-width: 2.2; fill: rgba(255, 220, 0, .25); }
.fcity.sel { fill: var(--hi); fill-opacity: .9; stroke-opacity: 1; stroke-width: 2.4; }
.fselline { fill: none; stroke: var(--ink); stroke-width: 1.6; vector-effect: non-scaling-stroke; pointer-events: none; stroke-linejoin: round; }
.fselline.under { stroke: var(--hi); stroke-width: 6px; }
.farea { fill: var(--blue); stroke: var(--blue); stroke-opacity: .6; stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.farea:hover { stroke: var(--ink); stroke-width: 2; stroke-opacity: 1; }
.farea.sel { stroke: var(--ink); stroke-width: 2.4; stroke-opacity: 1; fill: var(--hi); fill-opacity: .9 !important; }
#fchi.all .farea { stroke: var(--ink); stroke-opacity: .85; stroke-width: 1.4; }
.farea-label { font-family: var(--mono); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; fill: var(--ink); paint-order: stroke; stroke: var(--sheet); stroke-width: 3px; stroke-linejoin: round; text-anchor: middle; pointer-events: none; }
.zoom button.wide { width: auto; padding: 0 12px; border-radius: 19px; font-size: 12px; letter-spacing: .08em; }

/* the front card */
.fcard { max-height: calc(100svh - 150px); overflow: auto; width: min(420px, calc(100vw - 2 * var(--gutter))); }
.fcard h1 { font-size: 40px; }
.fcard h2 { margin: 0 0 4px; font: 700 10.5px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.ftop { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ftop .list li { padding: 5px 0; font-size: 12.5px; gap: 8px; }
.ftop .list { counter-reset: r; }
.ftop .list b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pills a { cursor: pointer; }

/* place and organization sheets */
.big { font: 900 54px/1 var(--display); color: var(--blue); letter-spacing: .005em; }
.crumbs { margin: -8px 0 0; }
.box h2.subh, .box h3.subh { margin: 20px 0 6px; font: 700 10.5px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.box h2.subh:first-of-type { margin-top: 12px; }
.box .pills { margin-bottom: 4px; }
.box p.lede { margin: 6px 0 0; }
.box p.small { margin: 8px 0 0; }
table.yrs { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
table.yrs td { padding: 4px 0; }
table.yrs td:first-child { width: 44px; font: 11.5px/1 var(--mono); color: var(--muted); }
table.yrs td.bar i { display: block; height: 10px; background: var(--sky); border-radius: 1px; min-width: 1px; }
table.yrs td.num { text-align: right; width: 70px; font-variant-numeric: tabular-nums; font-weight: 700; padding-left: 8px; }
ol.rank { counter-reset: none; }
ol.rank li { align-items: flex-start; }
ol.rank li > span { min-width: 0; overflow-wrap: anywhere; }
ol.rank li > span small { display: block; }
ol.rank li > b { font-variant-numeric: tabular-nums; white-space: nowrap; }
ol.grants { list-style: none; margin: 10px 0 0; padding: 0; display: grid; }
ol.grants li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 14px; padding: 11px 0; border-top: 1px solid var(--rule); }
ol.grants li:first-child { border-top: 0; padding-top: 0; }
ol.grants .why { grid-column: 1; margin: 0; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
ol.grants .who { grid-column: 1; margin: 3px 0 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
ol.grants .who a { color: var(--blue); }
ol.grants .arr { color: var(--blue); }
ol.grants .amt { grid-column: 2; grid-row: 1 / span 2; font-variant-numeric: tabular-nums; align-self: start; white-space: nowrap; }
ol.grants.soft .amt { font-weight: 400; color: var(--muted); }
ol.progs { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 14px; }
ol.progs li { padding-top: 12px; border-top: 1px solid var(--rule); }
ol.progs li:first-child { border-top: 0; padding-top: 0; }
.prog-text { margin: 0 0 4px; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.cond.ins { grid-template-columns: minmax(0, 1fr) 76px 76px 1px; }
.cond.ins .r > .b { font-weight: 700; }
ul.plainlist { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }
.kv > span:nth-child(odd) { min-width: 0; }

@media (max-width: 760px) {
  .big { font-size: 46px; }
  .fcard { max-height: 46svh; }
  .ftop { grid-template-columns: 1fr; }
  body.funding:not(.has-sheet) .zoom { top: 74px; }
  .cond.ins { grid-template-columns: minmax(0, 1fr) 64px 64px 1px; }
}

/* zoomed into a place the state shading steps back, so the place is what you see */
#fmap.close .fstate:not(.sel) { fill-opacity: .05 !important; }
/* zoomed into a state its counties do the shading; the other states step back */
#fmap.reg .fstate:not(.sel) { fill-opacity: .04 !important; }

/* the words that named the place, and a line beside the sentence when the place came some other way */
mark.named { background: var(--hi); color: var(--ink); padding: 0 .12em; border-radius: 2px; }
ol.grants .whynote { grid-column: 1; margin: 3px 0 0; font-size: 12px; color: var(--muted); font-style: italic; }
#fmap.reg .fstate.sel { fill-opacity: 0 !important; }

/* under the time-range ruler */
#fmap { top: var(--range-h); }
.fcard { max-height: calc(100svh - var(--range-h) - 150px); }
@media (max-width: 760px) {
  #fmap { height: calc(100lvh - var(--range-h)); }
  .fcard { max-height: 46svh; }
  body.funding:not(.has-sheet) .zoom { top: calc(var(--range-h) + 74px); }
}
