/*
 * Layout: a scrollable list on the left, the map on the right.
 * Stack on mobile/small tablet.
 */

.glm-map-block {
	margin: 0 0 2rem;
	--glm-map-height: 640px;
}

.glm-map-layout {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
}

/* ----- Location List ----- */

.glm-map-list-panel {
	flex: 0 0 320px;
	max-height: var( --glm-map-height );
	overflow-y: auto;
	background: #ffffff;
	border: 2px solid #F2F2F2;
	border-radius: 0.5rem;
	padding: 0.5rem 1rem;
}

.glm-map-list-panel-heading {
	font-size: 1.6rem; 
}

.glm-map-search {
	position: sticky;
	top: 0;
	background: #ffffff;
	padding-top: 0.25rem;
	margin-bottom: 0.5rem;
}

.glm-map-search-input {
	width: 100%;
	box-sizing: border-box;
	padding: 0.5rem 0.75rem;
	border: 2px solid #F8F9FA;
	border-radius: 0.5rem;
	font: inherit;
}

.glm-map-list-heading {
	margin: 1rem -1rem 0.5rem;
	padding: 0.5rem 1rem;
	background: #f2f2f2;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #333333;
}

.glm-map-list-heading:first-child {
	margin-top: 0;
}

.glm-map-list {
	list-style: none;
	margin: 0 0 0.5rem;
	padding: 0;
}

.glm-map-list-item {
	display: block;
	width: 100%;
	text-align: left;
	background: #ffffff;
	border: 2px solid #F8F9FA;
	border-radius: 0.5rem;
	padding: 0.75rem 1rem;
	margin-bottom: 0.5rem;
	cursor: pointer;
	font: inherit;
	color: #1a1a1a;
	transition: 0.3s all;
}

.glm-map-list-item:hover,
.glm-map-list-item:focus {
	border: 2px solid #cccccc;
}

.glm-map-list-title {
	display: block;
	font-weight: 600;
}

.glm-map-list-address,
.glm-map-list-category,
.glm-map-list-phone {
	display: block;
	font-size: 0.875rem;
	color: #4d4d4d;
}

.glm-map-list-category {
	margin-top: 0.25rem;
	font-style: italic;
}

/* ----- MAP ----- */

.glm-map-panel {
	flex: 1 1 480px;
	min-width: 0;
}

.glm-map {
	width: 100%;
	height: var( --glm-map-height );
	border: 2px solid #F2F2F2;
	border-radius: 0.5rem;
}

/* ----- Coloured map markers ----- */

.glm-map-marker svg {
	display: block;
	filter: drop-shadow( 0 1px 2px rgba( 0, 0, 0, 0.4 ) );
}

.glm-map-marker:focus-visible {
	outline: 3px solid #1a1a1a;
	outline-offset: 2px;
}

/* ----- Marker popup content ----- */

.glm-map-popup h3 {
	margin: 0 0 0.5rem;
	font-size: 1rem;
	font-weight: 700;
}

.glm-map-popup p {
	margin: 0 0 0.25rem;
	font-size: 0.875rem;
}

.glm-map-popup-category {
	font-style: italic;
	color: #4d4d4d;
}

.glm-map-popup img {
	max-width: 100%;
	height: auto;
	margin-bottom: 0.5rem;
}

.glm-map-popup p {
	display: flex;
	align-items: start;
	gap: 8px;
}

.glm-map-popup-icon {
	display: block;
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.glm-map-popup-separator {
	border: 0;
	border-top: 1px solid #ddd;
	margin: 8px 0;
}

/* ----- Screen Reader Accessibility ----- */

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
}

/* ----- Responsive ----- */

@media ( max-width: 640px ) {
	.glm-map-layout {
		flex-direction: column;
	}

	.glm-map-list-panel {
		flex-basis: auto;
		width: 100%;
		max-height: 260px;
	}

	.glm-map-panel {
		width: 100%;
	}
}
