/* Deliberately minimal — inherits type and colour from the theme. */

.trails-map-wrap {
	margin: 1.5rem 0;
}

.trails-map {
	width: 100%;
	min-height: 240px;
	background: #eceff1;
	border-radius: 4px;
}

.trails-map__loading,
.trails-map__error {
	padding: 1rem;
	margin: 0;
	font-style: italic;
	color: #546e7a;
}

.trails-map__empty {
	margin: 0.75rem 0 0;
	padding: 0.6rem 1rem;
	background: #ffffff;
	border: 1px solid #cfd8dc;
	border-radius: 4px;
	color: #546e7a;
	font-style: italic;
}

/*
 * The filter panel doubles as the map legend, so it has to stay readable
 * whatever the theme puts behind it — a coloured section band, a photo, a
 * dark footer. Background and text colour are both set explicitly rather
 * than inherited, since inheriting is what made it hard to read.
 */
.trails-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1rem;
	margin: 0.75rem 0 0;
	padding: 0.75rem 1rem;
	background: #ffffff;
	border: 1px solid #cfd8dc;
	border-radius: 4px;
	color: #1a1c15;
}

/*
 * The legend sits in a gap in the fieldset border, so it needs its own
 * opaque background or the border rule shows through the text.
 */
.trails-filters legend {
	padding: 0 0.35rem;
	background: #ffffff;
	color: inherit;
	font-weight: 600;
}

.trails-filters__option {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	cursor: pointer;
	white-space: nowrap;
}

.trails-filters__swatch {
	display: inline-block;
	width: 0.85rem;
	height: 0.85rem;
	border-radius: 2px;
}

/* The status swatches double as the map legend: each is drawn in the line
   style that status uses on the map. */
.trails-filters__line {
	display: inline-block;
	width: 1.75rem;
	border-top-width: 3px;
	border-top-style: solid;
}

/* [trail_facts] — the stats panel on a single trail page. Colours come from
   currentColor and the theme where possible, so it inherits rather than
   fighting whatever theme is active. */

.trails-facts {
	margin: 1.5rem 0;
}

.trails-facts__status {
	margin: 0 0 1rem;
	padding: 0.6rem 0.9rem;
	border-radius: 4px;
	border-left: 4px solid currentColor;
	background: #eceff1;
}

.trails-facts__status strong {
	display: block;
}

.trails-facts__status--open {
	background: #e8f0e0;
	color: #2c4a10;
}

.trails-facts__status--caution {
	background: #fff8e1;
	color: #7a4a14;
}

.trails-facts__status--closed {
	background: #f6dedb;
	color: #8c2c1e;
}

.trails-facts__status--in-progress {
	background: #ffebd6;
	color: #a34d00;
}

.trails-facts__status--proposed {
	background: #e6eaef;
	color: #3e4a55;
}

.trails-facts__list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 0.75rem 1.5rem;
	margin: 0;
}

.trails-facts__item dt {
	font-size: 0.78rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.7;
}

.trails-facts__item dd {
	margin: 0.1rem 0 0;
	font-weight: 600;
}

.trails-facts__download {
	margin: 1rem 0 0;
}

.trails-popup__title {
	margin: 0 0 0.25rem;
	font-size: 1.05rem;
}

.trails-popup__stats {
	margin: 0.25rem 0;
	color: #546e7a;
	font-size: 0.9em;
}

.trails-popup__excerpt {
	margin: 0.5rem 0;
}

.trails-popup__status {
	margin: 0.25rem 0;
	padding: 0.35rem 0.5rem;
	border-radius: 3px;
	font-size: 0.9em;
}

.trails-popup__status--closed {
	background: #ffebee;
	color: #b71c1c;
}

.trails-popup__status--caution {
	background: #fff8e1;
	color: #e65100;
}

.trails-popup__status--in-progress {
	background: #fff3e0;
	color: #bf5000;
}

.trails-popup__status--proposed {
	background: #eceff1;
	color: #37474f;
}

.trails-popup__links {
	margin: 0.5rem 0 0;
	font-size: 0.9em;
}

.trails-popup__links a + a {
	margin-left: 0.75rem;
}

@media (prefers-color-scheme: dark) {
	.trails-map {
		background: #263238;
	}

	.trails-filters,
	.trails-filters legend,
	.trails-map__empty {
		background: #263238;
		border-color: #455a64;
		color: #eceff1;
	}

	.trails-map__empty {
		color: #b0bec5;
	}
}
