/* Digital Divide Explorer (information-technology/digital-divide.php). The page chrome is the one-screen layout in
   /css/resource.css. Explore: the chart fills the height on the left, what it shows on the right; Causes &
   solutions: the causes on the left, the chosen one on the right. On smaller screens they stack and the page scrolls.
   Theme tokens only: the chart's own colours are named below, the income groups ordered from low (warm) to high (cool). */

:root{--dd-lic:var(--viz-2);--dd-lmc:var(--viz-7);--dd-umc:var(--viz-3);--dd-hic:var(--viz-1);--dd-wld:var(--ink-soft);--dd-off:var(--line-strong)}
/* each group's colour as --c, for whatever is drawn in it (digital-divide.js adds the class) */
.dd-c-LIC{--c:var(--dd-lic)}
.dd-c-LMC{--c:var(--dd-lmc)}
.dd-c-UMC{--c:var(--dd-umc)}
.dd-c-HIC{--c:var(--dd-hic)}
.dd-c-WLD{--c:var(--dd-wld)}
.dd-c-nz{--c:var(--accent-b)}
.dd-c-acc{--c:var(--accent)}

.objective h4{margin:14px 0 6px;font:700 14px/1.2 var(--font-display);color:var(--ink)}
.rp-main{gap:10px}
.seg-toggle.is-off{opacity:.45;pointer-events:none}

.dd-stage{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,360px);gap:12px}
.dd-chart{display:flex;flex-direction:column;gap:6px;padding:10px 12px;min-height:0;min-width:0}
.dd-chart-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.dd-svgbox{flex:1;min-height:0;display:flex}
.dd-svgbox svg{display:block;width:100%;height:100%}
.dd-yearctl{flex:none;display:flex;align-items:center;gap:10px;font:600 13px/1 var(--font-display);color:var(--ink)}
.dd-yearctl input{flex:1;accent-color:var(--accent);min-height:28px}
.dd-yearctl output{font:700 15px var(--font-mono);color:var(--accent-deep);min-width:44px}
.dd-src{flex:none;margin:0;font-size:12px;color:var(--muted);line-height:1.4}
.dd-src a{color:var(--muted)}

/* the chart's parts */
.dd-axis{stroke:var(--ink-soft);stroke-width:1.2}
.dd-grid{stroke:var(--line);stroke-width:1}
.dd-tick{fill:var(--muted);font:12px var(--font-mono)}
.dd-tick.dd-pairhead{font-weight:700;fill:var(--ink-soft)}
.dd-label{font:600 13px var(--font-body)}
.dd-line{fill:none;stroke:var(--c);stroke-width:3;stroke-linejoin:round;stroke-linecap:round}
.dd-line.dim{opacity:.25}
.dd-wld{stroke-dasharray:6 5;stroke-width:2.2}
.dd-line.sel{stroke-width:4.5}
.dd-hitline{stroke:transparent;stroke-width:16;fill:none}
.dd-glabel{fill:var(--c)}
.dd-glabel.sel{font-weight:800}
.dd-now{fill:var(--ink)}
.dd-year{stroke:var(--ink);stroke-width:1.2;stroke-dasharray:4 4}
.dd-dot{fill:var(--c);stroke:var(--panel);stroke-width:2}
.dd-bar{rx:3;fill:var(--c)}
.dd-barlabel{fill:var(--ink);font:13px var(--font-body)}
.dd-barval{fill:var(--ink);font:600 12.5px var(--font-mono)}
.dd-barnz{fill:var(--ink);font:700 13px var(--font-body)}
.dd-hit{cursor:pointer}

/* the side panel */
.dd-side{min-height:0;overflow:auto;padding:12px 14px;display:flex;flex-direction:column;gap:10px}
.dd-side h3{margin:0 0 4px;font:600 11.5px/1.2 var(--font-display);letter-spacing:.07em;text-transform:uppercase;color:var(--muted)}
.dd-big{font:700 30px/1.1 var(--font-display);color:var(--ink)}
.dd-big small{font:500 14px var(--font-body);color:var(--ink-soft)}
.dd-people{display:grid;grid-template-columns:repeat(10,1fr);gap:3px;max-width:240px}
.dd-people i{aspect-ratio:1;border-radius:50%;background:var(--dd-off)}
.dd-people i.on{background:var(--c)}
.dd-pick{display:flex;flex-wrap:wrap;gap:5px}
.dd-pick button{font:600 12px/1.2 var(--font-display);padding:6px 9px;border-radius:999px;border:1.5px solid var(--c);background:transparent;color:var(--ink);cursor:pointer}
.dd-pick button[aria-pressed="true"]{background:var(--c);color:var(--on-viz)}
.dd-meters{display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--ink-soft)}
.dd-meter .row{display:flex;justify-content:space-between;gap:8px}
.dd-meter .row b{font-family:var(--font-mono);color:var(--ink)}
.dd-meter .track{height:8px;border-radius:4px;background:var(--panel-2);border:1px solid var(--line);overflow:hidden}
.dd-meter .fill{height:100%;background:var(--c)}
.dd-note{padding:10px 12px;border-radius:8px;background:var(--paper);border:1px solid var(--line);border-left:3px solid var(--accent);font-size:13.5px;line-height:1.5;color:var(--ink-soft)}
.dd-note b{color:var(--ink)}

/* causes & solutions */
.dd-causes{flex:1;min-height:0;display:grid;grid-template-columns:minmax(280px,360px) minmax(0,1fr);gap:12px}
.dd-cause-list{min-height:0;overflow:auto;padding:12px 14px}
.dd-cause-list h2{margin-bottom:8px}
.dd-cause-list .dd-gap{margin-top:14px}
#ddCauseBtns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.dd-cbtn{font:600 13.5px/1.2 var(--font-display);text-align:left;padding:9px 10px;border-radius:6px;border:1px solid var(--line-strong);background:var(--panel-2);color:var(--ink);cursor:pointer;min-height:40px}
.dd-cbtn:hover{border-color:var(--accent)}
.dd-cbtn[aria-selected="true"]{border:2px solid var(--accent);background:var(--accent-tint)}
.dd-effects{margin:0;padding-left:18px;font-size:13.5px;line-height:1.45;color:var(--ink-soft)}
.dd-effects li{margin-bottom:5px}
.dd-effects b{color:var(--ink)}
.dd-cause{min-height:0;overflow:auto;padding:14px 18px}
.dd-cause h2.nm{font:700 22px/1.2 var(--font-display);color:var(--accent-deep);text-transform:none;letter-spacing:0;margin-bottom:6px}
.dd-cause .what{font-size:15px;line-height:1.5;color:var(--ink-soft);margin:0 0 10px}
.dd-cause h3{margin:12px 0 6px;font:600 11.5px/1.2 var(--font-display);letter-spacing:.07em;text-transform:uppercase;color:var(--muted)}
.dd-cause ul{margin:0;padding-left:18px;font-size:14px;line-height:1.5;color:var(--ink-soft)}
.dd-cause .nz{border-left:3px solid var(--accent-b);background:var(--panel-2);border-radius:0 6px 6px 0;padding:8px 12px 8px 30px}
.dd-quiz{flex:1;min-height:0;display:flex;flex-direction:column}
.dd-quiz .cq{flex:1}
#ddSources ul{padding-left:20px}
#ddSources li{margin-bottom:8px}

@media (max-width:900px){
  .dd-stage,.dd-causes{display:flex;flex-direction:column}
  .dd-svgbox{flex:none}
  .dd-svgbox svg{height:auto}
  .dd-side,.dd-cause-list,.dd-cause{overflow:visible}
  .btn,.seg-toggle button,.dd-pick button{min-height:40px}
  .dd-yearctl input{min-height:40px}
}
@media (max-width:640px){
  .rp-main{padding-left:10px;padding-right:10px}
  #ddCauseBtns{grid-template-columns:1fr 1fr}
}
