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

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

.popup__text a {
	color: var(--color-primary);
	font-weight: bold;
	font-size: 0.75rem;
	text-transform: uppercase;
}
.popup__text a:hover {
	text-decoration: underline;
}


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

.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__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 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__controls,
.map__toggles {
	display: flex;
	text-align: center;
	align-items: center;
	justify-content: center;
}

.select__wrapper {
	position: relative;
	margin: 0rem 0rem 1rem 0rem;
}


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

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

.map__controls button:hover { background: #711; }


.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-lightgray) 100%);

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

/* Add downward pointing triangle */
.select__wrapper::after {
	content: "▼";
	font-size: 0.75rem;
	top: calc(0.75rem - 1px);
	right: 0.75rem;
	position: absolute;
	color: var(--color-reggray);
	/* Without this, the triangle intercepts clicks meant for the select itself. */
	pointer-events: none;
}

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

.map__legend {
	display: flex;
	justify-content: center;
	margin-bottom: 1rem;
}
.map__legend .control__row {
	display: inline;
}

.map__legend ul {
	margin: 0px;
	padding: 0;
	list-style: none;
	display: flex;
	gap: 0.875rem;
}

.map__legend ul li {
	display: flex;
	gap: 0.25rem;
	font-size: 0.875rem;
	line-height: 0.875rem;
	height: 0.875rem;
}


.map__legend .legend-square,
.map__legend ul li span {
	display: inline-block;
	width: 1.75rem;
	height: 0.875rem;
	/* border-radius: 0.875rem; */
	overflow: visible;
}

.map__legend .legend-square g,
.map__legend .legend-square rect,
.map__legend .legend-square path {
	width: 1.5rem;
	height: 0.75rem;
}

.map__legend .legend-square path {
	fill: rgb(0,0,0);
/*	transform: translate(50%,50%);
*/}

.map__legend .legend-square.property-review rect { fill: #D72638; stroke: #D72638; stroke-width: 2; }
.map__legend .legend-square.property-waitlist rect { fill: #C05060; stroke: #C05060; stroke-width: 2; }
.map__legend .legend-square.property-initial rect { fill: #909090; stroke: #909090; stroke-width: 2; }


.map__legend .legend-square.stream-perennial path {
	stroke: #2c7fb8;
	stroke-width: 2;
	stroke-linejoin: round;
	stroke-linecap: round;
/*	stroke-dasharray: 1,3;
*/}

.map__legend .legend-square.stream-intermittent path {
	stroke: #2c7fb8;
	stroke-width: 2;
	stroke-linejoin: round;
	stroke-linecap: round;
	stroke-dasharray: 5 4;
}


/* This is for enclosing multiple legends that will stack on top of each other */
.legend__wrapper {
	width: 100%;
	display: flex;
	/* Force legends to stack */
	flex-direction: column;
	justify-content: center;
}

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


/* Color scale. */
.color-0 { border: 2px solid #000; background-color: transparent; }
.color-1 { border: 2px solid #C44; background-color: rgba(204,68,68,0.25); }
.color-2 { border: 2px solid #44C; background-color: rgba(68,68,204,0.25); }
/*
.color-3 { background-color: #f90; }
.color-4 { background-color: #c00; }
.color-5 { background-color: #60c; }
*/


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




/*-------------
LAYOUT OF MAP AND INFO
--------------- */

.map__wrapper {
	display: grid;

	grid-template-columns: repeat(4, 1fr);
	column-gap: 1rem;
}

#interactive-map {
	/*grid-column: 1 / span 3;*/
	grid-column: 1 / span 4;
}


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

.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);
}
.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);
	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:last-child {
	margin-bottom: 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__election {
	margin: 0.25rem 0;
}

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

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



/* INTERACTIVE-TABLE */

#interactive-table table {
	margin: 15px 0px 15px 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(4),
#interactive-table table tr td:nth-child(5),
#interactive-table table tr td:nth-child(6),
#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 td:nth-child(4),
#interactive-table table tr td:nth-child(5),
#interactive-table table tr td:nth-child(6),
#interactive-table table tr td:nth-child(7),
#interactive-table table tr th:nth-child(4),
#interactive-table table tr th:nth-child(5),
#interactive-table table tr th:nth-child(6),
#interactive-table table tr th:nth-child(7) {
	text-align: right;
}

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



/* solid colors */
.solid-blue { fill: #2c7fb8; stroke: #2c7fb8; }
.solid-purple { fill: #aa53c9; stroke: #aa53c9; }
.solid-red { fill: #D72638; stroke: #D72638; }


/* INITIAL FEATURE STYLES */
.feature-zone {
	stroke-width: 2;
	stroke-linejoin: round;
	stroke-linecap: round;
	fill-opacity: 0.25;
}

.feature-site {
	opacity: 1;
	stroke-width: 2;
	stroke: #eee;
	stroke-linejoin: miter;
	stroke-linecap: butt;
	stroke-dasharray: 6,4;
	fill: transparent;
}

.feature-details { opacity: 0; }

/* STYLE PER SCENE */


.leaflet-container { background: white; }

.leaflet-interactive.no-pointer {
	cursor: default;
}

/* This is the container for text-label and also for label-icon */
.map-label {
	text-align: center;
	font-family: var(--font-primary);
	font-size: 1rem;
	line-height: 1;
	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: 12px; }

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



i.fa-check-circle,
i.fa-times-circle {
	margin-right: 6px;
}


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

/* Large devices */
@media (max-width: 1024px) {
	.map__legend ul {
		display: flex;
	}

	.map__wrapper {
		display: grid;
		grid-template-columns: 1fr;
		column-gap: 0;
	}

	#interactive-map {
		grid-column: 1 / 1;
		order: 2;
	}

}

/* Medium devices */
@media (max-width: 800px) {
	#interactive-map {
		height: 500px;
	}
}

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

	html {
		font-size: 87.5%;
	}

	#interactive-map {
		height: 450px;
	}

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


}

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

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

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