/* WANTRIPLOG v0.4.65: all-spots map page + the buttons that lead to it.
   Loaded on the front page, single facility pages, the map page and,
   since v0.4.67, the current-location page /nearby/ (for its map button). */

/* Button that leads to the map page (under the current-location results
   on /nearby/; until v0.4.66 the same button also sat in the homepage hero). */
.wt-map-home-action { text-align: left; }
.wt-map-home-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  margin: 18px 0 0; padding: 15px 20px; min-height: 48px;
  background: #265f4d; border: 1px solid #1c513f; border-radius: 14px;
  color: #fff !important; text-decoration: none !important;
  font-weight: 800; font-size: 15px;
  box-shadow: 0 6px 18px rgba(29, 91, 64, .15);
  transition: background .2s, transform .2s;
}
.wt-map-home-cta:hover { background: #1c493a; transform: translateY(-1px); }
.wt-map-home-note { font-size: 12px !important; color: #5e7869 !important; margin: 9px 0 0 !important; }

/* v0.4.68: on /nearby/ the button is spliced inside the plugin's section,
   directly after the fallback note (see page.php). The CTA keeps its own
   18px top margin (an inline-flex margin, so it never collapses), hence
   the wrapper only adds the remaining 10px for a 28px gap in total. */
.wt-geo-app .wt-nearby-to-map { margin-top: 10px; }

/* v0.4.68: on spot articles the map button stands on its own line
   directly above the reviews section (until v0.4.67 it was one of the
   pills in the actions row under the title). The pill itself reuses the
   theme's .wt-place-action styles from site.css. */
.wt-place-map-action { margin: 30px 0 0; }
@media (max-width: 540px) {
  .wt-place-map-action .wt-place-action { width: 100%; }
}
@media (max-width: 600px) {
  .wt-map-home-cta { width: 100%; font-size: 14px; padding: 14px 12px; gap: 6px; }
}

/* Map page layout. */
.wt-map-shell { max-width: 1160px; }
.wt-map-head h1 { margin: 8px 0 10px; }
.wt-map-lead { color: #5e7869; font-size: 14px; line-height: 1.9; margin: 0 0 16px; max-width: 760px; }

/* v0.4.117: line-mode banner + station name labels on the line layer. */
.wt-map-line-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  margin: 20px 0 4px; padding: 13px 16px;
  background: #fdf6e0; border: 1px solid #ecd27a; border-radius: 12px;
}
.wt-map-line-banner p { margin: 0; font-size: 14px; line-height: 1.7; color: #4d3f05; }
.wt-map-line-banner a { font-size: 13px; font-weight: 700; color: #235d58; white-space: nowrap; }
.wt-line-station-label {
  background: rgba(255, 255, 255, .92); border: 1px solid #c9c2a8; border-radius: 6px;
  box-shadow: none; color: #3d3800;
  font-size: 10px; font-weight: 700; line-height: 1.3; padding: 1px 4px;
}
.wt-line-station-label::before { display: none; }

.wt-map-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 26px 0 16px;
}
.wt-map-tab {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 14px; font-weight: 800; color: #2c6757;
  background: #f8fbf7; border: 1px solid #ccddd1; border-radius: 99px;
  padding: 10px 18px; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.wt-map-tab:hover { background: #ecf6ed; }
.wt-map-tab.is-active { background: #265f4d; border-color: #1c513f; color: #fff; }
.wt-map-tab-count {
  font-size: 11px; font-weight: 850; line-height: 1;
  background: rgba(38, 95, 77, .12); border-radius: 99px; padding: 4px 8px;
}
.wt-map-tab.is-active .wt-map-tab-count { background: rgba(255, 255, 255, .22); }

.wt-map-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 0 0 14px; }
.wt-map-locate {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 13px; font-weight: 800; color: #fff;
  background: #205c4a; border: 0; border-radius: 11px;
  padding: 11px 16px; min-height: 44px; cursor: pointer;
}
.wt-map-locate:hover { background: #194838; }
.wt-map-locate:disabled { opacity: .6; cursor: wait; }
.wt-map-locate .wt-icon { width: 16px; height: 16px; }
.wt-map-status { font-size: 12px; color: #74877b; margin: 0; }

/* v0.4.79: zoom slider control (replaces Leaflet's +/- buttons).
   White rounded bar matching the old leaflet-bar look: + button,
   vertical draggable slider, - button. */
.wt-zoom-slider {
  background: #fff; border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 5px rgba(20, 50, 35, .35);
  border: 2px solid rgba(0, 0, 0, .2); background-clip: padding-box;
  display: flex; flex-direction: column; align-items: stretch;
  user-select: none; -webkit-user-select: none; touch-action: none;
}
.wt-zoom-btn {
  width: 32px; height: 32px; border: 0; background: #fff; color: #214434;
  font-size: 20px; font-weight: 700; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.wt-zoom-btn:hover { background: #f0f6f0; }
.wt-zoom-btn:active { background: #e2efe4; }
.wt-zoom-track {
  position: relative; width: 32px; height: 118px; cursor: pointer;
  background:
    linear-gradient(#c9d8cc, #c9d8cc) center / 4px 100% no-repeat;
}
.wt-zoom-fill {
  position: absolute; left: 50%; bottom: 0; width: 4px; height: 0;
  transform: translateX(-50%); background: #265f4d; border-radius: 2px;
}
.wt-zoom-thumb {
  position: absolute; left: 50%; bottom: -9px; width: 18px; height: 18px;
  transform: translateX(-50%); border-radius: 50%;
  background: #fff; border: 2px solid #265f4d;
  box-shadow: 0 1px 4px rgba(20, 50, 35, .35); pointer-events: none;
}
/* v0.4.80: horizontal form (small screens only; the class is added by
   JS when the viewport is <=760px). Layout reads [- slider +] and the
   control sits at the map's bottom right. */
.wt-zoom-horizontal { flex-direction: row; align-items: center; }
.wt-zoom-horizontal .wt-zoom-btn[data-zoom="out"] { order: 1; }
.wt-zoom-horizontal .wt-zoom-track {
  order: 2; width: 128px; height: 32px;
  background: linear-gradient(#c9d8cc, #c9d8cc) center / 100% 4px no-repeat;
}
.wt-zoom-horizontal .wt-zoom-btn[data-zoom="in"] { order: 3; }
.wt-zoom-horizontal .wt-zoom-fill {
  left: 0; top: 50%; bottom: auto; width: 0; height: 4px;
  transform: translateY(-50%);
}
.wt-zoom-horizontal .wt-zoom-thumb {
  top: 50%; bottom: auto; transform: translate(-50%, -50%);
}

.wt-nearby-map {
  /* v0.4.78: PC map is viewport-relative so it fills the screen better
     (was a fixed 540px). Small screens override this below (62svh). */
  height: 78vh; height: 78svh; min-height: 560px; max-height: 880px; width: 100%;
  border-radius: 19px; background: #eef4e9;
  border: 1px solid #d5e4d8; overflow: hidden;
  /* v0.4.75: keep Leaflet's internal panes (z-index 200-1000) inside this
     stacking context so sibling overlays (the detail panel) can paint
     above the map. */
  isolation: isolate;
}
.wt-map-popup a { font-weight: 800; color: #215741; }
.wt-map-popup span { font-size: 12px; color: #656e64; }

.wt-map-legend {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  list-style: none; margin: 16px 0 0; padding: 0;
  font-size: 12px; color: #5b786a; font-weight: 700;
}
.wt-map-legend li { display: inline-flex; align-items: center; gap: 6px; }
.wt-map-legend-dot {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(30, 60, 45, .25);
  flex: none;
}
.wt-map-note, .wt-map-nearby-link { color: #85968a; font-size: 11px; line-height: 1.9; margin: 13px 0 0; }
.wt-map-nearby-link { font-size: 12px; }
.wt-map-nearby-link a { color: #246747; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.wt-map-content { margin-top: 44px; }

/* v0.4.71: marker-cluster badges. The plugin's own stylesheet only
   carries the animation/spider base styles; the badge look is the
   theme's: a solid accent-green circle with a white ring, a small paw
   mark and the child count (the count stays dominant for legibility).
   Badges with 100+ children grow slightly. */
.wt-cluster { background: transparent; border: 0; }
.wt-cluster-badge {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: #265f4d; border: 2px solid #fff;
  box-shadow: 0 2px 9px rgba(23, 54, 40, .38);
  color: #fff; line-height: 1;
  transition: transform .15s ease;
}
.wt-cluster-badge--lg { width: 48px; height: 48px; }
.leaflet-marker-icon:hover .wt-cluster-badge { transform: scale(1.09); }
.wt-cluster-paw { width: 11px; height: 11px; fill: #fff; opacity: .92; margin-bottom: 1px; flex: none; }
.wt-cluster-count { font-size: 13px; font-weight: 800; letter-spacing: .02em; }
.wt-cluster-badge--lg .wt-cluster-count { font-size: 14px; }

/* v0.4.71: spot detail panel over the map. The stage wraps the map so
   the panel can overlay it without covering the whole page: on PC it
   is a left panel (~360px / a third of the stage) and the rest of the
   map stays visible; on small screens it is a bottom sheet about half
   the map height, and the script pans the tapped pin into the upper
   half. Closed state is visibility + transform so the open transition
   can animate. */
.wt-map-stage { position: relative; }
.wt-map-panel {
  position: absolute; z-index: 1100;
  top: 12px; left: 12px; bottom: 12px;
  width: min(360px, 36%);
  background: #fff; border: 1px solid #d5e4d8; border-radius: 16px;
  box-shadow: 0 14px 34px rgba(23, 54, 40, .22);
  padding: 14px; overflow-y: auto;
  visibility: hidden; opacity: 0; transform: translateX(-10px);
  transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
  pointer-events: none;
}
.wt-map-panel.is-open {
  visibility: visible; opacity: 1; transform: none;
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: auto;
}
.wt-map-panel-close {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(23, 54, 40, .14);
  background: rgba(255, 255, 255, .94); color: #2c4a3c;
  font-size: 19px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.wt-map-panel-close:hover { background: #eef4e9; }
.wt-map-panel-thumb {
  display: block; width: 100%; aspect-ratio: 16 / 9;
  object-fit: cover; border-radius: 10px; background: #eef4e9;
}
.wt-map-panel-name { font-size: 17px; font-weight: 800; line-height: 1.5; margin: 12px 0 4px; color: #214434; }
.wt-map-panel-meta { font-size: 12px; color: #656e64; margin: 0 0 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
/* v0.4.85: the panel's category is a .wt-cat-chip (built by nearby-map.js,
   colours defined in site.css) so it matches the card labels. */
.wt-map-panel-article {
  display: flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 12px 16px; border-radius: 12px;
  background: #265f4d; border: 1px solid #1c513f;
  color: #fff !important; text-decoration: none !important;
  font-weight: 800; font-size: 14px;
}
.wt-map-panel-article:hover { background: #1c493a; }
.wt-map-panel-dir {
  display: inline-block; margin-top: 11px;
  font-size: 13px; font-weight: 750; color: #246747 !important;
  text-decoration: underline; text-underline-offset: 3px;
}
@media (max-width: 760px) {
  /* v0.4.76: small-screen layout. The map gets viewport-relative height
     so it is actually usable, the tabs become one scrollable row, and
     the panel leaves the map entirely: a compact card fixed to the
     viewport bottom (his "overlay the page, not the map" suggestion),
     with the thumbnail as a small square on the left so the facility
     name and buttons are visible at a glance instead of a giant image
     popup covering half the map. */
  .wt-nearby-map { height: 62vh; height: 62svh; min-height: 430px; max-height: none; }
  .wt-map-tabs { flex-wrap: nowrap; overflow-x: auto; margin: 18px 0 12px; padding-bottom: 4px; }
  .wt-map-tab { flex: none; }
  .wt-map-panel {
    position: fixed; z-index: 1200;
    top: auto; left: 10px; right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: auto; height: auto; max-height: 46vh;
    border-radius: 16px; border-bottom: 1px solid #d5e4d8;
    padding: 12px;
    transform: translateY(calc(100% + 26px));
  }
  .wt-map-panel.is-open { transform: none; }
  .wt-map-panel-thumb {
    float: left; width: 92px; height: 92px; aspect-ratio: 1;
    margin: 0 12px 6px 0;
  }
  .wt-map-panel-name { font-size: 15px; margin: 2px 26px 3px 0; }
  .wt-map-panel-meta { margin: 0 0 10px; }
  .wt-map-panel-article { min-height: 42px; padding: 10px 14px; }
}

@media (max-width: 540px) {
  .wt-map-tab { font-size: 13px; padding: 9px 14px; }
  .wt-map-controls { gap: 9px; }
}
