@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;

	--color-map-base: rgb(250,250,250); /* This is the base color of Carto's `light_all` map tiles. */

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

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

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

	--layer-opacity: 1;

	/* 5-class YlGnBu */
	--legend-color-0:  rgb(255,255,204); /* yl */
	--legend-color-1:  rgb(161,218,180);
	--legend-color-2:  rgb(65,182,196); /* gn */
	--legend-color-3:  rgb(44,127,184);
	--legend-color-4:  rgb(37,52,148); /* bu */
}

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;
	font-family: var(--font-primary);
}


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

.map__wrapper {
	position: relative;
}

/* Needed for the map to appear */
#interactive-map {
	height: 500px;
}

.map__info {
	margin: 0 auto;
	/*padding: 24px;*/
}

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

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

.map__date {
	margin-top: 4px;
}

.map__subheadline {
	font-size: 1rem;
	margin-top: 4px;
}

.map__date,
.map__note,
.map__credit,
.map__source {
	font-size: 0.875rem;
}

.map__source {
	font-style: italic;
	margin: 0.25rem 0px;
}

.map__credit {
	margin: 0.25rem 0px;
	text-align: right;
}

/* Displays information when a polygon is clicked */
.map__sentence {
	font-family: var(--font-primary);
	font-size: 1rem;
	margin-top: 0;
	/*margin-top: 32px;*/
	/*margin-bottom: 32px;*/
}

.map__sentence h2, .map__sentence p {
	margin: 0.5rem 0px;
}

.map__sentence h2 {
	font-size: 1rem;
	text-transform: uppercase;
	color: var(--color-gray);
}

.map__sentence strong {
	font-weight: 700;
}

.rate-wrapper {
	padding: 2px 4px;
}

.prompt {
	font-family: var(--font-primary);
	/*font-weight: 700;*/
	color: var(--color-gray);
	margin-top: 32px;
	/*margin-bottom: 8px;*/
}


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

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


.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);
}

.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);
}
.map__toggles button:first-of-type {
	border-top-left-radius: 0.25rem;
	border-bottom-left-radius: 0.25rem;
}
.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);
}

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

/* At desktop widths, hide this line break. We'll use it on mobile. */
.party__label br {
	display: none;
}

.legend__wrapper {
	width: 100%;
	max-width: 80%;
	margin: 0 auto 0.5rem auto;
	display: block;
	grid-template-columns: 1fr;
}

.map__legend {
	width: 100%;
	max-width: 80%;
	margin: 0 auto 0.5rem auto;
	display: grid;
}

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


.legend__row {
	display: grid;
	grid-template-columns: repeat(var(--num-legend-items), 1fr);
}

/* 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 {
}


.legend__tick {
	height: 6px;
}

.party__label {
	text-align: center;
	/* background-color: #dedede; */
	text-transform: uppercase;
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1;
	color: var(--color-gray);
	padding: 0;
}
.view-0 .party__label {
	grid-column: span var(--num-legend-items);
}
.view-1 .party__label {
	grid-column: span var(--num-legend-items);
}


.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;
}

/* Color scale. */
.legend-color-0,  .view-0 .square-0  { opacity: var(--layer-opacity); background: var(--legend-color-0) }
.legend-color-1,  .view-0 .square-1  { opacity: var(--layer-opacity); background: var(--legend-color-1) }
.legend-color-2,  .view-0 .square-2  { opacity: var(--layer-opacity); background: var(--legend-color-2) }
.legend-color-3,  .view-0 .square-3  { opacity: var(--layer-opacity); background: var(--legend-color-3) }
.legend-color-4,  .view-0 .square-4  { opacity: var(--layer-opacity); background: var(--legend-color-4) }
/*.legend-color-5,  .view-0 .square-5  { opacity: var(--layer-opacity); background: var(--legend-color-5) }
.legend-color-6,  .view-0 .square-6  { opacity: var(--layer-opacity); background: var(--legend-color-6) }
.legend-color-7,  .view-0 .square-7  { opacity: var(--layer-opacity); background: var(--legend-color-7) }
.legend-color-8,  .view-0 .square-8  { opacity: var(--layer-opacity); background: var(--legend-color-8) }
.legend-color-9,  .view-0 .square-9  { opacity: var(--layer-opacity); background: var(--legend-color-9) }
.legend-color-10, .view-0 .square-10 { opacity: var(--layer-opacity); background: var(--legend-color-10) }
.legend-color-11, .view-0 .square-11 { opacity: var(--layer-opacity); background: var(--legend-color-11) }
*/


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




/*-------------
OTHER
--------------- */

.info {
	background: white;
	font-family: var(--font-secondary);
	font-size: 1rem;
	line-height: 1.8;
	border-radius: var(--border-radius);
	color: black;
	max-width: 285px;
}

.legend {
	padding: 16px;
	font-family: var(--font-primary);
}

.legend h3 {
	margin: 0px 0px 0.875rem 0px;
	font-size: 1rem;
	font-weight: 700;
	color: var(--color-gray);
	text-transform: uppercase;
}

.legend ul {
	margin: 0px 0px;
	padding-left: 0px;
	list-style-type: none;
}
.legend ul li {
	margin-left: 0px;
	padding-left: 0px;
	font-size: 0.8rem;
}


.legend i {
	width: 0.8rem;
	height: 0.8rem;
	border: 1px solid black;
	margin-right: 10px;
	display: inline-block;
}

.popup {
	font-family: var(--font-primary);
	background: white;
	padding: 1rem;
	border: 2px solid #000;
}

.popup__county,
.popup__pct-wrapper {
	border-bottom: 1px solid black;
}

.popup__name {
	font-weight: 900;
	line-height: 1.2;
	text-transform: uppercase;
	margin: 0px;
	color: var(--color-gray);
}

.popup__text {
	line-height: 1.2;
	padding-bottom: 0.25rem;
	margin: 0.5rem 0px 0.25rem 0px;
	border-bottom: 1px solid #AAA;
}

.popup__text:last-of-type {
	margin-bottom: 0px;
	padding-bottom: 0px;
	border-bottom: none;
}

.popup__county {
	margin: 0px 0px 1rem 0px;
	padding-bottom: 0.5rem;
}

.popup__margin {
	margin: 0.25rem 0px 0px;
	font-weight: 700;
}


.popup table {
	border-collapse: collapse;
}

.popup table tr:nth-child(even) {
	background-color: var(--color-lightgray);
} 

.popup table tr td, 
.popup table tr th {
	text-align: left;
}
.popup table tr td.data, 
.popup table tr th.data {
	text-align: right;
	padding-left: 0.75rem;
}


.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;
}


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

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

/* Medium devices */
@media (max-width: 640px) {
	html {
		font-size: 87.5%;
	}

	#interactive-table table tr td,
	#interactive-table table tr th {
		padding: 3px;
	}

	#interactive-table table tr td:nth-of-type(3),
	#interactive-table table tr th:nth-of-type(3) {
		display: none;
	}

	.party__label br {
		display: block;
	}

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

	#interactive-map { 
		height: 400px;
	}

}

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

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

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




