/* Theme map chrome (headers, schemes, multi-day map UI). Leaflet core: assets/leaflet/. */
/*
 * Faithful port of the pre-split hybrid leaflet.css theme sections (git 4.1.13 /
 * production restore). Stock Leaflet 1.9 ships default popup margins/fonts; these
 * overrides restore the classic map cards. Must load AFTER style.css so .entry p/h3
 * padding does not restyle popup copy.
 */

/* ---- Map card headers / multi-day banners ---- */

.map-header {
	width: 100%;
	display: inline-flex;
	height: 50px;
	justify-content: flex-end;
	justify-items: flex-end;
	align-items: center;
	flex-flow: row nowrap;
	vertical-align: top;
	background-color: #FFCFD7;
	margin-top: -4px;
	margin-bottom: 5px;
	z-index: 1;
	position: relative;
}

.map-header-days {
	width: 31px;
}

.map-header-elev,
.map-header-maxelev {
	width: 86px;
}

.map-header-dist {
	width: 87px;
}

.map-header-days,
.map-header-dist,
.map-header-elev,
.map-header-maxelev {
	text-align: center;
	height: 50px;
	padding-top: 8px;
}

.map-header-days-body,
.map-header-dist-body,
.map-header-elev-body,
.map-header-maxelev-body {
	font-size: 14px;
	line-height: 14px;
}

.map-header-days-body {
	line-height: 2;
}

.map-header-days-titles,
.map-header-dist-titles,
.map-header-elev-titles,
.map-header-maxelev-titles {
	font-size: 12px;
	line-height: 12px;
	font-weight: bold;
	height: 12px;
}

.map-mdname {
	margin: -5px 0 -15px 0;
	padding: 5px 8px 0 0;
	height: 20px;
	z-index: 1;
	position: relative;
	font-size: 11px;
	font-family: 'Fjalla One', sans-serif;
	text-align: right;
	font-style: italic;
}

.map-mdname:empty,
a.map-mdname:has(.map-mdname:empty) {
	display: none;
}

.map-mdname a,
.map-mdname p,
.map-mdname a:visited,
.map-mdname a:link,
.map-mdname a:hover,
.map-mdname a:active,
.a.map-mdname,
a.map-mdname:visited,
a.map-mdname:link,
a.map-mdname:hover,
a.map-mdname:active {
	text-decoration: none;
}

.map-body img {
	position: absolute;
	opacity: 0.15;
	right: 0;
	bottom: 0;
	height: calc(100% - 280px);
	width: auto !important;
	z-index: 0;
}

.map-body img[src=""] {
	display: none;
}

.map-mdname.ben-hike-map-mdname {
	overflow: hidden;
	margin: -5px 0 0 0;
	padding: 4px 8px 1px 0;
	height: 18px;
	min-height: 18px;
}

.map-mdname.ben-hike-map-mdname a,
.map-mdname.ben-hike-map-mdname span {
	display: block;
	position: relative;
	z-index: 1;
	padding-right: 0;
	font-family: 'Fjalla One', sans-serif;
	font-size: 11px;
	font-style: italic;
	text-align: right;
	text-decoration: none;
	color: inherit;
}

.map-mdname.ben-hike-map-mdname a:visited,
.map-mdname.ben-hike-map-mdname a:link,
.map-mdname.ben-hike-map-mdname a:hover,
.map-mdname.ben-hike-map-mdname a:active {
	color: inherit;
	font-family: 'Fjalla One', sans-serif;
	text-decoration: none;
}

.map-body.ben-hike-map-body {
	position: relative;
	overflow: hidden;
	padding-top: 4px;
}

.map-body.ben-hike-map-body .ben-hike-map-mdbg {
	position: absolute;
	opacity: 0.15;
	right: 0;
	bottom: 0;
	height: 100%;
	width: auto !important;
	z-index: 0;
	border-radius: 0;
	max-height: none;
	object-fit: contain;
}

.map-body.ben-hike-map-body h3,
.map-body.ben-hike-map-body p,
.map-body.ben-hike-map-body a {
	position: relative;
	z-index: 1;
}

.leaflet-right,
div[class^="leaflet-control-layers"],
a[class^="leaflet-control-layers"],
p[class^="leaflet-control-layers"],
section[class^="leaflet-control-layers"],
input[class^="leaflet-control-layers"] {
	width: 0 !important;
	height: 0 !important;
	z-index: -1000 !important;
	border: 0 !important;
	visibility: hidden;
}

.page .entry {
	min-height: 800px;
}

/* Soft map background while tiles load. */
.leaflet-container {
	background: #e5e1d8;
}

/*
 * Do NOT set .entry .leaflet-map { position:absolute } here.
 * Single-post mileage map sizing lives under .mileagewrapper in style.css.
 */

/* ---- Popup overrides (production hybrid leaflet.css) ---- */

.leaflet-popup-content-wrapper {
	padding: 1px;
	text-align: left;
	border-radius: 12px;
}

/* Kill stock Leaflet 1.9 inset margins (13/24/13/20). */
.leaflet-popup-content {
	margin: 0 !important;
	line-height: 1.4;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
	background: white;
	color: #333;
	box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
}

/* Close button sizing from Leaflet 1.5-era hybrid (production cards). */
.leaflet-container a.leaflet-popup-close-button {
	position: absolute;
	top: 0;
	right: 0;
	padding: 4px 4px 0 0;
	border: none;
	text-align: center;
	width: 18px;
	height: 14px;
	font: 16px/14px Tahoma, Verdana, sans-serif;
	color: #c3c3c3;
	text-decoration: none;
	font-weight: bold;
	background: transparent;
}

.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus {
	color: #999;
}

/* Hero images: fixed width, top radius, cover crop at max 200px. */
.leaflet-popup-content img {
	width: 301px;
	border-radius: 12px 12px 0 0;
	max-height: 200px;
	object-fit: cover;
}

/*
 * Title + body type. Entry article rules in style.css exclude
 * .leaflet-popup-content descendants (cascade Phase B); normal specificity is enough.
 * Keep !important only on popup content margin (must beat Leaflet core 13/24/13/20).
 */
.leaflet-popup-content h3,
.leaflet-popup-content p {
	padding: 0 1vw;
	z-index: 1;
	position: relative;
	max-width: none;
	font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
	box-sizing: border-box;
}

.leaflet-popup-content h3 {
	margin: 0;
	font-family: "Open Sans", sans-serif;
}

/* Production hybrid: body paragraph keeps a small bottom gap. */
.leaflet-popup-content p {
	margin: 0 0 10px 0;
}

.leaflet-popup-content p,
.leaflet-popup-content a {
	font-size: 14px;
	font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
}

/* Titles: bold black, no underline. Body "Read more" keeps Leaflet link blue. */
.leaflet-popup-content h3 a,
.leaflet-popup-content h3 a:link,
.leaflet-popup-content h3 a:visited,
.leaflet-popup-content h3 a:hover,
.leaflet-popup-content h3 a:active {
	font-weight: bold;
	color: #000000;
	text-decoration: none;
}

/* Watermark logos must not pick up the hero width/radius rules. */
.leaflet-popup-content .map-body img,
.leaflet-popup-content .map-body.ben-hike-map-body .ben-hike-map-mdbg {
	width: auto !important;
	max-height: none;
	border-radius: 0;
	object-fit: contain;
}
