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

	/* Plasma hues from bright yellow to purple/blue */
	--color-plasma-0: rgb(240,249,33); /* #F0F921 */  /* EF0 */
	--color-plasma-1: rgb(252,166,54); /* #FCA636 */  /* EF1 */
	--color-plasma-2: rgb(225,100,98); /* #E16462 */  /* EF2 */
	--color-plasma-3: rgb(177,42,144); /* #B12A90 */  /* EF3 */
	--color-plasma-4: rgb(106,0,168); /* #6A00A8 */  /* EF4 */
	--color-plasma-5: rgb(13,8,135); /* #0D0887 */  /* EF4 */

	/* interpolateCool hues */
	--color-cool-0: rgb(110, 64, 170); /* EF0 */
	--color-cool-1: rgb(76, 110, 219); /* EF1 */
	--color-cool-2: rgb(35, 171, 216); /* EF2 */
	--color-cool-3: rgb(29, 223, 163); /* EF3 */
	--color-cool-4: rgb(82, 246, 103); /* EF4 */
	--color-cool-5: rgb(175, 240, 91); /* EF4 */

	/* interpolateWarm hues */
	--color-warm-0: rgb(175, 240, 91); /* EF0 */
	--color-warm-1: rgb(226, 183, 47); /* EF1 */
	--color-warm-2: rgb(255, 120, 71); /* EF2 */
	--color-warm-3: rgb(254, 75, 131); /* EF3 */
	--color-warm-4: rgb(191, 60, 175); /* EF4 */
	--color-warm-5: rgb(110, 64, 170); /* EF5 */



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

.wrapper {
	/*max-width: 700px;*/
	width: 100%;
	position: relative;
	margin: 0;
	padding: 0;
}


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

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

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

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

.map__credit {
	text-align: right;
}

.map__source {
	font-style: italic;
}

/* 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 span {
	font-weight: 700;
}

.prompt {
	font-family: var(--font-primary);
	/*font-weight: 700;*/
	color: var(--color-gray);
	margin: 4px 0px 8px 0px;
	/*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)
--------------- */

#marker-legend ul, #map-controls ul {
	margin: 0px 0px 1rem 0px;
	padding: 0;
	list-style: none;
}

#marker-legend ul li, #map-controls ul li {
	display: inline-block;
	margin-right: 0.5rem;
	list-style: none;
	font-size: 0.875rem;
	line-height: 0.875rem;
	height: 0.875rem;
}

#marker-legend ul li span {
	display: inline-block;
	width: 0.875rem;
	height: 0.875rem;
	border-radius: 0.875rem;
}

#map-controls ul {
	float: right;
}


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

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

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

#marker-legend {
	grid-column: span 2;
}

#map-controls {
	grid-column: span 1;
}

.legend-0 {
	grid-column: span 12;
}
.legend-spacer {
	grid-column: span 1;
}
.legend-1 {
	grid-column: span 2;
}

.legend__row {
	display: grid;
	grid-template-columns: repeat(5, 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% / (6*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 6;
}
.view-1 .party__label {
	grid-column: span 5;
}


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

/* Only show the legend that matches the current view */
/* .view-0 .legend-1 { display: none; } */
/* .view-1 .legend-0 { display: none; } */

/* Dynamically change the number of grid columns between views */
.legend-0 .legend__row { grid-template-columns: repeat(6, 1fr); }
.legend-1 .legend__row { grid-template-columns: 1fr; }



/* Rainbow from blue to orange; blue is open; orange is dead/unknown */
.view-0 .square-0, .color-0 { background: var(--color-warm-0); } /* EF0 */
.view-0 .square-1, .color-1 { background: var(--color-warm-1); } /* EF1 */
.view-0 .square-2, .color-2 { background: var(--color-warm-2); } /* EF2 */
.view-0 .square-3, .color-3 { background: var(--color-warm-3); } /* EF3 */
.view-0 .square-4, .color-4 { background: var(--color-warm-4); } /* EF4 */
.view-0 .square-5, .color-5 { background: var(--color-warm-5); } /* EF4 */



.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;
	border: 2px solid black;
	max-width: 300px;
}

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


.leaflet-popup-content {
	font-family: var(--font-primary);
	max-width: 200px;
}
.leaflet-popup-content h3,
.leaflet-popup-content p, 
.leaflet-popup-content tr td {
	line-height: 1;
	font-size: 1rem;
}
.leaflet-popup-content h3 {
	margin-top: 1rem;
	margin-bottom: 0.75rem;
}
.leaflet-popup-content p {
	margin-top: 0.75rem;
	margin-bottom: 0.75rem;
}
.leaflet-popup-content strong.pct-wrapper {
	padding: 0 3px;
}
.pct-wrapper.color0 { padding: 0px; background: transparent; } /* Override for the popups */

.leaflet-popup-content table {
	border-collapse: collapse;
}

.leaflet-popup-content table tr td {
	padding: 6px 0px 4px 0px;
}

.leaflet-popup-content table tr td:nth-child(1) {
	padding-right: 6px;
}

.leaflet-popup-content table tr td:nth-child(2) {
	text-align: right;
}

.leaflet-popup-content table tr:nth-child(1) td,
.leaflet-popup-content table tr:nth-child(2) td {
	border-bottom: 1px solid black;
}


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

/* OVERRIDE BORDER AND PADDING ON _MARKER_ POPUPS */
.leaflet-popup-content .popup {
	border: none;
	padding: 0px;
}

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

.popup p.popup__name {
	font-weight: 900;
	text-transform: uppercase;
	margin: 0.25rem 0px 0.875rem 0px;
}

.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;
	width: 100%;
}

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



/* INTERACTIVE-TABLE */

/* Only show the legend that matches the current view */
.view-0 .table-1 { display: none; }
.view-1 .table-0 { display: none; }


/* Style the toggle button like a hyperlink */
.interactive-table-toggle {
	font-family: var(--font-primary);
	font-weight: bold;
	font-size: 1rem;
	text-align: left;
	color: black;
	background: none;
	margin: 1rem 0 0 0;
	padding: 0 0 3px 0;
	border: none;
	border-bottom: 1px solid black;
	cursor: pointer;
}
.interactive-table-toggle:hover {
	color: var(--color-primary);
	border-bottom: 1px solid var(--color-primary);
}


/* Styles to simulate jQuery slideToggle() */
.interactive-table {
	display: block;
    overflow-y: hidden;
	max-height: 1000px;
    transition: max-height 0.3s ease;
}
.interactive-table.hidden {
    max-height: 0;
}


/* Table styles */

.interactive-table table {
	margin: 1rem 0px 1rem 0px;
	padding: 0;
	width: 100%;
	border-collapse: collapse;
	/*display: none;*/
}

.interactive-table table tr td,
.interactive-table table tr th {
	font-size: 1rem;
	line-height: 1;
	padding: 6px;
}

.interactive-table table tr td div,
.interactive-table table tr th div {
	display: inline-block;
	width: 1rem;
	height: 1rem;
	border-radius: 1rem;
}

.interactive-table table tr td {
	font-weight: normal;
	border-bottom: 1px solid #aaa;
}

.interactive-table table tr th {
	text-align: left;
	font-weight: bold;
	border-bottom: 1px solid black;
}

.interactive-table table tr td a { color: black; text-decoration: none;}

.interactive-table table tr td:nth-child(3),
.interactive-table table tr td:nth-child(4),
.interactive-table table tr td:nth-child(5),
.interactive-table table tr td:nth-child(6),
.interactive-table table tr th:nth-child(3),
.interactive-table table tr th:nth-child(4),
.interactive-table table tr th:nth-child(5),
.interactive-table table tr th:nth-child(6) {
	border-left: 1px solid #aaa;
}


.interactive-table table tr:nth-child(even) {
	background: #f0f0f0;
}



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

.leaflet-multiply {
	opacity: var(--layer-opacity) !important;
	mix-blend-mode: multiply;
}

/* Let's make the Stamen tiles a little bit lighter */
.leaflet-container { background: #fff; }
.leaflet-tile-container {
	opacity: 0.5;
}


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

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


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




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

	.map__legend {
		display: block;
	}
	#map-controls ul {
		float: none;
	}


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