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

:root {

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

	--color-map-base: rgb(255,255,255); /* This is the base color of Stamen Toner map tiles. */

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

	/* YlOrRd 22 - specifically for road map */
	--color-YlOrRd-00: rgb(255,255,178);
	--color-YlOrRd-01: rgb(255,245,162);
	--color-YlOrRd-02: rgb(255,236,145);
	--color-YlOrRd-03: rgb(254,226,129);
	--color-YlOrRd-04: rgb(254,216,112);
	--color-YlOrRd-05: rgb(254,206,96);
	--color-YlOrRd-06: rgb(254,195,87);
	--color-YlOrRd-07: rgb(254,183,81);
	--color-YlOrRd-08: rgb(253,171,75);
	--color-YlOrRd-09: rgb(253,159,69);
	--color-YlOrRd-10: rgb(253,147,63);
	--color-YlOrRd-11: rgb(252,133,57);
	--color-YlOrRd-12: rgb(249,118,52);
	--color-YlOrRd-13: rgb(247,102,47);
	--color-YlOrRd-14: rgb(244,86,41);
	--color-YlOrRd-15: rgb(242,71,36);
	--color-YlOrRd-16: rgb(238,56,32);
	--color-YlOrRd-17: rgb(228,45,33);
	--color-YlOrRd-18: rgb(218,34,35);
	--color-YlOrRd-19: rgb(208,22,36);
	--color-YlOrRd-20: rgb(199,11,37);
	--color-YlOrRd-21: rgb(189,0,38);



	/* Fonts */
	--font-primary: 'Libre Franklin', 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);
	padding-bottom: 1rem;
}


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

#interactive-map {
	width: 100%;
	height: 600px;
}

.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 {
	margin: 0.25rem 0px;
	text-align: right;
}

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

.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: 0.875rem;
	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: 1rem;
}
button.disabled,
.button__wrapper.disabled {
	opacity: 0.1;
	pointer-events: none;
}


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

button.disabled,
.disabled button {
	cursor: default;
}

/* Button labels */
.label-pause { display: none; }
.label-play { display: inline; }

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

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

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

/* Labels */
.map__time {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	font-family: var(--font-tertiary);
	font-size: 1.5rem;
	margin-bottom: 0;
	color: rgba(0,0,0,255);
	z-index: 1000;
	text-shadow: -2px -2px 0 white, 2px -2px 0 white, -2px 2px 0 white, 2px 2px 0 white;
}

.map__place {
	position: absolute;
	top: 2.5rem;
	right: 0.5rem;
	font-family: var(--font-primary);
	font-size: 1rem;
	font-weight: 900;
	text-transform: uppercase;
	margin-bottom: 0;
	color: rgba(0,0,0,255);
	z-index: 1000;
	text-shadow: -2px -2px 0 white, 2px -2px 0 white, -2px 2px 0 white, 2px 2px 0 white;
}


.map__time .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: 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);
	border-radius: unset;
}

.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 0 (controls)
--------------- */

.map__legend.legend-0 {
	width: 100%;
	margin: 1rem auto 1rem auto;
	max-width: 90%;
}

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

.view-0 .legend-0 .legend__row { display: grid; }

#control-panel { display: grid; gap: 1rem; }


.input__row {
	font-size: 0.875rem;
	display: flex;
	justify-content: center;
	gap: 1rem;
}

.input--time { gap: 0.5rem; }

.input__row label {
	font-weight: bold;
	text-transform: uppercase;
}
/* Hide all the inputs */
.input--years, .input--radius, .input--coverage, .input--upperPercentile { display: none; }



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

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

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

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

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


.legend__row {
	display: grid;
	grid-template-columns: repeat(22, 1fr);
}

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


.legend__group {
	text-align: center;
	line-height: 1;
	display: grid;
	align-content: start;
	align-items: start;
}

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


/* 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(22, 1fr); }


/* 22-bucket YlOrRd */
.view-0 .square-0, .color-0 { background: var(--color-YlOrRd-00); }
.view-0 .square-1, .color-1 { background: var(--color-YlOrRd-01); }
.view-0 .square-2, .color-2 { background: var(--color-YlOrRd-02); }
.view-0 .square-3, .color-3 { background: var(--color-YlOrRd-03); }
.view-0 .square-4, .color-4 { background: var(--color-YlOrRd-04); }
.view-0 .square-5, .color-5 { background: var(--color-YlOrRd-05); }
.view-0 .square-6, .color-6 { background: var(--color-YlOrRd-06); }
.view-0 .square-7, .color-7 { background: var(--color-YlOrRd-07); }
.view-0 .square-8, .color-8 { background: var(--color-YlOrRd-08); }
.view-0 .square-9, .color-9 { background: var(--color-YlOrRd-09); }
.view-0 .square-10, .color-10 { background: var(--color-YlOrRd-10); }
.view-0 .square-11, .color-11 { background: var(--color-YlOrRd-11); }
.view-0 .square-12, .color-12 { background: var(--color-YlOrRd-12); }
.view-0 .square-13, .color-13 { background: var(--color-YlOrRd-13); }
.view-0 .square-14, .color-14 { background: var(--color-YlOrRd-14); }
.view-0 .square-15, .color-15 { background: var(--color-YlOrRd-15); }
.view-0 .square-16, .color-16 { background: var(--color-YlOrRd-16); }
.view-0 .square-17, .color-17 { background: var(--color-YlOrRd-17); }
.view-0 .square-18, .color-18 { background: var(--color-YlOrRd-18); }
.view-0 .square-19, .color-19 { background: var(--color-YlOrRd-19); }
.view-0 .square-20, .color-20 { background: var(--color-YlOrRd-20); }
.view-0 .square-21, .color-21 { background: var(--color-YlOrRd-21); }

.view-0 .square-0 { height: 1.0px; }
.view-0 .square-1 { height: 1.5px; }
.view-0 .square-2 { height: 2.0px; }
.view-0 .square-3 { height: 2.5px; }
.view-0 .square-4 { height: 3.0px; }
.view-0 .square-5 { height: 3.5px; }
.view-0 .square-6 { height: 4.0px; }
.view-0 .square-7 { height: 4.5px; }
.view-0 .square-8 { height: 5.0px; }
.view-0 .square-9 { height:  5.5px; }
.view-0 .square-10 { height: 6.0px; }
.view-0 .square-11 { height: 6.5px; }
.view-0 .square-12 { height: 7.0px; }
.view-0 .square-13 { height: 7.5px; }
.view-0 .square-14 { height: 8.0px; }
.view-0 .square-15 { height: 8.5px; }
.view-0 .square-16 { height: 9.0px; }
.view-0 .square-17 { height: 9.5px; }
.view-0 .square-18 { height: 10.0px; }
.view-0 .square-19 { height: 10.5px; }
.view-0 .square-20 { height: 11.0px; }
.view-0 .square-21 { height: 11.5px; }

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

/* ================================================== */
/* This is an approximation of the d3 interpolateCool */
/* color band. It's good enough and avoids having to  */
/* write js/d3 code to create the legend band.        */
/* ================================================== */
.legend__band {
	width:  100%;
	background: linear-gradient(
		to right,
		#6e40aa,
		#5e57cb,
		#4775de,
		#2f96e0,
		#1eb8d0,
		#1ad5b1,
		#28ea8d,
		#4af56c,
		#79f659,
		#aff05b
	);
}




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

/* DECK.GL TOOLTIPS */
#interactive-map .deck-tooltip {
	background-color: rgba(30,30,30,200) !important;
	color: rgba(240,240,240,255) !important;
	width: 230px;
	height: 112px;
}



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


/*-------------
INFO BOX UNDER MAP (not a popup)
--------------- */

.table__wrapper {
	font-family: var(--font-primary);
}

.table__wrapper .table {
	padding: 1rem;
	background: var(--color-lightgray);
}

/*.table__wrapper .table.columns {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
}
*/
.table__wrapper p {
	line-height: 1;
	margin: 0.875rem 0;
}

/*
.info__county,
.info__pct-wrapper {
	border-bottom: 1px solid black;
}
*/

.table__wrapper .info__name {
	font-size: 1rem;
	font-weight: 900;
	text-transform: uppercase;
	margin: 0px 0px 0.875rem 0px;
}

.table__wrapper .info__text {
	line-height: 1.2;
	margin: 0.875rem 0;
}

.table__wrapper .columns .info__text {
	display: inline-block;
	margin: 0px 1rem 0px 0px;
}

.table__wrapper p:last-child {
	margin-bottom: 0px;
}

.table__wrapper table {
	border-collapse: collapse;
	width: 100%;
}

/*
.table__wrapper table tr:nth-child(even) {
	background-color: var(--color-lightgray);
}
*/
/*
.table__wrapper table tr td {
	border-bottom: 1px solid black;
}
*/
.table__wrapper table tr:last-child td {
	border-bottom: none;
}


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

.table__wrapper table tr td.data span { font-weight: bold; }



/*-------------
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:
	-1px -1px 0 var(--color-map-base),
	 0   -1px 0 var(--color-map-base),
	 1px -1px 0 var(--color-map-base),
	 1px  0   0 var(--color-map-base),
	 1px  1px 0 var(--color-map-base),
	 0    1px 0 var(--color-map-base),
	-1px  1px 0 var(--color-map-base),
	-1px  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 .blue { color: #2c7fb8; }
.map-label .white { color: #fefefe; }

.map-label .larger {
	font-size: 1.5rem;
}

.map-label .fadeinout {
	animation: fadeinout 3s 1;
}

@keyframes fadeinout {
	0%, 100% {
		opacity: 0.2;
	}
	50% {
		opacity: 1;
	}
}

.map-label .fadein {
	animation: fadein 1.5s 1;
}

@keyframes fadein {
	0% {
		opacity: 0.2;
	}
	100% {
		opacity: 1;
	}
}

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


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

/* At low zooms, we need to push down every other label so they don't stack atop each other */
.interactive__wrapper.low-zoom .text-label.pad-top.pad-top-odd { top: 48px; }


.interactive__wrapper[data-scene="3"] .map-label .text-neighbors {
	display: block;
}

/* LEAFLET OVERRIDES */
.leaflet-container {
	background: white;
}

.leaflet-tile-pane {
	opacity: 0.25;
}

/* RANGE INPUT */

/* Baseline, reset styles */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  width: 20rem;
}

/* Removes default focus */
input[type="range"]:focus {
  outline: none;
}

/******** Chrome, Safari, Opera and Edge styles ********/
/* slider track */
input[type="range"]::-webkit-slider-runnable-track {
  background-color: var(--color-lightgray);
  border: 1px solid var(--color-gray);
  border-radius: 0.5rem;
  height: 0.5rem;
}

/* slider thumb */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; /* Override default look */
  appearance: none;
  margin-top: -12px; /* Centers thumb on the track */
  background-color: var(--color-gray);
  border-radius: 0.5rem;
  height: 2rem;
  width: 0.875rem;
}

input[type="range"]:focus::-webkit-slider-thumb {
  outline: 3px solid var(--color-gray);
  outline-offset: 0.125rem;
}

/*********** Firefox styles ***********/
/* slider track */
input[type="range"]::-moz-range-track {
  background-color: var(--color-lightgray);
  border-radius: 0.5rem;
  height: 0.5rem;
}

/* slider thumb */
input[type="range"]::-moz-range-thumb {
  background-color: var(--color-gray);
  border: none; /*Removes extra border that FF applies*/
  border-radius: 0.5rem;
  height: 2rem;
  width: 1rem;
}

input[type="range"]:focus::-moz-range-thumb{
  outline: 3px solid var(--color-gray);
  outline-offset: 0.125rem;
}



/* RESPONSIVE */

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


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

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

@media (max-width: 640px) {
	#interactive-map {
		height: 325px;
	}
	input[type="range"] {
		width: 16rem;
	}
	h4 {
		margin: 0px 0px 4px 0px;
		padding: 0px;
	}
}

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

