/* GorillaGear Rentals: the Find a GorillaBox map. Uses the theme's colours where there are any. */

.ggr-boxmap, .ggr-minimap {
	--bm-ink: var(--gg-ink, #14141a);
	--bm-soft: var(--gg-soft, #5d5d6b);
	--bm-line: var(--gg-line, #e3e3ea);
	--bm-surface: var(--gg-surface, #fff);
	--bm-surface-2: var(--gg-surface-2, #f7f7fb);
	--bm-purple: var(--gg-purple, #4834e1);
	--bm-purple-pale: var(--gg-purple-pale, #f1effe);
	--bm-yellow: var(--gg-yellow, #FFD93D);
	color: var(--bm-ink);
}

.ggr-boxmap__find {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	margin: 0 0 1rem;
	padding: 0.9rem 1.1rem;
	border: 1px solid var(--bm-line);
	border-radius: 12px;
	background: var(--bm-surface);
}
.ggr-boxmap__find label { font-weight: 700; }
.ggr-boxmap__findrow { display: flex; gap: 0.5rem; }
.ggr-boxmap__find input { width: 11em; text-transform: uppercase; }
.ggr-boxmap__find input::placeholder { text-transform: none; }
.ggr-boxmap__msg { font-size: 0.92rem; font-weight: 600; }
.ggr-boxmap__msg.is-bad { color: var(--gg-bad, #b32d2e); }

.ggr-boxmap__btn {
	display: inline-block;
	padding: 0.55em 1.1em;
	border: 2px solid var(--bm-purple);
	border-radius: 7px;
	background: var(--bm-purple);
	color: #fff !important;
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}
.ggr-boxmap__btn:hover { filter: brightness(1.08); }
.ggr-boxmap__btn--big { padding: 0.8em 1.6em; font-size: 1.05rem; }

.ggr-boxmap__main {
	display: grid;
	grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
	gap: 1rem;
	align-items: stretch;
}
.ggr-boxmap__map {
	height: 560px;
	border: 1px solid var(--bm-line);
	border-radius: 12px;
	overflow: hidden;
	background: var(--bm-surface-2);
	z-index: 0;
}
.ggr-boxmap__list {
	list-style: none;
	margin: 0;
	padding: 0 0.35rem 0 0;
	height: 560px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	scrollbar-width: thin;
}
.ggr-boxmap__item {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	padding: 0.75rem 0.9rem;
	border: 1px solid var(--bm-line);
	border-radius: 10px;
	background: var(--bm-surface);
	cursor: pointer;
}
.ggr-boxmap__item:hover, .ggr-boxmap__item:focus-visible { border-color: var(--bm-purple); outline: none; }
.ggr-boxmap__item.is-on { border-color: var(--bm-purple); background: var(--bm-purple-pale); box-shadow: inset 0 0 0 1px var(--bm-purple); }
.ggr-boxmap__top { display: flex; justify-content: space-between; gap: 0.8rem; align-items: baseline; }
.ggr-boxmap__top strong { font-size: 1.02rem; }
.ggr-boxmap__miles { font-style: normal; font-size: 0.85rem; font-weight: 600; color: var(--bm-soft); white-space: nowrap; }
.ggr-boxmap__meta, .ggr-boxmap__addr { font-size: 0.9rem; color: var(--bm-soft); }
.ggr-boxmap__open {
	display: inline-block;
	margin-left: 0.4rem;
	padding: 0.05rem 0.5rem;
	border-radius: 99px;
	background: var(--gg-yellow-bg, #fffbe8);
	color: var(--gg-warn, #5c4400);
	font-size: 0.8rem;
	font-weight: 700;
	white-space: nowrap;
}
.ggr-boxmap__open.is-always { background: var(--gg-good-bg, #e3f5e8); color: var(--gg-good, #1c6b34); }
.ggr-boxmap__dir { align-self: flex-start; margin-top: 0.25rem; font-size: 0.9rem; font-weight: 600; color: var(--bm-purple); }
.ggr-boxmap__foot { margin: 1rem 0; color: var(--bm-soft); }

/* Pins: a purple drop with a G; yellow when chosen. */
.ggr-pin { background: none; border: 0; }
.ggr-pin span {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: 2px solid #fff;
	border-radius: 50% 50% 50% 0;
	background: #4834e1;
	color: #fff;
	font: 800 16px/1 "Jost", "Futura", sans-serif;
	transform: rotate(-45deg);
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}
.ggr-pin span b { transform: rotate(45deg); }
.ggr-pin.is-on span { background: #FFD93D; color: #111; border-color: #111; }

/* The map itself always uses light map tiles; soften them a little on the dark site. */
html[data-theme="dark"] .ggr-minimap .leaflet-tile-pane,
html[data-theme="dark"] .ggr-boxmap .leaflet-tile-pane { filter: invert(1) hue-rotate(200deg) brightness(0.95) contrast(0.9) saturate(0.6); }
html[data-theme="dark"] .ggr-minimap .leaflet-container,
html[data-theme="dark"] .ggr-boxmap .leaflet-container { background: #14131f; }
html[data-theme="dark"] .ggr-minimap img.leaflet-tile,
html[data-theme="dark"] .ggr-boxmap img.leaflet-tile { filter: none !important; }
.ggr-minimap .leaflet-popup-content,
.ggr-boxmap .leaflet-popup-content { margin: 10px 14px; font: 14px/1.4 inherit; color: #14141a; }
.ggr-minimap .leaflet-container a,
.ggr-boxmap .leaflet-container a { color: #4834e1; }

@media (max-width: 860px) {
	.ggr-boxmap__main { grid-template-columns: 1fr; }
	.ggr-boxmap__map { height: 380px; }
	.ggr-boxmap__list { height: auto; max-height: none; overflow: visible; padding-right: 0; }
}

/* Wider than the page text, centred on the screen. */
.ggr-boxmap {
	position: relative;
	left: 50%;
	width: min(1260px, calc(100vw - 2.5rem));
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	transform: translateX(-50%);
}

/* The page title and intro line up with the left edge of the map. */
main:has(.ggr-boxmap) > .gg-page-head,
main:has(.ggr-boxmap) > .entry-content {
	width: min(1260px, calc(100vw - 2.5rem));
	max-width: none !important;
	margin-left: auto !important;
	margin-right: auto !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}
main:has(.ggr-boxmap) > .gg-page-head > *,
main:has(.ggr-boxmap) > .wp-block-post-title,
main:has(.ggr-boxmap) .entry-content > p,
main:has(.ggr-boxmap) .entry-content > h2 {
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}
main:has(.ggr-boxmap) .wp-block-post-title { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 0.4em; }
main:has(.ggr-boxmap) .entry-content > p { max-width: 46rem !important; color: var(--gg-soft, #5d5d6b); }
main:has(.ggr-boxmap) .ggr-boxmap { left: 0; width: 100%; transform: none; }

/* The small map used inside other sections (for example "Using the box" on the home page). */
.ggr-minimap { margin: 1rem 0 0; }
.ggr-minimap .ggr-boxmap__map { height: 320px; }
.ggr-minimap__foot {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.3rem 1.5rem;
	margin: 0.6rem 0 0 !important;
	font-size: 0.9rem;
	color: var(--bm-soft);
}
.ggr-minimap__foot a { font-weight: 700; color: var(--bm-purple); white-space: nowrap; }
@media (max-width: 860px) { .ggr-minimap .ggr-boxmap__map { height: 260px; } }
