/* =======================
   Layout
   ======================= */
.vimap-shell{
  display:grid;
  grid-template-columns: 320px 1fr;   /* legend left, canvas right */
  gap:16px;
  align-items:stretch;
  position:relative;                  /* new stacking context */
  z-index:0;
}
.vimap-shell.vimap-legend-right{
  grid-template-columns: 1fr 320px;
}

/* Map canvas box */
.vimap-shell .vimap-canvas{
  height: var(--vimap-height, 600px);
  border-radius:10px;
  overflow:hidden;
  border:1px solid #e5e7eb;
  position:relative;
  z-index:0;
}

/* Legend panel */
.vimap-shell .vimap-legend{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:10px;
  padding:12px;
  overflow:auto;
  max-height: var(--vimap-height, 600px);
}

/* =======================
   Legend
   ======================= */

/* remove “Areas”/“Pins” headings and tighten spacing */

.vimap-legend .legend-group{ margin-top:8px; }
.vimap-legend .legend-group:first-child{ margin-top:0; }

.vimap-legend .legend-title{ display:none; } /* not used */
.vimap-legend ul{ list-style:none; margin:0; padding:0; }

/* 2-column legend list on desktop */
.vimap-legend .legend-group ul{
  display:grid;
  grid-template-columns: repeat(1, minmax(0,1fr));
  column-gap:16px;
  row-gap:6px;
}

.vimap-legend li{
  display:flex;
  align-items:flex-start;
  gap:8px;
  padding:6px;
  border-radius:6px;
  cursor:pointer;
  line-height:1.25;
  white-space: normal;        /* wrap to new lines */
  overflow: visible;          /* show full text */
  text-overflow: clip;        /* no ellipsis */
}
.vimap-legend li:hover{ background:#f3f4f6; }
.vimap-legend li.off{ opacity:.55; text-decoration:line-through; }
.vimap-legend li.on{ font-weight:600; }
.vimap-legend li.locked{ text-decoration:underline; }

/* Icon (SVG) + dot fallback */
.vimap-legend .icon{
  width:14px; height:14px; display:inline-block; object-fit:contain;
  margin-top:2px; flex:0 0 auto;
}
.vimap-legend .dot{
  width:10px; height:10px; border-radius:999px; display:inline-block;
  margin-top:3px; flex:0 0 auto;
}

/* =======================
   Leaflet popup (hover/tap card)
   ======================= */
.leaflet-container .vimap-hover-card .leaflet-popup-content-wrapper{
  border-radius:12px; border:1px solid #e5e7eb; box-shadow:0 10px 25px rgba(0,0,0,.08);
}
.leaflet-container .vimap-hover-card .leaflet-popup-content{
  margin:8px 16px; text-align:center; line-height:1.35; font-size:14px;
}
.leaflet-container .vimap-hover-card .leaflet-popup-tip-container{
  display:none;
}
.vimap-card{ font-size:14px; line-height:1.3; }

/* =======================
   SVG pin markers (divIcon)
   ======================= */
.vimap-pin{
  width:18px;
  height:18px;
  line-height:0;
  z-index:2;
}
.vimap-pin .vimap-pin-inner{
  display:block;
  width:100%;
  height:100%;
  transform-origin:center center;
  transition:transform 140ms ease, filter 140ms ease;
}
.vimap-pin img{ width:100%; height:100%; display:block; }
.vimap-pin .vimap-pin-fallback{
  width:100%; height:100%; border-radius:999px; display:block;
}

/* per-pin hover bump */
.vimap-pin.is-hover .vimap-pin-inner{
  transform:scale(1.6);
  filter:drop-shadow(0 2px 6px rgba(0,0,0,.25));
}
/* legend-hover bump (all pins in category) */
.vimap-pin.is-legend .vimap-pin-inner{
  transform:scale(1.35);
}

/* =======================
   Controls & attribution
   ======================= */
.vimap-canvas .leaflet-top,
.vimap-canvas .leaflet-bottom,
.vimap-canvas .leaflet-control-container{
  z-index: 1;                 /* keep controls above overlay but under site header */
}
.vimap-canvas .leaflet-control-attribution{
  display:none !important;    /* hide Leaflet logo */
}

/* =======================
   Responsive
   ======================= */

/* Mobile: legend stays on top, smaller area */
@media (max-width: 900px){
  .vimap-shell{
    grid-template-columns: 1fr;   /* stack: legend then canvas */
  }

  /* legend full-width on top, smaller/compact height */
  .vimap-shell .vimap-legend{
    order: 0;
    max-height: 28vh;             /* smaller area */
    padding:10px;
  }

  /* canvas below, usual height unless overridden by inline style */
  .vimap-shell .vimap-canvas{
    order: 1;
    height: var(--vimap-height, 56vh); /* leaves some room for legend; adjust if you want */
  }

  /* In narrow screens, one column is easier to scan */
  .vimap-legend .legend-group ul{
    grid-template-columns: 1fr;   /* single column on mobile */
    row-gap:4px;
  }

  .vimap-legend li{
    padding:5px 6px;
    font-size:14px;
  }
}

.vimap-legend .legend-title{
  grid-column: 1 / -1;
  font-weight: 700;
  color: #6b7280;
  margin: 10px 0 6px;
}

/* --- ValovIT: simple lightbox --- */
.vimap-no-scroll { overflow: hidden; }

.vimap-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  display: none;
}
.vimap-lightbox.on { display: block; }

.vimap-lb-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
}

.vimap-lb-figure {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  pointer-events: none;
  padding: 4vh 4vw;
}
.vimap-lb-img {
  max-width: 92vw; max-height: 88vh;
  object-fit: contain; background: #111;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border-radius: 8px; pointer-events: auto;
}
.vimap-lb-caption {
  position: absolute; bottom: 3vh; left: 50%;
  transform: translateX(-50%);
  color: #fff; font: 14px/1.4 system-ui,-apple-system,Segoe UI,Roboto;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  max-width: 80vw; text-align: center;
}
.vimap-lb-close {
  position: absolute; top: 2vh; right: 2vw;
  width: 40px; height: 40px; border-radius: 999px;
  border: 0; background: rgba(0,0,0,0.55); color: #fff;
  font-size: 24px; line-height: 40px; cursor: pointer;
  pointer-events: auto;
}
.vimap-lb-close:hover { background: rgba(0,0,0,0.7); }

/* tiny loader effect while the image source sets */
.vimap-lb-img:not([src]) {
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.08) 0 40px, transparent 41px) center/200px 200px,
    #111;
}
