/* ETT Tour Map v1.0.2 — GetYourGuide-style itinerary layout
   Brand palette: terracotta #DC8376 · deep brown #502F2A · gold #c2a360 */

.ett-tour-map {
	--ett-terracotta: #DC8376;
	--ett-brown: #502F2A;
	--ett-gold: #c2a360;
	--ett-line: #f0d6d0;
	--ett-tm-map-height: 480px;
	--ett-tm-sticky-top: 100px; /* adjust if the sticky header is taller */

	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: 28px;
	align-items: start;
	margin: 0 0 30px;
}

/* ---------- Stop list (left column) ---------- */

.ett-tour-map ol.ett-tm-stops {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	position: relative;
}

/* vertical timeline line — centered on the pin axis (pin width 30 → axis at 15px) */
.ett-tour-map ol.ett-tm-stops::before {
	content: "";
	position: absolute;
	left: 15px;
	margin-left: -1.5px;
	top: 28px;
	bottom: 34px;
	width: 3px;
	background: var(--ett-line);
	border-radius: 3px;
}

.ett-tour-map .ett-tm-stop {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.ett-tm-stop-btn {
	display: flex;
	gap: 14px;
	width: 100%;
	text-align: left;
	background: none;
	border: 0;
	box-shadow: none;
	padding: 12px 12px 12px 0;
	margin: 0;
	border-radius: 10px;
	cursor: pointer;
	position: relative;
	transition: background-color 0.15s ease;
	text-transform: none;
	letter-spacing: 0;
	font-weight: 400;
	line-height: 1.4;
	color: inherit;
}

.ett-tm-stop-btn:hover,
.ett-tm-stop-btn:focus-visible {
	background: #faf4f2;
	box-shadow: none;
	color: inherit;
}

.ett-tm-stop.is-open .ett-tm-stop-btn {
	background: #f9efec;
}

/* Numbered teardrop pin */
.ett-tm-pin {
	flex: 0 0 30px;
	width: 30px;
	position: relative;
	z-index: 2;
}

.ett-tm-pin svg {
	display: block;
	filter: drop-shadow(0 2px 3px rgba(80, 47, 42, 0.25));
}

.ett-tm-stop-body {
	display: block;
	min-width: 0;
	flex: 1 1 auto;
}

.ett-tm-stop-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 2px;
}

.ett-tm-stop-name {
	display: block;
	font-weight: 600;
	font-size: 16px;
	color: var(--ett-brown);
}

.ett-tm-chev {
	display: flex;
	flex: 0 0 auto;
	color: #b7a59d;
	transition: transform 0.25s ease;
}

.ett-tm-stop.is-open .ett-tm-chev {
	transform: rotate(180deg);
}

/* Optional badge on its own line, below the stop name */
.ett-tm-badge-row {
	display: block;
	margin: 3px 0 1px;
}

.ett-tm-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--ett-gold);
	border: 1px solid var(--ett-gold);
	border-radius: 999px;
	padding: 1px 9px;
	line-height: 1.5;
	white-space: nowrap;
	max-width: 100%;
}

/* Optional badge inside the map popup — matches the list badge */
.ett-tour-map .ett-tm-popup-badge {
	display: inline-block;
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--ett-gold);
	border: 1px solid var(--ett-gold);
	border-radius: 999px;
	padding: 0 8px;
	vertical-align: 1px;
	white-space: nowrap;
}

.ett-tm-stop-meta {
	display: block;
	font-size: 13px;
	color: #8a7a72;
	margin-bottom: 2px;
}

/* Collapsible description — closed by default */
.ett-tm-desc-wrap {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.28s ease;
}

.ett-tm-stop.is-open .ett-tm-desc-wrap {
	grid-template-rows: 1fr;
}

.ett-tm-stop-desc {
	display: block;
	overflow: hidden;
	min-height: 0;
	font-size: 14px;
	color: #5b5049;
	line-height: 1.5;
}

.ett-tm-stop.is-open .ett-tm-stop-desc {
	padding-top: 4px;
}

/* ---------- Map (right column) ---------- */

.ett-tm-map-col {
	position: sticky;
	top: var(--ett-tm-sticky-top);
}

.ett-tm-map {
	height: var(--ett-tm-map-height);
	border-radius: 12px;
	overflow: hidden;
	background: #f2ede8; /* placeholder tone before tiles load — zero CLS */
	box-shadow: 0 2px 14px rgba(80, 47, 42, 0.14);
	z-index: 1;
}

/* Leaflet marker (same teardrop pin as the list) */
.ett-tm-divicon {
	background: none;
	border: none;
}

.ett-tm-divicon svg {
	display: block;
	filter: drop-shadow(0 2px 4px rgba(80, 47, 42, 0.35));
}

/* Two-finger gesture mode (touch devices):
   let single-finger swipes scroll the page */
.ett-tm-map.ett-tm-gesture {
	touch-action: pan-y !important;
}

.ett-tm-hint {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	z-index: 1200;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.ett-tm-hint.is-visible {
	opacity: 1;
}

.ett-tm-hint span {
	display: inline-block;
	background: rgba(80, 47, 42, 0.78);
	color: #fff;
	font-size: 14px;
	padding: 10px 18px;
	border-radius: 10px;
	white-space: nowrap;
}

/* Leaflet popup polish */
.ett-tour-map .leaflet-popup-content-wrapper {
	border-radius: 10px;
	box-shadow: 0 4px 16px rgba(80, 47, 42, 0.2);
}

.ett-tour-map .leaflet-popup-content {
	margin: 12px 16px;
	font-size: 14px;
	line-height: 1.45;
}

.ett-tour-map .leaflet-popup-content strong {
	color: #502F2A;
}

.ett-tm-popup-meta {
	color: #8a7a72;
	font-size: 12.5px;
}

/* ---------- Mobile: single column, map on top ---------- */

@media (max-width: 849px) {
	.ett-tour-map {
		grid-template-columns: 1fr;
		gap: 18px;
	}

	.ett-tm-map-col {
		position: static;
		order: -1;
	}

	.ett-tm-map {
		height: 320px;
	}

	.ett-tm-stop-name {
		font-size: 15px;
	}
}

/* Bigger touch targets for zoom controls on coarse pointers */
@media (pointer: coarse) {
	.ett-tour-map .leaflet-bar a {
		width: 40px;
		height: 40px;
		line-height: 40px;
		font-size: 22px;
	}
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
	.ett-tm-desc-wrap,
	.ett-tm-chev,
	.ett-tm-stop-btn,
	.ett-tm-hint {
		transition: none;
	}
}
