
/****************************************
 * INFOBOX
 ****************************************/

/* Generic element for Google Maps OR Mapbox */
.map-infobox {
	color: #2a2a2a;
}

#portal-column-content .hike-title {
	/* override theme styles */
	text-transform: none;
	color: inherit;
	font-family: inherit;
	font-size: 1rem;
	letter-spacing: 0;
	line-height: 1.25;
}

#portal-column-content .hike-title a {
	color: #00557B;
	text-decoration: underline;
}

	#portal-column-content .hike-title a:hover,
	#portal-column-content .hike-title a:focus {
		text-decoration: none;
		color: #00557B;
	}

.map-infobox .hike-meta {
	margin-top: .5rem;
	padding-top: .5rem;
	border-top: 1px dashed #ccc;
}

/****************************************
 * HIKE COMPACT LISTING
 *
 * Now in both Map and My Backpack Recommendations
 * !important needed for #mbp-content selector
 ****************************************/
.map-hike-gallery-item-link {
	display: block;
	color: inherit !important;
}
	.map-hike-gallery-item-link:hover,
	.map-hike-gallery-item-link:focus {
		color: inherit;
	}

.map-hike-gallery-item-title {
	margin-bottom: .35rem;
	font-family: "Trebuchet MS", "Helvetica", sans-serif;
	font-size: 15px;
	font-weight: normal;
	text-decoration: underline;
	color: #006191 !important;
}

.map-hike-gallery-item-link:hover .map-hike-gallery-item-title,
.map-hike-gallery-item-link:focus .map-hike-gallery-item-title {
	text-decoration: none;
}

.map-hike-gallery-item .hike-meta {
	display: flex;
	justify-content: flex-start;
	flex-wrap: wrap;
	line-height: 1.5;
}
	.map-hike-gallery-item .hike-meta > span {
		margin-right: 1em;
	}
	.map-hike-gallery-item .hike-meta > span:last-child {
		margin-right: 0;
	}

/* Image Placeholder and Aspect Ratio Enforcement */
.map-hike-details-image-wrapper,
.map-hike-gallery-item-image-wrapper {
	position: relative;
	width: 100%;
	margin-bottom: 1rem;
	overflow: hidden;
	background: #ddd url("/++theme++plonetheme.wta/images/svg/placeholder-photo.svg") center / 50% no-repeat;
}
	.map-hike-gallery-item-image-wrapper {
		margin-bottom: .35rem;
	}
	/* Set ratio of images */
	.map-hike-details-image-wrapper::before,
	.map-hike-gallery-item-image-wrapper::before {
		display: block;
		content: '';
		width: 100%;
		padding-top: 66%;
	}
	.map-hike-details-image-wrapper img,
	.map-hike-gallery-item-image-wrapper img {
		position: absolute;
		max-width: 100%;
		height: auto;
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
	}

	/* safety check since we sometimes have empty src's */
	.map-hike-details-image-wrapper img[src=""],
	.map-hike-gallery-item-image-wrapper img[src=""] {
		display: none;
	}

	@supports (object-fit: cover) {

		.map-hike-details-image-wrapper img,
		.map-hike-gallery-item-image-wrapper img {
			/* reset position */
			width: 100%;
			height: 100% !important; /* punch wta.css in the face */
			top: 0;
			left: 0;
			transform: none;
			/* fill the full window with a center crop. may result in image stretching */
			object-fit: cover;
		}

	}

/****************************************
 * HIKE META & ICONS
 ****************************************/
.hike-meta,
.hike-details-region {
	font-size: .8666rem;
	color: inherit;
}

	.hike-meta span {
		display: flex;
		align-items: center;
	}

	.hike-meta .no-value {
		display: none !important;
	}

	.hike-meta span span {
		display: inline;
		margin-right: 0;
	}

	.hike-meta > span::before {
		display: inline-block;
		content: '';
		width: .8666rem;
		height: .8666rem;
		margin-right: .5em;
		background-size: 100% auto;
		background-size: contain;
		background-repeat: no-repeat;
		background-position: center;
	}

	.hike-meta .hike-completed::before {
		background-image: url("/++theme++plonetheme.wta/images/svg/check-mark-circle-green.svg");
	}

	.hike-meta .hike-date::before {
		background-image: url("/++theme++plonetheme.wta/images/svg/calendar-gray.svg");
	}

	.hike-meta .hike-mileage::before {
		background-image: url("/++theme++plonetheme.wta/images/svg/trail-icons/distance.svg");
	}

	.hike-meta .hike-gain::before {
		background-image: url("/++theme++plonetheme.wta/images/svg/trail-icons/elevationgain.svg");
	}

	.hike-meta .hike-gain + .hike-peak::before {
		content: '|';
		font-weight: normal;
		margin-right: 0;
	}

	.hike-meta .hike-rating::before {
		background-image: url("/++theme++plonetheme.wta/images/svg/trail-icons/rating.svg");
	}

.hike-image {
	margin-top: .5rem;
	text-align: center;
}

/* Hike Details Icons */
.map-hike-details-icons {
	margin-top: 1rem;
}

.map-hike-details-icon {
	position: relative;
	display: inline-block;
	cursor: help;
	margin-left: 0;
	margin-right: .5em;
}

.map-hike-details-icon:last-child {
	margin-right: 0;
}

.map-hike-details-icon-label {
	/* Accessibly Hidden */
	position: absolute;
	width: 1px;
	height: 1px;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	margin: -1px;
	padding: 0;
	overflow: hidden;
}

/* prevent "tooltip" from going off screen */
.map-hike-details-icon:first-of-type .map-hike-details-icon-label {
	max-width: 70px !important;
}

.map-hike-details-icon:focus {
	outline: 0;
}
.map-hike-details-icon:focus img {
	transform: scale(1.125);
}

.map-hike-details-icon:hover .map-hike-details-icon-label,
.map-hike-details-icon:focus .map-hike-details-icon-label {
	/* undo hiding */
	display: block;
	width: auto;
	height: auto;
	clip: auto;
	clip-path: none;
	margin: 0;
	padding: .5em;
	overflow: visible;
	z-index: 1;

	top: 100%;
	left: 50%;
	margin-top: -1px;
	transform: translateX(-50%);
	min-width: min-content;
	width: 70px;
	background-color: #006191;
	font-size: 13px;
	font-weight: 40;
	line-height: 1.25;
	color: #fff;
	text-align: center;
	border-radius: 3px;
}
	.map-hike-details-icon:hover .map-hike-details-icon-label::before,
	.map-hike-details-icon:focus .map-hike-details-icon-label::before,
	.map-hike-details-icon:hover .map-hike-details-icon-label::after,
	.map-hike-details-icon:focus .map-hike-details-icon-label::after {
		display: block;
		content: '';
		width: 0;
		height: 0;
		position: absolute;
		top: -12px;
		left: 50%;
		margin-left: -6px;
		border: 6px solid transparent;
		border-bottom-color: #006191;
	}
	.map-hike-details-icon:hover .map-hike-details-icon-label::before,
	.map-hike-details-icon:focus .map-hike-details-icon-label::before {
		/* "outline" around triangle */
		border: 7px solid transparent;
		border-bottom-color: #f8f8f8;
		top: -14px;
		margin-left: -7px;
	}



/* Add to Backpack Controls */
/* BACKPACK CONTROLS */
.map-hike-details .map-hike-backpack-control,
.mbp-recommend .hike-backpack-control {
	display: none;

	position: absolute;
	top: -5px;
	right: 35px;
	width: 30px;
	height: 35px;
	padding: 0;
	background-color: #E9A82B;
	background-size: 18px auto;
	background-position: bottom center;
	background-repeat: no-repeat;
	border-radius: 0;
	z-index: 1;

	cursor: pointer;
	transition: top .1s linear;
}
	.map-hike-details .map-hike-backpack-control::after,
	.mbp-recommend .hike-backpack-control::after {
		position: absolute;
		display: block;
		content: '';
		width: 0;
		height: 0;
		top: 100%;
		border: 15px solid transparent;
		border-top-color: #E9A82B;
	}

	.map-hike-details .map-hike-backpack-control:hover,
	.map-hike-details .map-hike-backpack-control:focus,
	.mbp-recommend .hike-backpack-control:hover,
	.mbp-recommend .hike-backpack-control:focus {
		top: 0;
		outline: 0;
	}

body.userrole-authenticated .map-hike-details .map-hike-backpack-add,
body.userrole-anonymous .map-hike-details .map-hike-backpack-add,
body.userrole-authenticated .mbp-recommend .hike-backpack-add {
	display: block;
}

body.userrole-authenticated .map-hike-details.is-in-backpack .map-hike-backpack-add,
body.userrole-authenticated .mbp-recommend .is-in-backpack .hike-backpack-add {
	display: none;
}

body.userrole-authenticated .map-hike-details.is-in-backpack .map-hike-backpack-remove,
body.userrole-authenticated .mbp-recommend .is-in-backpack .hike-backpack-remove {
	display: block;
}

.map-hike-details .map-hike-backpack-add,
.mbp-recommend .hike-backpack-add {
	background-image: url("/++theme++plonetheme.wta/images/svg/plus-black.svg");
}

.map-hike-details .map-hike-backpack-remove,
.mbp-recommend .hike-backpack-remove {
	background-image: url("/++theme++plonetheme.wta/images/svg/check-mark-black.svg");
}
	.map-hike-details .map-hike-backpack-remove:hover,
	.map-hike-details .hike-backpack-remove:focus {
		background-image: url("/++theme++plonetheme.wta/images/svg/minus-black.svg");
	}


/******************************
 * MAPBOX SPECIFIC
 ******************************/
.mapboxgl-popup-content {
	padding: 10px;
	width: 11rem;
	border: 0.5px solid rgba(151, 151, 151, .75);
	box-shadow: 0 2px 4px 0 rgba(141,141,141,0.5);
}

/* our design doesn't include the close button or pointer on the infobox */
.mapboxgl-popup-close-button {
	display: none;
}

.mapboxgl-popup-tip {
	/* take up same amount of space, but be transparent */
	border-color: transparent !important;
}

.mapboxgl-control-container fieldset {
	position: relative;
	padding: 0;
	margin: 0;
	border: 0;
	line-height: inherit;
}

#map-layer-options input[type="checkbox"] + label::before {
	height: 1rem;
	width: 1rem;
}

.mapboxgl-ctrl-top-left .map-filter input[type="checkbox"] + label:last-of-type {
	margin-bottom: 0;
}

/****************************************
 * MAPBOX Expandable controls
 ****************************************/

 /* We'll write it when we need it. */

/****************************************
 * MAPBOX STYLE OVERRIDES
 ****************************************/
.mapboxgl-map {
	font-family: inherit !important;
}

.mapboxgl-map .mapboxgl-ctrl-top-left {
	left: 20px;
	top: 20px;
	font-size: 15px;
}

.mapboxgl-map .mapboxgl-ctrl-top-left .mapboxgl-ctrl {
	padding: 1em;
}
