/* ArcheMap (arche-map.js): the base map, its pieces and its colour and style templates.
   Paths keep their stroke width while zooming (non-scaling stroke). --am-k is the number of map units one screen pixel covers at the current zoom:
   dots, labels and the pin multiply their size by it so they keep their size on screen.
   TEMPLATES: every colour and line weight a map uses is a variable below. The default template is "atlas". Another one is chosen in the BACKOFFICE
   (arche-backoffice/map_style.json, then publish_map_style.py): it is written on <html data-arche-map-theme> at build time and applies to all maps of the site.
   Visitors are shown no selector.
   Colours that carry data (the over/under scale, the region palette) are not part of a template: they mean something. */
:root,[data-arche-map-theme="atlas"]{
  --am-terr-solid:#e0a21a;
  --am-sea:#eaf2f6;--am-land:#eef1ee;--am-border:var(--ds-action-text);--am-bw:1;--am-in:var(--ds-action);--am-hover:var(--ds-ink);--am-home:var(--ds-clay);
  --am-terr-fill:rgba(224,162,26,.58);--am-terr-line:#8a6000;--am-ghost:#8a6000;--am-pin:#a21942;
  --am-ctx-fill:#eef2f0;--am-ctx-line:#d3dcd8;--am-mini-bg:#eaf2f6;--am-frame:var(--ds-action);--am-vp:rgba(216,237,112,.18);
  --am-dot:#8aa19b;--am-focus:#eb6834;--am-ink:var(--ds-ink);--am-halo:var(--ds-action-text);--am-hatch-a:#f3f3ee;--am-hatch-b:#c9d0cc;--am-quiet:#dfe8e6;
}
[data-arche-map-theme="paper"]{
  --am-terr-solid:#b07028;
  --am-sea:#f3ead7;--am-land:#fbf6ea;--am-border:#d9c9a6;--am-bw:1.15;--am-in:#5a3b16;--am-hover:#3a2410;--am-home:#a4262c;
  --am-terr-fill:rgba(176,112,40,.5);--am-terr-line:#6e4310;--am-ghost:#6e4310;--am-pin:#a4262c;
  --am-ctx-fill:#fbf6ea;--am-ctx-line:#d9c9a6;--am-mini-bg:#f3ead7;--am-frame:#4a3516;--am-vp:rgba(176,112,40,.16);
  --am-dot:#a58f66;--am-focus:#b4482a;--am-ink:#3a2410;--am-halo:#fbf6ea;--am-hatch-a:#fbf6ea;--am-hatch-b:#d9c9a6;--am-quiet:#efe4c8;
}
[data-arche-map-theme="night"]{
  --am-terr-solid:#ffc440;
  --am-sea:#0e1a26;--am-land:#1c2b3a;--am-border:#2d4256;--am-bw:.85;--am-in:#9cc7e6;--am-hover:var(--ds-action-text);--am-home:#ff5c93;
  --am-terr-fill:rgba(255,196,64,.5);--am-terr-line:#ffd56b;--am-ghost:#ffd56b;--am-pin:#ff5c93;
  --am-ctx-fill:#1c2b3a;--am-ctx-line:#2d4256;--am-mini-bg:#0e1a26;--am-frame:#9cc7e6;--am-vp:rgba(156,199,230,.18);
  --am-dot:#6f8ca3;--am-focus:#ff8a4c;--am-ink:#e6eef5;--am-halo:#0e1a26;--am-hatch-a:#1c2b3a;--am-hatch-b:#3a5167;--am-quiet:#27384a;
}
[data-arche-map-theme="mono"]{
  --am-terr-solid:#6a6a6a;
  --am-sea:var(--ds-action-text);--am-land:#eeeeee;--am-border:#9a9a9a;--am-bw:.8;--am-in:#000000;--am-hover:#000000;--am-home:#000000;
  --am-terr-fill:rgba(0,0,0,.28);--am-terr-line:#000000;--am-ghost:#000000;--am-pin:#000000;
  --am-ctx-fill:#eeeeee;--am-ctx-line:#9a9a9a;--am-mini-bg:var(--ds-action-text);--am-frame:#000000;--am-vp:rgba(0,0,0,.12);
  --am-dot:#6a6a6a;--am-focus:#000000;--am-ink:#000000;--am-halo:var(--ds-action-text);--am-hatch-a:var(--ds-action-text);--am-hatch-b:#8a8a8a;--am-quiet:#dcdcdc;
}
[data-arche-map-theme="contrast"]{
  --am-terr-solid:#ffff00;
  --am-sea:#000000;--am-land:#2a2a2a;--am-border:var(--ds-action-text);--am-bw:1.3;--am-in:#ffff00;--am-hover:#00ffff;--am-home:#ff00ff;
  --am-terr-fill:rgba(255,255,0,.55);--am-terr-line:#ffff00;--am-ghost:#ffff00;--am-pin:#ff00ff;
  --am-ctx-fill:#2a2a2a;--am-ctx-line:var(--ds-action-text);--am-mini-bg:#000000;--am-frame:var(--ds-action-text);--am-vp:rgba(255,255,255,.25);
  --am-dot:#bdbdbd;--am-focus:#00ffff;--am-ink:var(--ds-action-text);--am-halo:#000000;--am-hatch-a:#2a2a2a;--am-hatch-b:var(--ds-action-text);--am-quiet:#444444;
}

.am-stage{display:grid;grid-template-columns:minmax(0,2.2fr) minmax(260px,1fr);gap:14px;margin:8px 0 0;align-items:start}
.am-map{position:relative;min-width:0}.am-host{position:relative}.am-host--maplibre{height:clamp(290px,40vw,520px);background:var(--ds-surface-soft)}.am-host--maplibre .maplibregl-canvas{outline:none}.am-host--maplibre .maplibregl-ctrl-attrib{font-size:var(--ds-fs-label)}
.am-svg{display:block;width:100%;height:var(--am-h,min(560px,calc(100vh - 330px)));min-height:300px;background:var(--am-sea);border:1px solid var(--line);touch-action:pan-y}
.am-svg path{vector-effect:non-scaling-stroke}
.am-c:not([fill]){fill:var(--am-land)}.am-c{stroke:var(--am-border);stroke-width:calc(.5px * var(--am-bw))}.am-c:hover{stroke:var(--am-hover);stroke-width:1.4px}
.am-c--in{stroke:var(--am-in);stroke-width:calc(1.1px * var(--am-bw))}
.am-ghost{fill:none;stroke:var(--am-ghost);stroke-width:.6px;stroke-dasharray:3 2;opacity:.55}
.am-active{fill:var(--am-terr-fill);stroke:var(--am-terr-line);stroke-width:calc(1px * var(--am-bw))}
.am-hit{fill:var(--am-terr-fill);stroke:var(--am-terr-line);stroke-width:calc(1px * var(--am-bw))}
.am-pin{r:calc(5px * var(--am-k,1));fill:var(--am-pin);stroke:var(--am-border);stroke-width:1.5px}
.am-terr{transition:fill-opacity .15s;stroke-width:calc(1.3px * var(--am-bw))}.am-terr.is-hot{stroke-width:3px;fill-opacity:.8}
.am-home{stroke:var(--am-home);stroke-linejoin:round}
.am-ctx{fill:var(--am-ctx-fill);stroke:var(--am-ctx-line);stroke-width:calc(.6px * var(--am-bw))}
.am-shape{cursor:default}.am-shape[data-click]{cursor:pointer}
.am-dot:not([fill]){fill:var(--am-dot)}.am-dot{stroke:var(--am-border);cursor:pointer}.am-dot--focus{fill:var(--am-focus)}
.am-label{font-size:calc(var(--fs,11) * 1px * var(--am-k,1));font-weight:700;font-family:system-ui,sans-serif;fill:var(--am-ink);stroke:var(--am-halo);stroke-width:calc(3px * var(--am-k,1));paint-order:stroke;pointer-events:none}
.am-arrow{vector-effect:none;stroke-linecap:round}
.am-extent{position:absolute;right:10px;top:10px;display:flex;background:var(--ds-surface);border:1px solid var(--am-frame)}.am-extent button{min-height:36px;padding:9px 12px;border:0;background:var(--ds-surface);color:var(--am-frame);font:700 13px/1 system-ui,sans-serif;cursor:pointer}.am-extent button+button{border-left:1px solid var(--am-frame)}.am-extent button[aria-pressed=true]{background:var(--am-frame);color:var(--ds-action-text)}.am-extent button:focus-visible{outline:3px solid #d8ed70;outline-offset:-3px}
.am-mini{position:absolute;left:10px;bottom:10px;width:22%;min-width:110px;max-width:240px;height:auto;border:1px solid var(--am-frame);background:var(--am-mini-bg);cursor:crosshair;touch-action:none}.am-mini:focus-visible{outline:2px solid #d8ed70;outline-offset:2px}.am-mini path{vector-effect:non-scaling-stroke}
.am-vp{fill:var(--am-vp);stroke:var(--am-frame);stroke-width:2px;vector-effect:non-scaling-stroke}
.am-style{position:absolute;right:10px;bottom:10px;display:flex;align-items:center;gap:6px;padding:3px 6px;background:rgba(255,255,255,.92);border:1px solid var(--ds-action);font:700 12px system-ui,sans-serif;color:var(--ds-action)}.am-style select{font:inherit;border:0;background:transparent;color:inherit;cursor:pointer;max-width:9em}.am-style:focus-within{outline:3px solid #d8ed70}
.am-read{margin:6px 2px 0}
.am-side{display:grid;gap:10px}.am-card{border:1px solid var(--line);background:var(--ds-surface);padding:14px 16px}.am-card h3{margin:0 0 4px;font-size:var(--ds-fs-body)}.am-card p{margin:5px 0;font-size:var(--ds-fs-control);line-height:1.45;color:var(--muted)}.am-card .am-big{font:400 30px/1.1 Georgia,serif;color:var(--ds-action)}
.am-clocks{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:12px 0 0}
.am-clock{border:1px solid var(--line);background:var(--ds-surface);padding:10px 14px;margin-top:10px}.am-clocks .am-clock{margin-top:0}.am-clock--past{border-top:4px solid #e0a21a}.am-clock--now{border-top:4px solid var(--ds-link)}
.am-clock__head{display:flex;flex-wrap:wrap;gap:2px 10px;align-items:baseline}.am-clock__head b{font-size:var(--ds-fs-body)}.am-clock__head span{font-size:var(--ds-fs-small);color:var(--muted)}.am-clock__val{margin-left:auto;font:400 22px/1 Georgia,serif;color:var(--ds-action)}
.am-clock__ctl{display:flex;align-items:center;gap:10px;margin-top:6px}.am-range{flex:1;min-height:44px;accent-color:var(--ds-link);cursor:ew-resize;touch-action:manipulation}.am-range::-webkit-slider-thumb{width:20px;height:20px;cursor:grab}.am-range:active::-webkit-slider-thumb{cursor:grabbing}.am-range::-moz-range-thumb{width:18px;height:18px;cursor:grab}.am-play{min-width:42px;min-height:36px}
.am-clock--past .am-range{accent-color:#c88a00}
.am-legend{margin-top:10px}.am-key{display:inline-block;width:18px;height:12px;border:1px solid #98a9a4;vertical-align:-1px}.am-key--amber{background:var(--am-terr-fill);border-color:var(--am-terr-line)}.am-key--hatch{background:repeating-linear-gradient(45deg,var(--am-hatch-a) 0 3px,var(--am-hatch-b) 3px 5px)}.am-key--grey{background:var(--am-quiet)}.am-key--in{background:var(--ds-surface);border:2px solid var(--am-in)}
@media(max-width:900px){.am-stage{grid-template-columns:minmax(0,1fr)}.am-clocks{grid-template-columns:minmax(0,1fr)}}
.am-svg.is-all .am-l-ghost,.am-svg.is-all .am-l-territory{display:none}.am-svg:not(.is-all) .am-l-all{display:none}
