/* ==========================================================================
   acadia/itinerary-map — itinerary rail + live map.

   Styled to the Acadia system, not the reference it was structured from. The
   interaction model is unchanged; the vocabulary is ours:

     shape   square corners throughout (the system is border-radius: 0), and a
             sharp map "tack" instead of a rounded pin + teardrop pair
     type    Fraunces for titles, Spline Sans Mono for numerals and specs,
             Libre Franklin for everything else
     colour  forest / spruce / terracotta / sage, gold stars for ratings
     rules   1px hairline-green, matching the FAQ and numbered-list blocks

   Colours and sizes come in as custom properties from render.php, so the
   values here are only fallbacks.
   ========================================================================== */

.acadia-imap {
	--aim-ink: #22411f;        /* forest — headings, titles          */
	--aim-muted: #5d6163;      /* gray — meta, categories            */
	--aim-pin: #22411f;
	--aim-pin-ink: #f1eadb;    /* cream                              */
	--aim-accent: #cc4b33;     /* terracotta — start / end           */
	--aim-accent-ink: #f1eadb;
	--aim-rule: rgba(46, 90, 42, 0.3);

	/* Pulled from the global design system, with literals as a fallback so the
	   block still looks right if it is ever used without design.css. */
	--aim-spruce: var(--acadia-spruce, #356a31);
	--aim-cream: var(--acadia-cream, #f1eadb);
	--aim-sage: var(--acadia-sage, #e4edd6);
	--aim-gold: var(--acadia-gold, #f6b73c);
	--aim-offwhite: var(--acadia-offwhite, #f5f6f4);

	--aim-serif: var(--acadia-serif, "Fraunces", Georgia, serif);
	--aim-sans: var(--acadia-sans, "Libre Franklin", -apple-system, sans-serif);
	--aim-mono: var(--acadia-mono, "Spline Sans Mono", ui-monospace, monospace);

	--aim-disc: 40px;
	--aim-row-pad: 15px;   /* breathing room inside a stop row */
	--aim-marker: 34px;
	--aim-tail: 7px;
	--aim-map-h: 520px;
	--aim-map-h-mob: 260px;
	--aim-sticky-top: 24px;
	--aim-radius: 0px;

	/* The theme sets contentSize/wideSize to 100% and uses a flow layout, so
	   WordPress applies no max-width — every Acadia block constrains itself.
	   Same 1200px / 32px gutter as tour-glance, reviews and map. */
	display: block;
	max-width: var(--acadia-maxw, 1200px);
	margin-inline: auto;
	padding: 34px 32px 74px;
	font-family: var(--aim-sans);
	color: var(--aim-ink);
	/* Defensive: block themes and page builders leak borders/shadows onto
	   section roots. */
	border: none;
	outline: none;
	box-shadow: none;
	contain: layout style;
}

.acadia-imap *,
.acadia-imap *::before,
.acadia-imap *::after { box-sizing: border-box; }

/* ==========================================================================
   Plate — the framed card shared with acadia/map, so the two read as one
   family on the page. Border, shadow and header metrics are lifted from that
   block verbatim rather than re-eyeballed.
   ========================================================================== */

.acadia-imap__plate {
	position: relative;
	background-color: #fff;
	border: 1px solid rgba(84, 89, 90, 0.35);
	box-shadow: rgba(24, 51, 26, 0.13) 0 6px 24px;
}

.acadia-imap__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
	padding: 22px 24px 16px;
	border-bottom: 1px solid rgba(84, 89, 90, 0.22);
}

.acadia-imap__head-text { min-width: 0; }

/* --- route switcher ------------------------------------------------------
   A segmented control: one hairline box, dividers between, active segment
   filled forest. Sharp corners like the rest of the system. */

.acadia-imap__tabs {
	display: flex;
	flex: none;
	border: 1px solid var(--aim-ink);
}

.acadia-imap__tab {
	padding: 9px 16px;
	border: 0;
	border-left: 1px solid var(--aim-ink);
	border-radius: 0;
	background: transparent;
	color: var(--aim-ink);
	font-family: var(--aim-sans);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 160ms ease, color 160ms ease;
}

.acadia-imap__tab:first-child { border-left: 0; }

.acadia-imap__tab:hover { background: var(--aim-sage); }

.acadia-imap__tab[aria-pressed="true"] {
	background: var(--aim-ink);
	color: var(--aim-cream);
}

.acadia-imap__tab:focus-visible {
	outline: 2px solid var(--aim-spruce);
	outline-offset: 2px;
	position: relative;
	z-index: 1;
}

/* Rows and markers filtered out by the active route.
   Height/opacity rather than display:none so the list collapses smoothly
   instead of snapping. */
.acadia-imap__stop[data-hidden="true"] {
	display: none;
}

.acadia-imap-marker[data-hidden="true"] {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.acadia-imap__eyebrow {
	margin: 0 0 6px;
	font-family: var(--aim-sans);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--acadia-gray-2, #7a7e70);
}

.acadia-imap__heading {
	margin: 0;
	font-family: var(--aim-serif);
	font-size: 26px;
	font-weight: 600;
	line-height: 1.1;
	color: var(--aim-ink);
}

.acadia-imap__note {
	margin-top: 6px;
	font-family: var(--aim-mono);
	font-size: 13px;
	line-height: 1.5;
	color: var(--aim-muted);
}

/* Rail beside map, divided by the same hairline as the header. The rail is
   capped rather than proportional: a fractional split gives the list far more
   width than its text needs, which reads as a dead channel between them. */
.acadia-imap__grid {
	display: grid;
	grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
	/* Stretch, not start: the map cell has to run the full height of the plate
	   or the column divider stops halfway down and the map leaves a band of
	   dead white beneath it. */
	align-items: stretch;
}

.acadia-imap__list-col { padding: 4px 9px 22px; }

.acadia-imap__map-col {
	min-width: 0;
	border-left: 1px solid rgba(84, 89, 90, 0.22);
}

.acadia-imap.is-map-left .acadia-imap__map-col {
	order: -1;
	border-left: 0;
	border-right: 1px solid rgba(84, 89, 90, 0.22);
}

/* ==========================================================================
   Timeline rail
   ========================================================================== */

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

/* The numeral is positioned over the row rather than occupying a grid column.
   With a column, everything in the row — including the expanded photo and body
   copy — inherits its indent, and pulling the panel back out with a negative
   margin fails: ::details-content needs overflow:hidden for the open animation,
   so it clips anything reaching outside the <details> box. Floating the numeral
   means only the summary is indented and the panel is full width for free. */
.acadia-imap__stop {
	position: relative;
	padding: 16px var(--aim-row-pad);
	border-bottom: 1px solid var(--aim-rule);
	list-style: none;
	transition: background-color 200ms ease;
}

.acadia-imap__stop::marker { content: none; }

/* The plate header closes the top and the plate edge closes the bottom, so a
   rule in either place just doubles a line that is already there. */
.acadia-imap__stop:last-child { border-bottom: 0; }

/* Continuous hairline connector rather than the reference's dotted run — the
   same 1px hairline-green the FAQ and spec tables use. */
.acadia-imap__stop:not(:last-child)::before {
	content: "";
	position: absolute;
	left: calc(var(--aim-row-pad) + var(--aim-disc) / 2 - 0.5px);
	top: calc(16px + var(--aim-disc));
	bottom: -1px;
	width: 1px;
	background: var(--aim-rule);
}

.acadia-imap__stop--terminus:not(:last-child)::before {
	top: calc(16px + var(--aim-disc) + var(--aim-tail));
}

/* An open row's content starts at the row edge, so the connector would print
   underneath the body copy. Drop it there — the sage highlight and the row
   rules carry the structure while a stop is open. */
.acadia-imap__stop:has(.acadia-imap__detail[open])::before { display: none; }

/* --- numeral / terminus tag --------------------------------------------- */

.acadia-imap__badge {
	position: relative;
	z-index: 1;
	display: grid;
	place-items: center;
	/* Grid items stretch by default. The numbered square hides that behind an
	   explicit height, but the terminus tag is height:auto and would grow to
	   the full row height. */
	position: absolute;
	left: calc(var(--aim-row-pad) + var(--aim-disc) / 2);
	top: 16px;
	translate: -50% 0;
	width: var(--aim-disc);
	height: var(--aim-disc);
	background: var(--aim-pin);
	color: var(--aim-pin-ink);
	font-family: var(--aim-mono);
	font-size: 13px;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
	line-height: 1;
	transition: background-color 200ms ease, box-shadow 200ms ease,
		transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.acadia-imap__badge--terminus {
	width: auto;
	min-width: var(--aim-disc);
	height: auto;
	padding: 8px 10px;
	background: var(--aim-accent);
	color: var(--aim-accent-ink);
	font-size: 10px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

/* Sharp tail — the tack silhouette, shared with the map markers. */
.acadia-imap__badge--terminus::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	width: 10px;
	height: var(--aim-tail);
	background: var(--aim-accent);
	clip-path: polygon(50% 100%, 0 0, 100% 0);
	transform: translateX(-50%);
}

.acadia-imap__stop[data-active="true"] { background: var(--aim-sage); }

.acadia-imap__stop[data-active="true"] .acadia-imap__badge:not(.acadia-imap__badge--terminus) {
	background: var(--aim-spruce);
	transform: translateY(-1px);
	box-shadow: 0 3px 0 0 rgba(34, 65, 31, 0.18);
}

/* --- text + disclosure -------------------------------------------------- */

.acadia-imap__body { min-width: 0; padding-top: 1px; }

.acadia-imap__detail { display: block; }

.acadia-imap__trigger {
	display: block;
	padding-left: calc(var(--aim-disc) + 16px);
	cursor: pointer;
	list-style: none;
}

.acadia-imap__trigger::-webkit-details-marker { display: none; }
.acadia-imap__trigger::marker { content: none; }
.acadia-imap__trigger--static {
	padding-left: calc(var(--aim-disc) + 16px);
	cursor: default;
}

.acadia-imap__trigger:focus-visible {
	outline: 2px solid var(--aim-spruce);
	outline-offset: 3px;
}

.acadia-imap__title {
	display: block;
	font-family: var(--aim-serif);
	font-size: 19px;
	font-weight: 600;
	line-height: 1.28;
	color: var(--aim-ink);
	transition: color 180ms ease;
}

.acadia-imap__stop[data-active="true"] .acadia-imap__title,
.acadia-imap__trigger:hover .acadia-imap__title { color: var(--aim-spruce); }

/* Specs in the mono face, as everywhere else on the site. */
.acadia-imap__meta {
	display: block;
	margin-top: 5px;
	font-family: var(--aim-mono);
	font-size: 12.5px;
	line-height: 1.5;
	letter-spacing: 0.01em;
	color: var(--aim-muted);
}

.acadia-imap__disclose {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-top: 9px;
	font-family: var(--aim-sans);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--aim-spruce);
}

.acadia-imap__trigger:hover .acadia-imap__disclose { text-decoration: underline; }

/* "+" to open, matching the FAQ block's disclosure glyph. */
.acadia-imap__disclose::before {
	content: "+";
	display: grid;
	place-items: center;
	width: 16px;
	height: 16px;
	border: 1px solid currentColor;
	font-size: 14px;
	font-weight: 400;
	line-height: 1;
	transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.acadia-imap__detail[open] .acadia-imap__disclose::before { transform: rotate(135deg); }
.acadia-imap__detail[open] .acadia-imap__disclose { display: none; }

/* --- detail panel ------------------------------------------------------- */

/* The expanded panel runs the full width of the rail column.
   Everything inside a stop is indented past the numeral square, which leaves
   the photo AND the body copy pushed into the right-hand two thirds of an
   already narrow column. The title stays beside the numeral; everything that
   opens below it starts at the row's left edge. */
.acadia-imap__detail-body { overflow: hidden; }
.acadia-imap__detail-inner { padding: 14px 0 2px; }

@supports selector(::details-content) {
	.acadia-imap__detail::details-content {
		block-size: 0;
		overflow: hidden;
		transition: block-size 300ms cubic-bezier(0.22, 1, 0.36, 1),
			content-visibility 300ms allow-discrete;
	}
	.acadia-imap__detail[open]::details-content { block-size: auto; }
}

/* Contents drift up as the panel opens.

   Scoped to __detail-body on purpose. The editor renders __detail-inner on its
   own, with no <details> around it, so an unscoped rule here would leave every
   stop's photo, blurb and address permanently at opacity 0 on the canvas —
   present, taking up space, invisible. */
.acadia-imap__detail-body .acadia-imap__detail-inner > * {
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 320ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.acadia-imap__detail[open] .acadia-imap__detail-body .acadia-imap__detail-inner > * {
	opacity: 1;
	transform: none;
}

.acadia-imap__detail[open] .acadia-imap__detail-body .acadia-imap__detail-inner > *:nth-child(2) { transition-delay: 55ms; }
.acadia-imap__detail[open] .acadia-imap__detail-body .acadia-imap__detail-inner > *:nth-child(3) { transition-delay: 110ms; }
.acadia-imap__detail[open] .acadia-imap__detail-body .acadia-imap__detail-inner > *:nth-child(4) { transition-delay: 150ms; }

.acadia-imap__rating {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 12px;
	font-family: var(--aim-mono);
	font-size: 13px;
	line-height: 1;
}

.acadia-imap__rating-score { font-weight: 500; color: var(--aim-ink); }
.acadia-imap__rating-count { color: var(--aim-muted); }
.acadia-imap__stars { display: block; flex: none; }
.acadia-imap__star-bg { fill: rgba(34, 65, 31, 0.16); }
.acadia-imap__star-fg { fill: var(--aim-gold); }

/* The photo bleeds left to the full width of the rail column.
   Everything in a stop is indented past the numeral square, which costs the
   image ~56px in a 420px column and leaves it looking shoved into the corner.
   Running it edge to edge reads as deliberate and gives the picture real size;
   the text stays indented so it still lines up under the title. */
.acadia-imap__photo-wrap {
	margin: 0;
	max-width: none;
	border: 1px solid var(--aim-rule);
	border-left: 0;
	border-right: 0;
	overflow: hidden;
}

.acadia-imap__photo {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	background: var(--aim-offwhite);
	transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.acadia-imap__photo-wrap:hover .acadia-imap__photo { transform: scale(1.035); }

.acadia-imap__blurb,
.acadia-imap__address {
	margin: 14px 0 0;
	max-width: 46ch;
	font-size: 15.5px;
	line-height: 1.62;
	color: var(--aim-muted);
}

.acadia-imap__address {
	font-family: var(--aim-mono);
	font-size: 12.5px;
	font-style: normal;
	line-height: 1.55;
}

/* Square terracotta CTA — the site's primary button, not a pill. */
.acadia-imap__cta {
	display: inline-block;
	margin: 16px 0 0;
	padding: 12px 22px;
	border: 0;
	border-radius: 0;
	background: var(--aim-accent);
	color: var(--aim-cream);
	font-family: var(--aim-sans);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.01em;
	text-decoration: none;
	transition: background-color 200ms ease, transform 200ms ease;
}

.acadia-imap__cta:hover,
.acadia-imap__cta:focus-visible {
	background: var(--acadia-terracotta-dk, #b03e23);
	color: var(--aim-cream);
	transform: translateY(-1px);
}

.acadia-imap__less {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 14px 0 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--aim-spruce);
	font-family: var(--aim-sans);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	cursor: pointer;
}

.acadia-imap__less::before {
	content: "\2212";
	display: grid;
	place-items: center;
	width: 16px;
	height: 16px;
	border: 1px solid currentColor;
	font-size: 14px;
	line-height: 1;
}

.acadia-imap__less:hover { text-decoration: underline; }

/* --- rail reveal -------------------------------------------------------- */

.acadia-imap__stop[data-reveal="pending"] {
	opacity: 0;
	transform: translateY(10px);
}

.acadia-imap__stop[data-reveal="in"] {
	opacity: 1;
	transform: none;
	transition: opacity 480ms ease var(--aim-delay, 0ms),
		transform 520ms cubic-bezier(0.22, 1, 0.36, 1) var(--aim-delay, 0ms);
}

/* ==========================================================================
   Map column
   ========================================================================== */

.acadia-imap__map-col { min-width: 0; }

.acadia-imap.is-sticky .acadia-imap__map {
	position: sticky;
	top: var(--aim-sticky-top);
}

.acadia-imap__map {
	position: relative;
	height: 100%;
	min-height: var(--aim-map-h);
	max-height: calc(100vh - 140px);
	border: 0;
	border-radius: var(--aim-radius);
	/* Clips the canvas and every DOM marker to the frame, so a pin near the
	   edge cannot spill outside the map. */
	overflow: hidden;
	background: var(--aim-offwhite);
	/* New stacking + containing context: markers are absolutely positioned by
	   the GL library and would otherwise escape to the nearest positioned
	   ancestor on the page. */
	isolation: isolate;
	contain: layout paint;
}

/* The element the GL library owns. It must stay empty in the markup —
   overlays are siblings, never children. */
.acadia-imap__canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.acadia-imap__map .maplibregl-map,
.acadia-imap__map .mapboxgl-map { font: inherit; }

/* Some themes set a global `canvas { max-width: 100% }`, which fights the GL
   canvas sizing and produces a stretched or clipped map. */
.acadia-imap__canvas .maplibregl-canvas,
.acadia-imap__canvas .mapboxgl-canvas {
	max-width: none;
	max-height: none;
}

.acadia-imap__map::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 5;
	background: linear-gradient(100deg, var(--aim-offwhite) 30%, #fff 50%, var(--aim-offwhite) 70%)
		0 0 / 300% 100%;
	animation: acadia-imap-shimmer 1.5s linear infinite;
	transition: opacity 420ms ease;
	pointer-events: none;
}

.acadia-imap__map[data-ready="true"]::after { opacity: 0; }

@keyframes acadia-imap-shimmer { to { background-position: -200% 0; } }

.acadia-imap__map-empty {
	position: absolute;
	inset: 0;
	z-index: 6;
	display: grid;
	place-items: center;
	margin: 0;
	padding: 24px;
	font-family: var(--aim-mono);
	font-size: 12.5px;
	color: var(--aim-muted);
	text-align: center;
}

.acadia-imap.is-map-unavailable .acadia-imap__map-col { display: none; }
.acadia-imap.is-map-unavailable .acadia-imap__grid { grid-template-columns: 1fr; }

/* --- recenter control --------------------------------------------------- */

.acadia-imap__recenter {
	position: absolute;
	z-index: 4;
	top: 12px;
	left: 50%;
	transform: translateX(-50%);
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 14px;
	border: 1px solid var(--aim-ink);
	border-radius: 0;
	background: var(--aim-cream);
	color: var(--aim-ink);
	font-family: var(--aim-sans);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	white-space: nowrap;
	cursor: pointer;
	animation: acadia-imap-drop 320ms cubic-bezier(0.22, 1, 0.36, 1);
	transition: background-color 180ms ease, color 180ms ease;
}

.acadia-imap__recenter[hidden] { display: none; }

.acadia-imap__recenter:hover {
	background: var(--aim-ink);
	color: var(--aim-cream);
}

.acadia-imap__recenter svg { width: 13px; height: 13px; fill: currentColor; }

@keyframes acadia-imap-drop {
	from { opacity: 0; transform: translate(-50%, -8px); }
	to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ==========================================================================
   Map markers — DOM overlays.

   The marker root is a zero-size anchor pinned to the coordinate. The tack and
   its label are positioned off that anchor, so the tail tip lands exactly on
   the point and the label overflows outward without shifting the anchor.
   ========================================================================== */

.acadia-imap-marker {
	position: relative;
	width: 0;
	height: 0;
	padding: 0;
	border: 0;
	background: none;
	font-family: var(--aim-sans);
	color: var(--aim-ink, #22411f);
	cursor: pointer;
}

.acadia-imap-marker:focus { outline: none; }

/* Tail tip on the coordinate: the tack points AT its point. */
.acadia-imap-marker__pin {
	position: absolute;
	left: 0;
	bottom: var(--aim-tail, 7px);
	transform: translateX(-50%);
	transform-origin: 50% 100%;
	transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.acadia-imap-marker__disc {
	--tack: var(--aim-pin, #22411f);
	--tack-ink: var(--aim-pin-ink, #f1eadb);
	position: relative;
	display: grid;
	place-items: center;
	min-width: var(--aim-marker, 34px);
	height: var(--aim-marker, 34px);
	padding: 0 4px;
	border-radius: 0;
	background: var(--tack);
	color: var(--tack-ink);
	font-family: var(--aim-mono);
	font-size: 12px;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
	line-height: 1;
	box-shadow: 0 1px 4px rgba(20, 38, 18, 0.34);
	transition: background-color 200ms ease, color 200ms ease,
		box-shadow 200ms ease;
}

.acadia-imap-marker__disc::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	width: 10px;
	height: var(--aim-tail, 7px);
	background: var(--tack);
	clip-path: polygon(50% 100%, 0 0, 100% 0);
	transform: translateX(-50%);
	transition: background-color 200ms ease;
}

.acadia-imap-marker--terminus .acadia-imap-marker__disc {
	--tack: var(--aim-accent, #cc4b33);
	--tack-ink: var(--aim-accent-ink, #f1eadb);
	padding: 0 11px;
	font-family: var(--aim-sans);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* --- label -------------------------------------------------------------- */

.acadia-imap-marker__label {
	position: absolute;
	bottom: 50%;
	left: calc(var(--aim-marker, 34px) / 2 + 9px);
	transform: translateY(50%);
	width: max-content;
	max-width: 15ch;
	text-align: left;
	pointer-events: none;
	/* Halo instead of a plate: legible over any basemap colour without boxing
	   in the map. */
	text-shadow: 0 0 3px var(--aim-cream), 0 0 3px var(--aim-cream),
		0 0 6px var(--aim-cream), 0 0 9px var(--aim-cream);
	transition: opacity 200ms ease;
}

.acadia-imap-marker__name {
	display: block;
	font-family: var(--aim-serif);
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--aim-ink);
}

.acadia-imap-marker__cat {
	display: block;
	margin-top: 1px;
	font-family: var(--aim-mono);
	font-size: 11px;
	font-weight: 400;
	letter-spacing: 0.02em;
	line-height: 1.25;
	color: var(--aim-muted);
}

.acadia-imap-marker[data-flip="true"] .acadia-imap-marker__label {
	left: auto;
	right: calc(var(--aim-marker, 34px) / 2 + 9px);
	text-align: right;
}

/* Collision outcomes, set by view.js. */
.acadia-imap-marker[data-label="false"] .acadia-imap-marker__label {
	opacity: 0;
	visibility: hidden;
}

.acadia-imap-marker[data-min="true"] .acadia-imap-marker__disc {
	min-width: 12px;
	width: 12px;
	height: 12px;
	padding: 0;
	font-size: 0;
}

.acadia-imap-marker[data-min="true"] .acadia-imap-marker__disc::after { opacity: 0; }

/* --- hover / active ----------------------------------------------------- */

.acadia-imap-marker:hover .acadia-imap-marker__pin { transform: translateX(-50%) scale(1.08); }

.acadia-imap-marker[data-active="true"] .acadia-imap-marker__pin {
	transform: translateX(-50%) scale(1.14);
}

/* Active inverts to cream on a forest keyline, rather than changing shape. */
.acadia-imap-marker[data-active="true"] .acadia-imap-marker__disc {
	--tack: var(--aim-cream);
	--tack-ink: var(--aim-pin);
	box-shadow: inset 0 0 0 2px var(--aim-pin), 0 3px 10px rgba(20, 38, 18, 0.34);
}

.acadia-imap-marker--terminus[data-active="true"] .acadia-imap-marker__disc {
	--tack-ink: var(--aim-accent);
	box-shadow: inset 0 0 0 2px var(--aim-accent), 0 3px 10px rgba(20, 38, 18, 0.34);
}

/* Soft ring that breathes once focus lands, so the eye finds the active stop. */
.acadia-imap-marker[data-active="true"] .acadia-imap-marker__pin::before {
	content: "";
	position: absolute;
	inset: -8px;
	border: 1px solid var(--aim-spruce);
	opacity: 0;
	animation: acadia-imap-pulse 1.8s ease-out infinite;
	pointer-events: none;
}

@keyframes acadia-imap-pulse {
	0%   { opacity: 0.55; transform: scale(0.86); }
	70%  { opacity: 0;    transform: scale(1.18); }
	100% { opacity: 0;    transform: scale(1.18); }
}

/* Staggered entrance as the map finishes loading. */
.acadia-imap-marker[data-enter="1"] .acadia-imap-marker__pin {
	animation: acadia-imap-tack 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
	animation-delay: var(--aim-delay, 0ms);
}

@keyframes acadia-imap-tack {
	from { opacity: 0; transform: translateX(-50%) translateY(-12px) scale(0.82); }
	to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.acadia-imap-marker:focus-visible .acadia-imap-marker__disc {
	box-shadow: inset 0 0 0 2px var(--aim-cream), 0 0 0 3px var(--aim-spruce);
}

/* Keep the active marker and the terminus above their neighbours. */
.maplibregl-marker,
.mapboxgl-marker { z-index: 1; }

.maplibregl-marker:has(.acadia-imap-marker--terminus),
.mapboxgl-marker:has(.acadia-imap-marker--terminus) { z-index: 2; }

.maplibregl-marker:has(.acadia-imap-marker[data-active="true"]),
.mapboxgl-marker:has(.acadia-imap-marker[data-active="true"]) { z-index: 3; }

.maplibregl-marker:has(.acadia-imap-marker:focus-visible),
.mapboxgl-marker:has(.acadia-imap-marker:focus-visible) { z-index: 4; }

/* --- GL controls -------------------------------------------------------- */

.acadia-imap__map .maplibregl-ctrl-group,
.acadia-imap__map .mapboxgl-ctrl-group {
	border: 1px solid var(--aim-rule);
	border-radius: 0;
	background: var(--aim-cream);
	box-shadow: 0 1px 4px rgba(20, 38, 18, 0.2);
}

.acadia-imap__map .maplibregl-ctrl-group button,
.acadia-imap__map .mapboxgl-ctrl-group button {
	width: 30px;
	height: 30px;
	background-color: transparent;
}

.acadia-imap__map .maplibregl-ctrl-group button + button,
.acadia-imap__map .mapboxgl-ctrl-group button + button {
	border-top: 1px solid var(--aim-rule);
}

.acadia-imap__map .maplibregl-ctrl-attrib,
.acadia-imap__map .mapboxgl-ctrl-attrib {
	font-family: var(--aim-sans);
	font-size: 10px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
	.acadia-imap {
		padding: 20px 20px 48px;
		--aim-disc: 36px;
		--aim-marker: 30px;
	}

	.acadia-imap__grid { grid-template-columns: 1fr; }

	/* Map first and stuck to the viewport, so it stays visible while the
	   itinerary scrolls under it. The column divider becomes a rule under
	   the map. */
	.acadia-imap .acadia-imap__map-col,
	.acadia-imap.is-map-left .acadia-imap__map-col {
		order: -1;
		border-left: 0;
		border-right: 0;
		border-bottom: 1px solid rgba(84, 89, 90, 0.22);
	}

	.acadia-imap.is-sticky .acadia-imap__map-col { z-index: 6; }

	.acadia-imap__map,
	.acadia-imap.is-sticky .acadia-imap__map {
		height: var(--aim-map-h-mob);
		min-height: 0;
		max-height: none;
		top: 0;
	}

	.acadia-imap__head {
		align-items: flex-start;
		flex-direction: column;
		gap: 14px;
		padding: 18px 20px 14px;
	}
	.acadia-imap__tab { padding: 8px 12px; font-size: 10px; letter-spacing: 0.1em; }
	.acadia-imap__heading { font-size: 22px; }
	.acadia-imap__list-col { padding: 4px 5px 18px; }
	.acadia-imap__title { font-size: 17px; }
	.acadia-imap-marker__label { max-width: 11ch; }
	.acadia-imap-marker__name { font-size: 13px; }
	.acadia-imap-marker__cat { font-size: 10px; }
	.acadia-imap__cta { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
	.acadia-imap *,
	.acadia-imap-marker__pin,
	.acadia-imap-marker__disc { transition-duration: 1ms !important; }

	.acadia-imap__map::after,
	.acadia-imap__recenter,
	.acadia-imap-marker[data-enter="1"] .acadia-imap-marker__pin,
	.acadia-imap-marker[data-active="true"] .acadia-imap-marker__pin::before {
		animation: none;
	}

	.acadia-imap__stop[data-reveal="pending"] { opacity: 1; transform: none; }
	.acadia-imap__detail-inner > * { opacity: 1; transform: none; }
}

/* ==========================================================================
   ⚠️  ATTRIBUTION OVERRIDE — REQUESTED, NON-COMPLIANT, SAFE TO DELETE
   --------------------------------------------------------------------------
   Hides the Mapbox wordmark and the credit line. This is deliberate and was
   asked for, but be clear about what it is:

     · The Mapbox wordmark is required by the Mapbox Terms of Service. Hiding
       it without a written logo-removal agreement is a breach, and the
       remedy is against the account holder (the pk. token's owner).
     · "© OpenStreetMap" is required by the ODbL licence on the map DATA, not
       by Mapbox. That obligation follows the data to any provider, so it is
       not resolved by switching vendors.

   The compliant way to get a clean map is to drop the Mapbox token, which
   makes the block fall back to MapLibre + OpenFreeMap — no wordmark at all.
   See inc/itinerary-map.php.

   Delete this whole block to restore attribution.
   ========================================================================== */

.acadia-imap__map .mapboxgl-ctrl-logo,
.acadia-imap__map .maplibregl-ctrl-logo,
.acadia-imap__map .mapboxgl-ctrl-attrib,
.acadia-imap__map .maplibregl-ctrl-attrib {
	display: none !important;
}

/* The attribution normally reserves the bottom-right corner; without it the
   zoom control can sit lower. */
.acadia-imap__map .mapboxgl-ctrl-bottom-right,
.acadia-imap__map .maplibregl-ctrl-bottom-right { bottom: 4px; }

/* "Flush" placement — the map sits inside a prose section that already owns
   the space above it, so the block keeps the design's 34px lead-in and closes
   with the section's own 20px rather than its standalone 74px tail. Opt-in via
   a class on the block, so /tours/ and the tour pages keep their spacing. */
.acadia-imap.is-flush { padding-bottom: 20px; }
