@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,248); /* This is the base color of Carto's `light_all` map tiles. */

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

	/* Number of views */
	--num-views: 1;

	--legend-color-0: rgb(255,255,212);
	--legend-color-1: rgb(254,217,142);
	--legend-color-2: rgb(254,153,41);
	--legend-color-3: rgb(217,95,14);
	--legend-color-4: rgb(153,52,4);


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


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

#interactive-map {
	height: 500px;
}

.map__info {
	margin: 0;
}

.map__info ul li {
	font-size: 0.875rem;

}

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

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




/*-------------
SLIDER
--------------- */
.map__start {
	margin-right: 8px;
	text-align: center;
}
.map__end {
	margin-left: 8px;
	text-align: center;
}
.map__slider {
	font-size: 14px;
	display: block;
	width: calc(100% - 2rem);
	min-height: 1rem;
	margin: 2rem 1rem 4rem;
}

.noUi-connect { background: var(--color-medgray); }

.noUi-marker-horizontal.noUi-marker-large {
    height: 7px;
}

/* Buttons */
.button__wrapper {
	margin-bottom: 24px;
}

/*button {
	background: none;
	border: 1px solid #000;
	border-radius: 3px;
	padding: 8px;
	padding-left: 16px;
	padding-right: 16px;
	text-align: center;
	text-transform: uppercase;
	font-family: var(--font-primary);
	font-weight: 700;
	letter-spacing: 0.5px;
	cursor: pointer;
}*/

/* Icons */
.fa-play,
.fa-pause,
.fa-redo {
	margin-right: 8px;
}

/* Helpers */
.is-left {
	margin-right: 8px;
}

.is-right {
	margin-left: 8px;
}

/* Labels */
.map__year {
	font-family: 'Libre Franklin', sans-serif;
	font-size: 24px;
	margin-bottom: 0;
}

.map__year .is-emphasis {
	font-weight: 700;
	color: #c62828;
}

.map__current {
	margin-left: 2px;
}



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

.map__toggles {
	overflow: hidden;
	display: -ms-flexbox;
	display: flex;
	max-width: 600px;
	margin: 1rem auto 1rem 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);
}

/* FORM CONTROLS */

.map__controls {
	position: relative;
	max-width: 800px;
	width: 100%;
	margin: 0px auto 1.5rem auto;
	grid-column: 1 / span 4;

/*	display: flex;
	text-align: center;
	align-items: center;
	justify-content: center;*/
}


.form__group {
	position: relative;
	width: 100%;
}

.form__group.group--byplace {
	display: flex;
	gap: 1rem;
}

.form__group.group--separator hr {
	border: none;
	width: 100%;
	display: block;
	background: var(--color-medgray);
	height: 1px;
	margin: 1rem auto;
}




.control__wrapper,
.input__wrapper,
.select__wrapper {
	position: relative;
}

.control__wrapper { width: 100%; }

.map__controls label {
	text-transform: uppercase;
	font-size: 0.75rem;
}


.map__controls button {
	-webkit-appearance: none;
	-moz-appearance: none;

	font-family: var(--font-primary);
	font-weight: 700;
	font-size: 0.875rem;

	color: white;
	text-transform: uppercase;
	cursor: pointer;
	padding: 0.875rem 1rem;

	border-radius: 0.25rem;
	border: none;
	background: var(--color-black-500);
}

.map__controls button:hover { background: var(--color-black); }


.map__controls input {
	border: none;
	border: 1px solid var(--color-black-500);
	border-radius: 0.25rem;
	padding: 1rem;
	font-family: var(--font-primary);
	font-size: 1rem;
}

.map__controls input[type='search'] {
	width: 100%;
	background: var(--color-grey-white);
	padding-left: 3rem;
	box-shadow: inset 0 1px 3px rgba(0,0,0,.3);
}

/* Remove Safari's default styling since we are adding our own. */
.map__controls input[type="search"]::-webkit-search-decoration,
.map__controls input[type="search"]::-webkit-search-cancel-button,
.map__controls input[type="search"]::-webkit-search-results-button,
.map__controls input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance:none;
}

.map__controls button[type='submit'] {
	position: absolute;
	top: 0px;
	right: 0px;
	border-top-left-radius: 0px;
	border-bottom-left-radius: 0px;
	font-size: 1rem;
	padding: 1rem;
	background-color: var(--color-black-500);
	color: var(--color-white);
	border: 1px solid var(--color-black-500);
}
.map__controls button[type='submit']:hover {
	background-color: var(--color-black);
	border: 1px solid var(--color-black);
}

.map__controls button[type='submit'] span {
	font-size: 0.875rem;
}

/* Button text is inside a span so we can set a smaller font-size on the text */
/* while keeping button's font size same as other inputs. This keeps height the same. */



/* Add downward pointing triangle */
.input__wrapper .fa-search {
	position: absolute;
	top: 1.25rem;
	left: 1.125rem;
	color: var(--color-reggray);
}




.map__controls select {
	-webkit-appearance: none;
	-moz-appearance: none;

	font-family: var(--font-primary);
	font-weight: 700;
	width: 100%;
	line-height: 1;
	font-size: 1rem;

	background: #FFF;
	background: linear-gradient(to bottom, #FFF 50%, var(--color-grey-150) 100%);

	/* Reserve space on right for the downward pointing triangle */
	padding: 1rem 1.75rem 1rem 0.75rem;
	border: 1px solid var(--color-black-500);
	border-radius: 0.25rem;
}

/* Add downward pointing triangle */
.select__wrapper::after {
	content: "▼";
	font-size: 0.75rem;
	top: calc(1.25rem - 1px);
	right: 0.75rem;
	position: absolute;
	color: var(--color-reggray);
}

/* Gray out the disabled selects */
select:disabled,
.select__wrapper.disabled::after {
	opacity: 0.333;
}






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

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


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

.legend__row {
	display: grid;
}

/* Position the breakpoints and hashes at the borders between the legend rectangles */
.legend__row.legend__breakpoints {
	position: relative;
}

/* 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 */
.view-0 .legend__row { grid-template-columns: repeat(var(--num-legend-items-0), 1fr); }
.view-1 .legend__row { grid-template-columns: repeat(var(--num-legend-items-1), 1fr); }


.view-0 .legend__row.legend__breakpoints {
	left: calc(100% / (var(--num-legend-items-0)*2));
}

.view-1 .legend__row.legend__breakpoints {
	left: calc(100% / (var(--num-legend-items-1)*2));
}

.legend__tick {
	height: 6px;
}

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


.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: 14px;
	height: 14px;
	vertical-align: middle;
}


.legend__square {
	background: #aaa;
	height: 14px;
	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;
}


/* Yellow to brown sequential */
.view-0 .square-0 { background: var(--legend-color-0); } /* yellow */
.view-0 .square-1 { background: var(--legend-color-1); } /*  */
.view-0 .square-2 { background: var(--legend-color-2); } /*  */
.view-0 .square-3 { background: var(--legend-color-3); } /*  */
.view-0 .square-4 { background: var(--legend-color-4); } /* brown */


.legend__value {
	margin: 0;
	font-size: 14px;
}


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

/*-------------
MAP TEXT LABELS / ICONS
--------------- */

/* This is the container for text-label and also for label-icon */
.map-label {
	line-height: 1;
	text-align: center;
	font-family: var(--font-primary);
	font-size: 1rem;
	font-weight: 900;
	color: var(--color-reggray);
	/* `paint-order` forces the browser to draw the stroke first and the fill later, */
	/* so the stroke won't appear in the interior of the letters. */
	/* Unfortunately, it only works in Safari and Firefox as of 2021-07. */
	/* paint-order: stroke fill; */
	text-shadow:
	-2px -2px 0 var(--color-map-base),
	 0   -2px 0 var(--color-map-base),
	 2px -2px 0 var(--color-map-base),
	 2px  0   0 var(--color-map-base),
	 2px  2px 0 var(--color-map-base),
	 0    2px 0 var(--color-map-base),
	-2px  2px 0 var(--color-map-base),
	-2px  0   0 var(--color-map-base);
}

/* TEXT STYLES AND COLORS */
.text-label.state {
	text-transform: uppercase;
	letter-spacing: 0.25rem;
}

.map-label .red { color: var(--color-primary); }
.map-label .black { color: #000; }
.map-label .gray { color: #555; }
.map-label .blue { color: #2c7fb8; }
.map-label .white { color: #fefefe; }

/* Don't show until final scene */
.map-label .text-neighbors { display: none; }


/* POSITIONING */
.text-label { position: relative; }
.text-label.pad-bot { top: -20px; }
.text-label.pad-top { top: 20px; }


/*-------------
POPUP INFO BOXES
--------------- */

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

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

.popup.is-hidden {
	border: none;
	display: none;
	padding: 0px;
}

.popup p {
	line-height: 1;
	margin: 0.875rem 0;
}

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

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

.popup p.popup__election {
	margin: 0.25rem 0;
}

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

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

.popup ul {
	width: 100%;
	margin: 0;
	-webkit-padding-start: 0;
}

.popup ul li {
	font-size: 0.8125rem;
	margin: 0 0 0.5rem 1rem;
	padding: 0;
	text-indent: 0;
	-webkit-padding-start: 0;
	line-height: 1;
}

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


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



/* RESPONSIVE */

@media (max-width: 700px) {
}


@media (min-width: 1400px) {
}

@media (max-width: 800px) {
	#interactive-map {
		height: 450px;
	}

	.info {
		font-size: 0.875rem;
		width: 200px;
	}

	.popup {
		padding: 0.75rem;
	}

	.popup p {
		margin: 0.75rem 0;
	}

	.map__legend {
		max-width: 100%;
	}
}

@media (max-width: 640px) {
	h4 {
		margin: 0px 0px 4px 0px;
		padding: 0px;
	}

}

@media (max-width: 360px) {
}

