/* map-buttons.css — a small stack of layer badges ON a page map (2026-11-18; small on every screen 2026-11-19).

   George, on seeing the first version (a 310 px column of named pills): "make the buttons small". The stack is now
   one small round badge per switch on every screen, the letter-badge idea of the /sensors map's phone buttons
   (css/sensors.css .sn-filters / .sn-kind), under neutral names so other page maps can use it: /bigsur is the
   first. /sensors keeps its own rules; nothing here touches them.

     <div class="mapbtns">
       <button type="button" class="mapbtn" aria-pressed="true" aria-label="Mile markers on Highway 1" style="--mb-c:#fafaf9">
         <span aria-hidden="true">58</span><span>Mile markers</span>
       </button>
       ...
     </div>

   A button is two spans: the first is the badge (a letter or number), the second is the name.
     on   the badge is filled with the button's own colour (--mb-c, the colour of its things on the map)
     off  (aria-pressed="false") dark, outlined, the letter struck through
     a button that opens something instead of switching a layer has no aria-pressed and class mapbtn--act
   The name is a small label beside the badge: shown while the pointer is on it, while it has keyboard focus, and
   for a moment after a press (the page adds class mapbtn--say and takes it off on animationend; that is how a
   touch screen gets the name). The button's aria-label carries the name always.
   Size: the badge is 2 rem; with a mouse the button is no bigger than its badge, so the stack is about as wide
   as the map's zoom buttons. On a touch screen each button is a 44 px square around the same badge.
   The stack stands on the map's left edge; class mapbtns--phone-right moves it to the right edge on a phone
   (narrow, or wide and short), under whatever sits in the top right corner, for a map whose open water is on the
   left. A short map (a phone on its side) gets two columns. */
.mapbtns { position: absolute; z-index: 5; left: 0.5rem; top: 0.5rem; max-height: calc(100% - 1rem);
  display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start; gap: 0.25rem; box-sizing: border-box; }
.mapbtns:empty { display: none; }
.mapbtn { position: relative; display: flex; align-items: center; justify-content: center; flex: none; box-sizing: border-box;
  width: 2rem; height: 2rem; margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer;
  font: 700 0.75rem/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: 0; white-space: nowrap;
  color: #0c0a09; -webkit-tap-highlight-color: transparent; }
/* the badge */
.mapbtn > span:first-child { display: flex; align-items: center; justify-content: center; flex: none; box-sizing: border-box;
  width: 2rem; height: 2rem; border-radius: 50%; font-size: 0.75rem; line-height: 1; color: #0c0a09;
  margin: 0 !important; background: var(--mb-c, #38bdf8); border: 2px solid #0c0a09; box-shadow: 0 1px 4px rgba(0,0,0,.55); }
.mapbtn[aria-pressed="false"] > span:first-child { color: #a8a29e; border: 1px solid rgba(255,255,255,.45);
  background: linear-gradient(to top right, transparent 47%, #a8a29e 47%, #a8a29e 53%, transparent 53%), #0c0a09; }
.mapbtn--act > span:first-child { color: var(--mb-c, #7dd3fc); background: #0c0a09; border: 2px solid var(--mb-c, #7dd3fc); }
.mapbtn:focus-visible { outline: none; }
.mapbtn:focus-visible > span:first-child { outline: 2px solid #f5f5f4; outline-offset: 2px; }
.mapbtn:disabled { opacity: 0.5; cursor: default; }
/* the name: beside the badge, only when asked for */
.mapbtn > span:last-child { display: none; position: absolute; left: calc(100% + 0.375rem); top: 50%; z-index: 1; margin-top: -0.75rem;
  padding: 0 0.5rem; font-weight: 700; line-height: 1.5rem; border-radius: 0.375rem; color: #f5f5f4; background: #0c0a09;
  border: 1px solid rgba(255,255,255,.3); box-shadow: 0 2px 8px rgba(0,0,0,.5); pointer-events: none; }
.mapbtn--say > span:last-child { display: block; opacity: 0; animation: mapbtn-say 1.8s ease-out; }
.mapbtn:focus-visible > span:last-child { display: block; opacity: 1; animation: none; }
@media (hover: hover) { .mapbtn:hover > span:last-child { display: block; opacity: 1; animation: none; } }
/* a touch screen: a 44 px square to tap, the same badge in its middle */
@media (pointer: coarse) {
  .mapbtns { gap: 0; left: 0.125rem; top: 0.125rem; }
  .mapbtn { width: 2.75rem; height: 2.75rem; }
}
@media (max-width: 759.98px), (max-height: 500px) {
  .mapbtns--phone-right { left: auto; right: 0.375rem; top: 3.75rem; max-height: calc(100% - 4rem); flex-wrap: wrap-reverse; }
  .mapbtns--phone-right .mapbtn > span:last-child { left: auto; right: calc(100% + 0.375rem); }
}
@media (max-width: 759.98px) and (pointer: coarse), (max-height: 500px) and (pointer: coarse) { .mapbtns--phone-right { right: 0.125rem; } }
/* a phone on its side: two columns, so the stack ends above the zoom buttons */
@media (max-height: 500px) { .mapbtns { max-height: calc(100% - 9.5rem); } .mapbtns--phone-right { max-height: calc(100% - 9.5rem); } }
@keyframes mapbtn-say { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mapbtn--say > span:last-child { animation-duration: 3s; animation-timing-function: step-end; } }
