/* Map additions for the signature map (home): place photographs in cards, the stop-by-stop stepper, clusters.
   The base map, route trace, numbered stops and markers stay in the legacy map sheet until it is migrated. */
@layer components {
/* Photograph at the head of a place card. */
.mp-map-card__photo { margin: calc(var(--s-6) * -1) calc(var(--s-6) * -1) var(--s-1); aspect-ratio: 3 / 2; overflow: hidden; background: var(--c-canvas-alt); }
.mp-map-popup .mp-map-card__photo { margin: 0 0 var(--s-1); }
.mp-map-card__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Stop by stop */
.mp-map-stepper { display: grid; grid-template-columns: var(--h-touch) minmax(0, 1fr) var(--h-touch); align-items: center; gap: var(--s-3); margin-block-start: var(--s-2); padding-block-start: var(--s-4); border-block-start: 1px solid var(--c-rule); }
.mp-map-stepper__button { display: grid; place-items: center; width: var(--h-touch); height: var(--h-touch); padding: 0; border: 1px solid var(--c-rule-strong); border-radius: 50%; background: var(--c-surface); color: var(--c-ink); font-size: 1.125rem; line-height: 1; cursor: pointer; transition: transform var(--dur-press) var(--ease-out), border-color var(--dur-micro) var(--ease); }
.mp-map-stepper__button:active:not(:disabled) { transform: scale(0.94); }
.mp-map-stepper__button:disabled { opacity: 0.4; cursor: default; }
.mp-map-stepper__button:focus-visible { outline: 2px solid var(--c-signal-text); outline-offset: 2px; }
.mp-map-stepper__status { margin: 0; text-align: center; font-size: var(--fs-meta); line-height: 1.4; color: var(--c-ink); font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) { .mp-map-stepper__button:hover:not(:disabled) { border-color: var(--c-ink); } }

/* Clusters: a numbered disc where markers would touch at country zoom. */
.mp-map-marker.is-clustered { display: none; }
.mp-map-cluster { display: grid; place-items: center; min-width: 2.75rem; height: 2.75rem; padding: 0 var(--s-2); border: 2px solid var(--c-surface); border-radius: 999px; background: var(--c-deep); color: var(--c-on-deep); font: 600 var(--fs-meta) / 1 var(--font-ui); font-variant-numeric: tabular-nums; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-deep) 22%, transparent); cursor: pointer; transition: transform var(--dur-press) var(--ease-out); }
.mp-map-cluster:active { transform: scale(0.94); }
.mp-map-cluster:focus-visible { outline: 2px solid var(--c-glow); outline-offset: 3px; }
/* MapLibre's own "Ctrl + scroll" hint: on a night ground so it reads at AA over any part of the map. */
/* Touch targets (final audit, 22 Nov 2026): MapLibre's own sheet is loaded unlayered by the map script and set the zoom
   buttons to 29px and the attribution toggle to 24px, beating every layer; a layered !important is the only override. */
.mp-map .maplibregl-ctrl-group button { width: var(--h-touch) !important; height: var(--h-touch) !important; }
@media (pointer: coarse) { .mp-map .maplibregl-ctrl-attrib-button { width: var(--h-touch) !important; height: var(--h-touch) !important; background-position: center !important; } }
.mp-map :is(.maplibregl-cooperative-gesture-screen) { background: color-mix(in srgb, var(--c-night) 86%, transparent); color: var(--c-on-deep); font-family: var(--font-ui); }
@media (prefers-reduced-motion: reduce) { .mp-map-stepper__button, .mp-map-cluster { transition: none; } .mp-map-stepper__button:active:not(:disabled), .mp-map-cluster:active { transform: none; } }
}
