/* HUBCO Green — Journey Planner */

:root {
	--hj-green: #3aa64b;
	--hj-green-hover: #34963f;
	--hj-panel: #1f1f1f;
	--hj-field: #2e2e2e;
	--hj-border: #3d3d3d;
	--hj-text: #ffffff;
	--hj-muted: #a9a9a9;
	/* Height of the site header above the map. Override in your theme if it differs. */
	--hj-header-h: 64px;
}

/* ---------- "Plan Your Journey" button ---------- */

.hubco-journey-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 26px;
	border-radius: 999px;
	background: var(--hj-green);
	color: #fff !important;
	font-weight: 600;
	font-size: 15px;
	line-height: 1;
	text-decoration: none !important;
	transition: background .2s, transform .2s;
}
.hubco-journey-btn:hover,
.hubco-journey-btn:focus-visible {
	background: var(--hj-green-hover);
	transform: translateY(-1px);
}

/* ---------- Planner layout ---------- */

.hubco-journey {
	position: relative;
	/* Full-bleed: break out of the page template's content container so
	   the map spans the whole screen. journey-planner.js then fine-tunes
	   this to the exact pixel (scrollbar, off-centre containers). */
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	box-sizing: border-box;
	height: calc(100vh - var(--hj-header-h));
	height: calc(100dvh - var(--hj-header-h));
	min-height: 520px;
	background: #2b2b2b;
	overflow: hidden;
	font-size: 13px;
	color: var(--hj-text);
}

/* On the journey page the map has no container: the homepage wrappers
   (#network section, .wrap) are removed in PHP, and the map shell fills
   the whole planner edge to edge. Doubled selectors + !important so the
   homepage card styles in network-map.css can't shrink it. */
.hubco-journey .map-shell.map-shell,
.hubco-journey #network,
.hubco-journey .wrap {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	max-width: none !important;
	height: 100% !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}
.hubco-journey .map-canvas.map-canvas {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	max-width: none !important;
	height: 100% !important;
	min-height: 0 !important;
	aspect-ratio: auto !important;
	margin: 0 !important;
	border-radius: 0 !important;
}
.hubco-journey .map-shell.map-shell{

	max-height: 100dvh !important;
}
/* The planner panel replaces the homepage search box and the expand button. */
.hubco-journey .map-search,
.hubco-journey .map-control--expand {
	display: none !important;
}

/* ---------- Side panel ---------- */

.hubco-journey__panel {
	position: absolute;
	top: 24px;
	left: 24px;
	z-index: 1001;
	width: 330px;
	max-height: calc(100% - 48px);
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 18px;
	background: var(--hj-panel);
	border-radius: 22px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
	box-sizing: border-box;
	margin: 0;
}

.hubco-journey__field,
.hubco-journey__submit {
	position: relative;
	flex-shrink: 0;
}
.hubco-journey__field input {
	width: 100%;
	height: 38px;
	padding: 0 40px 0 16px;
	border: 1px solid var(--hj-border);
	border-radius: var( --wp--custom--radius--md, 12px );
	background: var(--hj-field);
	color: var(--hj-text);
	font: inherit;
	box-sizing: border-box;
	outline: none;
	transition: border-color .2s;
}
.hubco-journey__field input::placeholder {
	color: var(--hj-muted);
	opacity: 1;
}
.hubco-journey__field input:focus {
	border-color: var(--hj-green);
}
/* Hide Chrome's datalist arrow; the search icon sits there instead. */
.hubco-journey__field input::-webkit-calendar-picker-indicator {
	opacity: 0;
}
.hubco-journey__icon {
	position: absolute;
	top: 50%;
	right: 14px;
	transform: translateY(-50%);
	display: flex;
	color: var(--hj-muted);
	pointer-events: none;
}

.hubco-journey__submit {
	height: 38px;
	border: 0;
	border-radius: 999px;
	background: var(--hj-green);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: background .2s, opacity .2s;
}
.hubco-journey__submit:hover {
	background: var(--hj-green-hover);
}
.hubco-journey__submit:disabled {
	opacity: .6;
	cursor: progress;
}

/* ---------- Results ---------- */

.hubco-journey__results {
	margin-top: 6px;
	overflow-y: auto;
	overflow-x: hidden;
	min-height: 0;
	scrollbar-width: thin;
	scrollbar-color: #444 transparent;
}
.hubco-journey__results[hidden] {
	display: none;
}

.hubco-journey__results-title {
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 700;
	color: var(--hj-text);
}

.hubco-journey__list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.hubco-journey__list > li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 8px;
	margin: 0px;
	border-radius: 10px;
	cursor: pointer;
	transition: background .15s;
}
.hubco-journey__list > li + li {
	margin-top: 6px;
}
.hubco-journey__list > li:hover,
.hubco-journey__list > li:focus-visible,
.hubco-journey__list > li.is-active {
	background: rgba(255, 255, 255, .06);
	outline: none;
}
.hubco-journey__list > li.is-active {
	background: rgba(58, 166, 75, .14);
}

.hubco-journey__station {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
	flex: 1 1 auto;
	overflow-wrap: anywhere; /* long addresses wrap instead of scrolling sideways */
}
.hubco-journey__station strong {
	font-weight: 700;
	font-size: 12.5px;
}
.hubco-journey__station span {
	color: #d6d6d6;
	font-size: 11.5px;
}

.hubco-journey__chargers {
	list-style: none;
	margin: 4px 0 0;
	padding: 0;
	display: none;
}
.hubco-journey__chargers li {
	position: relative;
	padding-left: 12px;
	color: var(--hj-green);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.5;
}
.hubco-journey__chargers li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .55em;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--hj-green);
}

.hubco-journey__dist {
	display: none;
	flex-direction: column;
	align-items: flex-end;
	flex-shrink: 0;
	text-align: right;
}
.hubco-journey__dist small {
	font-size: 10.5px;
	font-weight: 700;
}
.hubco-journey__dist span {
	font-size: 10px;
	color: var(--hj-muted);
	white-space: nowrap;
}

.hubco-journey__total {
	margin: 10px 0 0;
	padding-top: 10px;
	border-top: 1px solid var(--hj-border);
	color: var(--hj-muted);
	font-size: 11.5px;
}
.hubco-journey__total strong {
	color: var(--hj-text);
}

.hubco-journey__msg {
	margin: 0;
	color: var(--hj-muted);
	line-height: 1.5;
}
.hubco-journey__msg.is-error {
	color: #ff8a80;
}

/* ---------- Sidebar parts (hidden on desktop) ---------- */

.hubco-journey__toggle,
.hubco-journey__backdrop,
.hubco-journey__panel-head {
	display: none;
}

/* ---------- Tablet & mobile: panel becomes a slide-in sidebar ---------- */

@media (max-width: 1024px) {
	.hubco-journey__panel {
		top: 0;
		left: 0;
		bottom: 0;
		right: auto;
		width: min(360px, 86vw);
		height: 100%;
		max-height: none;
		padding: 16px 18px 18px;
		border-radius: 0 22px 22px 0;
		box-shadow: 8px 0 30px rgba(0, 0, 0, .5);
		/* Above the map panes and controls, below the network map's mobile bottom sheet. */
		z-index: 2;
		transform: translateX(-105%);
		visibility: hidden;
		transition: transform .3s ease, visibility 0s linear .3s;
	}
	.hubco-journey.is-sidebar-open .hubco-journey__panel {
		transform: none;
		visibility: visible;
		transition: transform .3s ease, visibility 0s;
	}

	.hubco-journey__panel-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		flex-shrink: 0;
		margin-bottom: 2px;
	}
	.hubco-journey__panel-title {
		font-size: 15px;
		font-weight: 700;
		color: var(--hj-text);
	}
	.hubco-journey__close {
		width: 34px;
		height: 34px;
		display: grid;
		place-items: center;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: var(--hj-field);
		color: var(--hj-text);
		cursor: pointer;
	}
	.hubco-journey__close:hover {
		background: #3a3a3a;
	}

	.hubco-journey__results {
		flex: 1 1 auto;
	}

	.hubco-journey__backdrop {
		display: block;
		position: absolute;
		inset: 0;
		z-index: 1;
		background: rgba(0, 0, 0, .45);
		opacity: 0;
		pointer-events: none;
		transition: opacity .3s ease;
	}
	.hubco-journey.is-sidebar-open .hubco-journey__backdrop {
		opacity: 1;
		pointer-events: auto;
	}

	.hubco-journey__toggle {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		position: absolute;
		top: 16px;
		left: 16px;
		z-index: 2;
		max-width: calc(100% - 100px); /* clear of the map controls on the right */
		height: 44px;
		padding: 0 18px 0 14px;
		border: 0;
		border-radius: 999px;
		background: var(--hj-green);
		color: #fff;
		font: inherit;
		font-size: 14px;
		font-weight: 600;
		white-space: nowrap;
		cursor: pointer;
		box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
	}
	.hubco-journey__toggle span {
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.hubco-journey__toggle:hover {
		background: var(--hj-green-hover);
	}
}

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