/* The council map (council-map.js): Leaflet on OpenStreetMap tiles, restyled to sit in the page. Leaflet's own stylesheet loads first. */
.cmap-host { --cmap-ease: cubic-bezier(.23, 1, .32, 1);
             position: relative; isolation: isolate; width: 100%; height: clamp(440px, 70vh, 760px); overflow: hidden;
             border-radius: 18px; border: 1px solid var(--sea-line); background: var(--sea-2);
             box-shadow: 0 1px 2px rgba(29, 35, 39, .06), 0 18px 34px -22px rgba(36, 56, 68, .5); }
@supports (height: 1dvh) { .cmap-host { height: clamp(440px, 70dvh, 760px); } }
@media (min-width: 900px) { .cmap-host { height: clamp(520px, 74vh, 720px); } }
.cmap-fail { margin: 0; padding: 40px 24px; text-align: center; color: var(--text-dim); font: 500 14px/1.5 var(--font); }

/* The container shows through any hairline gap between tiles, so it carries the colour of OpenStreetMap's sea after the tile filter below. */
.cmap-host { --cmap-sea: #aed0da; }
:root[data-theme="dark"] .cmap-host { --cmap-sea: #859fa6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cmap-host { --cmap-sea: #859fa6; } }
.cmap { position: absolute; inset: 0; background: var(--cmap-sea); font-family: var(--font); user-select: none; -webkit-user-select: none; }
.cmap.leaflet-container { font-family: var(--font); font-size: 12px; line-height: 1.4; outline: none; }
.cmap.leaflet-container:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
/* One finger must scroll the page (Leaflet would otherwise claim every touch), two fingers move and zoom the map. */
.cmap-host .leaflet-container.leaflet-touch-drag.leaflet-touch-zoom { touch-action: pan-x pan-y; }

/* Tiles are light only; in dark mode they are dimmed and cooled a little instead of swapping providers. */
.cmap .leaflet-tile-pane { filter: saturate(.86) contrast(.98); }
:root[data-theme="dark"] .cmap .leaflet-tile-pane { filter: brightness(.75) contrast(1.05) saturate(.8); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cmap .leaflet-tile-pane { filter: brightness(.75) contrast(1.05) saturate(.8); } }

/* Dots */
.cmap .cmap-dot { cursor: pointer; outline: none; transition: stroke-width 150ms var(--cmap-ease), stroke 150ms var(--cmap-ease); }
.cmap .cmap-dot:hover, .cmap .cmap-dot:focus-visible { stroke: var(--ink); stroke-width: 2px; }
.cmap .cmap-dot.on { stroke: var(--ink); stroke-width: 2.6px; }
.cmap .cmap-dot:focus-visible { stroke-width: 3px; }

/* Names: atolls in capitals beside the chain, places beside their dot */
.cmap .cmap-atoll, .cmap .cmap-place { pointer-events: none; }
.cmap .cmap-atoll span, .cmap .cmap-place span { position: absolute; top: 0; transform: translateY(-50%); white-space: nowrap; line-height: 1;
  text-shadow: 0 0 2px var(--map-halo), 0 0 2px var(--map-halo), 0 0 5px var(--map-halo), 0 0 5px var(--map-halo); animation: cmap-in 220ms var(--cmap-ease) backwards; }
.cmap .cmap-atoll span { font: 600 10.5px/1 var(--font); letter-spacing: .09em; text-transform: uppercase; color: color-mix(in srgb, var(--text-dim) 88%, var(--ink)); }
.cmap .cmap-atoll.east span { left: 12px; }
.cmap .cmap-atoll.west span { right: 12px; }
.cmap .cmap-place span { left: 11px; font: 600 12px/1 var(--font); color: var(--ink); }
.cmap .cmap-place.is-city span { left: 14px; font-size: 13px; font-weight: 650; }
.cmap .cmap-place.on span { left: 14px; font-size: 13px; font-weight: 700; }
@keyframes cmap-in { from { opacity: 0; } }

/* Hover and focus card */
.cmap .leaflet-tooltip.cmap-tip { background: var(--panel); color: #e6f4f1; border: 0; border-radius: 10px; padding: 8px 11px; font: 400 12.5px/1.35 var(--font);
  white-space: normal; max-width: 200px; box-shadow: 0 10px 22px -8px rgba(15, 28, 36, .5); }
.cmap .leaflet-tooltip.cmap-tip div { display: grid; gap: 2px; }
.cmap .leaflet-tooltip.cmap-tip b { color: #fff; font: 600 14px var(--display); }
.cmap .leaflet-tooltip.cmap-tip span { color: #9fc2bb; }
.cmap .leaflet-tooltip-top.cmap-tip::before { border-top-color: var(--panel); }
.cmap .leaflet-tooltip-bottom.cmap-tip::before { border-bottom-color: var(--panel); }

/* Controls */
.cmap-ctl { position: absolute; top: 12px; right: 12px; z-index: 1000; display: grid; gap: 8px; }
.cmap-group { display: grid; border-radius: 12px; overflow: hidden; background: var(--surface); border: 1px solid var(--sea-line);
  box-shadow: 0 1px 2px rgba(29, 35, 39, .08), 0 8px 18px -10px rgba(36, 56, 68, .45); }
.cmap-btn { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; margin: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); cursor: pointer; box-shadow: none;
  transition: background-color 150ms var(--cmap-ease), color 150ms var(--cmap-ease), transform 150ms var(--cmap-ease); }
.cmap-btn + .cmap-btn { border-top: 1px solid var(--sea-line); }
.cmap-btn:hover { background: var(--surface-2); }
.cmap-btn:active { transform: scale(.94); }
.cmap-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.cmap-btn:disabled { color: var(--text-dim); opacity: .45; cursor: default; transform: none; background: transparent; }
@media (pointer: coarse) { .cmap-btn { width: 44px; height: 44px; } }

/* The short hint ("Use two fingers to move the map") */
.cmap-hint { position: absolute; left: 50%; bottom: 40px; z-index: 1000; max-width: calc(100% - 32px); padding: 9px 15px; border-radius: 999px; text-align: center;
  background: color-mix(in srgb, var(--panel) 90%, transparent); color: #eaf4f2; font: 500 12.5px/1.3 var(--font); pointer-events: none;
  opacity: 0; transform: translate(-50%, 6px); transition: opacity 200ms var(--cmap-ease), transform 200ms var(--cmap-ease); }
.cmap-hint.on { opacity: 1; transform: translate(-50%, 0); }

/* Credit line */
.cmap .leaflet-control-attribution { margin: 0; padding: 3px 9px; border-radius: 10px 0 0 0; background: color-mix(in srgb, var(--surface) 82%, transparent); color: var(--text-dim); font: 400 10.5px/1.4 var(--font); }
.cmap .leaflet-control-attribution a { color: var(--accent-dim); text-decoration: none; }
.cmap .leaflet-control-attribution a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .cmap-host *, .cmap-host *::before, .cmap-host *::after { transition-duration: 0ms !important; animation: none !important; }
}
