/* mod_projectsmap - dark sidebar layout modelled on the STR POWER MapSVG map */
.pm-root {
  --pm-bg: #212121;
  --pm-fg: #ffffff;
  --pm-muted: rgba(255, 255, 255, .5);
  --pm-line: rgba(255, 255, 255, .2);
  --pm-map-bg: #000000;
  position: relative;
  display: flex;
  width: 100%;
  height: var(--pm-height, 80vh);
  min-height: 420px;
  background: var(--pm-bg);
  color: var(--pm-fg);
  font-family: inherit;
  overflow: hidden;
  box-sizing: border-box;
}
.pm-root *, .pm-root *::before, .pm-root *::after { box-sizing: border-box; }

.pm-sidebar {
  position: relative;
  flex: 0 0 var(--pm-sidebar, 25%);
  min-width: 260px;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  background: var(--pm-bg);
  border-right: 1px solid var(--pm-line);
  z-index: 2;
}

.pm-map {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  background: var(--pm-map-bg);
}

/* Filters */
.pm-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 16px 12px;
  border-bottom: 1px solid var(--pm-line);
}
/* Templates often style form fields (dark text, no border): force readable values inside the map */
.pm-root .pm-filters .pm-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 38px;
  margin: 0 !important;
  padding: 8px 30px 8px 10px !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.3 !important;
  letter-spacing: normal !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
  opacity: 1 !important;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%23ffffff' d='M0 0h10L5 6z'/%3E%3C/svg%3E") no-repeat right 10px center !important;
  border: 1px solid rgba(255, 255, 255, .45) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
}
.pm-root .pm-filters .pm-select:hover { border-color: rgba(255, 255, 255, .8) !important; }
.pm-root .pm-filters .pm-select:focus-visible { outline: 2px solid #faa73f !important; outline-offset: 1px; }
.pm-root .pm-filters .pm-select option { color: #212121; -webkit-text-fill-color: #212121; background: #ffffff; }
.pm-clear {
  align-self: flex-start;
  padding: 4px 0;
  font: inherit;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--pm-fg);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--pm-fg);
  cursor: pointer;
}
.pm-clear:hover, .pm-clear:focus-visible { color: #faa73f; border-color: #faa73f; outline: none; }

/* List */
.pm-list {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .3) transparent;
}
.pm-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  font: inherit;
  color: var(--pm-fg);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--pm-line);
  opacity: .5;
  cursor: pointer;
  transition: opacity .15s ease;
}
.pm-item:hover, .pm-item:focus-visible, .pm-item.is-active { opacity: 1; outline: none; }
.pm-item[hidden] { display: none; }
.pm-item-title {
  display: block;
  font-size: 20px;
  font-weight: 100;
  line-height: 1.25;
}
.pm-item-sub {
  display: block;
  margin-top: 4px;
  font-size: .8em;
  font-weight: 300;
}
.pm-empty { padding: 16px; margin: 0; font-size: 14px; color: var(--pm-muted); }

/* Details (over the list, like MapSVG "detailsViewLocation: overDirectory") */
.pm-details {
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 56px 20px 24px;
  overflow-y: auto;
  background: var(--pm-bg);
  color: var(--pm-fg);
}
.pm-details[hidden] { display: none; }
.pm-details-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  font-size: 28px;
  line-height: 1;
  color: var(--pm-fg);
  background: none;
  border: 0;
  cursor: pointer;
}
.pm-details-close:hover, .pm-details-close:focus-visible { color: #faa73f; outline: none; }
.pm-root .pm-details-body h5, .pm-details.pm-portal .pm-details-body h5 { margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, .6); font-family: inherit; font-size: 16px; font-weight: 700; line-height: 1.4; letter-spacing: normal; text-transform: none; color: var(--pm-fg); }
.pm-root .pm-details-body .pm-d-heading, .pm-details.pm-portal .pm-details-body .pm-d-heading { margin: 22px 0 8px; padding: 0; border: 0; }
.pm-root .pm-details-body p, .pm-details.pm-portal .pm-details-body p { margin: 0 0 12px; font-family: inherit; font-size: 16px; font-weight: 300; line-height: 1.3; letter-spacing: normal; color: var(--pm-fg); }
.pm-root .pm-details-body p strong, .pm-details.pm-portal .pm-details-body p strong { font-weight: 700; }
.pm-details { font-family: inherit; }
.pm-root .pm-details-body h5 strong, .pm-details.pm-portal .pm-details-body h5 strong, .pm-root .pm-popup h5 strong, .pm-gpopup h5 strong { font-weight: inherit; }
.pm-root .pm-details .pm-details-close, .pm-details.pm-portal .pm-details-close { color: #ffffff !important; background: none !important; border: 0 !important; box-shadow: none !important; }
.pm-root .pm-details .pm-details-close:hover, .pm-details.pm-portal .pm-details-close:hover { color: #faa73f !important; }
.pm-root .pm-popup .pm-popup-close { color: #555555 !important; background: none !important; border: 0 !important; box-shadow: none !important; }
.pm-root .pm-popup .pm-popup-close:hover { color: #000000 !important; }

/* Popup over the pin (MapSVG "marker popover"): white card, dark text */
.pm-root .pm-popup .leaflet-popup-content-wrapper { border-radius: 0; background: #ffffff; color: #212121; box-shadow: 0 6px 24px rgba(0, 0, 0, .45); padding: 0; }
.pm-root .pm-popup .leaflet-popup-content { margin: 0; max-height: 300px; overflow-y: auto; }
.pm-root .pm-popup .leaflet-popup-tip { background: #ffffff; }
.pm-popup-inner { position: relative; padding: 16px 44px 14px 16px; font-family: inherit; color: #212121; }
.pm-root .pm-popup .pm-popup-inner h5, .pm-gpopup h5 { margin: 0 0 10px; font-family: inherit; font-size: 18px; font-weight: 700; line-height: 1.4; text-transform: none; color: #000000; }
.pm-root .pm-popup .pm-popup-inner .pm-d-heading, .pm-gpopup .pm-d-heading { margin: 14px 0 4px; font-size: 18px; }
.pm-root .pm-popup .pm-popup-inner p, .pm-gpopup p { margin: 0 0 4px; font-family: inherit; font-size: 12px; font-weight: 400; line-height: 1.3; color: #000000; }
.pm-popup-close { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; padding: 0; font-size: 30px; line-height: 1; color: #555; background: none; border: 0; cursor: pointer; }
.pm-popup-close:hover, .pm-popup-close:focus-visible { color: #000; outline: none; }
.pm-gpopup { padding: 4px 8px 6px 4px; max-height: 320px; }

/* Hover tooltip (MapSVG style): white card to the right of the pin */
.pm-root .leaflet-tooltip.pm-tooltip { display: block !important; position: absolute; margin: 0; max-width: none; font-family: inherit; font-size: 12px; text-align: left; padding: 0; background: #ffffff; border: 0; border-radius: 0; box-shadow: 0 3px 12px rgba(0, 0, 0, .45); color: #000000; white-space: nowrap; }
.pm-root .leaflet-tooltip.pm-tooltip::before { display: none; }
.pm-gtooltip { position: absolute; z-index: 5; pointer-events: none; background: #ffffff; box-shadow: 0 3px 12px rgba(0, 0, 0, .45); color: #000000; white-space: nowrap; transform: translateY(-50%); }
.pm-gtooltip[hidden] { display: none; }
.pm-tip { padding: 6px 8px; font-family: inherit; line-height: 1.35; color: #000000; }
.pm-tip .pm-tip-title { display: block; margin-bottom: 2px; font-size: 14px; font-weight: 700; }
.pm-tip .pm-tip-row { display: block; font-size: 12px; font-weight: 400; }
.pm-tip .pm-tip-row strong { font-weight: 700; }

/* Pins */
.pm-pin { background: none; border: 0; line-height: 0; cursor: pointer; }
.pm-pin svg { display: block; transition: transform .15s ease; transform-origin: 50% 100%; }
.pm-pin:hover svg, .pm-pin.is-active svg { transform: scale(1.4); }

/* Dark look for light tile sets (OpenStreetMap): greyscale + invert, close to the Google dark style */
/* Normally dark tiles are recoloured in a canvas by the script (no CSS filter at all). This per-tile CSS filter is
   only the fallback for tile servers without CORS. Never on the whole tile pane: Safari/WebKit mis-computes the filter region of a
   transformed pane during zoom animations (unfiltered light areas / black bands). Per-tile filters are stable. */
.pm-dark-tiles img.leaflet-tile, .pm-dark-tiles canvas.pm-css-dark { filter: grayscale(1) invert(1) brightness(.78) contrast(1.15); -webkit-filter: grayscale(1) invert(1) brightness(.78) contrast(1.15); }
.pm-dark-tiles .leaflet-tile-pane { filter: none !important; }
/* Dark backdrop behind tiles that are still loading (instead of light grey flashes) */
.pm-dark-tiles.leaflet-container, .pm-dark-tiles .leaflet-tile-container { background: #1c1c1c; }

/* Leaflet on dark */
.pm-root .leaflet-container { background: var(--pm-map-bg); font: inherit; }
.pm-root .leaflet-control-attribution { background: rgba(0, 0, 0, .55); color: #9e9e9e; font-size: 10px; }
.pm-root .leaflet-control-attribution a { color: #bdbdbd; }
.pm-root .leaflet-bar a { background: #2c2c2c; color: #ffffff; border-bottom-color: #444; }
.pm-root .leaflet-bar a:hover { background: #3c3c3c; }

/* Mobile */
.pm-mobilebar { display: none; }
.pm-root.is-mobile { flex-direction: column; height: auto; min-height: 0; }
.pm-root.is-mobile .pm-mobilebar {
  display: flex;
  border-bottom: 1px solid var(--pm-line);
}
.pm-tab {
  flex: 1;
  padding: 12px;
  font: inherit;
  font-size: 14px;
  text-transform: uppercase;
  color: var(--pm-muted);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.pm-tab.is-active { color: var(--pm-fg); border-bottom-color: var(--pm-fg); }
.pm-root.is-mobile .pm-sidebar { flex: none; max-width: none; min-width: 0; width: 100%; border-right: 0; }
.pm-root.is-mobile .pm-map { height: var(--pm-height, 80vh); min-height: 380px; }
.pm-root.is-mobile[data-view="map"] .pm-sidebar { display: none; }
.pm-root.is-mobile[data-view="list"] .pm-map { display: none; }
.pm-root.is-mobile[data-view="list"] .pm-list { max-height: var(--pm-height, 80vh); }
.pm-root.is-mobile .pm-item-title { font-size: 17px; }
/* Details full screen on mobile */
.pm-details.pm-portal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: var(--pm-bg, #212121);
  color: var(--pm-fg, #ffffff);
  font-family: inherit;
  -webkit-overflow-scrolling: touch;
}
.pm-details.pm-portal .pm-details-close { color: var(--pm-fg, #ffffff); }
.pm-details.pm-portal .pm-details-body h5, .pm-details.pm-portal .pm-details-body p { color: var(--pm-fg, #ffffff); }
html.pm-noscroll, html.pm-noscroll body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .pm-item, .pm-pin svg { transition: none; }
}

/* Wheel guard: plain wheel scrolls the page, the hint tells how to zoom (Ctrl/Cmd + wheel) */
.pm-wheel-hint { position: absolute; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; font-size: 18px; line-height: 1.3; color: #ffffff; background: rgba(0, 0, 0, .45); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.pm-wheel-hint.is-visible { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .pm-wheel-hint { transition: none; } }
