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

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

	/* 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);
	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: 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 {
	position: absolute;
	top: 1rem;
	left: 1rem;
	font-family: var(--font-primary);
	font-size: 24px;
	margin-bottom: 0;
	color: rgba(150,150,150,250);
	z-index: 1000;
}

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

.map__current {
	margin-left: 2px;
}




/*-------------
LEGEND 0 (controls)
--------------- */

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

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

.legend-0 .legend__group:nth-of-type(1) {
	grid-column: 1 / span 1;
	border-right: 1px solid black;
	padding-right: 2rem;
	margin-right: 2rem;
}

.legend-0 .legend__group:nth-of-type(2) {
	grid-column: 2 / span 1;
}

.input__row {
	font-size: 0.875rem;
	display: flex;
	justify-content: center;
	gap: 1rem;
}
.input__row label {
	font-weight: bold;
	text-transform: uppercase;
}
/* Hide all the inputs */
.input--years, .input--radius, .input--coverage, .input--upperPercentile { display: none; }


/*-------------
LEGEND 1 (color scale above map)
--------------- */

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


.map__legend.legend-1 {
	width: 80%;
	max-width: 640px;
	margin: 0 auto 0.5rem auto;
	display: grid;
}

.legend-1 .legend__row {
	display: grid;
}

/* Position the breakpoints and hashes at the borders between the legend rectangles */
.legend-1 .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 */
.legend-0 .legend__row { grid-template-columns: repeat(var(--num-legend-items-0), 1fr); }
.legend-1 .legend__row { grid-template-columns: repeat(var(--num-legend-items-1), 1fr); }


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

.legend-1 .legend__row.legend__labels .legend__group:first-child {
	grid-column: 1 / span 3;
	text-align: left;
}
.legend-1 .legend__row.legend__labels .legend__group:last-child {
	grid-column: 4 / span 3;
	text-align: right;
}

.legend__row.legend__ticks,
.legend__tick {
	height: 4px;
}

.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-0);
}
.view-1 .party__label {
	grid-column: span var(--num-legend-items-1);
}

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

.legend-1 .legend__group-span {
	line-height: 1;
	grid-column: span var(--num-legend-items-1);
}

.legend__group {
	text-align: center;
	line-height: 1;
}

.legend__square, .legend__value, .legend__band {
	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 #fff;
}

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

.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: 15px;
	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; }

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




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

@media (max-width: 640px) {
	#interactive-map {
		height: 275px;
	}
	h4 {
		margin: 0px 0px 4px 0px;
		padding: 0px;
	}
}

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

