/* GPX Route Viewer — frontend styles (desktop-first, schaalt naar mobiel) */

:root {
	--brv-primary: #2D6A4F;
	--brv-accent: #E85D04;
	--brv-dark: #1A1A2E;
	--brv-surface: #F8F9FA;
	--brv-text: #212529;
	--brv-text-muted: #6C757D;
	--brv-radius: 16px;
	--brv-shadow: 0 12px 36px rgba(26, 26, 46, 0.12);
	--brv-max-width: 1240px;
	/* Body-text font for the viewer. Defaults to the Bushbikers site font
	   "Graphik" (loaded by the theme) with a clean system-sans fallback for
	   other sites. Override per site in Customizer → Extra CSS:
	   .brv-viewer { --brv-font: "JouwFont", sans-serif; }
	   Headings keep inheriting the theme's heading font. */
	--brv-font: "Graphik", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, "Helvetica Neue", Arial, sans-serif;
}

.brv-viewer {
	color: var(--brv-text);
	font-family: var(--brv-font);
	font-size: 17px;
	line-height: 1.65;
}

.brv-viewer [hidden] {
	display: none !important;
}

.brv-error {
	padding: 14px 18px;
	border-left: 4px solid var(--brv-accent);
	background: var(--brv-surface);
}

/* ------------------------------------------------------------------ *
 * Breakout: components escape the (smalle) theme content column so the
 * layout targets desktop widths; inner .brv-container re-centers.
 * ------------------------------------------------------------------ */

/* Block themes: the alignfull class on the same element lets core's
   constrained layout stretch the component edge-to-edge (incl. negative
   root-padding margins) on every viewport. Width must stay auto so the
   negative margins can widen the box. Classic themes have no such layout
   engine; there the component simply fills the content column. */
.brv-breakout {
	width: auto;
}

.brv-container {
	max-width: var(--brv-max-width);
	margin: 0 auto;
	padding: 0 32px;
}

.brv-component {
	margin-top: 32px;
	margin-bottom: 32px;
}

/* ------------------------------------------------------------------ *
 * Hero (full-bleed band)
 * ------------------------------------------------------------------ */

.brv-hero {
	padding: 72px 0 96px;
	background:
		radial-gradient(120% 160% at 0% 0%, rgba(45, 106, 79, 0.55) 0%, transparent 55%),
		radial-gradient(110% 140% at 100% 0%, rgba(232, 93, 4, 0.30) 0%, transparent 50%),
		var(--brv-dark);
	color: #fff;
}

.brv-hero-kicker {
	margin: 0 0 10px;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.65);
}

.brv-hero-title {
	margin: 0 0 22px;
	font-size: clamp(2rem, 4.5vw, 3.4rem);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.08;
	color: #fff;
}

.brv-hero-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.brv-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 16px;
	border-radius: 999px;
	font-size: 0.88rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.22);
	color: #fff;
	backdrop-filter: blur(4px);
}

.brv-badge.brv-badge-difficulty {
	background: var(--brv-accent);
	border-color: var(--brv-accent);
}

.brv-badge.brv-difficulty-beginner {
	background: #588157;
	border-color: #588157;
}

.brv-badge.brv-difficulty-intermediate {
	background: #0077B6;
	border-color: #0077B6;
}

.brv-badge.brv-difficulty-advanced {
	background: var(--brv-accent);
	border-color: var(--brv-accent);
}

.brv-badge.brv-difficulty-expert {
	background: #D62828;
	border-color: #D62828;
}

/* ------------------------------------------------------------------ *
 * Statistics cards (prominent)
 * ------------------------------------------------------------------ */

.brv-stats {
	margin: 36px 0;
}

/* In the full viewer the cards overlap the hero bottom edge. */
.brv-full .brv-stats {
	margin: -56px 0 40px;
	position: relative;
	z-index: 5;
}

.brv-stats-grid {
	display: grid;
	/* Adapts to the number of cards (up to 6); card width via --brv-stat-min
	   (admin slider). See responsive overrides below. */
	grid-template-columns: repeat(auto-fit, minmax(var(--brv-stat-min, 150px), 1fr));
	gap: 18px;
}

.brv-stat-custom .brv-stat-icon {
	background: rgba(26, 26, 46, 0.06);
	color: var(--brv-dark);
}

.brv-stat-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	padding: 26px 24px 22px;
	background: #fff;
	border: 1px solid rgba(26, 26, 46, 0.08);
	border-radius: var(--brv-radius);
	box-shadow: var(--brv-shadow);
	transition: transform 0.18s ease;
}

.brv-stat-card:hover {
	transform: translateY(-4px);
}

.brv-stat-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 50px;
	height: 50px;
	border-radius: 14px;
	background: rgba(45, 106, 79, 0.1);
	color: var(--brv-primary);
}

.brv-stat-gain .brv-stat-icon {
	background: rgba(45, 106, 79, 0.1);
	color: var(--brv-primary);
}

.brv-stat-loss .brv-stat-icon {
	background: rgba(0, 119, 182, 0.1);
	color: #0077B6;
}

.brv-stat-distance .brv-stat-icon {
	background: rgba(232, 93, 4, 0.1);
	color: var(--brv-accent);
}

.brv-stat-elevation .brv-stat-icon {
	background: rgba(114, 9, 183, 0.08);
	color: #7209B7;
}

.brv-stat-value {
	font-size: var(--brv-stat-value, 2.3rem);
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1;
	color: var(--brv-text);
}

.brv-stat-value small {
	margin-left: 4px;
	font-size: 1rem;
	font-weight: 700;
	color: var(--brv-text-muted);
}

.brv-stat-value-text {
	font-size: 1.5rem;
	line-height: 50px;
}

.brv-stat-label {
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--brv-text-muted);
}

/* Difficulty card: dark accent variant. */
.brv-stat-difficulty-card {
	background: var(--brv-dark);
	border-color: var(--brv-dark);
}

.brv-stat-difficulty-card .brv-stat-icon {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
}

.brv-stat-difficulty-card .brv-stat-value {
	color: #fff;
}

.brv-stat-difficulty-card .brv-stat-label {
	color: rgba(255, 255, 255, 0.6);
}

.brv-stat-difficulty-card.brv-difficulty-beginner {
	background: #588157;
	border-color: #588157;
}

.brv-stat-difficulty-card.brv-difficulty-intermediate {
	background: #0077B6;
	border-color: #0077B6;
}

.brv-stat-difficulty-card.brv-difficulty-advanced {
	background: var(--brv-accent);
	border-color: var(--brv-accent);
}

.brv-stat-difficulty-card.brv-difficulty-expert {
	background: #D62828;
	border-color: #D62828;
}

/* ------------------------------------------------------------------ *
 * Map
 * ------------------------------------------------------------------ */

.brv-map-section {
	margin: 40px 0;
}

.brv-map-wrap {
	position: relative;
	/* Own stacking context: keeps the map controls (z-index 10) and the
	   slide-in panel (z-index 20) contained, so they never paint over a
	   sticky/fixed site header instead of scrolling under it. */
	isolation: isolate;
	overflow: hidden;
	border-radius: var(--brv-radius);
	box-shadow: var(--brv-shadow);
}

#brv-map {
	height: 620px;
	width: 100%;
}

.brv-view-toggle {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 10;
	display: flex;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.brv-toggle-btn {
	padding: 9px 20px;
	border: none;
	background: rgba(26, 26, 46, 0.85);
	color: rgba(255, 255, 255, 0.7);
	font-weight: 700;
	font-size: 0.9rem;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
	backdrop-filter: blur(4px);
}

.brv-toggle-btn:hover {
	color: #fff;
}

.brv-toggle-btn.is-active {
	background: var(--brv-accent);
	color: #fff;
}

.brv-rotate-hint {
	position: absolute;
	bottom: 18px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	padding: 8px 18px;
	border-radius: 999px;
	background: rgba(26, 26, 46, 0.85);
	color: #fff;
	font-size: 0.85rem;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.5s;
}

.brv-rotate-hint.is-visible {
	opacity: 1;
}

/* ------------------------------------------------------------------ *
 * Feature markers
 * ------------------------------------------------------------------ */

/* Pulsing halo marker on the currently opened feature/segment (both
   platforms). pointer-events disabled so the pin underneath stays clickable. */
.brv-pulse-marker {
	position: absolute;
	top: 0;
	left: 0;
	width: 20px;
	height: 20px;
	pointer-events: none;
}

.brv-pulse-marker::before,
.brv-pulse-marker::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 20px;
	margin: -10px 0 0 -10px;
	border-radius: 50%;
	background: var(--brv-pulse-color, var(--brv-accent, #E85D04));
	opacity: 0.5;
	animation: brv-pulse 1.8s ease-out infinite;
}

.brv-pulse-marker::after {
	/* Negative delay = start half a cycle in, immediately. A positive delay
	   would park a static blob on the map for the first 0.9s. */
	animation-delay: -0.9s;
}

@keyframes brv-pulse {
	0% { transform: scale(0.4); opacity: 0; }
	10% { opacity: 0.55; }
	70% { opacity: 0.1; }
	100% { transform: scale(3.4); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.brv-pulse-marker::before,
	.brv-pulse-marker::after {
		animation: none;
		transform: scale(1.6);
		opacity: 0.3;
	}
}

.brv-marker {
	/* position: absolute keeps the element out of normal flow inside the
	   MapLibre canvas container. With position: relative/static, each
	   marker stacks 34px below the previous one, so MapLibre's
	   transform: translate(x,y) starts from a shifted origin and the
	   marker drifts further from its coordinate at low zoom levels.
	   The visual pin lives in a child (.brv-marker-pin) so its hover scale
	   never touches MapLibre's transform on this element — scaling the
	   positioned element would also scale its translate(-50%) anchor offset
	   and make the marker jitter toward the bottom-right while growing. */
	position: absolute;
	top: 0;
	left: 0;
	width: 34px;
	height: 34px;
	cursor: pointer;
}

.brv-marker-pin {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	border: 2.5px solid #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
	color: #fff;
	transition: transform 0.15s ease;
}

.brv-marker.is-hovered {
	z-index: 5;
}

.brv-marker.is-hovered .brv-marker-pin {
	transform: scale(1.15);
}

.brv-marker-tooltip {
	position: absolute;
	bottom: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%) translateY(4px);
	padding: 5px 12px;
	border-radius: 8px;
	background: var(--brv-dark);
	color: #fff;
	font-size: 0.8rem;
	font-weight: 600;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s, transform 0.15s;
}

.brv-marker-tooltip::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: var(--brv-dark);
}

.brv-marker.is-hovered .brv-marker-tooltip {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* ------------------------------------------------------------------ *
 * Slide-in feature panel
 * ------------------------------------------------------------------ */

.brv-feature-panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 400px;
	max-width: 92%;
	z-index: 20;
	background: #fff;
	box-shadow: -8px 0 30px rgba(0, 0, 0, 0.25);
	transform: translateX(105%);
	transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.35, 1);
	display: flex;
	flex-direction: column;
	/* The panel is moved to <body> on mobile, so it no longer inherits the
	   .brv-viewer typography — set the base font/colour explicitly here. */
	font-family: var(--brv-font);
	color: var(--brv-text);
	font-size: 17px;
	line-height: 1.65;
}

.brv-feature-panel.is-open {
	transform: translateX(0);
}

/* Drag handle ("grabber") to resize the bottom sheet — mobile only. Hidden on
   desktop, where the panel is a fixed-width side drawer. */
.brv-panel-grabber {
	display: none;
}

.brv-panel-close {
	position: absolute;
	top: 10px;
	right: 12px;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(26, 26, 46, 0.08);
	color: var(--brv-text);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s;
}

.brv-panel-close:hover {
	background: rgba(26, 26, 46, 0.18);
}

/* Prev/next item navigation (left/right edges of the panel) */
.brv-panel-nav-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 6;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(26, 26, 46, 0.55);
	color: #fff;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s;
}

.brv-panel-nav-btn:hover {
	background: var(--brv-accent);
}

.brv-panel-prev {
	left: 8px;
}

.brv-panel-next {
	right: 8px;
}

.brv-panel-content {
	overflow-y: auto;
	/* Keep panel scrolling from chaining to the (locked) page behind it. */
	overscroll-behavior: contain;
	padding: 20px;
	flex: 1;
}

.brv-panel-head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
	padding-right: 40px;
}

.brv-panel-head h2 {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--brv-text);
}

.brv-panel-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	color: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.brv-panel-description {
	margin-bottom: 18px;
	color: var(--brv-text);
}

.brv-panel-description p:first-child {
	margin-top: 0;
}

.brv-panel-swiper {
	margin: 0 0 18px;
	border-radius: 10px;
	overflow: hidden;
	background: var(--brv-surface);
	--swiper-navigation-color: #fff;
	--swiper-navigation-size: 26px;
	--swiper-pagination-color: var(--brv-accent);
}

.brv-panel-swiper .swiper-slide img {
	display: block;
	width: 100%;
	height: 240px;
	object-fit: cover;
}

.brv-panel-video {
	position: relative;
	margin-bottom: 18px;
	border-radius: 10px;
	overflow: hidden;
	background: #000;
	aspect-ratio: 16 / 9;
}

.brv-panel-video iframe,
.brv-panel-video video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: none;
}

/* ------------------------------------------------------------------ *
 * Sponsor (feature card + panel)
 * ------------------------------------------------------------------ */

.brv-card-sponsor {
	display: flex;
	align-items: center;
	gap: 8px;
	padding-top: 12px;
	border-top: 1px solid rgba(26, 26, 46, 0.08);
	font-size: 0.8rem;
	color: var(--brv-text-muted);
}

.brv-card-sponsor img {
	height: 24px;
	width: auto;
	object-fit: contain;
	flex-shrink: 0;
}

/* Sponsor caption split over two lines: label + name. */
.brv-card-sponsor-text {
	display: flex;
	flex-direction: column;
	line-height: 1.3;
	min-width: 0;
}

.brv-card-sponsor-name {
	font-weight: 700;
	color: var(--brv-text);
}

.brv-panel-sponsor {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 14px;
	padding: 10px 14px;
	border-radius: 8px;
	background: var(--brv-surface);
	font-size: 0.85rem;
	color: var(--brv-text-muted);
}

.brv-panel-sponsor img {
	height: 26px;
	width: auto;
	object-fit: contain;
	flex-shrink: 0;
}

/* ------------------------------------------------------------------ *
 * Description section
 * ------------------------------------------------------------------ */

.brv-description {
	margin: 48px 0;
}

.brv-description h2,
.brv-features-section h2 {
	margin: 0 0 20px;
	font-size: 1.7rem;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--brv-text);
}

.brv-description h2::after,
.brv-features-section h2::after {
	content: "";
	display: block;
	width: 52px;
	height: 4px;
	margin-top: 10px;
	border-radius: 2px;
	background: var(--brv-accent);
}

.brv-description-content {
	color: var(--brv-text);
	max-width: 76ch;
}

/* ------------------------------------------------------------------ *
 * Features grid (photo cards)
 * ------------------------------------------------------------------ */

.brv-features-section {
	margin: 48px 0;
}

.brv-features-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

.brv-feature-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid rgba(26, 26, 46, 0.08);
	border-radius: var(--brv-radius);
	overflow: hidden;
	cursor: pointer;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.brv-feature-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--brv-shadow);
}

.brv-card-media {
	position: relative;
	aspect-ratio: 16 / 9;
	background: var(--brv-surface);
}

.brv-card-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Fallback when a feature has no photos: tinted band (JS sets color). */
.brv-card-media-plain {
	background-image: radial-gradient(120% 150% at 20% 0%, rgba(255, 255, 255, 0.25) 0%, transparent 60%);
}

.brv-card-icon {
	position: absolute;
	left: 18px;
	bottom: -22px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 3px solid #fff;
	color: #fff;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
	z-index: 2;
}

.brv-card-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 32px 20px 20px;
}

.brv-card-title {
	margin: 0 0 6px;
	font-size: 1.18rem;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--brv-text);
}

.brv-card-excerpt {
	margin: 0 0 12px;
	font-size: 0.95rem;
	color: var(--brv-text-muted);
}

/* Override theme heading/paragraph margins (higher specificity via the
   .brv-viewer wrapper) so the title sits right under the badge and the body
   hugs the title — no theme-injected vertical gaps. */
.brv-viewer .brv-card-title {
	margin: 0 0 6px;
	text-align: center;
}

.brv-viewer .brv-card-distance {
	margin: 0 0 8px;
}

.brv-viewer .brv-card-excerpt {
	margin: 0 0 12px;
}

.brv-card-link {
	/* Push the link (and the sponsor below it) to the bottom of the card so
	   the link sits just above the sponsor, while the body stays at the top. */
	margin-top: auto;
	margin-bottom: 10px;
	padding: 0;
	border: none;
	background: none;
	color: var(--brv-accent);
	font-size: 0.92rem;
	font-weight: 700;
	cursor: pointer;
}

.brv-card-link:hover {
	text-decoration: underline;
}

/* ------------------------------------------------------------------ *
 * Responsive: tablet
 * ------------------------------------------------------------------ */

@media (max-width: 1100px) {
	.brv-stats-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.brv-features-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	#brv-map {
		height: 520px;
	}
}

/* ------------------------------------------------------------------ *
 * Responsive: mobiel
 * ------------------------------------------------------------------ */

@media (max-width: 767px) {
	.brv-container {
		padding: 0 18px;
	}

	.brv-hero {
		padding: 44px 0 72px;
	}

	.brv-stats-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}

	.brv-stat-card {
		padding: 18px 16px 16px;
	}

	.brv-stat-value {
		font-size: 1.7rem;
	}

	.brv-stat-value-text {
		font-size: 1.15rem;
		line-height: 42px;
	}

	.brv-stat-icon {
		width: 42px;
		height: 42px;
	}

	.brv-features-grid {
		grid-template-columns: 1fr;
	}

	/* Mobile map height complements the panel so the map (top) and the fixed
	   bottom-sheet panel together fit on screen. Overrides any height=""
	   attribute on this breakpoint. vh declaration is the fallback for
	   browsers without dvh. */
	#brv-map {
		height: 340px !important;
		/* Fill the full viewport height minus the bottom-sheet panel so there is
		   no gap between the map and the panel for page content to show through
		   when the panel is open and the page is scroll-locked.
		   --brv-panel-h-live is set on <html> by the drag handle (live resize);
		   it falls back to the route's configured --brv-panel-h, then 62dvh. */
		height: calc(100dvh - var(--brv-panel-h-live, var(--brv-panel-h, 62dvh))) !important;
	}

	/* Bottom sheet panel on mobile: fixed to the viewport bottom (reliable on
	   iOS — unlike making the map itself fixed, which collapses on iOS).
	   Height via --brv-panel-h in dvh (vh fallback) so the iOS toolbar doesn't
	   push it off-screen. */
	.brv-feature-panel {
		position: fixed;
		top: auto;
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		max-width: 100%;
		height: 62vh;
		height: var(--brv-panel-h-live, var(--brv-panel-h, 62dvh));
		z-index: 99990;
		border-radius: 18px 18px 0 0;
		transform: translateY(105%);
		box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
	}

	.brv-feature-panel.is-open {
		transform: translateY(0);
	}

	/* Drag handle to resize the bottom sheet (and, complementarily, the map). */
	.brv-panel-grabber {
		display: flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 auto;
		height: 26px;
		cursor: grab;
		touch-action: none;
	}

	.brv-panel-grabber::before {
		content: "";
		width: 42px;
		height: 5px;
		border-radius: 3px;
		background: rgba(26, 26, 46, 0.22);
	}

	.brv-panel-grabber:active {
		cursor: grabbing;
	}

	.brv-panel-swiper .swiper-slide img {
		height: 180px;
	}
}

/* --- Segment cards & badge --- */

.brv-card-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 8px;
	margin-bottom: 6px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #fff;
	background: rgba(0, 0, 0, 0.45);
	border-radius: 999px;
}

.brv-card-badge svg {
	width: 13px;
	height: 13px;
}

.brv-card-distance {
	display: block;
	margin-top: 2px;
	font-size: 13px;
	font-weight: 600;
	color: var(--brv-accent, #E85D04);
}

/* --- Segment hover name popup --- */

.brv-segment-popup .maplibregl-popup-content {
	padding: 5px 12px;
	border-radius: 8px;
	background: var(--brv-dark);
	color: #fff;
	font-size: 0.8rem;
	font-weight: 600;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.brv-segment-popup .maplibregl-popup-tip {
	border-top-color: var(--brv-dark);
	border-bottom-color: var(--brv-dark);
}

/* ------------------------------------------------------------------ *
 * Layout variants for [route_features] / [route_segments]
 *   default = cards (grid; column count + image height via CSS vars)
 *   compact = smaller cards (grid; column count + image height via vars)
 *   list    = horizontal rows (image width + row height via vars)
 * The CSS vars are emitted per route on the .brv-viewer wrapper from the
 * admin size sliders (BRV_Shortcode::display_style_string); the fallbacks
 * here are the defaults when no slider value is stored.
 * ------------------------------------------------------------------ */

.brv-features-grid.brv-layout-cards {
	grid-template-columns: repeat(var(--brv-cards-cols, 3), 1fr);
}

.brv-layout-cards .brv-card-media {
	aspect-ratio: auto;
	height: var(--brv-cards-mediah, 200px);
}

.brv-features-grid.brv-layout-compact {
	grid-template-columns: repeat(var(--brv-compact-cols, 4), 1fr);
	gap: 16px;
}

.brv-layout-compact .brv-card-media {
	aspect-ratio: auto;
	height: var(--brv-compact-mediah, 150px);
}

.brv-layout-compact .brv-card-body {
	padding: 26px 16px 16px;
}

.brv-layout-compact .brv-card-icon {
	width: 38px;
	height: 38px;
	bottom: -18px;
	left: 14px;
}

.brv-layout-compact .brv-card-title {
	font-size: 1.02rem;
}

.brv-layout-compact .brv-card-excerpt {
	font-size: 0.85rem;
}

.brv-features-grid.brv-layout-list {
	grid-template-columns: 1fr;
	gap: 14px;
}

.brv-layout-list .brv-feature-card {
	flex-direction: row;
	align-items: stretch;
	min-height: var(--brv-list-minh, 92px);
}

.brv-layout-list .brv-card-media {
	flex: 0 0 var(--brv-list-mediaw, 130px);
	aspect-ratio: auto;
}

.brv-layout-list .brv-card-body {
	flex: 1;
	padding: 14px 20px;
}

/* Horizontal list rows keep a left-aligned title (centering only applies to
   the vertical card/compact layouts). */
.brv-viewer .brv-layout-list .brv-card-title {
	text-align: left;
}

.brv-layout-list .brv-card-icon {
	width: 36px;
	height: 36px;
	top: 12px;
	bottom: auto;
	left: 12px;
}

.brv-layout-list .brv-card-excerpt {
	margin-bottom: 8px;
	font-size: 0.9rem;
}

/* Responsive: column-count layouts collapse on smaller screens (overrides
   the slider-driven desktop column count via equal-specificity + later
   source order). */
@media (max-width: 1100px) {
	.brv-features-grid.brv-layout-cards {
		grid-template-columns: repeat(2, 1fr);
	}

	.brv-features-grid.brv-layout-compact {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 767px) {
	.brv-features-grid.brv-layout-cards,
	.brv-features-grid.brv-layout-compact {
		grid-template-columns: 1fr;
	}

	.brv-layout-list .brv-card-media {
		flex-basis: 104px;
	}

	.brv-layout-list .brv-card-body {
		padding: 12px 14px;
	}
}

/* --- Custom uploaded icons (override the built-in SVG) --- */

.brv-icon-img {
	width: 68%;
	height: 68%;
	object-fit: contain;
	display: block;
}
