/* Version 2 (MapLibre) on top of version 1's styles.css */
#map { position: absolute; inset: 0; background: #e6dfd2; }
.maplibregl-canvas { outline: none; }

/* My position (gps.js): version 1's dot, and a cone where the phone points */
.gps-marker { position: relative; width: 64px; height: 64px; pointer-events: none; }
.gps-dot {
  position: absolute; left: 25px; top: 25px; width: 14px; height: 14px; border-radius: 50%;
  background: #2a4f7c; border: 2.5px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); box-sizing: border-box;
}
.gps-cone { position: absolute; inset: 0; width: 64px; height: 64px; opacity: 0; transition: opacity 0.3s; }
.gps-marker.has-heading .gps-cone { opacity: 1; }


/* Place card (inspect.js), styled as version 1's Leaflet popup (styles.css .inspect-popup) */
.inspect-popup .maplibregl-popup-content {
  background: rgba(242, 237, 228, 0.96); border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  color: var(--ink); padding: 12px 26px 11px 16px; cursor: pointer;
  width: max-content; max-width: 250px;     /* its own width, not squeezed at the screen's edge */
  font-family: 'DM Mono', monospace; font-size: 11px; line-height: 1.5;
}
.inspect-popup.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: rgba(242, 237, 228, 0.96); }
.inspect-popup .maplibregl-popup-close-button {
  top: 2px; right: 2px; width: 24px; height: 24px; padding: 0; border-radius: 4px;
  font: 18px/24px Tahoma, Verdana, sans-serif; color: #757575; background: none;
}
.inspect-popup .maplibregl-popup-close-button:hover { color: #585858; background: none; }
/* The nearest place name and parish (names.js), above the title */
.inspect-popup .ip-place { font-size: 10px; opacity: 0.75; margin-bottom: 3px; }
.inspect-popup .ip-place b { font-weight: 500; }
.inspect-popup .ip-place span { opacity: 0.7; }
.inspect-popup .ip-former { margin-top: 5px; line-height: 1.4; font-style: italic; }
@media (pointer: coarse) {
  .inspect-popup .maplibregl-popup-close-button { top: 0; right: 0; width: 40px; height: 40px; font-size: 22px; line-height: 40px; }
  .inspect-popup .maplibregl-popup-content { padding-right: 36px; }
}




/* 3D: the compass by the scale bar (compass.js); hints above the panel (hint.js) */
.compass-btn { perspective: 90px; touch-action: none; cursor: grab; }
.compass-btn:active { cursor: grabbing; }
.compass-btn[hidden] { display: none; }
.compass-needle { width: 28px; height: 28px; transition: transform 0.05s linear; }
.map-hint {
  position: absolute; left: 50%; bottom: calc(var(--panel-h, 104px) + 84px); transform: translate(-50%, 6px);
  z-index: 1001; padding: 8px 14px; border-radius: 8px; max-width: min(90vw, 420px); text-align: center;
  font: 11px/1.45 'DM Mono', monospace; color: var(--ink); opacity: 0; transition: opacity 0.5s, transform 0.5s;
  pointer-events: none;
}
.map-hint.visible { opacity: 1; transform: translate(-50%, 0); }
.map-hint[hidden] { display: none; }

/* Typing on a phone (keyboard.js): the panel with the year field, or the
   layers sheet with the search field, stands on top of the keyboard */
.kb-open .panel:focus-within { transform: translateY(calc(-1 * var(--kb, 0px))); }
@media (max-width: 820px) {
  .kb-open body.layers-open .left-controls:focus-within {
    bottom: calc(var(--kb, 0px) + 8px);
    max-height: calc(100dvh - var(--kb, 0px) - 8px - 68px);
  }
}

/* The timeline in the panel. Version 1's styles make its parts GPU layers
   (translateZ(0), backface-visibility: hidden), and inside the panel's
   backdrop-filter Safari then at times clipped the handle on loading: to the
   epoch bar, or along an edge in the blurred map behind. Here they are
   ordinary elements (that fixed it). Besides, the bar's corners are rounded
   by overflow and border-radius alone (no clip-path), and the input is as
   high as the handle, the track filling it, so nothing sticks out of it */
.timeline-track-stack .epoch-bar { clip-path: none; -webkit-clip-path: none; }
.epoch-wrap, .epoch-icons-row, .timeline-track-shell, .timeline-track-stack,
.timeline-track-stack .epoch-bar,
.timeline-track-stack input[type="range"] {
  transform: none; -webkit-transform: none;
  backface-visibility: visible; -webkit-backface-visibility: visible;
}
.timeline-track-stack input[type="range"] { z-index: 2; height: 20px; margin-top: -15px; margin-bottom: -5px; }
/* The track fills the input (transparent; the bar is the epoch bar), so the
   handle's place doesn't depend on how a browser places the track */
.timeline-track-stack input[type="range"]::-webkit-slider-runnable-track { height: 20px; }
.timeline-track-stack input[type="range"]::-webkit-slider-thumb { margin-top: 2px; }
.timeline-track-stack input[type="range"]::-moz-range-track { height: 20px; }
