@import url('https://fonts.googleapis.com/css?family=Libre+Franklin:400,700|Montserrat:400,700');

:root {

	/* Colors */
	--color-primary: #c62828;
	--color-gray: #4a4a4a;
	--color-reggray: #777;
	--color-medgray: #ccc;
	--color-lightgray: #e9e9e9;

	/* Number of legend divisions */
	--num-legend-items: 5;

	/* Light, 7-color qualitative color scheme  */
	--color-qualitative-lt-0: rgb(102,194,165); /* teal */
	--color-qualitative-lt-1: rgb(252,141,98); /* lt orange */
	--color-qualitative-lt-2: rgb(141,160,203); /* lt blue */
	--color-qualitative-lt-3: rgb(231,138,195); /* pink */
	--color-qualitative-lt-4: rgb(166,216,84); /* yellow green */
	--color-qualitative-lt-5: rgb(255,217,47); /* lt yellow */
	--color-qualitative-lt-6: rgb(229,196,148); /* tan */

	/* Dark, 7-color qualitative color scheme  */
	--color-qualitative-dk-0: rgb(228,26,28); /* red */
	--color-qualitative-dk-1: rgb(55,126,184); /* blue */
	--color-qualitative-dk-2: rgb(77,175,74); /* green */
	--color-qualitative-dk-3: rgb(152,78,163); /* purple */
	--color-qualitative-dk-4: rgb(255,127,0); /* orange */
	--color-qualitative-dk-5: rgb(255,255,51); /* yellow */
	--color-qualitative-dk-6: rgb(166,86,40); /* brown */

	/* Fonts */
	--font-primary: 'Libre Franklin', sans-serif;
	--font-secondary: 'Lato', sans-serif;
	--font-tertiary: 'Montserrat', sans-serif;

	--letter-spacing: 0.5px;
	--border-radius: 3px;
}

html {
	padding: 0;
	margin: 0;
	font-size: 100%;
	box-sizing: border-box;
}
*, *:before, *:after {
	box-sizing: inherit;
}

body {
	margin: 0;
	padding: 0;
	font-family: var(--font-primary);
}

a {
	color: var(--color-primary);
	text-decoration: none;
}

.desktop-text { display: inline; }
.mobile-text { display: none; }

/*-------------
GRID
--------------- */

.interactive__wrapper {
	width: 100%;
	position: relative;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	column-gap: 1.5rem;
}


/*-------------
MAP
--------------- */

.chart__wrapper,
.map__wrapper {
	position: relative;
	width: 100%;
	grid-column: span 1;
	margin: 0;
	display: inline-block;
	vertical-align: top;
}

.chart__label,
.map__label {

}

.chart-container,
.map-container {
	position: relative;
	width: 100%;
	height: 15vw;
    height: calc((100vw - 1.5rem) / 3.5);
}

svg {
	position: relative;
	width: 100%;
	height: 100%;
}



.state:hover, .county:hover {
	stroke: black;
	stroke-width: 2px;
}

.state, .county {
	stroke: white;
	stroke-width: 1px;
	stroke-linejoin: round;
	stroke-linecap: round;
}

/* These are for separate meshes which I decided not to use, in favor of a hover effect */
.us-border {
	fill: none;
	stroke: white;
	stroke-width: 1px;
	stroke-linejoin: round;
	stroke-linecap: round;
}

.state-borders {
	fill: none;
	stroke: black;
	stroke-width: 0.5px;
	stroke-linejoin: round;
	stroke-linecap: round;
	pointer-events: none;
}

.county-borders {
	fill: none;
	stroke: white;
	stroke-width: 1px;
	stroke-linejoin: round;
	stroke-linecap: round;
	pointer-events: none;
}



.tooltip {
	background: #fff;
	border: 1px solid var(--color-medgray);
	position: absolute;
	bottom: 0;
	left: 0;
	padding: 6px 7px;
	opacity: 0;
	transition: opacity 0.3s;
	pointer-events: none;
	box-shadow: 0px 3px 4px rgba(0, 0, 0, 0.3);
	border-radius: 2px;
	text-align: center;
	z-index: 200;
}
.tooltip h3 {
	font-size: 0.75rem;
	text-transform: uppercase;
	font-weight: normal;
	margin: 0px;
	line-height: 1.125rem;
}
.tooltip p.key-number {
	font-size: 1.125rem;
	font-weight: bold;
	margin: 0.25rem 0px 0px 0px;
	line-height: 1.125rem;
}
.tooltip p.label {
	font-size: 0.75rem;
	font-weight: normal;
	margin: 0.25rem 0px 0px 0px;
	line-height: 1.125rem;
}


.chart__info, .chart__source, .chart__credit,
.map__info, .map__source, .map__credit {
	grid-column: 1 / -1;
	margin: 0.25rem 0px;
	/*padding: 24px;*/
}


.chart__headline, .chart__date, .chart__subheadline, .chart__source,
.map__headline, .map__date, .map__subheadline, .map__source {
	font-family: var(--font-primary);
}

.chart__headline,
.map__headline {
	font-size: 1.25rem;
	margin: 0;
	font-weight: 700;
	color: var(--color-gray);
	/*margin-top: 24px;*/
}

.chart__date,
.map__date {
	margin-top: 0.25rem;
}

.chart__subheadline,
.map__subheadline {
	font-size: 1rem;
}

.chart__date, .chart__note, .chart__credit, .chart__source,
.map__date, .map__note, .map__credit, .map__source {
	font-size: 0.875rem;
}

.chart__source,
.map__source {
	font-style: italic;
}


.rate-wrapper {
	padding: 0.125rem 0.25rem;
}

.prompt {
	font-family: var(--font-primary);
	/*font-weight: 700;*/
	color: var(--color-gray);
	margin: 0.25rem 0 0.5rem 0;
}


/*-------------
CONTROLS (above map)
--------------- */

.chart__toggles,
.map__toggles {
	overflow: hidden;
	display: -ms-flexbox;
	display: flex;
	max-width: 450px;
	margin: 1rem auto 1.5rem auto;
}


.chart__toggles button,
.map__toggles button {
	background-color: var(--color-lightgray);
	padding: 0.5rem 0.75rem;
	width: 7rem;
	border: 1px solid var(--color-medgray);
	display: inline;
	-ms-flex: 1;
	flex: 1;
	outline: none;
	color: var(--color-reggray);
	border-right: none;
	line-height: 1;
	vertical-align: middle;
	margin: 0;
	cursor: pointer;
	font-size: 0.75rem;
	text-transform: uppercase;
	font-family: var(--font-primary);
}

.chart__toggles button.active,
.map__toggles button.active {
	font-weight: 700;
	background-color: white;
	box-shadow: inset 0px 0px 2px rgba(0,0,0,0.2);
	color: var(--color-darkgray);
}
.chart__toggles button:first-of-type,
.map__toggles button:first-of-type {
	border-top-left-radius: 0.25rem;
	border-bottom-left-radius: 0.25rem;
}
.chart__toggles button:last-of-type,
.map__toggles button:last-of-type {
	border-top-right-radius: 0.25rem;
	border-bottom-right-radius: 0.25rem;
	border-right: 1px solid var(--color-medgray);
}

.chart__controls {
    display: flex;
    text-align: center;
    align-items: center;
    justify-content: center;
}

.input__wrapper {
	margin: 0.5rem 1rem;
	display: flex;
    align-items: center;
}

.input__wrapper label {
	margin: 0px 0.25rem;
	font-weight: bold;
}

/* FORM CONTROLS */
select {
	font-size: 1rem;
	padding: 0.5rem;
}


/*-------------
LEGEND (above map)
--------------- */

.chart__label,
.map__label {
	text-align: center;
	font-size: 1rem;
	margin: 0 0 0.25rem 0;
	font-weight: 700;
	color: var(--color-gray);
}

.legend__wrapper {
	width: 100%;
	max-width: 500px;
	margin: 0 auto 0.5rem auto;
	display: grid;
	grid-template-columns: repeat(var(--num-legend-items),1fr);
}

.chart__legend,
.map__legend {
	max-width: 500px;
	display: grid;
	/* grid-template-rows: repeat(2, 1fr); */
}

.legend-0 {
	grid-column: span var(--num-legend-items);
}
.legend-spacer {
	grid-column: span 1;
}
.legend-1 {
	grid-column: span var(--num-legend-items);
}


.legend__row {
	display: grid;
	grid-template-columns: repeat(var(--num-legend-items), 1fr);
	/* margin-bottom: 0.5rem; */
}

/* Position the breakpoints and hashes at the borders between the legend rectangles */
.legend__row.legend__breakpoints {
	position: relative;
}
.legend-0 .legend__row.legend__breakpoints {
	left: calc(100% / (var(--num-legend-items)*2));
}
.legend-1 .legend__row.legend__breakpoints {
	left: calc(100% / (var(--num-legend-items)*2));
}


.legend__tick {
	height: 6px;
}


.legend__group {
	text-align: center;
	line-height: 1;
/*	display: grid;
	grid-template-columns: 26px 1fr;
	align-content: center;
	align-items: center;
*/}

.legend__square, .legend__value {
	display: inline-block;
	margin: 0px;
	padding: 0px;
	line-height: 0.875rem;
	height: 0.875rem;
	vertical-align: middle;
}


.legend__square {
	background: #aaa;
	height: 0.875rem;
	opacity: 1;
}

.legend__tick,
.legend__square {
	width: 100%;
}

.legend__group .legend__tick,
.legend__group .legend__square {
	border-right: 1px solid #000;
}

.legend__group:last-of-type .legend__tick,
.legend__group:last-of-type .legend__square {
	width: 100%;
	border-right: none;
}

.chart__legend ul {
	margin: 0.5rem 0px 0.5rem 0px;
	padding: 0;
	list-style: none;
	display: flex;
	gap: 1.5rem;
	justify-content:  center;
}

.chart__legend ul li {
	list-style: none;
	font-size: 0.75rem;
	line-height: 0.75rem;
}

.chart__legend ul li span {
	display: inline-block;
	width: 0.75rem;
	height: 0.75rem;
	margin-right: 0.25rem;
}

.view-0 .square-0, .color-0 { background: var(--color-qualitative-lt-0); }
.view-0 .square-1, .color-1 { background: var(--color-qualitative-lt-1); }
.view-0 .square-2, .color-2 { background: var(--color-qualitative-lt-2); }
.view-0 .square-3, .color-3 { background: var(--color-qualitative-lt-3); }
.view-0 .square-4, .color-4 { background: var(--color-qualitative-lt-4); }
.view-0 .square-5, .color-5 { background: var(--color-qualitative-lt-5); }
.view-0 .square-6, .color-6 { background: var(--color-qualitative-lt-6); }


.legend__value {
	margin: 0;
	font-size: 0.875rem;
}




.leaflet-interactive.no-pointer {
	cursor: default;
}

.text-labels {
	text-align: center;
	font-family: var(--font-primary);
	font-size: 0.875rem;
	font-weight: 900;
	color: var(--color-reggray);
}


i.fa-check-circle,
i.fa-times-circle {
	margin-right: 6px;
}


.line-bg {
	color:  var(--color-lightgray);
}

.chart__tooltip {
	pointer-events: none;
	display: block;
	position: absolute;
	opacity: 0;
	top: 0;
	border: 0.125rem black solid;
	border-radius: 0.25rem;
	background-color: white;
	padding: 0px;
	width: 8rem;
	height: 2.5rem;
	text-align: center;
	margin-top: -1.3125rem; /* height (40px) + top border (2px) / 2 = 21px  */
}
.chart__tooltip.anchored_left { margin-left: 0.625rem; }
.chart__tooltip.anchored_right { margin-right: 0.625rem; }


.chart__tooltip.anchored_left:before {
	content: "";
	position: absolute;
	top: 25%;
	right: 100%;
	width: 0;
	border-width: 0.625rem;
	border-style: solid;
	border-color: transparent #000 transparent transparent;
}

.chart__tooltip.anchored_right:before {
	content: "";
	position: absolute;
	top: 25%;
	left: 100%;
	width: 0;
	border-width: 0.625rem;
	border-style: solid;
	border-color: transparent transparent transparent #000;
}

.chart__tooltip h2 {
	font-size: 0.75rem;
	font-weight: 900;
	margin: 0.25rem 0.25rem 0px 0.25rem;
}
.chart__tooltip p {
	font-size: 0.75rem;
	margin: 0px 0.25rem 0.25rem 0.25rem;
}




/* Large devices */
@media (max-width: 1200px) {
}

/* Large devices */
@media (max-width: 1024px) {
	.chart-container,
	.map-container {
	    height: calc((100vw - 1.5rem) / 3);
	}
}

/* Medium devices */
@media (max-width: 640px) {
	.chart-container,
	.map-container {
	    height: calc((100vw - 1.5rem) / 2);
	}

	html {
		font-size: 87.5%;
	}

	.desktop-text { display: none; }
	.mobile-text { display: inline; }

}

/* Medium devices */
@media (max-width: 600px) {
}

/* Small devices */
@media (max-width: 480px) {
	.interactive__wrapper {
		column-gap: 0.5rem;
	}


	.chart__controls {
	    display: grid;
	}
	.input__wrapper { margin: 0.5rem auto 0 auto; }
	.input__wrapper.select__wrapper { flex-flow: column; }
}

/* Small devices */
@media (max-width: 320px) {
}


















