/* === routemap.css ===
   Shared stylesheet for route maps (OpenLayers + OS Raster)
   Last tidy: 31/10/25
================================================================ */

/* === Layout === */
body {
  margin: 0;
  padding: 0;
}
#map {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
}

/* === Toast (top-centre) — shown when user is outwith route extent === */
.ol-control.map-toast {
  position: absolute !important;
  top: calc(6px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  background: rgba(20, 24, 28, 0.85);
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font: 13px/1.2 Arial, sans-serif;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.ol-control.map-toast.show {
  opacity: 1;
}

/* === Zoom control restyle === */
.ol-control.ol-zoom {
  position: absolute;
  top: 8px;
  left: 8px;
  background: transparent;
  border: none;
  box-shadow: none;
  z-index: 1100;
}
.ol-control.ol-zoom button {
  width: 28px;
  height: 28px;
  line-height: 28px;
  padding: 0;
  margin: 0 0 6px 0;
  border: 0;
  border-radius: 2px;
  background: rgba(90, 120, 150, 0.8);
  color: #fff;
  font: 18px/28px Arial, sans-serif;
  cursor: pointer;
  transition: opacity .15s ease, background .15s ease;
}
.ol-control.ol-zoom button:hover {
  background: rgba(70, 100, 130, 0.9);
}
/* Replace OL’s built-in zoom icons with plain text via ::after (uses the button's title) */
.ol-control.ol-zoom .ol-zoom-in::after,
.ol-control.ol-zoom .ol-zoom-out::after {
  content: attr(title);
  display: block;
  text-align: center;
  font-weight: 600;
}
.ol-control.ol-zoom .ol-zoom-in > span,
.ol-control.ol-zoom .ol-zoom-out > span {
  display: none !important;
}

/* === Layers menu (under zoom) === */
.ol-control.layer-menu {
  position: absolute !important;
  top: 96px;
  left: 7px;
  z-index: 1100;
}
.ol-control.layer-menu .layer-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: rgba(90, 120, 150, 0.8);
  color: #fff;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  padding: 0;
  outline: none;
  box-shadow: none;
}
.ol-control.layer-menu .layer-btn:hover {
  background: rgba(70, 100, 130, 0.9);
}
.ol-control.layer-menu .menu {
  position: absolute;
  top: 2px;
  left: 44px;
  background: #fff;
  border-radius: 3px;
  box-shadow: none;
  outline: none;
  padding: 4px;
  min-width: 140px;
  display: none;
}
.ol-control.layer-menu .menu button {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  text-align: left;
  padding: 2px 10px;
  font: 14px Arial, sans-serif;
  color: #222;
  border-radius: 2px;
  cursor: pointer;
}
.ol-control.layer-menu .menu button:hover {
  background: #f2f5f8;
}
.ol-control.layer-menu .menu button.active {
  background: #e8f0fb;
  color: #1f5fb8;
}

/* === Locate button (lines up under layer menu) === */
.ol-control.locate-btn.bl {
  position: absolute;
  top: 150px;
  left: 7px;
}
.ol-control.locate-btn .locate-button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: rgba(90, 120, 150, 0.8);
  color: #fff;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
  outline: none;
}
.ol-control.locate-btn .locate-button:hover {
  background: rgba(70, 100, 130, 0.9);
}
.ol-control.locate-btn .locate-button svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* === Bottom-centre scale bar === */
.ol-scale-line {
  position: absolute !important;
  top: calc(8px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  bottom: auto;
  right: auto;
  z-index: 1000;
  background: rgba(90, 120, 150, 0.8);
  padding: 1px 3px;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
  opacity: 0.5;
}
/* Tidy the inner ticks/label */
.ol-scale-line-inner {
  border-style: solid;
  border-color: #ffffff;
  border-width: 0 1px 1px 1px;
  color: #ffffff;
  font: 9px/0.9 Arial, sans-serif;
  max-width: 110px;        /* cap to avoid long labels on tiny screens */
  white-space: nowrap;     /* keep label on one line */
  overflow: hidden;
  text-overflow: clip;
}

/* === Small screens === */
@media (max-width: 380px) {
  .ol-control.layer-menu { }
  .ol-control.ol-zoom { }
}

/* === OS branding (bottom-left): gently shrink & pin tighter to the corner === */
.os-api-branding {
  transform: scale(0.85);
  transform-origin: left bottom;
}
.os-api-branding,
.os-api-branding * {
  position: absolute !important;
  right: 0 !important;
  bottom: 3px;
  font-size: 11px !important;
  line-height: 1.15 !important;
}

/* === Hypsometric tint (colour gradient) & readability helpers === */
/* If the hypsometric layer is added in JS, this supports blend tweaks.
   Default is normal; uncomment multiply for a punchier “inked” look. */
.hyps canvas {
  /* mix-blend-mode: multiply; */ /* optional */
}

/* Slightly boost Outdoor readability without over-saturating colours.
   Applies when the Outdoor layer is created with className: 'os-overlay'. */
.os-overlay canvas {
  filter: contrast(1.08) saturate(0.85) brightness(1.0);
  mix-blend-mode: multiply;
}

/* === Attribution (bottom-right) ===
   Put OL attribution bottom-right, above OS branding; keep it small & tidy. */
.ol-attribution {
  position: absolute !important;
  right: 0 !important;
  bottom: 18px !important;                        /* clears OS branding */
  background: rgba(255, 255, 255, 0.9) !important;
  padding: 1px 2px !important;
  border-radius: 1px !important;
  font: 10px/1.2 Arial, sans-serif !important;
  opacity: 0.8;
  z-index: 1200 !important;
}
.ol-attribution button {
  display: none !important;
}
.ol-attribution,
.ol-attribution ul,
.ol-attribution li,
.ol-attribution a,
.ol-attribution span {
  font-size: 10px !important;
  line-height: 1.15 !important;
}

/* When Satellite or Outdoor (Shaded) is active, set attribution up a bit */
/*#map.attrib-up .ol-attribution { bottom: 4px !important;  opacity: 0.7; }*/
#map .ol-attribution { right: 0 !important; bottom: 4px !important; }
#map .ol-attribution.ol-uncollapsible { bottom: 4px !important; }

/* === Hide OS bottom-left copyright badge globally (Option B) ===
   OS CSS loads first; this override wins. */
.os-api-branding.copyright {
  display: none !important;
}

/* Tighter, lighter attribution */
.ol-attribution {opacity: 0.55 !important;  }   /* was ~0.8 */
.ol-attribution, .ol-attribution ul, .ol-attribution li, .ol-attribution a,
.ol-attribution span {  font-size: 9px !important;   line-height: 1.1 !important; }   /* was 10px */


