/* Shared foundation for every design: reset, map surface, legend colour tokens, popup skeleton. */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:root {
  /* Legend colours: set at runtime by the engine from the visitor's choices. */
  --c-open: #42E334; --c-open-deep: #268419;
  --c-cond: #F3A712; --c-cond-deep: #96670B;
  --c-barrier: #EF3340; --c-barrier-deep: #A7232C;
  --c-water: #9EDCF4;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}

.map { position: fixed; inset: 0; }
.maplibregl-canvas:focus-visible { outline: none; }

/* Stacked proportion bar used by all designs: open | conditional | barrier */
.bar { display: flex; overflow: hidden; }
.bar > i { display: block; height: 100%; flex: none; transform-origin: left; transition: width 600ms var(--ease-out); }
.bar > .b-open { background: var(--c-open); }
.bar > .b-cond { background: var(--c-cond); }
.bar > .b-barrier { background: var(--c-barrier); }

/* Popups: skeleton only; designs set colours and type. */
.wc-popup .maplibregl-popup-content { padding: 11px 13px 12px; border-radius: 10px; }
.wc-popup strong { display: block; margin-bottom: 3px; }
.wc-popup span { display: block; }

/* Value change: a quick blur-and-settle so numbers read as updated rather than swapped. */
.is-updating { animation: settle 360ms var(--ease-out); }
@keyframes settle { from { opacity: .35; filter: blur(3px); } }

@media (prefers-reduced-motion: reduce) {
  .bar > i { transition: none; }
  .is-updating { animation: none; }
}
