@import url(https://use.fontawesome.com/releases/v5.1.0/css/all.css);

* {
    margin: 0;
    padding: 0;
}
body, text {
    font-family: Arial, Helvetica, sans-serif;
}
body {
    font-size: 62.5%;
    letter-spacing: -.04em;
    height: 100vh;
    user-select: none;
    overflow-y: hidden;
}
body.hidden {
    opacity: 0;
}
body, 
.cols, .rows,
nav ul, nav ul li,
#map, #legend .item,
.graph-tooltip .data-container,
footer, footer #controls, footer #controls ul, footer #controls ul li, 
footer #controls ul li a, #progress-bar, #current-year {
    display: flex;
}
.cols {
    flex-direction: row;
    min-height: 0;
}
.rows {
    flex-direction: column;
}

#map, #progress-bar,
.cols, .rows {
    flex-grow: 1;
}

nav ul,
footer #controls ul {
    list-style-type: none;
}
nav ul li {
    align-items: center;
    width: 100%;
    height: 60px;
    padding: 10px 10px 6px 10px;
    border-bottom: 4px solid #fff;
    box-sizing: border-box;
}
nav ul li:not(.active):hover {
    background-color: #f9f9f9;
    border-bottom-color: #eaeaea;
}
nav ul li:not(.active):active {
    background-color: #dedede;
    border-bottom-color: #c7c7c7;
}
nav ul li.active {
    color: #0078a1;
    border-bottom-color: #0078a1;
    font-weight: bold;
}
nav ul li .icon {
    font-size: 3.2em;
    margin-right: 8px;
}
nav ul li .title {
    word-spacing: 100vw;
    line-height: 1em;
}
nav ul li .title,
aside h3, aside p, .graph-tooltip,
#legend, #map-tooltip {
    font-size: 1.2em;
}
nav ul li, 
aside {
    color: #838383;
}

#map {
    position: relative;
    box-shadow: inset -7px 5px 35px -15px #838383,
                inset 0px -10px 20px -15px #0078a1;
}
@-moz-document url-prefix() {
    #map {
        box-shadow: inset -4px 2px 21px -12px #838383, 
                    inset 0px -8px 11px -13px #0078a1;
    }
}
#map svg {
    display: flex;
    flex-grow: 1;
}
#map .county:hover {
    fill: #004d67;
}
#map .county:active {
    fill: #003e52;
}
#map .county#selected {
    fill: #006081;
}
#legend {
    position: absolute;
    bottom: 32px;
    right: 32px;
    padding: 10px;
    box-shadow: 0px 3px 10px -1px #838383;
    background-color: #fff;
}
#legend .item:not(:last-child) {
    margin-bottom: .4em;
}
#legend .item .color, #legend .item .value {
    display: inline-flex;
}
#legend .item .color {
    width: 12px;
    height: 12px;
    margin-right: .3em;
}
#map-tooltip {
    display: none;
    position: absolute;
    background-color: #838383;
    padding: 10px;
    color: #fff;
    z-index: 2;
}
#map-tooltip .county {
    font-weight: bold;
}

aside {
    padding: 20px 20px 0 20px;
    overflow-y: auto;
    min-width: -moz-min-content;
    min-width: min-content;
}
aside div:last-child {
    margin-bottom: 20px;
}
aside .category {
    margin-bottom: 4em;
}
aside .category #title {
    font-size: 1.5em;
    font-weight: bold;
    line-height: initial;
}
aside .county #not-selected {
    font-style: italic;
}
aside .county #not-selected.hidden {
    display: none;
}
aside .county #selected.hidden {
    height: 0;
    overflow-y: hidden;
}
aside .county .name {
    font-weight: bold;
}
aside h2, aside .category #title {
    margin-bottom: .6em;
}
aside p {
    line-height: 1.4em;
}
aside .attr-value {
    user-select: all;
}
aside #graphs {
    min-width: 200px;
}
aside #graphs h3 {
    margin-top: 3.3em;
}
aside #graphs .graph {
    margin-top: 1em;
    width: 200px;
    height: 100px;
}
aside #graphs .graph .line {
    stroke: #0078a1;
    stroke-width: 3px;
    fill: none;
}
aside #graphs .graph .cursor-line {
    fill: #838383;
}
aside #graphs .graph .cursor-circle {
    fill: #fff;
    stroke: #838383;
    stroke-width: 2px;
}
.graph-tooltip {
    position: absolute;
    align-items: center;
    display: flex;
    z-index: 2;
}
.graph-tooltip .data-container {
    background-color: #838383;
    padding: 5px;
    color: #fff;
    flex-direction: column;
    text-align: right;
}
.graph-tooltip .year {
    font-weight: bold;
    font-size: .8em;
}
.graph-tooltip::after {
    width: 0;
    height: 0;
    content: '';
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 4px solid #838383;
}

footer {
    /* single color fallback */
    background-color: #0078a1;
    background-image: linear-gradient(170deg, #0078a1 10%, #9600a1);
    background-size: 100% 400%;
    flex: 0 0 45px;
    z-index: 3;
}
footer, footer #controls ul li a {
    color: rgba(255, 255, 255, .9);
}
footer #controls ul li {
    font-size: 1.7em;
    padding: 0 17px;
    align-items: center;
    text-decoration: none;
}
footer #controls ul li:hover {
    background-color: rgba(0, 0, 0, .2);
}
footer #controls ul li:active {
    background-color: rgba(0, 0, 0, .4);
}
nav ul li,
#map .county,
footer #controls ul li, #progress-bar #lines, #progress-bar #handle {
    cursor: pointer;
}

#progress-bar {
    padding: 5px 10px;
}
#progress-bar svg {
    flex-grow: 1;
    height: 35px;
}
#progress-bar .tick line,
#progress-bar .domain {
    display: none;
}
#progress-bar #elapsed {
    fill: rgba(0, 0, 0, .3);
}
#progress-bar #remaining {
    fill: rgba(255, 255, 255, .2);
}
#progress-bar .tick text,
#progress-bar #handle {
    fill: rgba(255, 255, 255, .9);
}
#progress-bar #handle {
    stroke-width: 1.5px;   
}
#current-year {
    margin: 0 15px;
    align-items: center;
    font-weight: bolder;
    font-size: 2.4em;
    letter-spacing: -.06em;
}
