/**
 * Port Locator Map — front-end styles.
 * Mobile-first; collapses to a stacked layout on narrow screens.
 */

.plm-wrap {
	--plm-accent: #0b5fa5;
	--plm-border: #e2e2e2;
	--plm-bg: #fff;
	font-family: inherit;
}

.plm-controls {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin-bottom: 1rem;
}

.plm-controls .plm-search,
.plm-controls select {
	flex: 1 1 180px;
	padding: .55rem .7rem;
	border: 1px solid var(--plm-border);
	border-radius: 6px;
	font-size: 1rem;
	background: var(--plm-bg);
}

.plm-layout {
	display: flex;
	gap: 1rem;
	align-items: stretch;
}

.plm-sidebar {
	flex: 0 0 300px;
	max-height: 600px;
	overflow-y: auto;
	border: 1px solid var(--plm-border);
	border-radius: 8px;
	padding: .5rem;
	background: var(--plm-bg);
}

.plm-count {
	margin: .25rem .5rem .5rem;
	font-size: .85rem;
	color: #666;
}

.plm-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.plm-list-item {
	display: flex;
	flex-direction: column;
	padding: .6rem .7rem;
	border-radius: 6px;
	cursor: pointer;
	border-bottom: 1px solid var(--plm-border);
}

.plm-list-item:last-child {
	border-bottom: 0;
}

.plm-list-item:hover,
.plm-list-item:focus {
	background: #f3f8fc;
	outline: none;
}

.plm-list-title {
	font-weight: 600;
	color: var(--plm-accent);
}

.plm-list-loc {
	font-size: .82rem;
	color: #666;
}

.plm-map {
	flex: 1 1 auto;
	min-height: 320px;
	border-radius: 8px;
	overflow: hidden;
	z-index: 0; /* keep Leaflet panes below theme headers */
}

/* Popups */
.plm-popup strong {
	font-size: 1rem;
}

.plm-popup-loc {
	color: #666;
	margin-bottom: .35rem;
}

.plm-popup-actions {
	margin-top: .6rem;
	display: flex;
	gap: .4rem;
	flex-wrap: wrap;
}

.plm-btn {
	display: inline-block;
	padding: .4rem .7rem;
	border-radius: 5px;
	background: var(--plm-accent);
	color: #fff !important;
	font-size: .82rem;
	text-decoration: none;
	line-height: 1.2;
}

.plm-btn-alt {
	background: transparent;
	color: var(--plm-accent) !important;
	border: 1px solid var(--plm-accent);
}

/* Stack on small screens */
@media ( max-width: 782px ) {
	.plm-layout {
		flex-direction: column;
	}

	.plm-sidebar {
		flex: 1 1 auto;
		max-height: 260px;
		order: 2;
	}

	.plm-map {
		order: 1;
	}
}
